/* ==========================================================================
   assets/css/mobile-pro.css — Expérience Mobile Créative & Haut de Gamme
   Sahara Bouarif Voyages · Mobile App-Like UX (< 1024px)

   Apporte sur mobile et tablette :
   1. Dock flottant en verre fumé (App Navigation Dock) avec bouton central
      « Sur devis / Réserver » et détection automatique de la page active.
   2. Tiroir mobile plein écran redessiné ambiance nuit du Sahara (topographie,
      numérotation éditoriale, mini-cartes expériences 2 colonnes, accès direct Douz).
   3. Carrousels horizontaux à défilement magnétique (scroll-snap) pour les
      cartes d'accueil (Expériences phares & Pourquoi nous choisir).
   4. Finitions tactiles, typographie fluide, grilles compactes et footer mobile aéré.
   ========================================================================== */

/* ── Masquer les composants purement mobiles sur desktop (>= 1024px) ── */
.sbv-mobile-dock,
.sbv-mobile-swipe-hint {
  display: none;
}

@media (max-width: 1023px) {
  html {
    -webkit-tap-highlight-color: transparent;
  }

  body {
    overflow-x: clip;
  }

  /* Espace de respiration en bas du footer pour le Dock flottant */
  .site-footer {
    padding-bottom: calc(5.4rem + env(safe-area-inset-bottom, 0px));
  }

  /* Masquer les bulles flottantes redondantes (WhatsApp + Appel intégrés au Dock & Tiroir) */
  .floating-btns {
    display: none !important;
  }

  /* Remonter légèrement le bandeau cookies au-dessus du Dock mobile */
  .cookie-banner {
    bottom: calc(5.2rem + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* =========================================================
     1. HEADER MOBILE COMPACT & RAFFINÉ
     ========================================================= */
  .site-header {
    height: 70px !important;
  }

  .site-header.scrolled {
    height: 66px !important;
    box-shadow: 0 8px 28px rgba(36, 22, 10, 0.14);
  }

  body:not(.home):not(.sbv-front-en):not(.page-template-tpl-agence):not(.page-template-tpl-vie-des-nomades):not(.page-template-tpl-contact):not(.page-template-tpl-booking) {
    padding-top: 70px;
  }

  .site-header__inner {
    gap: 0.6rem;
    padding-inline: 1rem;
  }

  .site-header__logo-img {
    height: 50px !important;
    max-height: 52px !important;
    max-width: 175px !important;
  }

  .site-header.scrolled .site-header__logo-img {
    height: 46px !important;
  }

  .site-header__logo-text svg {
    height: 44px !important;
  }

  .site-header__actions {
    gap: 0.5rem;
  }

  .lang-dropdown__trigger {
    min-height: 38px;
    padding: 0.28rem 0.56rem;
    border-radius: 999px;
    font-size: 0.78rem;
    gap: 0.35rem;
  }

  /* Masquer le bouton burger du header sur mobile (le bouton Menu est dans le Dock en bas) */
  .burger-btn {
    display: none !important;
  }

  /* Exception Fiche Produit (?circuit=...) où le Dock est masqué au profit de la barre sticky produit */
  body.sbv-circuit-fp .sbv-mobile-dock {
    display: none !important;
  }

  body.sbv-circuit-fp .burger-btn {
    display: flex !important;
    width: 42px;
    height: 42px;
    padding: 11px 9px;
    border-radius: 12px;
    border: 1px solid rgba(59, 42, 23, 0.16);
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.18s ease;
  }

  body.sbv-circuit-fp .burger-btn:active {
    transform: scale(0.94);
  }

  .burger-btn__bar {
    height: 2px;
    border-radius: 2px;
  }

  .burger-btn__bar:nth-child(2) {
    width: 72%;
    margin-left: auto;
  }

  /* =========================================================
     2. DOCK FLOTTANT MOBILE EN VERRE FUMÉ (APP BAR)
     ========================================================= */
  .sbv-mobile-dock {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 980;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    padding: 0.38rem 0.35rem;
    border-radius: 24px;
    background: rgba(24, 16, 9, 0.90);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid rgba(231, 178, 107, 0.28);
    box-shadow:
      0 14px 36px rgba(14, 9, 4, 0.42),
      0 2px 8px rgba(0, 0, 0, 0.25),
      inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease;
  }

  .sbv-mobile-dock.is-hidden {
    transform: translateY(130%);
    opacity: 0;
    pointer-events: none;
  }

  .sbv-dock-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-height: 50px;
    padding: 0.28rem 0.15rem;
    border: 0;
    background: transparent;
    color: rgba(246, 239, 226, 0.78);
    text-decoration: none;
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    border-radius: 16px;
    cursor: pointer;
    transition: color 0.18s ease, transform 0.16s ease, background-color 0.18s ease;
  }

  .sbv-dock-item:active {
    transform: scale(0.92);
  }

  .sbv-dock-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }

  .sbv-dock-item span {
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .sbv-dock-item.is-active {
    color: #F4C37A;
  }

  .sbv-dock-item.is-active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    width: 16px;
    height: 2.5px;
    border-radius: 999px;
    background: #C9822B;
  }

  /* Bouton central signature : Devis / Réserver surélevé */
  .sbv-dock-item--cta {
    margin-top: -18px;
    min-height: 56px;
    padding: 0.45rem 0.35rem;
    border-radius: 18px;
    background: linear-gradient(145deg, #D99238 0%, #B86E1B 100%);
    color: #FFFFFF;
    font-weight: 700;
    box-shadow:
      0 10px 24px rgba(201, 130, 43, 0.48),
      0 0 0 3px rgba(24, 16, 9, 0.92);
  }

  .sbv-dock-item--cta:hover,
  .sbv-dock-item--cta:focus-visible,
  .sbv-dock-item--cta.is-active {
    color: #FFFFFF;
  }

  .sbv-dock-item--cta.is-active::after {
    display: none;
  }

  /* WhatsApp subtil vert émeraude */
  .sbv-dock-item--wa {
    color: #7CE8A4;
  }

  .sbv-dock-item--wa:active {
    background: rgba(37, 211, 102, 0.14);
  }

  /* =========================================================
     3. TIROIR MOBILE LUXE AMBIANCE NUIT DU SAHARA
     ========================================================= */
  .mobile-menu {
    background:
      radial-gradient(circle at 88% 8%, rgba(201, 130, 43, 0.22) 0%, transparent 46%),
      radial-gradient(circle at 10% 92%, rgba(31, 111, 107, 0.16) 0%, transparent 48%),
      linear-gradient(175deg, #1A120A 0%, #261A10 55%, #160F08 100%);
    color: #F6EFE2;
    z-index: 1200;
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .mobile-menu::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(rgba(246, 239, 226, 0.06) 1px, transparent 1px);
    background-size: 26px 26px;
    opacity: 0.45;
  }

  .mobile-menu__header {
    position: relative;
    z-index: 2;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(246, 239, 226, 0.12);
    gap: 0.75rem;
  }

  .mobile-menu__top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.75rem;
  }

  .mobile-menu__brand {
    display: flex;
    flex-direction: column;
    text-decoration: none;
  }

  .mobile-menu__brand strong {
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #FFFFFF;
  }

  .mobile-menu__brand span {
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #E7B26B;
  }

  .mobile-menu__close {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(246, 239, 226, 0.1);
    border: 1px solid rgba(246, 239, 226, 0.2);
    color: #F6EFE2;
  }

  .mobile-menu__close:hover,
  .mobile-menu__close:focus-visible {
    background: rgba(201, 130, 43, 0.28);
    border-color: #C9822B;
    color: #FFFFFF;
  }

  .mobile-menu__lang-bar {
    position: relative;
    z-index: 2;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid rgba(246, 239, 226, 0.1);
  }

  .mobile-menu .lang-mobile-flag-btn {
    background: rgba(246, 239, 226, 0.08);
    border-color: rgba(246, 239, 226, 0.18);
    color: #F6EFE2;
    border-radius: 999px;
    padding: 0.36rem 0.62rem;
  }

  .mobile-menu .lang-mobile-flag-btn.is-active {
    background: #C9822B;
    border-color: #C9822B;
    color: #FFFFFF;
  }

  .mobile-menu__nav {
    position: relative;
    z-index: 2;
    padding: 1rem 1.25rem 1.5rem;
  }

  .mobile-menu__item {
    border-bottom: 1px solid rgba(246, 239, 226, 0.1);
    opacity: 0;
    transform: translateX(18px);
    transition: opacity 0.32s ease, transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .mobile-menu.is-open .mobile-menu__item {
    opacity: 1;
    transform: translateX(0);
  }

  .mobile-menu.is-open .mobile-menu__item:nth-child(1) { transition-delay: 40ms; }
  .mobile-menu.is-open .mobile-menu__item:nth-child(2) { transition-delay: 80ms; }
  .mobile-menu.is-open .mobile-menu__item:nth-child(3) { transition-delay: 120ms; }
  .mobile-menu.is-open .mobile-menu__item:nth-child(4) { transition-delay: 160ms; }
  .mobile-menu.is-open .mobile-menu__item:nth-child(5) { transition-delay: 200ms; }
  .mobile-menu.is-open .mobile-menu__item:nth-child(6) { transition-delay: 240ms; }

  .mobile-menu__link {
    padding: 1rem 0;
    color: #F6EFE2;
    font-family: 'Cormorant Garamond', 'Montserrat', serif;
    font-size: 1.55rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    gap: 0.75rem;
  }

  .mobile-menu__link-num {
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #E7B26B;
    min-width: 24px;
  }

  .mobile-menu__link-label {
    flex: 1;
    text-align: left;
  }

  .mobile-menu__link:hover,
  .mobile-menu__link:focus-visible {
    color: #F1C583;
  }

  /* Grille 2 colonnes tactile pour les 9 expériences dans l'accordéon mobile */
  .mobile-menu__accordion-content:not([hidden]) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    padding: 0.2rem 0 1.1rem;
  }

  .mobile-menu__sublink {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.68rem 0.78rem;
    border-radius: 12px;
    background: rgba(246, 239, 226, 0.08);
    border: 1px solid rgba(246, 239, 226, 0.12);
    color: #F6EFE2;
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.25;
  }

  .mobile-menu__sublink::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #C9822B;
    flex-shrink: 0;
  }

  .mobile-menu__sublink:hover,
  .mobile-menu__sublink:focus-visible {
    background: rgba(201, 130, 43, 0.22);
    border-color: rgba(201, 130, 43, 0.55);
    color: #FFFFFF;
  }

  /* Pied du tiroir : actions rapides Douz + CTA principal */
  .mobile-menu__footer {
    position: relative;
    z-index: 2;
    padding: 1.15rem 1.25rem calc(1.4rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(246, 239, 226, 0.12);
    background: rgba(12, 8, 4, 0.45);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .mobile-menu__quick-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }

  .mobile-menu__quick-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 44px;
    padding: 0.55rem 0.75rem;
    border-radius: 12px;
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid rgba(246, 239, 226, 0.22);
    background: rgba(246, 239, 226, 0.08);
    color: #F6EFE2;
  }

  .mobile-menu__quick-btn--wa {
    background: rgba(37, 211, 102, 0.18);
    border-color: rgba(37, 211, 102, 0.45);
    color: #9BF5BC;
  }

  .mobile-menu__cta {
    min-height: 50px;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 10px 26px rgba(201, 130, 43, 0.36);
  }

  .mobile-menu__coords {
    text-align: center;
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: rgba(246, 239, 226, 0.48);
    margin: 0;
  }
}

/* =========================================================
   4. FINITIONS CRÉATIVES DES SECTIONS SUR MOBILE (<= 680px)
   ========================================================= */
@media (max-width: 680px) {
  /* Hero Accueil : cadrage immersif et boutons équilibrés */
  .hero {
    min-height: 92svh !important;
  }

  .hero__content {
    padding-top: 5.5rem;
    padding-bottom: 2.5rem;
  }

  .hero__title {
    font-size: clamp(2.15rem, 8.8vw, 2.85rem) !important;
    line-height: 1.08 !important;
  }

  .hero__subtitle {
    font-size: 0.98rem !important;
    line-height: 1.65 !important;
  }

  .hero__cta-group {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }

  .hero__cta-group .btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  .hero__reassurance {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem 0.75rem;
    font-size: 0.78rem;
  }

  .hero__reassurance-sep {
    display: none;
  }

  /* Chiffres clés : grille 2x2 élégante en cartes */
  .key-figures__list {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.85rem !important;
  }

  .key-figures__item {
    padding: 1.1rem 0.75rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(201, 130, 43, 0.16);
    box-shadow: 0 6px 18px rgba(59, 42, 23, 0.05);
  }

  /* CARROUSEL HORIZONTAL CRÉATIF : Expériences phares (scroll-snap) */
  .experiences-grid--immersive {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 1rem;
    gap: 1rem !important;
    margin-inline: -1rem;
    padding: 0.25rem 1rem 1.25rem !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .experiences-grid--immersive::-webkit-scrollbar {
    display: none;
  }

  .experiences-grid--immersive .exp-card-immersive {
    flex: 0 0 82vw;
    max-width: 340px;
    min-height: 390px !important;
    scroll-snap-align: center;
  }

  /* CARROUSEL HORIZONTAL CRÉATIF : Pourquoi voyager avec nous */
  .why-us__grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory;
    gap: 1rem !important;
    margin-inline: -1rem;
    padding: 0.5rem 1rem 1.25rem !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .why-us__grid::-webkit-scrollbar {
    display: none;
  }

  .why-us__grid .why-us__card {
    flex: 0 0 84vw;
    max-width: 340px;
    scroll-snap-align: center;
  }

  /* Indicateur visuel discret « Glisser → » au-dessus des carrousels mobiles */
  .featured-experiences .section-header::after,
  .why-us .section-header::after {
    content: '←  •  •  •  →';
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.25rem 0.85rem;
    border-radius: 999px;
    background: rgba(201, 130, 43, 0.12);
    color: #A86820;
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.22em;
  }

  /* Footer mobile compact : expériences en 2 colonnes pour diviser la hauteur */
  .footer-col--nav .footer-col__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem 0.9rem;
  }

  .footer-grid {
    gap: 2rem;
  }

  .footer-col--brand {
    text-align: center;
    align-items: center;
    display: flex;
    flex-direction: column;
  }

  .footer-social {
    justify-content: flex-start;
  }
}

@media print {
  .sbv-mobile-dock {
    display: none !important;
  }
}
