﻿/* ==========================================================================
   RESPONSIVE DESIGN - The Old Tavern
   ========================================================================== */

/* Extra small devices (phones, less than 576px) */
@media (max-width: 575.98px) {
    .container {
        padding: 0 var(--space-md);
    }

    .hero-title {
        font-size: 2rem;
        line-height: 1.1;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .menu-categories {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: var(--space-sm);
        -webkit-overflow-scrolling: touch;
    }

        .menu-categories::-webkit-scrollbar {
            height: 4px;
        }

        .menu-categories::-webkit-scrollbar-track {
            background: var(--surface);
        }

        .menu-categories::-webkit-scrollbar-thumb {
            background: var(--primary);
            border-radius: var(--radius-full);
        }

    .category-btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
        white-space: nowrap;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--space-sm);
    }

        .footer-links .separator {
            display: none;
        }

    .event-card {
        min-width: 280px;
    }

    .cta-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .events-slider {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .hero-title {
        font-size: 3rem;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .menu-preview-tabs .menu-items-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .features-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .menu-preview-tabs .menu-items-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* XXL devices (larger desktops, 1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .nav-link,
    .category-btn {
        min-height: 44px;
        min-width: 44px;
    }

    input,
    select,
    textarea {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    .menu-item:hover {
        transform: none;
    }
}

/* 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;
    }

    .hero-title,
    .feature-card,
    .menu-item {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --primary: #0000FF;
        --text: #000000;
        --background: #FFFFFF;
        --border: #000000;
    }

    .btn-primary {
        border: 2px solid currentColor;
    }
}

/* Dark mode adjustments (if using light theme) */
@media (prefers-color-scheme: light) {
    [data-bs-theme="auto"] {
        --dark: #FFFFFF;
        --dark-light: #F5F5F5;
        --surface: #FFFFFF;
        --surface-light: #F8F9FA;
        --text: #212529;
        --text-secondary: #6C757D;
        --border: #DEE2E6;
    }
}

/* Print styles */
@media print {
    .site-header,
    .main-navigation,
    .site-footer,
    .btn,
    .hero-actions,
    .mobile-menu-btn,
    .cookie-banner,
    .back-to-top {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff !important;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }

    .menu-section {
        break-inside: avoid;
    }

    .menu-item {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        margin-bottom: 1rem;
    }

    .hero-section {
        background: none !important;
        color: #000 !important;
        min-height: auto;
        padding: 2rem 0;
    }

    .hero-title {
        color: #000 !important;
        -webkit-text-fill-color: #000 !important;
        background: none !important;
    }
}

/* Landscape orientation */
@media (orientation: landscape) and (max-height: 500px) {
    .hero-section {
        min-height: 150vh;
    }

    .hero-content {
        padding: 2rem 0;
    }
}

/* Very large screens */
@media (min-width: 1920px) {
    html {
        font-size: 18px;
    }

    .container {
        max-width: 1600px;
    }
}

/* Performance optimizations for low-end devices */
@media (max-width: 768px) and (prefers-reduced-data: reduce) {
    .hero-section {
        background-image: none !important;
        background-color: var(--dark);
    }

    .feature-icon {
        font-size: 2rem;
    }

    .testimonial-card,
    .event-card {
        padding: var(--space-md);
    }
}

/* Notification styles for responsive */
.notification {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    max-width: 350px;
    width: calc(100% - 2rem);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: var(--shadow-xl);
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--transition-normal);
    z-index: 9999;
}

    .notification.show {
        transform: translateY(0);
        opacity: 1;
    }

.notification-content {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-xs);
    margin-left: auto;
}

@media (max-width: 768px) {
    .notification {
        left: var(--space-lg);
        right: var(--space-lg);
        width: auto;
    }
}

/* Loading overlay responsive */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

    .loading-overlay.active {
        display: flex;
    }

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .loading-spinner {
        animation: none;
        border-top-color: var(--border);
    }
}
