/* ========================================
   CROCO BRASSEUR - ENHANCED RESPONSIVE DESIGN
   Modern & Cool Styles for Mobile, Tablet, Desktop
   ======================================== */

/* ========================================
   ENHANCED MOBILE STYLES (< 768px)
   ======================================== */

@media (max-width: 767px) {
    /* Smoother animations on mobile */
    * {
        -webkit-tap-highlight-color: transparent;
    }

    /* Improved touch targets */
    button,
    a,
    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    /* Better mobile navigation */
    .navbar {
        background: rgba(26, 51, 38, 0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    /* Enhanced mobile menu */
    .nav-menu {
        background: rgba(26, 26, 26, 0.98) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        padding: 20px;
    }

    .nav-link {
        font-size: 1.1rem;
        padding: 15px 20px;
        border-radius: 8px;
        transition: all 0.3s ease;
    }

    .nav-link:hover {
        background: rgba(201, 169, 97, 0.1);
        transform: translateX(10px);
    }

    /* Improved mobile hero */
    .hero {
        padding: 100px 0 60px;
    }

    .hero-title {
        font-size: clamp(2rem, 8vw, 3.5rem) !important;
        line-height: 1.2;
        margin-bottom: 20px;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 30px;
    }

    .hero-buttons {
        gap: 15px;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
        padding: 15px 30px;
    }

    /* Mobile-optimized sections */
    section {
        padding: 60px 0;
    }

    .section-title {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
        margin-bottom: 20px;
    }

    .section-subtitle {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }

    /* Mobile cards with cool shadows */
    .menu-card,
    .beer-card,
    .event-card {
        margin-bottom: 20px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
        border-radius: 12px;
        overflow: hidden;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .menu-card:active,
    .beer-card:active,
    .event-card:active {
        transform: scale(0.98);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    }

    /* Optimized gallery for mobile */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .gallery-item {
        border-radius: 8px;
        overflow: hidden;
    }

    /* Mobile forms */
    .form-group {
        margin-bottom: 20px;
    }

    input,
    textarea,
    select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 15px;
        border-radius: 8px;
    }

    /* Mobile footer */
    .footer {
        text-align: center;
    }

    .footer-grid {
        gap: 40px;
    }

    /* WhatsApp button optimized for mobile */
    .whatsapp-float {
        bottom: 20px;
        right: 20px;
        width: 60px;
        height: 60px;
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.5);
    }

    /* Mobile parallax sections */
    .parallax-section {
        background-attachment: scroll !important; /* Better performance on mobile */
        min-height: 60vh;
    }

    /* Smooth scroll behavior */
    html {
        scroll-behavior: smooth;
        overflow-x: hidden;
    }

    /* Hide custom cursor on mobile */
    .cursor-arrow,
    .cursor-glow,
    .cursor-particle {
        display: none !important;
    }
}

/* ========================================
   ENHANCED TABLET STYLES (768px - 1024px)
   ======================================== */

@media (min-width: 768px) and (max-width: 1024px) {
    /* Tablet containers */
    .container {
        padding: 0 40px;
    }

    /* Tablet grid layouts */
    .menu-categories,
    .brewery-grid,
    .events-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }

    .beers-grid,
    .drinks-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    /* Tablet hero */
    .hero-title {
        font-size: clamp(3rem, 8vw, 4.5rem);
    }

    .hero-buttons {
        flex-direction: row;
        gap: 20px;
    }

    /* Tablet navigation */
    .nav-menu {
        gap: 30px;
    }

    .nav-link {
        font-size: 0.95rem;
    }

    /* Tablet cards hover effects */
    .menu-card:hover,
    .beer-card:hover,
    .event-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    }

    /* Tablet forms */
    .form-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    /* Optimized parallax for tablets */
    .parallax-section {
        min-height: 70vh;
        background-attachment: fixed;
    }
}

/* ========================================
   ENHANCED DESKTOP STYLES (> 1024px)
   ======================================== */

@media (min-width: 1025px) {
    /* Large desktop containers */
    .container {
        max-width: 1400px;
    }

    /* Desktop hero with animations */
    .hero {
        min-height: 100vh;
        display: flex;
        align-items: center;
    }

    .hero-title {
        font-size: clamp(4rem, 7vw, 6rem);
        animation: fadeInUp 1s ease-out;
    }

    .hero-subtitle {
        animation: fadeInUp 1s ease-out 0.2s both;
    }

    .hero-buttons {
        animation: fadeInUp 1s ease-out 0.4s both;
    }

    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Desktop navigation with cool hover effects */
    .nav-link {
        position: relative;
        overflow: hidden;
    }

    .nav-link::after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 50%;
        width: 0;
        height: 2px;
        background: var(--primary-gold);
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        transform: translateX(-50%);
    }

    .nav-link:hover::after {
        width: 100%;
    }

    /* Desktop grid with optimal layouts */
    .menu-categories,
    .brewery-grid,
    .events-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 40px;
    }

    .beers-grid,
    .drinks-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 30px;
    }

    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }

    /* Desktop cards with advanced hover effects */
    .menu-card,
    .beer-card,
    .event-card {
        transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .menu-card:hover,
    .beer-card:hover,
    .event-card:hover {
        transform: translateY(-15px) scale(1.02);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
        z-index: 10;
    }

    /* Desktop parallax with depth */
    .parallax-section {
        min-height: 80vh;
        background-attachment: fixed;
        background-size: cover;
        background-position: center;
    }

    /* Desktop footer */
    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 60px;
    }
}

/* ========================================
   EXTRA LARGE SCREENS (> 1440px)
   ======================================== */

@media (min-width: 1441px) {
    .container {
        max-width: 1600px;
    }

    .section-padding {
        padding: 150px 0;
    }

    .hero-title {
        font-size: 7rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ========================================
   SMALL MOBILE DEVICES (< 480px)
   ======================================== */

@media (max-width: 479px) {
    .container {
        padding: 0 15px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .btn {
        padding: 12px 25px;
        font-size: 0.9rem;
    }

    .whatsapp-float {
        width: 55px;
        height: 55px;
    }
}

/* ========================================
   LANDSCAPE MOBILE ORIENTATION
   ======================================== */

@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 80px 0 40px;
    }

    .parallax-section {
        min-height: auto;
        padding: 60px 0;
    }

    .nav-menu {
        height: auto;
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* ========================================
   ACCESSIBILITY & PERFORMANCE
   ======================================== */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --light-gray: #2a2a2a;
        --warm-beige: #1a1a1a;
        --medium-gray: #cccccc;
    }

    .detail-icon {
        border-color: rgba(255, 255, 255, 0.2);
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }

    .nav-link:focus,
    .btn:focus {
        outline: 3px solid var(--primary-gold);
        outline-offset: 2px;
    }
}

/* ========================================
   LOADING & PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* Lazy loading images */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Prevent layout shift */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* GPU acceleration for smooth animations */
.menu-card,
.beer-card,
.event-card,
.gallery-item,
.btn {
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* ========================================
   DROPDOWN MOBILE & TABLET
   ======================================== */

@media (max-width: 768px) {

    /* ---- NAVBAR COMPACTE ---- */
    .navbar {
        padding: 8px 0 !important;
        background: rgba(26, 51, 38, 0.97) !important;
        backdrop-filter: blur(10px);
    }

    .navbar.scrolled {
        padding: 6px 0 !important;
    }

    .nav-container {
        padding: 0 15px;
        min-height: 60px;
    }

    /* Logo plus petit */
    .logo img {
        height: 50px !important;
        width: 50px !important;
        object-fit: contain;
        border-radius: 50%;
    }

    .navbar.scrolled .logo img {
        height: 45px !important;
        width: 45px !important;
    }

    /* Cacher le texte logo sur mobile */
    .logo-text {
        display: none;
    }

    /* Bouton RESERVE compact */
    .nav-reserve {
        padding: 8px 14px !important;
        font-size: 11px !important;
        letter-spacing: 1px;
    }

    /* Hamburger bien positionné */
    .mobile-toggle {
        display: flex;
        flex-direction: column;
        gap: 5px;
        padding: 5px;
        cursor: pointer;
    }

    .mobile-toggle span {
        width: 24px;
        height: 2px;
        background: var(--white);
        display: block;
        transition: all 0.3s ease;
        border-radius: 2px;
    }

    /* Menu déroulant mobile plein écran */
    .nav-menu {
        top: 60px !important;
        height: calc(100vh - 60px) !important;
        padding: 30px 20px !important;
        gap: 10px !important;
        justify-content: flex-start !important;
        overflow-y: auto;
    }

    /* Liens nav mobile */
    .nav-menu > li {
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    .nav-menu > li:last-child {
        border-bottom: none;
    }

    .nav-link {
        font-size: 16px !important;
        padding: 14px 10px !important;
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* Dropdown mobile — style desktop conservé, juste repositionné */
    .nav-dropdown .dropdown-menu {
        position: absolute !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        background: white !important;
        border-radius: 8px !important;
        box-shadow: 0 10px 40px rgba(0,0,0,0.2) !important;
        min-width: 260px !important;
        padding: 10px 0 !important;
        display: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        z-index: 9999 !important;
        margin-top: 5px !important;
    }

    .nav-dropdown.open .dropdown-menu {
        display: block !important;
    }

    .nav-dropdown:hover .dropdown-menu {
        display: none !important;
    }

    .nav-dropdown.open:hover .dropdown-menu {
        display: block !important;
    }

    /* Flèche rotation quand ouvert */
    .nav-dropdown.open .nav-link i {
        transform: rotate(180deg) !important;
        color: #C9A961;
    }

    .nav-dropdown .nav-link {
        justify-content: center !important;
    }

    .dropdown-link {
        color: #1a1a1a !important;
        font-size: 13px !important;
        padding: 12px 25px !important;
        text-align: left !important;
        background: white !important;
        display: block;
        width: 100%;
    }

    .dropdown-link:hover,
    .dropdown-link.active {
        background: #f5f3f0 !important;
        color: #1a3326 !important;
        padding-left: 30px !important;
    }

    /* Logo size on mobile */
    .nav-logo img {
        height: 55px;
    }

    /* Navbar height */
    .navbar {
        padding: 10px 0;
    }

    /* Hero section mobile */
    .hero-content {
        text-align: center;
        padding: 0 15px;
    }

    /* Info bar mobile */
    .info-item {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }

    /* Section titles */
    .section-header {
        text-align: center;
        padding: 0 15px;
    }

    /* Beer cards 2 colonnes sur mobile */
    .beers-grid,
    .drinks-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    /* Beer card image */
    .beer-card-image {
        height: 180px;
    }

    /* Gallery 2 colonnes */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    /* Reservation / Contact forms */
    .reservation-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    /* Page hero */
    .page-hero-title {
        font-size: clamp(1.8rem, 7vw, 3rem);
    }

    /* Tables responsive */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    /* Admin panel */
    .admin-sidebar {
        width: 100%;
        position: relative;
    }

    .admin-content {
        margin-left: 0;
        padding: 20px 15px;
    }

    /* Stats grid admin */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* ========================================
   TABLET — dropdown hover normal
   ======================================== */

@media (min-width: 769px) and (max-width: 1024px) {
    /* Dropdown position tablet */
    .dropdown-menu {
        min-width: 180px;
    }

    /* Logo */
    .nav-logo img {
        height: 60px;
    }

    /* Nav gap réduit */
    .nav-menu {
        gap: 20px;
    }

    .nav-link {
        font-size: 0.85rem;
        letter-spacing: 0.5px;
    }

    /* Reserve button smaller */
    .nav-reserve {
        padding: 10px 18px;
        font-size: 0.8rem;
    }

    /* Hero tablet */
    .hero-content {
        max-width: 700px;
    }

    /* Beer grid 3 colonnes */
    .beers-grid,
    .drinks-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Stats grid admin */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Page hero */
    .page-hero-title {
        font-size: clamp(2.5rem, 6vw, 4rem);
    }
}

/* ========================================
   DESKTOP STANDARD (1025px - 1280px)
   Laptops & petits écrans PC
   ======================================== */

@media (min-width: 1025px) and (max-width: 1280px) {
    .container {
        max-width: 1100px;
        padding: 0 30px;
    }

    /* Navbar : réduire espacement pour tenir sur écran 13-14" */
    .nav-menu {
        gap: 30px !important;
    }

    .nav-link {
        font-size: 12px !important;
        letter-spacing: 1px !important;
    }

    .logo img {
        height: 75px !important;
    }

    .navbar.scrolled .logo img {
        height: 50px !important;
    }

    /* Hero : titre légèrement réduit */
    .hero-title {
        font-size: clamp(3rem, 5vw, 4.5rem) !important;
    }

    .hero-info {
        gap: 40px;
    }

    /* Sections */
    :root {
        --section-padding: 90px;
    }

    .section-title {
        font-size: clamp(2rem, 3.5vw, 3rem);
    }

    /* Grilles */
    .beers-grid,
    .drinks-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 25px;
    }

    .brewery-grid,
    .menu-categories,
    .events-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 35px;
    }

    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }

    .footer-grid {
        gap: 50px;
    }

    /* Formulaires */
    .reservation-form-container,
    .contact-form-container {
        padding: 50px 40px;
    }
}

/* ========================================
   DESKTOP LARGE (1281px - 1600px)
   Écrans PC 24"-27" standard
   ======================================== */

@media (min-width: 1281px) and (max-width: 1600px) {
    .container {
        max-width: 1300px;
        padding: 0 40px;
    }

    .nav-menu {
        gap: 40px !important;
    }

    .hero-title {
        font-size: clamp(4rem, 6vw, 5.5rem) !important;
    }

    .hero-info {
        gap: 50px;
    }

    .beers-grid,
    .drinks-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 30px;
    }

    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }

    .section-title {
        font-size: clamp(2.2rem, 3.5vw, 3.5rem);
    }
}

/* ========================================
   TRÈS GRAND ÉCRAN (> 1600px)
   Écrans 2K / 4K / ultrawide
   ======================================== */

@media (min-width: 1601px) and (max-width: 1920px) {
    .container {
        max-width: 1500px;
        padding: 0 60px;
    }

    .hero-title {
        font-size: clamp(5rem, 6vw, 7rem) !important;
    }

    .hero-subtitle {
        font-size: 18px;
    }

    .hero-info {
        gap: 80px;
    }

    .nav-menu {
        gap: 55px !important;
    }

    .nav-link {
        font-size: 14px !important;
    }

    .logo img {
        height: 110px !important;
    }

    .navbar.scrolled .logo img {
        height: 70px !important;
    }

    .section-title {
        font-size: clamp(2.5rem, 3vw, 4rem);
    }

    .gallery-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 20px;
    }

    .beers-grid,
    .drinks-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .footer-grid {
        gap: 100px;
    }

    .stat-number {
        font-size: 56px;
    }

    .section-description {
        font-size: 17px;
        max-width: 800px;
    }
}

/* ========================================
   ULTRA HD / 4K (> 1920px)
   ======================================== */

@media (min-width: 1921px) {
    .container {
        max-width: 1800px;
        padding: 0 80px;
    }

    html {
        font-size: 18px;
    }

    .hero-title {
        font-size: clamp(6rem, 7vw, 9rem) !important;
    }

    .hero-subtitle {
        font-size: 20px;
    }

    .nav-link {
        font-size: 15px !important;
        letter-spacing: 2px !important;
    }

    .nav-menu {
        gap: 65px !important;
    }

    .logo img {
        height: 120px !important;
    }

    .navbar.scrolled .logo img {
        height: 80px !important;
    }

    .gallery-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 25px;
    }

    .beers-grid,
    .drinks-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .section-title {
        font-size: clamp(3rem, 3.5vw, 5rem);
    }

    .stat-number {
        font-size: 72px;
    }

    .showcase-item-image {
        height: 800px;
    }

    .banner-image {
        height: 700px;
    }
}

/* ========================================
   TRÈS PETIT MOBILE (< 380px)
   ======================================== */

@media (max-width: 380px) {
    .hero-title {
        font-size: 1.8rem !important;
    }

    .beers-grid,
    .drinks-grid {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .logo img {
        height: 42px !important;
        width: 42px !important;
    }

    .nav-reserve {
        padding: 6px 10px !important;
        font-size: 10px !important;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 1.6rem;
    }
}
