/* ==========================================================================
   BEAUTEX UNIVERS — feuille de style
   Signature : le fil doré. La broderie et l'aiguille du logo se prolongent
   dans l'interface via un "fil" qui coud les sections entre elles.
   ========================================================================== */

/* ---------- tokens ---------- */

:root{
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Manrope', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-soft: 0 10px 30px -12px rgba(0,0,0,.35);
  --shadow-lift: 0 18px 40px -16px rgba(0,0,0,.45);

  --ease: cubic-bezier(.22,.61,.36,1);
}

:root[data-theme="dark"]{
  --bg: #0a1322;
  --bg-elevated: #0f1c33;
  --surface: #142544;
  --surface-hover: #1c3157;
  --text: #f2ede1;
  --text-muted: #aab4cc;
  --gold: #cda86b;
  --gold-strong: #e9cd93;
  --gold-soft: rgba(205,168,107,.28);
  --danger: #d1685a;
  --danger-soft: rgba(209,104,90,.18);
  --border: rgba(233,205,147,.14);
  --overlay-scrim: rgba(6,10,20,.72);
}

:root[data-theme="light"]{
  --bg: #f7f1e6;
  --bg-elevated: #fffdf9;
  --surface: #ffffff;
  --surface-hover: #f4ead3;
  --text: #1c1c22;
  --text-muted: #61606b;
  --gold: #9c7031;
  --gold-strong: #7c5822;
  --gold-soft: rgba(156,112,49,.16);
  --danger: #b64435;
  --danger-soft: rgba(182,68,53,.12);
  --border: rgba(28,28,34,.1);
  --overlay-scrim: rgba(20,15,5,.45);
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *{ animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

img{ max-width: 100%; display: block; }

[hidden]{ display: none !important; }

.wrap{
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link{
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--gold);
  color: #10182a;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 999;
}
.skip-link:focus{ left: 0; }

:focus-visible{
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.muted{ color: var(--text-muted); }
.no-scroll{ overflow: hidden; }

h1, h2, h3{
  font-family: var(--font-display);
  font-weight: 500;
  margin: 0;
}

/* ---------- boutons ---------- */

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 20px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .92rem;
  cursor: pointer;
  transition: transform .15s var(--ease), background-color .15s var(--ease), border-color .15s var(--ease), opacity .15s var(--ease);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover{ transform: translateY(-1px); }
.btn:active{ transform: translateY(0); }
.btn:disabled{ opacity: .45; cursor: not-allowed; transform: none; }

.btn--primary{
  background: linear-gradient(135deg, var(--gold-strong), var(--gold));
  color: #201404;
}
.btn--primary:hover{ filter: brightness(1.05); }

.btn--ghost{
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn--ghost:hover{ background: var(--surface-hover); }

.btn--outline{
  background: transparent;
  border-color: var(--gold);
  color: var(--gold-strong);
}
.btn--outline:hover{ background: var(--gold-soft); }

.btn--sm{ padding: 7px 14px; font-size: .82rem; }
.btn--lg{ padding: 14px 28px; font-size: 1rem; }
.btn--block{ width: 100%; }

/* ---------- en-tête ---------- */

.site-header{
  position: sticky;
  top: 0;
  z-index: 60;
  background: transparent;
  transition: background-color .25s var(--ease), backdrop-filter .25s var(--ease), border-color .25s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled{
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-color: var(--border);
}
.site-header__inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
}
.brand{
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}
.brand__logo{
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--gold-soft);
}
.brand__text{ display: flex; flex-direction: column; line-height: 1.2; }
.brand__name{ font-family: var(--font-display); font-size: 1.05rem; letter-spacing: .02em; }
.brand__tagline{ font-size: .72rem; color: var(--gold); text-transform: uppercase; letter-spacing: .08em; }

.site-header__actions{ display: flex; align-items: center; gap: 6px; }

.icon-btn{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background-color .15s var(--ease), transform .15s var(--ease);
}
.icon-btn:hover{ background: var(--surface-hover); transform: translateY(-1px); }
.icon-btn svg path{ fill: none; }
.icon-btn svg{ fill: currentColor; }

#theme-toggle .icon-moon{ display: none; }
:root[data-theme="dark"] #theme-toggle .icon-sun{ display: none; }
:root[data-theme="dark"] #theme-toggle .icon-moon{ display: block; fill: var(--gold); }
:root[data-theme="light"] #theme-toggle .icon-sun{ display: block; stroke: var(--gold); fill: none; }

.count-badge{
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--gold);
  color: #201404;
  font-size: .68rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ---------- hero ---------- */

.hero{
  position: relative;
  overflow: hidden;
  padding: 96px 0 84px;
  background: radial-gradient(120% 140% at 50% -10%, var(--surface) 0%, var(--bg) 62%);
  text-align: center;
}
.hero__ring{
  position: absolute;
  top: 50%;
  left: 50%;
  width: 620px;
  height: 620px;
  border: 1px solid var(--gold-soft);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.hero__ring::before{
  content: "";
  position: absolute;
  inset: 22px;
  border: 1px solid var(--gold-soft);
  border-radius: 50%;
}
.hero__inner{ position: relative; z-index: 1; }
.eyebrow{
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .72rem;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 18px;
}
.hero__title{
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  line-height: 1.08;
  color: var(--text);
  margin-bottom: 20px;
}
.hero__title em{
  font-style: italic;
  color: var(--gold-strong);
}
.hero__subtitle{
  max-width: 540px;
  margin: 0 auto 34px;
  color: var(--text-muted);
  font-size: 1.05rem;
}
.hero__actions{
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* fil doré — séparateur signature (point de couture) */
.stitch-divider{
  height: 18px;
  background-image: repeating-linear-gradient(
    100deg,
    transparent 0, transparent 10px,
    var(--gold) 10px, var(--gold) 22px
  );
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 1.4px;
  opacity: .55;
}

/* ---------- filtres ---------- */

.filters{ padding: 34px 0 10px; }
.filters__row{
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.search-field{
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--text-muted);
}
.search-field input{
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  color: var(--text);
  font-family: var(--font-body);
  font-size: .92rem;
}
.select{
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 16px;
  font-family: var(--font-body);
  font-size: .88rem;
  cursor: pointer;
}

.pills{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.pill{
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
  transition: all .15s var(--ease);
}
.pill:hover{ color: var(--text); border-color: var(--gold-soft); }
.pill.is-active{
  color: var(--gold-strong);
  border-color: var(--gold);
  border-bottom-width: 2px;
  border-bottom-style: dashed;
}

/* ---------- catalogue ---------- */

.catalogue-section{ padding: 26px 0 80px; }

.product-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 22px;
}

.product-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.product-card:hover{
  transform: translateY(-5px);
  box-shadow: var(--shadow-lift);
  border-color: var(--gold-soft);
}

.product-card__media{
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}
.product-card__img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}
.product-card:hover .product-card__img{ transform: scale(1.06); }

.badge{
  position: absolute;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge--category{
  top: 12px;
  left: 12px;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  color: var(--gold-strong);
  backdrop-filter: blur(4px);
  border: 1px solid var(--gold-soft);
}
.badge--sold{
  top: 12px;
  right: 12px;
  background: var(--danger);
  color: #fff;
}
.badge--featured{
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, var(--gold-strong), var(--gold));
  color: #201404;
}

.wishlist-btn{
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--gold-soft);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  color: var(--gold-strong);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .15s var(--ease);
}
.wishlist-btn svg path{ fill: none; stroke: currentColor; stroke-width: 1.7; }
.wishlist-btn.is-active svg path{ fill: currentColor; }
.wishlist-btn:hover{ transform: scale(1.08); }
.wishlist-btn.is-active{ animation: stitch-pop .3s var(--ease); }

@keyframes stitch-pop{
  0%{ transform: scale(1); }
  40%{ transform: scale(1.3) rotate(-6deg); }
  100%{ transform: scale(1); }
}

.product-card__body{ padding: 16px; }
.product-card__title{
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 500;
  margin-bottom: 6px;
}
.product-card__rating{ margin-bottom: 10px; }

.stars{ display: inline-flex; gap: 1px; }
.star{ color: var(--border); font-size: .9rem; }
.star.is-filled{ color: var(--gold); }
.rating-count{ font-size: .74rem; color: var(--text-muted); margin-left: 6px; }

.product-card__footer{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.price{ color: var(--gold-strong); font-family: var(--font-display); font-size: 1.05rem; }
.price--lg{ font-size: 1.5rem; }
.product-card__actions{ display: flex; gap: 8px; }

.empty-state{
  text-align: center;
  color: var(--text-muted);
  padding: 60px 20px;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

/* ---------- pied de page ---------- */

.site-footer{
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding: 34px 0;
}
.site-footer__inner{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: .88rem;
}
.site-footer__logo{ width: 40px; height: 40px; border-radius: 50%; }
.footer-whatsapp{ color: var(--gold-strong); font-weight: 700; text-decoration: none; }
.footer-whatsapp:hover{ text-decoration: underline; }
.footer-admin-link{ color: var(--text-muted); font-size: .78rem; text-decoration: none; opacity: .7; }
.footer-admin-link:hover{ opacity: 1; text-decoration: underline; }

/* ---------- overlays (tiroirs & modales) ---------- */

.overlay{
  position: fixed;
  inset: 0;
  z-index: 200;
}
.overlay__backdrop{
  position: absolute;
  inset: 0;
  background: var(--overlay-scrim);
  opacity: 0;
  transition: opacity .2s var(--ease);
}
.overlay.is-open .overlay__backdrop{ opacity: 1; }

.overlay--drawer .overlay__panel{
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(420px, 92vw);
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .28s var(--ease);
}
.overlay--drawer.is-open .overlay__panel{ transform: translateX(0); }

.overlay--modal{ display: flex; align-items: center; justify-content: center; padding: 20px; }
.overlay--modal .overlay__panel{
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: min(480px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(14px) scale(.98);
  transition: transform .22s var(--ease), opacity .22s var(--ease);
}
.overlay--modal.is-open .overlay__panel{ opacity: 1; transform: translateY(0) scale(1); }
.overlay__panel--wide{ width: min(880px, 100%); }

.overlay__close{ position: absolute; top: 14px; right: 14px; z-index: 2; }

.overlay__header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
}
.overlay__header h2{ font-size: 1.15rem; }
.overlay__body{ padding: 20px 22px; flex: 1; overflow-y: auto; }
.overlay__footer{ padding: 18px 22px; border-top: 1px solid var(--border); }

.total-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-family: var(--font-display);
  font-size: 1.05rem;
}
.btn-row{ display: flex; gap: 10px; }
.btn-row .btn{ flex: 1; }

.cart-item{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.cart-item:last-child{ border-bottom: none; }
.cart-item__img{ width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.cart-item__info{ flex: 1; min-width: 0; }
.cart-item__name{ font-weight: 600; font-size: .9rem; }
.cart-item__price{ color: var(--gold); font-size: .84rem; margin-bottom: 6px; }

.qty-control{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  width: fit-content;
}
.qty-control--lg{ padding: 6px 16px; font-size: 1.1rem; }
.qty-btn{
  background: none;
  border: none;
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  width: 20px;
  line-height: 1;
}
.remove-btn{
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 6px;
}
.remove-btn:hover{ color: var(--danger); }

.wishlist-item__actions{ display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }

/* ---------- vue rapide produit ---------- */

.quickview{
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.quickview__media{ background: var(--surface); }
.quickview__img{ width: 100%; height: 100%; object-fit: cover; min-height: 280px; }
.quickview__body{ padding: 30px; }
.quickview__title{ font-size: 1.5rem; margin: 10px 0 8px; }
.quickview__rating{ margin-bottom: 14px; }
.quickview__description{ color: var(--text-muted); margin-bottom: 18px; }
.quickview__meta{
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.stock-badge{ font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.stock-badge--ok{ color: #3f8f6c; background: rgba(63,143,108,.15); }
.stock-badge--out{ color: var(--danger); background: var(--danger-soft); }

.quickview__actions{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.quickview__reviews h3{ font-size: 1.05rem; margin-bottom: 12px; }
.reviews-list{ display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; max-height: 220px; overflow-y: auto; }
.review{ border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.review__head{ display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.review__author{ font-weight: 700; font-size: .88rem; }
.review__comment{ margin: 0; color: var(--text-muted); font-size: .88rem; }

.review-form{ display: flex; flex-direction: column; gap: 8px; }
.review-form__label{ font-weight: 700; font-size: .88rem; margin: 0; }
.review-form__note{ font-size: .74rem; color: var(--text-muted); margin: 4px 0 0; }

.rating-input{ display: flex; gap: 4px; }
.rating-input__star{
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--border);
  cursor: pointer;
  padding: 0;
  transition: color .12s var(--ease), transform .12s var(--ease);
}
.rating-input__star.is-selected{ color: var(--gold); }
.rating-input__star:hover{ transform: scale(1.15); }

.input{
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-family: var(--font-body);
  font-size: .9rem;
  margin-bottom: 4px;
}
.input:focus{ outline: none; border-color: var(--gold); }

.field-label{ display: block; font-size: .8rem; color: var(--text-muted); margin: 10px 0 4px; }
.checkbox-field{ display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: .86rem; }
.hr{ border: none; border-top: 1px solid var(--border); margin: 16px 0; }

.checkout-summary{ margin-bottom: 14px; }
.checkout-row{ display: flex; justify-content: space-between; font-size: .88rem; padding: 6px 0; color: var(--text-muted); }

/* ---------- toasts ---------- */

.toast-container{
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.toast{
  background: var(--surface);
  border: 1px solid var(--gold-soft);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 999px;
  font-size: .86rem;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.toast.is-visible{ opacity: 1; transform: translateY(0); }

/* ---------- responsive ---------- */

@media (max-width: 760px){
  .quickview{ grid-template-columns: 1fr; }
  .quickview__img{ min-height: 220px; }
  .hero{ padding: 72px 0 56px; }
  .filters__row{ flex-direction: column; }
}

@media (max-width: 480px){
  .brand__tagline{ display: none; }
  .product-grid{ grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .product-card__body{ padding: 12px; }
  .search-field input{ width: 80px; height: 32px; }
}