/* ==========================================================================
   Layout : conteneur, en-tête, navigation, pied de page, barre mobile
   ========================================================================== */

.ds-container {
  width: 100%;
  max-width: calc(var(--ds-container) + 2 * var(--ds-gutter));
  margin-inline: auto;
  padding-inline: var(--ds-gutter);
}

.ds-main {
  flex: 1 0 auto;
  padding-block: var(--ds-space-4) var(--ds-section-gap);
}

.ds-main:focus { outline: none; }

.ds-stack > * + * { margin-top: var(--ds-section-gap); }

.ds-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--ds-space-4);
  margin-bottom: var(--ds-space-4);
}

.ds-section-head__title {
  font-size: var(--ds-fs-xl);
}

.ds-section-head__desc {
  margin-top: var(--ds-space-1);
  color: var(--ds-text-muted);
  font-size: var(--ds-fs-sm);
}

.ds-section-head__link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-1);
  min-height: var(--ds-tap);
  font-weight: var(--ds-fw-semibold);
  font-size: var(--ds-fs-sm);
  text-decoration: none;
}

.ds-section-head__link:hover { text-decoration: underline; }

/* --- Bandeau d'information ------------------------------------------------ */
.ds-topbar {
  background: var(--ds-gray-900);
  color: var(--ds-white);
  font-size: var(--ds-fs-xs);
}

.ds-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--ds-space-2) var(--ds-space-6);
  flex-wrap: wrap;
  min-height: 2.25rem;
  padding-block: var(--ds-space-1);
  text-align: center;
}

.ds-topbar a {
  color: inherit;
  font-weight: var(--ds-fw-semibold);
}

.ds-topbar__item {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-2);
}

.ds-topbar__item .ds-icon { width: 1rem; height: 1rem; }

.ds-topbar__secondary { display: none; }

@media (min-width: 48em) {
  .ds-topbar__secondary { display: inline-flex; }
}

/* --- En-tête -------------------------------------------------------------- */
.ds-header {
  position: sticky;
  top: 0;
  z-index: var(--ds-z-sticky);
  background: var(--ds-surface);
  border-bottom: 1px solid var(--ds-border);
}

.ds-header__bar {
  display: flex;
  align-items: center;
  gap: var(--ds-space-2);
  min-height: var(--ds-header-h);
}

.ds-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 1;
  min-width: 0;
  min-height: var(--ds-tap);
  margin-right: auto;
}

.ds-logo img {
  /* Hauteur fixe réservée : aucun décalage au chargement du logo */
  height: 2.25rem;
  width: auto;
  max-width: min(9.5rem, 100%);
  object-fit: contain;
}

.ds-header__actions {
  display: flex;
  align-items: center;
  gap: var(--ds-space-1);
}

.ds-header__bar .ds-header__account { display: none; }
.ds-header__bar .ds-header__search-toggle { display: inline-grid; }

.ds-header__search {
  display: none;
  padding-bottom: var(--ds-space-3);
}

.ds-header.is-search-open .ds-header__search { display: block; }

@media (min-width: 48em) {
  .ds-logo { margin-right: 0; }
  .ds-logo img { height: 2.75rem; max-width: 11rem; }

  .ds-header__bar { gap: var(--ds-space-4); }

  .ds-header__search,
  .ds-header.is-search-open .ds-header__search {
    display: block;
    flex: 1 1 auto;
    max-width: 36rem;
    padding: 0;
  }

  .ds-header__bar .ds-header__search-toggle { display: none; }
  .ds-header__bar .ds-header__account { display: inline-grid; }
  .ds-header__actions { margin-left: auto; gap: var(--ds-space-2); }
}

@media (min-width: 64em) {
  .ds-header__bar .ds-header__menu { display: none; }
}

/* Formulaire de recherche (get_product_search_form) */
.ds-search {
  position: relative;
  display: flex;
  width: 100%;
}

.ds-search__input {
  width: 100%;
  min-height: var(--ds-tap-lg);
  padding: 0 3.25rem 0 var(--ds-space-4);
  background: var(--ds-surface-muted);
  border: 1px solid transparent;
  border-radius: var(--ds-radius-pill);
  font-size: var(--ds-fs-md);
  transition: border-color var(--ds-dur), background-color var(--ds-dur);
}

.ds-search__input::placeholder { color: var(--ds-text-subtle); }

.ds-search__input:hover { border-color: var(--ds-border-strong); }

.ds-search__input:focus {
  background: var(--ds-surface);
  border-color: var(--ds-focus);
}

.ds-search__input::-webkit-search-cancel-button { cursor: pointer; }

.ds-search__submit {
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: var(--ds-brand);
  color: var(--ds-white);
}

.ds-search__submit:hover { background: var(--ds-brand-hover); }

/* Bouton panier de l'en-tête */
.ds-cartbtn {
  flex-shrink: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-2);
  min-width: var(--ds-tap);
  min-height: var(--ds-tap);
  padding: 0 var(--ds-space-3);
  border: 0;
  border-radius: var(--ds-radius-pill);
  background: var(--ds-brand);
  color: var(--ds-white);
  font-weight: var(--ds-fw-bold);
  font-size: var(--ds-fs-sm);
  text-decoration: none;
}

.ds-cartbtn:hover { background: var(--ds-brand-hover); color: var(--ds-white); }

.ds-cartbtn__total { display: none; }

.ds-cartbtn__count {
  display: inline-grid;
  place-items: center;
  min-width: 1.375rem;
  height: 1.375rem;
  padding: 0 0.3rem;
  border-radius: var(--ds-radius-pill);
  background: var(--ds-white);
  color: var(--ds-rose-600);
  font-size: var(--ds-fs-xs);
  font-weight: var(--ds-fw-black);
  font-variant-numeric: tabular-nums;
}

.ds-cartbtn.is-updating .ds-cartbtn__count { opacity: 0.5; }

@media (min-width: 64em) {
  .ds-cartbtn { padding: 0 var(--ds-space-4); }
  .ds-cartbtn__total { display: inline; }
}

/* Navigation des rayons (desktop) */
.ds-catnav { display: none; }

@media (min-width: 64em) {
  .ds-catnav {
    display: block;
    border-top: 1px solid var(--ds-border);
  }

  .ds-catnav__list {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
    gap: var(--ds-space-1);
    margin: 0;
    padding: var(--ds-space-1) 0;
    list-style: none;
  }

  .ds-catnav__link {
    display: inline-flex;
    align-items: center;
    gap: var(--ds-space-2);
    min-height: 2.5rem;
    padding: 0 0.625rem;
    border-radius: var(--ds-radius-pill);
    white-space: nowrap;
    color: var(--ds-text);
    font-size: var(--ds-fs-sm);
    font-weight: var(--ds-fw-semibold);
    text-decoration: none;
  }

  .ds-catnav__link:hover { background: var(--ds-surface-muted); color: var(--ds-text-strong); }

  .ds-catnav__link[aria-current="page"] {
    background: var(--ds-rose-50);
    color: var(--ds-rose-600);
  }

  .ds-catnav__link--promo { color: var(--ds-rose-600); }
}

/* --- Fil d'Ariane (Rank Math / woocommerce_breadcrumb) -------------------- */
.ds-breadcrumb {
  margin-bottom: var(--ds-space-4);
  font-size: var(--ds-fs-sm);
  color: var(--ds-text-muted);
}

.ds-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ds-space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ds-breadcrumb li:not(:last-child)::after {
  content: "/";
  margin-left: var(--ds-space-1);
  color: var(--ds-text-subtle);
}

.ds-breadcrumb a {
  color: var(--ds-text-muted);
  text-decoration: none;
}

.ds-breadcrumb a:hover { color: var(--ds-brand-text); text-decoration: underline; }

.ds-breadcrumb [aria-current="page"] {
  color: var(--ds-text-strong);
  font-weight: var(--ds-fw-medium);
}

/* --- En-tête de page ------------------------------------------------------ */
.ds-pagehead {
  margin-bottom: var(--ds-space-6);
}

.ds-pagehead__title {
  font-size: var(--ds-fs-2xl);
}

.ds-pagehead__meta {
  margin-top: var(--ds-space-2);
  color: var(--ds-text-muted);
}

/* --- Barre de navigation mobile ----------------------------------------- */
.ds-bottomnav {
  position: fixed;
  inset: auto 0 0 0;
  z-index: var(--ds-z-bottomnav);
  padding-bottom: var(--ds-safe-bottom);
  background: var(--ds-surface);
  border-top: 1px solid var(--ds-border);
  box-shadow: var(--ds-shadow-3);
}

.ds-bottomnav__list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: var(--ds-bottomnav-h);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ds-bottomnav__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ds-text-muted);
  font-size: 0.75rem;
  font-weight: var(--ds-fw-semibold);
  text-decoration: none;
}

.ds-bottomnav__item .ds-icon { width: 1.5rem; height: 1.5rem; }

.ds-bottomnav__item:hover { color: var(--ds-text-strong); }

.ds-bottomnav__item[aria-current="page"] { color: var(--ds-rose-600); }

.ds-bottomnav__item[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 0;
  width: 2rem;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--ds-brand);
}

.ds-bottomnav__badge {
  position: absolute;
  top: 0.4rem;
  left: calc(50% + 0.3rem);
  min-width: 1.125rem;
  height: 1.125rem;
  padding: 0 0.25rem;
  border-radius: var(--ds-radius-pill);
  background: var(--ds-brand);
  color: var(--ds-white);
  font-size: 0.6875rem;
  font-weight: var(--ds-fw-bold);
  line-height: 1.125rem;
  text-align: center;
}

@media (min-width: 64em) {
  .ds-bottomnav { display: none; }
}

/* --- Bouton WhatsApp flottant ------------------------------------------- */
.ds-fab {
  position: fixed;
  right: var(--ds-space-4);
  bottom: calc(var(--ds-bottomnav-h) + var(--ds-safe-bottom) + var(--ds-space-4));
  z-index: var(--ds-z-fab);
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-2);
  min-height: var(--ds-tap-lg);
  min-width: var(--ds-tap-lg);
  padding: 0 var(--ds-space-4);
  border-radius: var(--ds-radius-pill);
  background: var(--ds-wa-700);
  color: var(--ds-white);
  font-weight: var(--ds-fw-bold);
  font-size: var(--ds-fs-sm);
  text-decoration: none;
  box-shadow: var(--ds-shadow-4);
}

.ds-fab:hover { background: var(--ds-wa-800); color: var(--ds-white); }

.ds-fab__label { display: none; }

@media (max-width: 47.99em) {
  .ds-fab { padding: 0; justify-content: center; }
}

@media (min-width: 48em) {
  .ds-fab__label { display: inline; }
}

@media (min-width: 64em) {
  .ds-fab { bottom: var(--ds-space-6); right: var(--ds-space-6); }
}

/* Pages de conversion : la barre d'achat collante remplace le bouton flottant */
.ds-no-fab .ds-fab { display: none; }

/* --- Pied de page --------------------------------------------------------- */
.ds-footer {
  margin-top: auto;
  padding-block: var(--ds-space-12) var(--ds-space-8);
  background: var(--ds-surface);
  border-top: 1px solid var(--ds-border);
  font-size: var(--ds-fs-sm);
}

.ds-footer__grid {
  display: grid;
  gap: var(--ds-space-8);
}

@media (min-width: 48em) {
  .ds-footer__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 64em) {
  .ds-footer__grid { grid-template-columns: 1.4fr 1fr 1fr 1.2fr; }
}

.ds-footer__brand img { height: 2.5rem; width: auto; }

.ds-footer__tagline {
  margin-top: var(--ds-space-3);
  color: var(--ds-rose-600);
  font-weight: var(--ds-fw-semibold);
}

.ds-footer__text {
  margin-top: var(--ds-space-2);
  color: var(--ds-text-muted);
  max-width: 34ch;
}

.ds-footer__title {
  margin-bottom: var(--ds-space-3);
  font-size: var(--ds-fs-md);
}

.ds-footer__links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ds-footer__links a,
.ds-footer__contact a {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-2);
  min-height: var(--ds-tap);
  color: var(--ds-text-muted);
  text-decoration: none;
}

.ds-footer__links a:hover,
.ds-footer__contact a:hover { color: var(--ds-brand-text); text-decoration: underline; }

.ds-footer__contact {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ds-text-muted);
}

.ds-footer__contact li {
  display: flex;
  align-items: center;
  gap: var(--ds-space-2);
  min-height: var(--ds-tap);
}

.ds-footer__contact .ds-icon { flex-shrink: 0; color: var(--ds-teal-700); }

.ds-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--ds-space-3);
  margin-top: var(--ds-space-10);
  padding-top: var(--ds-space-6);
  border-top: 1px solid var(--ds-border);
  color: var(--ds-text-subtle);
  font-size: var(--ds-fs-xs);
}

@media (min-width: 64em) and (max-width: 79.99em) {
  .ds-catnav__link { padding: 0 0.5rem; font-size: 0.8125rem; }
}
