/* ==========================================================================
   APPLE CLONE - Responsive Styles (Mobile & Tablet)
   ========================================================================== */

/* 1. Medium Screens / Tablet Landscape / Small Laptops (Max 1024px) */
@media only screen and (max-width: 1024px) {
    .container {
        padding: 0 16px;
    }
    
    .hero-title {
        font-size: 48px;
    }
    
    .hero-subtitle {
        font-size: 24px;
    }
}

/* 2. Tablet Portrait (Max 768px) */
@media only screen and (max-width: 768px) {
    :root {
        --nav-height: 48px; /* Slightly taller on mobile for easier taps */
    }
    
    /* Navigation Bar Changes */
    .global-nav {
        background-color: #000000; /* Solid color for mobile header menu */
    }
    
    .nav-list {
        display: flex;
        justify-content: space-between;
        width: 100%;
        padding: 0;
    }
    
    /* Hide desktop nav links */
    .nav-item:not(.nav-logo):not(.nav-bag):not(.nav-search) {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
        order: -1; /* Place hamburger on the left */
    }
    
    .nav-logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .nav-bag {
        order: 1; /* Align bag to the right */
    }
    
    /* Hero Section Spacing & Scale */
    .hero-section {
        height: 620px;
        padding-top: 40px;
    }
    
    .hero-title {
        font-size: 40px;
        line-height: 1.1;
    }
    
    .hero-title-wwdc {
        font-size: 56px !important;
    }
    
    #wwdc26 .bg-image {
        max-height: 48%;
    }
    
    #macbook-air-m5 .bg-image,
    #iphone-lineup .bg-image {
        height: 50%;
    }
    
    .hero-subtitle {
        font-size: 20px;
        line-height: 1.2;
    }
    
    .hero-extra-text {
        font-size: 16px;
    }
    
    /* Promotional Grid Stacks on Mobile */
    .promo-grid {
        grid-template-columns: 1fr;
        padding: 0;
        gap: var(--section-gap);
    }
    
    .promo-card {
        height: 480px;
        padding-top: 40px;
    }
    
    .promo-title {
        font-size: 32px;
    }
    
    .promo-subtitle {
        font-size: 16px;
    }

    /* TV Carousel Tablet adjustments */
    .tv-carousel-section {
        height: 480px;
    }
    
    .tv-show-title {
        font-size: 32px !important;
    }
    
    .tv-show-tagline {
        font-size: 15px !important;
    }
    
    /* Footer Restructure */
    .footer-directory {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 10px 0;
    }
    
    .directory-column {
        gap: 0;
    }

    .directory-section {
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    }
    
    .directory-section-title {
        padding: 14px 0;
        margin: 0;
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        user-select: none;
    }
    
    /* Chevron indicator for mobile accordions */
    .directory-section-title::after {
        content: '+';
        font-size: 16px;
        font-weight: 300;
        transition: transform var(--transition-fast);
        color: var(--color-text-muted-dark);
    }
    
    /* Accordion open state */
    .directory-section.active .directory-section-title::after {
        transform: rotate(45deg);
        content: '+'; /* Keeping + but rotated makes a clean cross/minus effect */
    }
    
    .directory-list {
        height: 0;
        overflow: hidden;
        opacity: 0;
        transition: height var(--transition-medium), opacity var(--transition-medium), padding-bottom var(--transition-fast);
        padding-bottom: 0;
    }
    
    .directory-section.active .directory-list {
        height: auto;
        opacity: 1;
        padding-bottom: 16px;
    }
    
    .directory-list-item {
        padding: 6px 0;
    }
    
    .footer-legal {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .legal-country {
        margin-left: 0;
        margin-top: 5px;
    }
}

/* 3. Small Mobile Devices (Max 480px) */
@media only screen and (max-width: 480px) {
    .hero-title {
        font-size: 32px;
    }
    
    .hero-subtitle {
        font-size: 18px;
    }
    
    .btn-primary, .btn-secondary {
        padding: 8px 18px;
        font-size: 14px;
    }
    
    .btn-link {
        font-size: 17px;
    }
    
    .promo-card {
        height: 450px;
    }
    
    .promo-title {
        font-size: 28px;
    }

    /* Mobile TV Carousel adjustments */
    .tv-carousel-section {
        height: 420px;
    }
    
    .tv-show-title {
        font-size: 28px !important;
    }
    
    .tv-show-tagline {
        font-size: 14px !important;
    }
    
    .carousel-nav-overlay {
        padding: 24px;
    }
    
    .hero-title-wwdc {
        font-size: 40px !important;
    }
    
    #wwdc26 .bg-image {
        max-height: 42%;
        bottom: 0;
    }
    
    #macbook-air-m5 .bg-image,
    #iphone-lineup .bg-image {
        height: 45%;
    }
}
