/* ================================
   BURGER PRIME - RESPONSIVE STYLES
   ================================ */

/* Mobile First Approach - Base styles are for mobile */

/* Small Mobile Devices (320px - 480px) */
@media (max-width: 480px) {
    /* Navigation */
    .nav-container {
        padding: 0 1rem;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .logo::before {
        font-size: 2rem;
    }
    
    .nav-menu {
        display: none; /* Hidden on small mobile, can add hamburger menu */
    }
    
    /* Hero Section */
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
    }
    
    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
        width: 100%;
        max-width: 250px;
    }
    
    /* Sections */
    .section {
        padding: 3rem 0;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    /* Menu Items */
    .menu-item-enhanced {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .item-price-section {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
        align-items: center;
    }
    
    .item-image {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    /* Menu Filters */
    .menu-filter,
    .gallery-filter {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    /* Gallery Grid */
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .gallery-item {
        height: 200px;
    }
    
    /* Upload Section */
    .upload-section {
        padding: 2rem 1rem;
    }
    
    .upload-info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1rem;
    }
    
    /* Order Button */
    .order-now-btn {
        bottom: 20px;
        right: 20px;
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* Mobile Devices (481px - 767px) */
@media (min-width: 481px) and (max-width: 767px) {
    /* Navigation */
    .nav-menu {
        gap: 1rem;
    }
    
    .nav-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    /* Hero */
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1.2rem;
    }
    
    .cta-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* Menu Items */
    .menu-item-enhanced {
        flex-direction: row;
        align-items: center;
    }
    
    .item-price-section {
        flex-direction: column;
    }
    
    /* Gallery */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* About */
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Tablet Devices (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    /* Navigation */
    .nav-container {
        padding: 0 1.5rem;
    }
    
    .nav-menu {
        gap: 1.5rem;
    }
    
    /* Hero */
    .hero h1 {
        font-size: 3rem;
    }
    
    .hero p {
        font-size: 1.3rem;
    }
    
    /* Menu */
    .menu-filter,
    .gallery-filter {
        gap: 0.8rem;
    }
    
    .menu-item-enhanced {
        padding: 1.2rem;
    }
    
    /* Gallery */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    /* Menu Categories */
    .menu-categories {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* About */
    .about-content {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    
    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop Devices (1024px - 1439px) */
@media (min-width: 1024px) and (max-width: 1439px) {
    /* Menu */
    .menu-categories {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Gallery */
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
    /* Container */
    .section {
        max-width: 1400px;
    }
    
    .nav-container {
        max-width: 1400px;
    }
    
    /* Menu */
    .menu-categories {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Gallery */
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Footer */
    .footer-content {
        max-width: 1400px;
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Landscape Mobile Devices */
@media (max-width: 767px) and (orientation: landscape) {
    .hero {
        height: 100vh;
        padding: 2rem 0;
    }
    
    .hero h1 {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .hero p {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .cta-buttons {
        gap: 0.5rem;
    }
    
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    .btn,
    .filter-btn,
    .add-to-cart,
    .nav-link {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects that don't work on touch */
    .menu-item-enhanced:hover,
    .gallery-item:hover,
    .review-display:hover {
        transform: none;
    }
    
    /* Increase spacing for easier touch */
    .menu-filter,
    .gallery-filter {
        gap: 1rem;
    }
    
    .item-tags {
        gap: 0.8rem;
    }
    
    /* Larger star rating for touch */
    .star {
        font-size: 2.5rem;
        padding: 0.2rem;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Optimize for retina displays */
    .hero::before {
        background-size: 200px 200px;
    }
    
    .item-image,
    .reviewer-avatar {
        box-shadow: 0 0 1px rgba(0,0,0,0.2);
    }
}

/* Print Styles */
@media print {
    .navbar,
    .order-now-btn,
    .upload-section,
    #reviewSuccessMessage,
    #overlay {
        display: none !important;
    }
    
    .page-section {
        display: block !important;
        page-break-inside: avoid;
    }
    
    .section {
        padding: 1rem 0;
    }
    
    .hero {
        height: auto;
        padding: 2rem 0;
        background: white !important;
        color: black !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

/* Reduced Motion Preferences */
@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;
    }
    
    .hero::before {
        animation: none;
    }
    
    .upload-section::before {
        animation: none;
    }
    
    .reviewer-avatar::before {
        animation: none;
    }
}

/* Dark Mode Support (for future) */
@media (prefers-color-scheme: dark) {
    :root {
        --text-dark: #e0e0e0;
        --text-light: #b0b0b0;
        --background-ivory: #1a1a1a;
    }
    
    /* This will be implemented when dark mode is added */
}

/* Container Queries (Progressive Enhancement) */
@container (max-width: 600px) {
    .menu-item-enhanced {
        flex-direction: column;
    }
    
    .item-price-section {
        flex-direction: row;
        width: 100%;
        justify-content: space-between;
    }
}

/* Utility Classes for Responsive Design */
.hide-mobile {
    display: block;
}

.show-mobile {
    display: none;
}

@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
    
    .show-mobile {
        display: block !important;
    }
}

/* Responsive Typography */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
}

@media (min-width: 481px) and (max-width: 767px) {
    html {
        font-size: 15px;
    }
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

/* Flexible Images */
img {
    max-width: 100%;
    height: auto;
}

/* ================================
   CROSS-PAGE RESPONSIVE FIXES
   ================================ */

/* Fix notifications overflowing on mobile */
@media (max-width: 480px) {
    .notification {
        max-width: calc(100% - 40px) !important;
        right: 20px !important;
        left: 20px !important;
        font-size: 14px !important;
    }

    /* Cart sidebar full width on mobile */
    .cart-sidebar {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Fix hero logo on small phones */
    .hero-logo {
        width: 120px !important;
        height: 110px !important;
    }
    .hero-logo-img {
        width: 100px !important;
        height: 90px !important;
    }

    /* Fix cart button position */
    .cart-button {
        top: auto !important;
        bottom: 80px !important;
        right: 15px !important;
        width: 50px !important;
        height: 50px !important;
    }

    /* Fix review success modal overflow */
    #reviewSuccessMessage,
    .review-modal .review-form-container {
        max-width: 95% !important;
        margin: 0 auto !important;
    }

    /* Fix page section padding */
    .page-section {
        padding-top: 80px !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* Fix navbar logo size */
    .logo-image {
        width: 45px !important;
        height: 40px !important;
    }

    /* Inline grid fix for contact/stats */
    .contact-grid,
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Login/Signup/Checkout page responsive */
@media (max-width: 480px) {
    /* Auth pages */
    .auth-container {
        padding: 25px 20px !important;
        margin: 10px !important;
        max-height: none !important;
        overflow: visible !important;
    }
    .auth-header h1 {
        font-size: 1.5rem !important;
    }
    .form-input {
        padding: 12px 12px 12px 42px !important;
        font-size: 16px !important; /* Prevents iOS zoom on focus */
    }
    .form-row {
        grid-template-columns: 1fr !important;
    }
    .auth-submit {
        padding: 14px !important;
        min-height: 48px !important;
    }
    .google-btn {
        padding: 14px 20px !important;
        min-height: 48px !important;
        font-size: 15px !important;
    }
    /* CAPTCHA input */
    .captcha-input {
        width: 100% !important;
        max-width: 120px !important;
    }
    /* Checkbox touch target */
    .terms-checkbox input[type="checkbox"] {
        width: 24px !important;
        height: 24px !important;
        min-width: 24px !important;
    }

    /* Checkout page */
    .checkout-container {
        padding: 15px !important;
    }
    .checkout-grid {
        grid-template-columns: 1fr !important;
    }
    .order-summary-card {
        position: static !important;
    }

    /* Profile page */
    .profile-grid {
        grid-template-columns: 1fr !important;
    }
    .profile-sidebar {
        width: 100% !important;
    }
    .info-grid {
        grid-template-columns: 1fr !important;
    }
    .profile-stats {
        grid-template-columns: 1fr 1fr !important;
    }
    .settings-actions {
        flex-direction: column !important;
    }
    .settings-actions .btn {
        width: 100% !important;
    }
}

/* Tablet fixes */
@media (min-width: 481px) and (max-width: 767px) {
    .auth-container {
        max-width: 480px !important;
        margin: 20px auto !important;
    }
    .checkout-grid {
        grid-template-columns: 1fr !important;
    }
    .profile-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Fix menu search on all mobile */
@media (max-width: 767px) {
    .menu-search,
    #menuSearch {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Gallery grid single column on small screens */
    .gallery-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Responsive Tables (for future data) */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 767px) {
    .table-responsive table {
        font-size: 0.8rem;
    }
}