/* ==========================================================================
   RESPONSIVE — Mobile / Tablette / Desktop
   Restaurant Relais "Au Bon Accueil" — 100% Responsive
   ========================================================================== */

/* ===== TABLETTE (max-width: 900px) ===== */
@media (max-width: 900px) {
    /* Navigation : passage en hamburger */
    .main-nav {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        background: var(--color-bordeaux-dark);
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 80px 24px 24px;
        gap: 8px;
        box-shadow: -4px 0 20px rgba(0,0,0,0.3);
        z-index: 200;
        transform: translateX(100%);
        transition: transform var(--transition-smooth);
        overflow-y: auto;
    }

    .main-nav.open {
        display: flex;
        transform: translateX(0);
    }

    .main-nav .nav-link,
    .main-nav .nav-cta {
        width: 100%;
        padding: 14px 0;
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    .main-nav .nav-cta {
        margin-top: 12px;
        border-bottom: none;
    }

    /* Bouton hamburger */
    .nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 32px;
        height: 24px;
        background: none;
        border: none;
        cursor: pointer;
        z-index: 210;
    }

    .nav-toggle span {
        display: block;
        height: 3px;
        width: 100%;
        background: var(--color-creme-bg);
        border-radius: 2px;
        transition: all var(--transition-fast);
    }

    .nav-toggle.open span:nth-child(1) {
        transform: translateY(10px) rotate(45deg);
    }
    .nav-toggle.open span:nth-child(2) {
        opacity: 0;
    }
    .nav-toggle.open span:nth-child(3) {
        transform: translateY(-10px) rotate(-45deg);
    }

    /* Overlay sombre quand le menu est ouvert */
    .nav-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 190;
    }
    .nav-overlay.active {
        display: block;
    }

    /* Hero */
    .hero-section {
        padding: 110px 0 70px;
    }
    .hero-title {
        font-size: 2.4rem;
    }
    .hero-lead {
        font-size: 1.1rem;
    }

    /* Sections */
    .section {
        padding: 60px 0;
    }
    .section-title {
        font-size: 2rem;
    }

    /* Grilles 2 colonnes → 1 colonne */
    .grid-2-col {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* Menu ardoise 3D : adaptation tablette */
    .menu-ardoise {
        width: 92vw;
        max-height: 88vh;
        border-width: 6px;
    }
    .ardoise-title {
        font-size: 1.7rem;
    }
    .ardoise-page-title {
        font-size: 1.8rem;
    }
    .ardoise-item-name {
        font-size: 1.2rem;
    }
    .ardoise-item-price {
        font-size: 1.3rem;
    }
    .ardoise-page {
        padding: 18px 22px;
    }

    /* Formulaire réservation : 1 colonne */
    .form-grid {
        grid-template-columns: 1fr;
    }
    .form-row {
        flex-direction: column;
        gap: 16px;
    }
    /* Ligne 4 champs (Couverts, Date, Heure, PMR) : 2x2 sur mobile portrait */
    .form-row-4 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .form-row-4 .form-group {
        flex: none !important;
    }
    .form-row-2 .form-group {
        flex: 1 1 auto !important;
    }
    .reservation-box {
        padding: 36px 28px;
    }

    /* Footer : 2 colonnes sur tablette */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }

    /* Carte Maps footer : pleine largeur sur tablette */
    .footer-col-maps {
        grid-column: 1 / -1;
    }

    /* Carte Maps dans histoire-card : hauteur réduite sur tablette */
    .card-maps-embed {
        height: 360px;
    }

    /* Admin layout : sidebar devient top bar */
    .admin-wrapper {
        flex-direction: column;
    }
    .admin-sidebar {
        width: 100%;
        position: relative;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 12px;
    }
    .admin-sidebar .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }
    .admin-sidebar .nav-item {
        font-size: 0.85rem;
        padding: 6px 10px;
    }
    .admin-main {
        width: 100%;
        padding: 16px;
    }
}

/* ===== MOBILE (max-width: 600px) ===== */
@media (max-width: 600px) {
    .container {
        padding: 0 16px;
    }

    /* Hero */
    .hero-section {
        padding: 100px 0 50px;
        text-align: center;
    }
    .hero-content {
        max-width: 100%;
    }
    .hero-title {
        font-size: 1.9rem;
        line-height: 1.2;
    }
    .hero-lead {
        font-size: 1rem;
    }
    .hero-actions {
        flex-direction: column;
        gap: 12px;
    }
    .hero-actions .btn {
        width: 100%;
    }
    .hero-badge {
        font-size: 0.8rem;
    }
    .hero-logo-img {
        max-width: 130px;
        max-height: 130px;
    }

    /* Sections */
    .section {
        padding: 45px 0;
    }
    .section-title {
        font-size: 1.6rem;
        line-height: 1.25;
    }
    .section-subtitle {
        font-size: 0.85rem;
    }

    /* Badge "Aujourd'hui" : étiré vers la gauche pour couvrir la date, laisse l'icône calendrier */
    .date-today-badge {
        right: 36px;
        left: 8px;
        text-align: center;
        padding: 4px 10px;
    }

    /* Carte histoire */
    .histoire-card {
        padding: 20px;
    }
    .card-badge {
        right: 15px;
        font-size: 0.8rem;
    }

    /* Features */
    .feature-item {
        gap: 12px;
    }
    .feature-icon {
        font-size: 1.6rem;
        padding: 8px;
    }

    /* Galerie : 2 colonnes en portrait */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* Modal menu ardoise 3D : plein écran sur mobile */
    .menu-ardoise {
        width: 95vw;
        max-height: 92vh;
        border-radius: 10px;
        border-width: 5px;
    }
    .ardoise-header {
        padding: 12px 18px;
    }
    .ardoise-title {
        font-size: 1.4rem;
    }
    .ardoise-tabs {
        padding: 8px 10px 0;
        gap: 2px;
    }
    .ardoise-tab {
        padding: 8px 12px;
        font-size: 1rem;
        flex: 0 0 auto;
    }
    .ardoise-page {
        padding: 14px 16px;
    }
    .ardoise-page-title {
        font-size: 1.5rem;
        margin-bottom: 16px;
    }
    .ardoise-item-name {
        font-size: 1.05rem;
    }
    .ardoise-item-compact .ardoise-item-name {
        font-size: 0.95rem;
    }
    .ardoise-item-price {
        font-size: 1.2rem;
    }
    .ardoise-item-compact .ardoise-item-price {
        font-size: 1rem;
    }
    .ardoise-item-note {
        font-size: 0.8rem;
    }
    .ardoise-item-highlight .ardoise-item-name {
        font-size: 1.2rem;
    }
    .ardoise-nav {
        padding: 10px 16px;
    }
    .ardoise-nav-btn {
        padding: 6px 14px;
        font-size: 1rem;
    }

    /* Réservation */
    .reservation-box {
        padding: 28px 20px;
    }
    .reservation-closed { text-align: center; }
    .reservation-closed-icon { font-size: 2.5rem; }
    .reservation-closed-title { font-size: 1.15rem; }
    .reservation-closed-text { font-size: 0.85rem; text-align: center; }
    .reservation-closed-phones { flex-direction: column; align-items: stretch; gap: 10px; }
    .reservation-closed-phone {
        justify-content: center;
        padding: 12px 20px;
        font-size: 1rem;
    }
    .room-choices {
        grid-template-columns: 1fr;
    }
    .pmr-toggle-wrapper {
        flex-wrap: wrap;
        gap: 10px;
    }
    .reservation-form .btn-xl {
        width: 100%;
        justify-content: center;
    }

    /* Footer : 1 colonne sur mobile */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    /* Carte Maps dans histoire-card : hauteur réduite sur mobile */
    .card-maps-embed {
        height: 320px;
    }

    .footer-maps-embed {
        height: 320px;
    }

    .site-footer {
        padding: 40px 0 0;
    }
    .footer-bottom {
        font-size: 0.8rem;
        padding: 16px 0;
    }

    /* Admin tables : scroll horizontal */
    .admin-table {
        font-size: 0.85rem;
    }
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Admin : sidebar en mode vertical compact */
    .admin-sidebar .sidebar-nav {
        flex-direction: column;
        gap: 4px;
    }
    .admin-sidebar .nav-item {
        width: 100%;
    }

    /* Éditeur about : feature grid en colonne */
    .feature-edit-grid {
        grid-template-columns: 1fr !important;
        gap: 8px;
    }
}

/* ===== TRÈS PETIT MOBILE (max-width: 380px) ===== */
@media (max-width: 380px) {
    .hero-title {
        font-size: 1.6rem;
    }
    .section-title {
        font-size: 1.4rem;
    }
    .brand-title {
        font-size: 1.1rem;
    }
    .brand-subtitle {
        font-size: 0.7rem;
    }
    .btn-lg {
        padding: 12px 20px;
        font-size: 1rem;
    }
}

/* ===== POP-IN PUBLICITAIRE — SMARTPHONE ===== */
@media (max-width: 768px) {
    .ad-modal-content {
        height: 100dvh;
        max-height: 100dvh;
    }

    .ad-image-container {
        padding: 0;
    }

    .ad-image {
        object-fit: contain;
    }

    /* Barre de partage compacte sur mobile */
    .ad-social-bar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 12px;
        justify-content: center;
    }

    .ad-social-bar > span {
        width: 100%;
        text-align: center;
        font-size: 0.8rem;
        margin-bottom: 4px;
    }

    .social-btn {
        padding: 8px 12px;
        font-size: 0.78rem;
        flex: 1;
        justify-content: center;
        min-width: 0;
    }
}

/* ===== NOS SERVICES — Responsive ===== */
@media (max-width: 600px) {
    .services-grid {
        gap: 12px;
    }
    .service-icon {
        width: 46px;
        height: 46px;
        font-size: 1.1rem;
    }
    .service-label {
        font-size: 0.75rem;
    }

    /* Bouton close plus gros et tactile */
    .ad-modal-content .modal-close {
        width: 48px;
        height: 48px;
        font-size: 1.6rem;
        top: 12px;
        right: 12px;
    }
}

@media (max-width: 380px) {
    .social-btn {
        font-size: 0.72rem;
        padding: 7px 8px;
    }
    .social-btn i {
        font-size: 0.9rem;
    }
}

/* ===== PRINT (impression) ===== */
@media print {
    .site-header, .site-footer, .hero-actions, .nav-toggle, .ad-modal-content,
    .menu-modal, .gallery-modal, #form-reservation {
        display: none !important;
    }
    .hero-section {
        padding: 20px 0;
        background: none;
        color: #000;
    }
    .hero-title, .hero-lead {
        color: #000;
    }
    .section {
        padding: 20px 0;
    }
}
