/* =========================================================================
   Leya Beauty — feuille de style du site public.
   Mobile-first. Aucun style inline (CSP stricte, sans 'unsafe-inline').
   ========================================================================= */

:root {
  --blush-50: #fffdfc;
  --blush-100: #fdf4f1;
  --blush-200: #f9e6e0;
  --blush-300: #f2cec4;

  --accent: #e9724c;
  --accent-dark: #cf5c39;
  --accent-soft: #fbe9e2;

  --ink: #2b2320;
  --ink-soft: #6b5f59;
  --muted: #9b8e88;
  --line: #efe3de;

  --success: #2f9e6f;
  --danger: #c8392b;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;

  --shadow-sm: 0 1px 2px rgba(43, 35, 32, 0.04), 0 2px 8px rgba(43, 35, 32, 0.04);
  --shadow-md: 0 4px 12px rgba(43, 35, 32, 0.06), 0 12px 32px rgba(43, 35, 32, 0.08);
  --shadow-lg: 0 12px 32px rgba(43, 35, 32, 0.1), 0 32px 64px rgba(43, 35, 32, 0.12);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --wrap: 1140px;

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--blush-50);
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
}

body.no-scroll {
  overflow: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ------------------------------------------------------------- Boutons --- */

.btn {
  --btn-bg: var(--accent);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border: 0;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background-color 0.2s;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(233, 114, 76, 0.32);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-dark);
}

.btn-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--accent);
  border: 1.5px solid var(--blush-300);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--accent-soft);
  box-shadow: none;
}

.btn-ghost.is-added {
  --btn-fg: var(--success);
  border-color: var(--success);
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-lg {
  padding: 17px 32px;
  font-size: 1.05rem;
}

/* Action secondaire des cartes : presente, mais visuellement en retrait du
   bouton de commande, qui reste l'action principale. */
.btn-sm {
  padding: 10px 18px;
  font-size: 0.9rem;
}

/* --------------------------------------------------------------- Header -- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 253, 252, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.logo span {
  color: var(--accent);
}

.cart-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  font-weight: 600;
  font-size: 0.92rem;
  transition: border-color 0.2s, background-color 0.2s;
}

.cart-link:hover {
  border-color: var(--blush-300);
  background: var(--blush-100);
}

.cart-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.cart-badge.is-empty {
  background: var(--muted);
}

/* ----------------------------------------------------------------- Hero -- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 80px;
  background: linear-gradient(160deg, var(--blush-100) 0%, var(--blush-50) 55%, var(--accent-soft) 100%);
}

.hero::before {
  content: '';
  position: absolute;
  top: -180px;
  right: -140px;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 206, 196, 0.55), transparent 68%);
  animation: float 14s ease-in-out infinite;
}

.hero .wrap {
  position: relative;
}

.hero-eyebrow {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--blush-200);
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}

.hero h1 {
  margin: 22px 0 18px;
  font-size: clamp(2.1rem, 6.5vw, 3.6rem);
  max-width: 16ch;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero p {
  max-width: 48ch;
  font-size: 1.08rem;
  color: var(--ink-soft);
  margin: 0 0 30px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-24px, 22px) scale(1.06); }
}

/* -------------------------------------------------------------- Sections - */

.section {
  padding: 72px 0;
}

.section-head {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 44px;
}

.section-head h2 {
  font-size: clamp(1.6rem, 4.5vw, 2.3rem);
}

.section-head p {
  color: var(--ink-soft);
  margin: 0;
}

/* ---------------------------------------------------------- Cartes produit */

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

.grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 48px 0;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.card-media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--blush-100);
}

.card-image,
.gallery-image,
.cart-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-image {
  transition: transform 0.6s var(--ease);
}

.card:hover .card-image {
  transform: scale(1.06);
}

.thumb-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--blush-200), var(--accent-soft));
  color: var(--accent-dark);
  font-size: 2.4rem;
  font-weight: 700;
}

.badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-sale {
  background: var(--accent);
  color: #fff;
}

.badge-out {
  left: auto;
  right: 14px;
  background: rgba(43, 35, 32, 0.82);
  color: #fff;
}

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.card-title {
  font-size: 1.08rem;
  margin: 0;
}

.card-desc {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
  flex: 1;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
}

.price-compare {
  color: var(--muted);
  text-decoration: line-through;
  font-size: 0.95rem;
}

.price-row-lg .price {
  font-size: 2rem;
}

.price-row-lg .badge {
  position: static;
}

/* ------------------------------------------------------------ Reassurance */

.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
}

.trust-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 22px;
  text-align: center;
  transition: transform 0.3s var(--ease), border-color 0.3s;
}

.trust-card:hover {
  transform: translateY(-4px);
  border-color: var(--blush-300);
}

.trust-card .icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 12px;
}

.trust-card h3 {
  font-size: 1.02rem;
  margin-bottom: 6px;
}

.trust-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.trust-list {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: grid;
  gap: 12px;
}

.trust-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.94rem;
  color: var(--ink-soft);
}

.trust-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  flex: none;
}

/* ----------------------------------------------------------- Fiche produit */

.product-layout {
  display: grid;
  gap: 40px;
  padding: 44px 0;
}

@media (min-width: 900px) {
  .product-layout {
    grid-template-columns: 1.05fr 1fr;
    align-items: start;
    gap: 60px;
  }
}

.gallery-stage {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--blush-100);
  border: 1px solid var(--line);
}

.gallery-image.is-fading {
  animation: fade-in 0.4s var(--ease);
}

.gallery-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.gallery-thumb {
  flex: none;
  width: 72px;
  height: 72px;
  padding: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  background: var(--blush-100);
  cursor: pointer;
  transition: border-color 0.2s, opacity 0.2s;
  opacity: 0.65;
}

.gallery-thumb.is-active {
  border-color: var(--accent);
  opacity: 1;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-title {
  font-size: clamp(1.7rem, 4.5vw, 2.5rem);
}

.product-tagline {
  color: var(--ink-soft);
  margin: 0 0 20px;
  font-size: 1.05rem;
}

.product-actions {
  display: flex;
  gap: 12px;
  margin: 26px 0 12px;
  flex-wrap: wrap;
}

.product-actions .btn {
  flex: 1;
  min-width: 200px;
}

.stock-out {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--blush-100);
  color: var(--ink-soft);
  font-weight: 600;
}

.qty-selector {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.qty-btn {
  width: 46px;
  height: 52px;
  border: 0;
  background: none;
  font-size: 1.25rem;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.15s;
}

.qty-btn:hover:not(:disabled) {
  background: var(--blush-100);
}

.qty-btn:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.qty-value {
  min-width: 34px;
  text-align: center;
  font-weight: 700;
}

.qty-selector-sm .qty-btn {
  width: 36px;
  height: 40px;
  font-size: 1.05rem;
}

.product-description {
  padding: 20px 0 64px;
  max-width: 780px;
}

.rich-text {
  color: var(--ink-soft);
}

.rich-text ul {
  padding-left: 20px;
}

.rich-text li {
  margin-bottom: 8px;
}

.rich-text strong {
  color: var(--ink);
}

/* ---------------------------------------------------------------- Panier -- */

.cart-page {
  padding: 44px 0 72px;
  max-width: 820px;
  margin: 0 auto;
}

.page-title {
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  margin-bottom: 28px;
}

.cart-notice {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.92rem;
}

.cart-list {
  display: grid;
  gap: 14px;
}

.cart-row {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 16px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  align-items: center;
}

@media (min-width: 640px) {
  .cart-row {
    grid-template-columns: 84px 1fr auto;
  }
}

.cart-media {
  width: 84px;
  height: 84px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--blush-100);
}

.cart-title {
  font-weight: 600;
  display: block;
}

.cart-unit {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.cart-controls {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

@media (min-width: 640px) {
  .cart-controls {
    grid-column: auto;
    justify-content: flex-end;
  }
}

.cart-line-total {
  font-weight: 700;
  min-width: 96px;
  text-align: right;
}

.cart-remove {
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px;
}

.cart-remove:hover {
  color: var(--danger);
}

.cart-footer {
  margin-top: 26px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 1.15rem;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.cart-total strong {
  font-size: 1.6rem;
}

.cart-hint {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0 0 18px;
}

.cart-back {
  display: block;
  text-align: center;
  margin-top: 16px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.cart-back:hover {
  color: var(--accent);
}

/* ----------------------------------------------------------------- Modal -- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(43, 35, 32, 0.5);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.22s ease;
  overflow-y: auto;
}

.modal-overlay.is-open {
  opacity: 1;
}

@media (min-width: 720px) {
  .modal-overlay {
    align-items: center;
    padding: 24px;
  }
}

.modal-panel {
  width: 100%;
  max-width: 520px;
  background: var(--blush-50);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg);
  transform: translateY(28px) scale(0.98);
  opacity: 0;
  transition: transform 0.34s var(--ease), opacity 0.28s ease;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
}

.modal-overlay.is-open .modal-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

@media (min-width: 720px) {
  .modal-panel {
    border-radius: var(--radius-lg);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 12px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.modal-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--blush-100);
  font-size: 1.4rem;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background-color 0.2s;
}

.modal-close:hover {
  background: var(--blush-200);
}

.modal-body {
  padding: 20px 22px 26px;
  overflow-y: auto;
}

/* ------------------------------------------------------------ Formulaire -- */

.order-summary {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 22px;
}

.order-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.92rem;
  padding: 5px 0;
  color: var(--ink-soft);
}

.order-summary-total {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-weight: 700;
  color: var(--ink);
  font-size: 1rem;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 13px 15px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  font: inherit;
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(233, 114, 76, 0.12);
}

.field-hint {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.field-error {
  margin: 0;
  font-size: 0.82rem;
  color: var(--danger);
  min-height: 0;
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--danger);
}

.field.has-error .field-error {
  margin-top: 6px;
}

.field.has-error .field-hint {
  display: none;
}

/* Honeypot : hors ecran, invisible et non focusable pour un humain. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-global-error {
  color: var(--danger);
  font-size: 0.88rem;
  text-align: center;
  margin: 12px 0 0;
}

.order-legal {
  margin: 14px 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Bouton en cours d'envoi : le libelle glisse, le spinner apparait. */
.btn-submit {
  min-height: 52px;
}

.btn-spinner {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s, transform 0.2s;
}

.order-form.is-loading .btn-label {
  opacity: 0;
  transform: translateY(-8px);
}

.btn-label {
  transition: opacity 0.2s, transform 0.2s;
}

.order-form.is-loading .btn-spinner {
  opacity: 1;
  transform: scale(1);
  animation: spin 0.7s linear infinite;
}

.order-form.is-loading .btn-submit {
  pointer-events: none;
}

@keyframes spin {
  to { transform: rotate(360deg) scale(1); }
}

/* ------------------------------------------------------------- Succes ---- */

.order-success {
  text-align: center;
  padding: 20px 0 8px;
  animation: fade-in 0.4s var(--ease);
}

.order-success h2 {
  margin: 20px 0 8px;
}

.order-success p {
  color: var(--ink-soft);
  margin: 0 0 6px;
}

.order-ref {
  margin: 14px 0 24px !important;
  padding: 10px;
  background: var(--blush-100);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.checkmark {
  width: 84px;
  height: 84px;
  margin: 0 auto;
  display: block;
}

.checkmark-circle {
  fill: none;
  stroke: var(--success);
  stroke-width: 2.5;
  stroke-dasharray: 152;
  stroke-dashoffset: 152;
}

.checkmark-check {
  fill: none;
  stroke: var(--success);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
}

.checkmark.is-animated .checkmark-circle {
  animation: draw 0.6s var(--ease) forwards;
}

.checkmark.is-animated .checkmark-check {
  animation: draw 0.35s var(--ease) 0.45s forwards;
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

/* ------------------------------------------------------------- Etat vide -- */

.empty-state {
  text-align: center;
  padding: 90px 20px;
}

.empty-state p {
  color: var(--ink-soft);
  margin-bottom: 26px;
}

/* --------------------------------------------------------------- Footer --- */

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 44px 0 32px;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.footer-note {
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
  margin: 20px 0 0;
}

/* ---------------------------------------------------------- Apparitions --- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Respecte le reglage systeme : on coupe tout mouvement superflu. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
