/* ============================================
   RESPONSIVE DESIGN - Mobile First Approach
   ============================================ */

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--color-text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    color: var(--color-primary);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    background: var(--color-bg-main);
    border-right: 1px solid var(--color-border);
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
}

.mobile-nav.active {
    transform: translateX(0);
}

.mobile-nav-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-nav-header .logo {
    font-size: 1.5rem;
}

.mobile-nav-close {
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.mobile-nav-close:hover {
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
}

.mobile-nav-links {
    padding: 1rem 0;
}

.mobile-nav-links a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--color-text-secondary);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.mobile-nav-links a:hover {
    background: var(--color-bg-secondary);
    color: var(--color-primary);
    padding-left: 2rem;
}

.mobile-nav-actions {
    padding: 1.5rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-nav-actions a,
.mobile-nav-actions button {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Touch-friendly buttons */
.btn, .cart-btn, .account-link {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
}

/* ============================================
   TABLET BREAKPOINT (768px - 1024px)
   ============================================ */
@media (max-width: 1024px) {
    .footer-content {
        grid-template-columns: 1fr 1fr; /* 2 cols on tablet */
        gap: var(--spacing-xl);
    }

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

    .hero h1 {
        font-size: 3rem;
    }

    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* ============================================
   MOBILE BREAKPOINT (up to 768px)
   ============================================ */
@media (max-width: 768px) {
    :root {
        --font-size-4xl: 2.5rem;
        --font-size-3xl: 2rem;
        --spacing-2xl: 4rem;
        --spacing-xl: 2rem;
    }

    /* Navigation */
    .navbar {
        padding: 1rem 0;
    }

    .nav-content {
        flex-wrap: wrap;
        gap: 1rem;
    }

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

    .mobile-menu-overlay {
        display: block;
    }

    .mobile-nav {
        display: block;
    }

    .nav-links {
        display: none; /* Hide desktop nav links on mobile */
    }

    .nav-actions {
        display: flex;
        gap: 0.5rem;
        align-items: center;
    }

    .logo {
        font-size: 1.5rem;
    }

    /* Hero Section */
    .hero {
        padding-top: 120px;
        padding-bottom: var(--spacing-xl);
        min-height: auto;
    }

    .hero h1 {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        padding: 0 1rem;
        line-height: 1.6;
    }

    .hero-cta {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        padding: 0 1rem;
    }

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

    /* Features Grid */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .footer-col {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* Container Padding */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Sections */
    section {
        padding: 3rem 0;
    }

    /* Cards */
    .card, .feature-card {
        padding: 1.5rem;
    }

    /* Tables - Make scrollable on mobile */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Forms */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 44px;
        padding: 0.75rem 1rem;
    }

    /* Buttons */
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.875rem;
        width: 100%;
        max-width: 100%;
    }

    /* Cart Modal */
    .cart-modal {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    /* Product Grids */
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* ============================================
   SMALL MOBILE BREAKPOINT (up to 480px)
   ============================================ */
@media (max-width: 480px) {
    :root {
        --font-size-4xl: 2rem;
        --font-size-3xl: 1.75rem;
        --spacing-2xl: 3rem;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

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

    .mobile-nav {
        width: 100%;
        max-width: 100%;
    }

    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    section {
        padding: 2rem 0;
    }

    .card, .feature-card {
        padding: 1rem;
    }
}

/* ============================================
   LANDSCAPE ORIENTATION OPTIMIZATIONS
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding-top: 100px;
        min-height: auto;
    }

    .navbar {
        padding: 0.75rem 0;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .navbar,
    .mobile-menu-toggle,
    .mobile-nav,
    .mobile-menu-overlay,
    .cart-btn,
    .nav-actions {
        display: none;
    }

    body {
        background: white;
        color: black;
    }
}
