/*
 * BarberFreedom v0.5.0 — Responsive
 * Source unique de vérité pour tous les breakpoints globaux.
 * Dépend de base.css (tokens : --spacing-*, --ease-*, --bf-*)
 */

/* ── Desktop compact — 1280px ────────────────────────────────── */

@media (max-width: 1280px) {
  .bf-nav__inner  { width: min(1200px, calc(100% - 36px)); }
  .bf-nav__links  { gap: clamp(var(--spacing-4), 2.2vw, var(--spacing-6)); }
  .bf-title       { font-size: clamp(48px, 6vw, 80px); } /* bornes px (leçon HM) */
  .bf-salon__title { font-size: clamp(61px, 8vw, 125px); }
}

/* ── Desktop intermédiaire — 1180px ──────────────────────────── */

@media (max-width: 1180px) {
  .bf-salon__title { font-size: clamp(54px, 8vw, 112px); } /* bornes px (leçon HM) */
  .bf-salon .bf-btn { width: min(100%, 300px); }
}

/* ── Tablette paysage — 1100px ───────────────────────────────── */

@media (max-width: 1100px) {
  .bf-booking__locations,
  .bf-footer__grid,
  .bf-team-grid,
  .bf-maps__grid,
  .bf-testimonials__grid,
  .bf-about__pillars {
    grid-template-columns: 1fr;
  }

  .bf-services__grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-5);
  }

  .bf-gallery__grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-areas:
      "a a"
      "b c"
      "d d"
      "e e"
      "f g"
      "h i";
  }

  .bf-salon-card,
  .bf-location-card,
  .bf-testimonial,
  .bf-map-card {
    max-width: 760px;
    width: 100%;
    margin-inline: auto;
  }

  .bf-footer__cygnes,
  .bf-footer { text-align: center; }

  .bf-footer a { width: fit-content; margin-inline: auto; }
}

/* ── Tablette portrait — 980px ───────────────────────────────── */

@media (max-width: 980px) {
  .bf-hero,
  .bf-hero:has(.bf-salon--alpes:hover),
  .bf-hero:has(.bf-salon--alpes:focus-within),
  .bf-hero:has(.bf-salon--cygnes:hover),
  .bf-hero:has(.bf-salon--cygnes:focus-within) {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .bf-salon {
    min-height: 58vh;
    padding: 120px var(--spacing-5) 78px;
  }

  .bf-salon--cygnes {
    border-left: 0;
    border-top: 1px solid var(--bf-border);
  }

  .bf-hero__logo { width: min(280px, 50vw); top: 50%; opacity: .2; }

  /* 1.5.0 — hero v2 sur panneaux empilés : texte Alpes en haut, Cygnes en bas,
     le milieu reste libre pour la ville et les épingles ; voiles limités aux
     bandes de texte. Bouton Pause en haut à droite : sous le menu,
     hors de la barre d'onglets. */
  .bf-hero--has-video .bf-salon--alpes  { place-items: start center; }
  .bf-hero--has-video .bf-salon--cygnes { place-items: end center; }
  /* Paliers calculés pour WCAG AA sur toute la boucle en 390x844 (surtitres ≥ 6,3:1, titres ≥ 12:1). */
  .bf-hero--has-video .bf-salon--alpes::before  { background: linear-gradient(to bottom, rgba(0,0,0,.86) 0, rgba(0,0,0,.8) 55%, rgba(0,0,0,.5) 70%, transparent 90%); }
  .bf-hero--has-video .bf-salon--cygnes::before { background: linear-gradient(to top, rgba(0,0,0,.86) 0, rgba(0,0,0,.8) 55%, rgba(0,0,0,.5) 70%, transparent 90%); }
  .bf-hero__toggle { top: 80px; right: var(--spacing-3); bottom: auto; left: auto; }

  .bf-nav         { height: 72px; }
  .bf-nav__inner  { width: calc(100% - 28px); }
  .bf-nav__links  { gap: var(--spacing-4); }
  .bf-nav__links a:not(.bf-btn) { font-size: 11px; letter-spacing: .1em; }

  .bf-team-grid { grid-template-columns: 1fr 1fr; }

  .bf-testimonials__grid { grid-template-columns: 1fr 1fr; }

  .bf-salon-card__title { max-width: 100%; }

  /* Team — grille compacte (déplacé de team.css) */
  .bf-team-compact__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--spacing-6) var(--spacing-5);
  }
}

/* ── Tablette portrait étroite — 820px ──────────────────────── */

@media (max-width: 820px) {
  .bf-about__pillars,
  .bf-maps__grid,
  .bf-local__info-grid,
  .bf-testimonials__grid { grid-template-columns: 1fr; }

  .bf-faq__item > summary { padding: var(--spacing-5) var(--spacing-1); }
}

/* ── Smartphone large — 768px ────────────────────────────────── */

@media (max-width: 768px) {
  .bf-section { padding: 72px 0; }

  .bf-container { width: min(100%, calc(100% - 28px)); }

  .bf-title { font-size: clamp(43px, 12vw, 74px); line-height: .95; } /* bornes px (leçon HM) */
  .bf-text  { font-size: 15.5px; line-height: 1.75; }

  .bf-nav        { height: 70px; }
  .bf-nav__logo  { font-size: 22px; }
  .bf-nav__links { display: none; }
  .bf-nav__mobile-bar { display: flex; }

  .bf-salon {
    min-height: 52vh;
    min-height: 52svh; /* 1.8.0 : Safari iOS, barre d'adresse visible (vh = écran sans elle) */
    padding: 104px var(--spacing-4) 64px;
  }

  /* 1.8.0 — Barre d'onglets fixe en bas (64 px, rond « Réserver » qui dépasse
     de 13 px, encoche de l'iPhone) : le bloc Cygnes remonte au-dessus. Son
     dégradé monte d'autant, donc le contraste calculé reste le même. Pas de
     grande marge haute (utile sous le menu, donc à Alpes seulement) : le hero
     tient dans l'écran, même sur l'iPhone SE (667 px de haut). */
  .bf-hero--has-video .bf-salon--cygnes {
    --bf-cygnes-lift: calc(54px + env(safe-area-inset-bottom, 0px));
    padding-top: var(--spacing-5);
    padding-bottom: calc(58px + var(--bf-cygnes-lift));
  }
  .bf-hero--has-video .bf-salon--cygnes::before { background: linear-gradient(to top, rgba(0,0,0,.86) 0, rgba(0,0,0,.86) var(--bf-cygnes-lift), rgba(0,0,0,.8) calc(55% + var(--bf-cygnes-lift)), rgba(0,0,0,.5) calc(70% + var(--bf-cygnes-lift)), transparent calc(90% + var(--bf-cygnes-lift))); }

  .bf-salon__content { width: 100%; gap: var(--spacing-4); }
  .bf-salon__title   { font-size: clamp(53px, 15vw, 93px); line-height: .88; } /* bornes px (leçon HM) */
  .bf-salon__label   { font-size: 14px; letter-spacing: .18em; }
  .bf-salon .bf-btn  { width: min(100%, 320px); }

  .bf-hero__logo { width: min(240px, 56vw); opacity: .18; }

  .bf-team-grid { grid-template-columns: 1fr; gap: var(--spacing-5); }

  .bf-team-card {
    max-width: 520px;
    width: 100%;
    margin-inline: auto;
  }

  .bf-gallery__grid {
    grid-template-columns: 1fr;
    grid-auto-rows: clamp(220px, 64vw, 360px);
    grid-template-areas: "a" "b" "c" "d" "e" "f" "g" "h" "i";
  }

  /* Tactile : pas de survol → légendes affichées d'emblée */
  .bf-gallery__cap { opacity: 1; transform: none; }

  /* Tab bar mobile native (remplace l'ancienne sticky CTA) */
  .bf-tabbar { display: block; }

  body.bf-fullwidth { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }

  /* Section vidéo — carte un peu plus généreuse sur mobile (Sprint 4 T2) */
  .bf-video__card { max-width: min(440px, 92vw); margin-top: var(--spacing-6); }

  .bf-salon-card          { padding: var(--spacing-5) var(--spacing-4); }
  .bf-salon-card__title   { font-size: 2.25rem; max-width: 100%; }
  .bf-salon-card__actions { gap: var(--spacing-3); }

  /* Home — intro (déplacé de home.css) */
  .bf-intro__word { letter-spacing: .06em; }

  /* Team (déplacé de team.css) */
  .bf-team-intro { padding-top: 110px; }
  .bf-team-card__body { padding: var(--spacing-5) var(--spacing-4) var(--spacing-6); }
  .bf-team-card__bio { max-width: 32ch; font-size: 14.5px; }

  /* Salons / pages locales (déplacé de local.css) */
  .bf-local__hero { min-height: 70vh; padding-inline: var(--spacing-4); }
  .bf-local__cta { flex-direction: column; align-items: center; width: 100%; }
  .bf-local__cta .bf-btn { width: min(100%, 320px); }
}

/* ── Smartphone compact — 560px ─────────────────────────────── */

@media (max-width: 560px) {
  .bf-nav        { height: 68px; }
  .bf-nav__inner { width: calc(100% - 20px); }
  .bf-nav__logo  { font-size: 20px; }

  .bf-salon {
    min-height: 50vh;
    min-height: 50svh; /* 1.8.0 : idem, le hero tient au-dessus de la barre d'onglets */
    padding: 96px var(--spacing-3) 58px;
  }

  .bf-salon__title { font-size: clamp(48px, 16vw, 80px); } /* bornes px (leçon HM) */
  .bf-salon__label { font-size: 12.5px; letter-spacing: .16em; }
  .bf-salon .bf-btn { width: 100%; max-width: 300px; }

  .bf-salon-card          { padding: var(--spacing-5) var(--spacing-4); }
  .bf-salon-card__title   { max-width: 100%; font-size: 2.25rem; }
  .bf-salon-card__actions { gap: var(--spacing-3); }

  .bf-footer         { padding: 82px 0 var(--spacing-6); }
  .bf-footer__grid   { gap: var(--spacing-7); }
  .bf-footer__bottom { margin-top: 58px; }
}

/* ── Team — grille 2 colonnes resserrée — 540px (déplacé de team.css) ── */

@media (max-width: 540px) {
  .bf-team-compact__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--spacing-5) var(--spacing-4);
  }

  .bf-team-compact__img-wrap {
    width: 90px;
    height: 90px;
  }
}

/* ── Très petits écrans — 420px ──────────────────────────────── */

@media (max-width: 420px) {
  .bf-container { width: min(100%, calc(100% - 22px)); }

  .bf-nav__logo  { font-size: 19px; }
  .bf-nav__links { gap: var(--spacing-2); }

  .bf-salon { min-height: 50vh; min-height: 50svh; padding-inline: var(--spacing-3); } /* 1.8.0 : svh, cf. 768 px */
  .bf-salon__title { font-size: clamp(48px, 17vw, 78px); } /* bornes px (leçon HM) */
  .bf-salon__label { font-size: 12.5px; letter-spacing: .16em; }
  .bf-salon .bf-btn { max-width: 300px; min-height: 50px; padding-inline: var(--spacing-5); font-size: 10px; }

  .bf-price { gap: var(--spacing-4); }
  .bf-price span:last-child { font-size: 1.05rem; }
}

/* ── Tactile : premium sans hover ────────────────────────────── */

@media (hover: none) and (pointer: coarse) {
  .bf-salon::before {
    background:
      radial-gradient(circle at center, rgba(206,164,111,.24), transparent 48%),
      linear-gradient(to top, rgba(0,0,0,.96), rgba(0,0,0,.36));
  }

  .bf-salon         { transform: none; }
  .bf-salon__title  { color: rgba(255,255,255,.92); }

  .bf-salon:active,
  .bf-salon:focus-within { transform: scale(1.01); }

  .bf-salon-card { border-color: var(--bf-border-gold); }

  .bf-salon-card:active,
  .bf-salon-card:focus-within {
    border-color: var(--bf-gold);
    transform: translateY(-2px);
  }

  .bf-team-card { border-color: rgba(206,164,111,.24); }

  .bf-team-card:active,
  .bf-team-card:focus-within {
    border-color: var(--bf-gold);
    transform: translateY(-3px);
  }
}

/* ── Réduction des animations ────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .bf-salon,
  .bf-salon::after,
  .bf-salon__title,
  .bf-salon-card,
  .bf-map-card,
  .bf-team-card,
  .bf-team-card__img-wrap img,
  .bf-gallery__item,
  .bf-gallery__item img,
  .bf-gallery__cap,
  .bf-about__rule,
  .bf-about__pillar,
  .bf-testimonial,
  .bf-faq__item,
  .bf-faq__item > summary,
  .bf-faq__toggle,
  .bf-faq__answer,
  .bf-price,
  .bf-btn,
  .bf-hero__pins,
  .bf-pin,
  .bf-pin__badge,
  .bf-hero__toggle {
    animation: none !important;
    transition: none !important;
  }

  .bf-salon:hover,
  .bf-salon:focus-within,
  .bf-salon-card:hover,
  .bf-salon-card:focus-within,
  .bf-team-card:hover,
  .bf-team-card:focus-within,
  .bf-about__pillar:hover,
  .bf-testimonial:hover {
    transform: none !important;
  }
}

/* =====================================================
   Concierge — sheet de réservation (Sprint 2 v0.6.0)
   ===================================================== */
@media (min-width: 821px) {
  .bf-concierge__sheet {
    padding-top: calc(var(--spacing-8) + env(safe-area-inset-top));
  }
}

@media (hover: none) and (pointer: coarse) {
  .bf-concierge__salon:hover {
    transform: none;
  }
}

/* ── Bloc réservation 1.4.0 (TRIXMAX / téléphone) ─────────────────── */

@media (max-width: 720px) {
  .bf-booking-direct {
    padding: var(--spacing-5) var(--spacing-4);
  }
}

/* ── Tarifs enrichie : breakpoints (centralises ici) ──────────────── */

@media (max-width: 720px) {
  .bf-tarifs__cat-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .bf-included__steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .bf-included__steps {
    grid-template-columns: 1fr;
  }
}

/* ── 1.3.0 V1 : fond hero allégé sur mobile (WebP 800 px au lieu de 1600 px) ── */

@media (max-width: 720px) {
  .bf-salon::after {
    background-image: var(--bf-hero-img-sm, var(--bf-hero-img));
  }
}

/* ── 1.3.0 : bandeau preuve sociale, prestations phares, atelier ── */

@media (max-width: 900px) {
  .bf-proof__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bf-rituals__grid { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; }
}

@media (max-width: 560px) {
  .bf-proof__item { justify-content: flex-start; text-align: left; font-size: 13px; }
  .bf-atelier__item img { height: 260px; }
}
