/**
 * ============================================
 * RESTAURANT/CAFÉ PREMIUM THEME - RESPONSIVE
 * Media queries for all breakpoints
 * Version: 1.0.0
 * ============================================
 */

/* ========================================
 * EXTRA LARGE SCREENS (1400px and up)
 * ======================================== */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* ========================================
 * LARGE SCREENS (1200px and up)
 * ======================================== */
@media (min-width: 1200px) {
    /* Grid responsive classes */
    .lg\:grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .lg\:grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .lg\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
 * DESKTOP (992px - 1199px)
 * ======================================== */
@media (max-width: 1199px) {
    :root {
        --header-height: 72px;
        --header-height-scrolled: 60px;
    }
    
    .container {
        max-width: 960px;
    }
    
    /* Hero */
    .hero-title {
        font-size: var(--text-5xl);
    }
    
    /* Footer */
    .footer-main {
        grid-template-columns: 1fr 1fr 1fr;
        gap: var(--space-8);
    }
    
    .footer-brand {
        grid-column: span 3;
        max-width: none;
        text-align: center;
        margin-bottom: var(--space-6);
    }
    
    /* Team */
    .team-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }
    
    /* Events */
    .events-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Gallery */
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========================================
 * TABLET (768px - 991px)
 * ======================================== */
@media (max-width: 991px) {
    :root {
        --header-height: 64px;
        --header-height-scrolled: 56px;
        --section-py: clamp(3rem, 6vw, 5rem);
    }
    
    .container {
        max-width: 720px;
    }
    
    /* Grid responsive classes */
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .md\:grid-cols-1 {
        grid-template-columns: 1fr;
    }
    
    /* Hide on tablet */
    .md\:hidden {
        display: none !important;
    }
    
    /* Show menu toggle */
    .menu-toggle {
        display: flex;
    }
    
    /* Hide desktop nav */
    .header-nav {
        display: none;
    }
    
    /* Two column layouts */
    .two-col,
    .two-col-40-60,
    .two-col-60-40,
    .two-col-30-70,
    .two-col-70-30 {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }
    
    .two-col-reverse {
        direction: ltr;
    }
    
    /* Sidebar layouts */
    .layout-sidebar,
    .layout-sidebar-left {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
    }
    
    /* Hero */
    .hero-title {
        font-size: var(--text-4xl);
    }
    
    .hero-subtitle {
        font-size: var(--text-lg);
    }
    
    .hero-slider-nav {
        bottom: var(--space-4);
        right: 50%;
        transform: translateX(50%);
    }
    
    /* Menu */
    .menu-grid {
        grid-template-columns: 1fr;
    }
    
    /* Specialties */
    .specialties-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Blog */
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Team */
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Reservation */
    .reservation-content {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }
    
    .reservation-info {
        text-align: center;
    }
    
    .reservation-features {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }
    
    /* Newsletter */
    .newsletter-content {
        flex-direction: column;
        text-align: center;
    }
    
    /* Footer */
    .footer-main {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-8);
    }
    
    .footer-brand {
        grid-column: span 2;
    }
    
    /* About */
    .about-content {
        padding-left: 0;
    }
    
    .about-image-secondary {
        position: relative;
        bottom: auto;
        right: auto;
        width: 100%;
        margin-top: var(--space-4);
    }
    
    .about-experience-badge {
        left: auto;
        right: var(--space-4);
        top: auto;
        bottom: var(--space-4);
    }
    
    /* Masonry */
    .masonry {
        column-count: 2;
    }
    
    .masonry-4 {
        column-count: 2;
    }
}

/* ========================================
 * MOBILE LANDSCAPE (576px - 767px)
 * ======================================== */
@media (max-width: 767px) {
    :root {
        --section-py: clamp(2.5rem, 5vw, 4rem);
    }
    
    .container {
        max-width: 540px;
    }
    
    /* Grid responsive classes */
    .sm\:grid-cols-1 {
        grid-template-columns: 1fr;
    }
    
    /* Hide on mobile */
    .sm\:hidden {
        display: none !important;
    }
    
    /* Hero */
    .hero {
        min-height: 80vh;
    }
    
    .hero-title {
        font-size: var(--text-3xl);
    }
    
    .hero-subtitle {
        font-size: var(--text-base);
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .hero-actions .btn {
        width: 100%;
    }
    
    .hero-scroll {
        display: none;
    }
    
    /* Buttons */
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        border-radius: var(--radius-sm);
        margin-left: 0;
    }
    
    /* Cards */
    .card-horizontal {
        flex-direction: column;
    }
    
    .card-horizontal .card-img {
        flex: none;
        aspect-ratio: 16/9;
    }
    
    /* Menu items */
    .menu-item {
        flex-direction: column;
    }
    
    .menu-item-image {
        width: 100%;
        height: 200px;
    }
    
    /* Specialties */
    .specialties-grid {
        grid-template-columns: 1fr;
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }
    
    .stat-value {
        font-size: var(--text-4xl);
    }
    
    /* Events */
    .events-grid {
        grid-template-columns: 1fr;
    }
    
    /* Blog */
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    /* Team */
    .team-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }
    
    /* Gallery */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-item.large {
        grid-column: span 2;
        grid-row: span 1;
    }
    
    /* Reservation */
    .reservation-form-grid {
        grid-template-columns: 1fr;
    }
    
    .reservation-form-grid .form-group.full-width {
        grid-column: span 1;
    }
    
    .reservation-features {
        grid-template-columns: 1fr;
    }
    
    /* Newsletter */
    .newsletter-form {
        flex-direction: column;
    }
    
    /* Footer */
    .footer-main {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-brand {
        grid-column: span 1;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .footer-contact-item {
        justify-content: center;
    }
    
    .footer-hours-item {
        flex-direction: column;
        gap: var(--space-1);
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }
    
    .footer-bottom-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* About */
    .about-features {
        grid-template-columns: 1fr;
    }
    
    /* Tabs */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: var(--space-2);
    }
    
    .tab-item {
        white-space: nowrap;
    }
    
    /* Menu categories */
    .menu-categories {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        flex-wrap: nowrap;
        padding-bottom: var(--space-2);
        margin-bottom: var(--space-6);
    }
    
    .menu-category-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* Modal */
    .modal {
        max-width: calc(100% - var(--space-8));
        margin: var(--space-4);
    }
    
    .modal-fullscreen {
        margin: 0;
        max-width: 100%;
    }
    
    /* Masonry */
    .masonry {
        column-count: 1;
    }
    
    .masonry-2,
    .masonry-4 {
        column-count: 1;
    }
    
    /* CTA */
    .cta-title {
        font-size: var(--text-3xl);
    }
    
    .cta-actions {
        flex-direction: column;
    }
    
    /* Pagination */
    .pagination {
        flex-wrap: wrap;
    }
    
    /* Toast */
    .toast-container {
        left: var(--space-4);
        right: var(--space-4);
    }
    
    .toast {
        min-width: auto;
        max-width: none;
    }
    
    /* Scroll to top */
    .scroll-top {
        right: var(--space-4);
        bottom: var(--space-4);
        width: 44px;
        height: 44px;
    }
    
    /* FAQ Categories */
    .faq-categories {
        flex-wrap: wrap;
    }
}

/* ========================================
 * MOBILE PORTRAIT (up to 575px)
 * ======================================== */
@media (max-width: 575px) {
    :root {
        --container-px: 1rem;
        --section-py: clamp(2rem, 4vw, 3rem);
    }
    
    /* Typography adjustments */
    h1, .h1 {
        font-size: var(--text-3xl);
    }
    
    h2, .h2 {
        font-size: var(--text-2xl);
    }
    
    h3, .h3 {
        font-size: var(--text-xl);
    }
    
    /* Display headings */
    .display-1 {
        font-size: var(--text-4xl);
    }
    
    .display-2 {
        font-size: var(--text-3xl);
    }
    
    /* Lead text */
    .lead {
        font-size: var(--text-lg);
    }
    
    /* Hero */
    .hero-badge {
        font-size: var(--text-xs);
        padding: var(--space-1) var(--space-3);
    }
    
    .hero-content {
        padding: var(--space-4);
    }
    
    /* Mobile menu */
    .mobile-menu {
        max-width: 100%;
    }
    
    /* Page header */
    .page-header {
        padding: calc(var(--header-height) + var(--space-8)) 0 var(--space-8);
    }
    
    /* Section headers */
    .section-header {
        margin-bottom: var(--space-8);
    }
    
    /* Cards */
    .card-body {
        padding: var(--space-4);
    }
    
    /* Forms */
    .form-input,
    .form-textarea,
    .form-select {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Buttons */
    .btn-sm {
        height: var(--btn-height-md);
    }
    
    /* Gallery */
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }
    
    .gallery-item.large {
        grid-column: span 1;
    }
    
    /* Error page */
    .error-code {
        font-size: 6rem;
    }
    
    /* Testimonial */
    .testimonial-quote {
        font-size: var(--text-lg);
    }
    
    .testimonial-avatar {
        width: 72px;
        height: 72px;
    }
    
    /* Blockquote */
    blockquote {
        padding: var(--space-4) var(--space-5);
        font-size: var(--text-lg);
    }
    
    .blockquote-fancy {
        padding: var(--space-8) var(--space-4);
    }
    
    .blockquote-fancy::before {
        font-size: 4rem;
    }
}

/* ========================================
 * VERY SMALL SCREENS (up to 359px)
 * ======================================== */
@media (max-width: 359px) {
    :root {
        --container-px: 0.75rem;
    }
    
    /* Further typography adjustments */
    h1, .h1 {
        font-size: var(--text-2xl);
    }
    
    h2, .h2 {
        font-size: var(--text-xl);
    }
    
    /* Hero */
    .hero-title {
        font-size: var(--text-2xl);
    }
    
    /* Buttons */
    .btn {
        padding: 0 var(--space-4);
        font-size: var(--text-xs);
    }
    
    /* Menu item */
    .menu-item-header {
        flex-direction: column;
        gap: var(--space-2);
    }
    
    /* Stats */
    .stat-value {
        font-size: var(--text-3xl);
    }
}

/* ========================================
 * LANDSCAPE ORIENTATION (Mobile)
 * ======================================== */
@media (max-width: 991px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: calc(var(--header-height) + var(--space-8)) 0 var(--space-8);
    }
    
    .hero-title {
        font-size: var(--text-3xl);
    }
    
    .hero-subtitle {
        margin-bottom: var(--space-4);
    }
}

/* ========================================
 * HIGH DPI SCREENS
 * ======================================== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Use higher resolution images where available */
    .hero-slide-bg img,
    .about-image img,
    .gallery-item img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ========================================
 * TOUCH DEVICES
 * ======================================== */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects that don't work well on touch */
    .hover-lift:hover {
        transform: none;
    }
    
    .hover-scale:hover {
        transform: none;
    }
    
    .img-hover-zoom:hover img {
        transform: none;
    }
    
    .card:hover {
        transform: none;
    }
    
    .menu-item:hover {
        transform: none;
    }
    
    /* Make touch targets larger */
    .nav-link,
    .dropdown-item,
    .footer-link {
        padding: var(--space-4);
    }
    
    /* Show overlay content immediately */
    .gallery-item-overlay {
        opacity: 1;
        background-color: rgba(0, 0, 0, 0.3);
    }
    
    .gallery-item-icon {
        transform: scale(1);
    }
    
    .team-card-social {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ========================================
 * PRINT STYLES
 * ======================================== */
@media print {
    /* Reset to single column */
    .grid,
    .two-col,
    .layout-sidebar {
        display: block;
    }
    
    /* Hide non-essential elements */
    .header,
    .footer,
    .mobile-menu,
    .scroll-top,
    .toast-container,
    .hero-slider-nav,
    .hero-scroll,
    .btn,
    .social-links,
    nav {
        display: none !important;
    }
    
    /* Reset backgrounds */
    .section-dark,
    .section-primary,
    .section-gradient {
        background: white !important;
        color: black !important;
    }
    
    /* Ensure images print */
    img {
        max-width: 100%;
        page-break-inside: avoid;
    }
    
    /* Add URLs to links */
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}

/* ========================================
 * ACCESSIBILITY - FORCED COLORS
 * ======================================== */
@media (forced-colors: active) {
    .btn,
    .form-input,
    .card {
        border: 2px solid currentColor;
    }
    
    .btn-primary,
    .btn-secondary {
        background-color: transparent;
    }
}

/* ========================================
 * DARK MODE RESPONSIVE ADJUSTMENTS
 * ======================================== */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        /* Auto dark mode if no explicit theme set */
    }
}
