/* ============================================
   GINGER HOUSE AMSTERDAM - RESPONSIVE STYLES
   Mobile-First Approach
   ============================================ */

/* ============================================
   MOBILE (до 767px) - Base styles already mobile-first
   ============================================ */

@media (max-width: 767px) {
    /* General Mobile Layout Fixes */
    html, body {
        max-width: 100vw;
        overflow-x: hidden;
    }

    .container {
        padding: 0 var(--spacing-sm);
        max-width: 100vw;
        overflow-x: hidden;
    }

    section {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* Header */
    .header-content {
        flex-wrap: wrap;
    }

    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-white);
        box-shadow: var(--shadow-md);
        padding: var(--spacing-md);
    }

    .nav.active {
        display: block;
    }

    .nav-list {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .nav-link {
        display: block;
        padding: var(--spacing-sm);
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .logo-text {
        display: none;
    }

    .social-links {
        display: none;
    }

    /* Hero */
    .hero {
        min-height: 80vh;
        padding: var(--spacing-xl) 0;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .hero-content {
        max-width: 100%;
        padding: 0 var(--spacing-sm);
    }

    .hero-title {
        font-size: clamp(1.8rem, 8vw, 2.5rem);
        word-wrap: break-word;
    }

    .hero-subtitle {
        font-size: clamp(1.2rem, 5vw, 1.5rem);
        word-wrap: break-word;
    }

    .hero-description {
        font-size: 0.95rem;
    }

    .hero-cta {
        flex-direction: column;
        width: 100%;
    }

    .hero-cta .btn {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .trust-badges {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .badge {
        font-size: 0.85rem;
        padding: 0.6rem;
        word-wrap: break-word;
    }

    .limited-offer {
        font-size: 0.85rem;
        padding: var(--spacing-sm);
        word-wrap: break-word;
    }

    /* About */
    .about-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        max-width: 100%;
    }

    .about-text {
        padding: 0;
        max-width: 100%;
    }

    .features-grid {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .feature-item {
        max-width: 100%;
    }

    /* Courses */
    .courses-grid {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .course-card {
        max-width: 100%;
        margin: 0 auto;
    }

    .course-title,
    .course-description {
        word-wrap: break-word;
    }

    /* Products */
    .products-grid {
        grid-template-columns: 1fr;
        max-width: 100%;
        margin: 0 auto;
    }

    .product-card {
        max-width: 100%;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
        max-width: 100%;
    }

    .info-item {
        word-wrap: break-word;
        font-size: 0.85rem;
    }

    /* Gift Vouchers */
    .voucher-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        max-width: 100%;
    }

    .voucher-options {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .voucher-card {
        max-width: 100%;
    }

    /* Gallery */
    .gallery-grid {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .gallery-item {
        max-width: 100%;
    }

    .gallery-filters {
        flex-direction: column;
        gap: var(--spacing-xs);
        max-width: 100%;
    }

    .filter-btn {
        width: 100%;
        max-width: 100%;
    }

    /* Reviews */
    .reviews-slider {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .review-card {
        max-width: 100%;
    }

    .review-text {
        word-wrap: break-word;
    }

    /* Contact */
    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .contact-block {
        padding: var(--spacing-md);
    }

    .contact-form-wrapper {
        padding: var(--spacing-sm);
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Contact Form Mobile Fixes */
    .contact-form {
        max-width: 100%;
        overflow-x: hidden;
    }

    .form-group {
        max-width: 100%;
        overflow-x: hidden;
        margin-bottom: var(--spacing-md);
    }

    .form-group label {
        font-size: 0.95rem;
        display: block;
        width: 100%;
    }

    .form-group input,
    .form-group textarea {
        padding: 0.75rem;
        font-size: 16px; /* Prevents iOS zoom on focus */
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .checkbox-group {
        gap: 0.75rem;
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-direction: column;
    }

    .checkbox-group label {
        font-size: 0.9rem;
        line-height: 1.4;
        align-items: flex-start;
        padding: 0.4rem 0;
        width: 100%;
        max-width: 100%;
        display: flex;
        word-break: break-word;
    }

    .checkbox-group label span {
        flex: 1;
        word-break: break-word;
        overflow-wrap: break-word;
        max-width: calc(100% - 35px);
        padding-top: 1px;
    }

    .checkbox-group input[type="checkbox"] {
        margin-top: 2px;
        margin-right: 0.6rem;
        flex-shrink: 0;
        width: 18px;
        height: 18px;
        min-width: 18px;
        min-height: 18px;
    }

    .checkbox-single {
        width: 100%;
        max-width: 100%;
    }

    .checkbox-single label {
        font-size: 0.85rem;
        line-height: 1.4;
        align-items: flex-start;
        width: 100%;
        max-width: 100%;
        display: flex;
    }

    .checkbox-single label span {
        flex: 1;
        word-break: break-word;
        overflow-wrap: break-word;
        max-width: calc(100% - 35px);
        padding-top: 1px;
    }

    .checkbox-single input[type="checkbox"] {
        margin-top: 2px;
        margin-right: 0.6rem;
        flex-shrink: 0;
        width: 18px;
        height: 18px;
        min-width: 18px;
        min-height: 18px;
    }

    .form-title {
        font-size: 1.2rem;
    }

    .privacy-notice {
        font-size: 0.75rem;
        padding: 0;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        max-width: 100%;
    }

    .footer-links {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        max-width: 100%;
    }

    .footer-brand,
    .footer-column,
    .footer-contact {
        max-width: 100%;
        word-wrap: break-word;
    }

    /* Buttons on mobile */
    .btn {
        word-wrap: break-word;
        white-space: normal;
        text-align: center;
    }

    .btn-block {
        width: 100%;
        max-width: 100%;
    }

    /* FAQ */
    .faq-item {
        max-width: 100%;
    }

    .faq-question {
        word-wrap: break-word;
        font-size: 0.95rem;
    }

    .faq-answer p {
        word-wrap: break-word;
    }

    /* Images */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Cookie Banner */
    .cookie-banner {
        padding: var(--spacing-md) var(--spacing-sm);
    }

    .cookie-content {
        flex-direction: column;
        align-items: stretch;
        max-width: 100%;
        gap: var(--spacing-md);
    }

    .cookie-content p {
        word-wrap: break-word;
        font-size: 0.9rem;
        text-align: center;
        margin-bottom: 0;
    }

    .cookie-buttons {
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: var(--spacing-sm);
        width: 100%;
    }

    #accept-cookies,
    #decline-cookies {
        flex: 1;
        min-width: 0;
        padding: var(--spacing-sm) var(--spacing-md) !important;
        font-size: 0.95rem !important;
        white-space: nowrap;
    }

    #accept-cookies {
        order: 1;
    }

    #decline-cookies {
        order: 2;
    }

    /* Tables and other elements */
    table {
        max-width: 100%;
        overflow-x: auto;
        display: block;
    }

    /* Text elements */
    h1, h2, h3, h4, h5, h6, p, li, span, a {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Lightbox */
    .lightbox-prev,
    .lightbox-next {
        padding: var(--spacing-sm);
        font-size: 1.5rem;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
        padding: var(--spacing-sm);
    }

    /* Spacing adjustments */
    section {
        padding: var(--spacing-2xl) 0;
    }

    :root {
        --spacing-3xl: 3rem;
    }
}

/* ============================================
   TABLET (768px - 1023px)
   ============================================ */

@media (min-width: 768px) and (max-width: 1023px) {
    /* Header */
    .logo-text {
        font-size: 1.1rem;
    }

    .nav-list {
        gap: var(--spacing-sm);
    }

    .nav-link {
        font-size: 0.9rem;
        padding: var(--spacing-xs);
    }

    /* About */
    .about-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }

    .about-image {
        max-width: 500px;
        margin: 0 auto;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Courses */
    .courses-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Products */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Vouchers */
    .voucher-options {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Gallery */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Reviews */
    .reviews-slider {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Contact */
    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .footer-links {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   DESKTOP (1024px - 1439px)
   ============================================ */

@media (min-width: 1024px) and (max-width: 1439px) {
    .container {
        padding: 0 var(--spacing-lg);
    }

    /* Courses */
    .courses-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Products */
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Gallery */
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   LARGE DESKTOP (1440px+)
   ============================================ */

@media (min-width: 1440px) {
    :root {
        --fs-h1: 3.5rem;
        --fs-h2: 2.5rem;
        --fs-h3: 2rem;
        --fs-body: 1.125rem;
    }

    /* Courses */
    .courses-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Products */
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Gallery */
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================
   TOUCH DEVICES
   ============================================ */

@media (hover: none) {
    /* Remove hover effects on touch devices */
    .course-card:hover .course-image img,
    .product-card:hover .product-image img,
    .gallery-item:hover img {
        transform: none;
    }

    /* Make gallery overlay always visible on touch */
    .gallery-overlay {
        opacity: 1;
    }
}

/* ============================================
   HIGH-DPI SCREENS (Retina)
   ============================================ */

@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
    /* Optimize for high-DPI displays */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* ============================================
   LANDSCAPE ORIENTATION (Mobile)
   ============================================ */

@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: var(--spacing-xl) 0;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    /* Hide non-essential elements */
    .header,
    .hero,
    .cookie-banner,
    .lightbox,
    .btn,
    .social-links,
    .language-switcher {
        display: none !important;
    }

    /* Optimize for printing */
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
    }

    section {
        page-break-inside: avoid;
        padding: 1rem 0;
    }

    h1, h2, h3 {
        page-break-after: avoid;
    }

    /* Show URLs for links */
    a[href]:after {
        content: " (" attr(href) ")";
    }
}

/* ============================================
   ACCESSIBILITY - REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .cookie-banner {
        transition: none !important;
    }

    .hero-content {
        animation: none !important;
    }
}

/* ============================================
   LOW-END DEVICE OPTIMIZATION
   ============================================ */

@media (max-width: 767px) {
    /* Reduce complex animations on mobile */
    .course-card:hover .course-image img,
    .product-card:hover .product-image img,
    .gallery-item:hover img {
        transform: none;
    }

    /* Simplify shadows on mobile for better performance */
    .cookie-banner {
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15);
    }

    /* Reduce will-change usage on mobile */
    .cookie-banner {
        will-change: auto;
    }
}

/* ============================================
   DARK MODE (Optional - for future)
   ============================================ */

@media (prefers-color-scheme: dark) {
    /* Currently not implemented, but reserved for future dark mode support */
}
