/* ===== Cart trigger (header) ===== */
.cart-trigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(43, 39, 34, 0.18);
  background: transparent;
  color: var(--color-charcoal);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.cart-trigger:hover {
  background: var(--color-terracotta);
  border-color: var(--color-terracotta);
  color: var(--color-white);
}
.cart-trigger svg { width: 18px; height: 18px; }
.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--color-terracotta);
  color: var(--color-white);
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.cart-trigger:hover .cart-badge { background: var(--color-white); color: var(--color-terracotta); }

/* ===== Cart drawer ===== */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(36, 36, 36, 0.45);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.cart-overlay.is-open { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100%);
  background: var(--color-white);
  z-index: 91;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -20px 0 50px rgba(43, 39, 34, 0.18);
}
.cart-drawer.is-open { transform: translateX(0); }
body.cart-open { overflow: hidden; }

.cart-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid rgba(43, 39, 34, 0.08);
}
.cart-drawer-head h2 { margin: 0; font-size: 1.2rem; }
.cart-drawer-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(43, 39, 34, 0.2);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-charcoal);
}
.cart-drawer-close:hover { background: var(--color-cream-dark); }
.cart-drawer-close svg { width: 16px; height: 16px; }

.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 28px;
}
.cart-empty {
  padding: 48px 0;
  text-align: center;
  color: var(--color-charcoal-soft);
}
.cart-items {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(43, 39, 34, 0.08);
}
.cart-item-img {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-cream-dark);
}
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-name { font-weight: 600; font-size: 0.92rem; margin: 0 0 2px; }
.cart-item-price { color: var(--color-terracotta); font-size: 0.85rem; margin: 0 0 8px; }
.cart-item-qty {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 600;
}
.qty-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(43, 39, 34, 0.25);
  background: var(--color-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  line-height: 1;
}
.qty-btn:hover { background: var(--color-cream-dark); }
.cart-item-remove {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--color-charcoal-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-item-remove:hover { color: #C0392B; }
.cart-item-remove svg { width: 16px; height: 16px; }

.cart-drawer-foot {
  padding: 22px 28px 28px;
  border-top: 1px solid rgba(43, 39, 34, 0.08);
}
.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}
.cart-total-label { font-weight: 600; }
.cart-total-amount {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--color-terracotta);
}
.cart-drawer-foot .btn { width: 100%; }

/* ===== Order step (commande.html — panier) ===== */
.order-empty {
  padding: 32px 0;
  color: var(--color-charcoal-soft);
}
.order-empty a { color: var(--color-terracotta); font-weight: 600; }
.order-items {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 760px;
}
.order-item {
  display: grid;
  grid-template-columns: 64px 1fr auto auto auto;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(43, 39, 34, 0.08);
}
.order-item-img {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-cream-dark);
}
.order-item-img img { width: 100%; height: 100%; object-fit: cover; }
.order-item-name { font-weight: 600; font-size: 0.95rem; margin: 0 0 4px; }
.order-item-price { color: var(--color-charcoal-soft); font-size: 0.85rem; margin: 0; }
.order-item-qty {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.9rem;
}
.order-item-line-total {
  font-family: var(--font-display);
  color: var(--color-terracotta);
  font-weight: 600;
  min-width: 56px;
  text-align: right;
  margin: 0;
}
.order-item-remove {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--color-charcoal-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.order-item-remove:hover { color: #C0392B; }
.order-item-remove svg { width: 16px; height: 16px; }

.order-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  max-width: 760px;
  padding-top: 20px;
  margin-top: 8px;
  font-size: 1.1rem;
}
.order-total-row strong {
  font-family: var(--font-display);
  color: var(--color-terracotta);
  font-size: 1.4rem;
}

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

@media (max-width: 640px) {
  .order-item {
    grid-template-columns: 48px 1fr auto;
    grid-template-areas: "img info remove" "img qty total";
    row-gap: 8px;
  }
  .order-item-img { grid-area: img; width: 48px; height: 48px; }
  .order-item-info { grid-area: info; }
  .order-item-remove { grid-area: remove; }
  .order-item-qty { grid-area: qty; }
  .order-item-line-total { grid-area: total; }
}

/* ===== Shop page ===== */
.shop-main {
  padding: 56px 0 96px;
  background: #FBF3E8;
}
.shop-title {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  margin-bottom: 10px;
}
.shop-subtitle {
  color: var(--color-charcoal-soft);
  max-width: 60ch;
  margin-bottom: 36px;
}

.shop-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}
.shop-filter {
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid rgba(43, 39, 34, 0.2);
  background: var(--color-white);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.shop-filter:hover { border-color: var(--color-terracotta); }
.shop-filter.is-active {
  background: var(--color-terracotta);
  border-color: var(--color-terracotta);
  color: var(--color-white);
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}
.shop-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.shop-card-img {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--color-cream-dark);
}
.shop-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.shop-card-img--contain img,
.product-media--contain img {
  object-fit: contain;
}
/* Les photos produit "posées" (dossier /pictures/, ex. bracelets) sont carrées
   (1254×1254) — sur la boîte 4/3 par défaut, object-fit:contain les fait
   "flotter" avec des bandes vides sur les côtés. On adapte la hauteur de la
   carte au ratio réel de ces photos plutôt que de forcer une boîte plus large
   que l'image. */
.shop-card-img--contain { aspect-ratio: 1/1; }
/* .product-media--contain (aspect-ratio + object-fit) est déclaré plus bas,
   après la règle de base .product-media/.product-media img (ligne ~450) —
   même spécificité (une classe + un élément), donc l'ordre dans le fichier
   décide : il doit rester APRÈS pour ne pas se faire écraser. */
.shop-card:hover .shop-card-img img { transform: scale(1.06); }
.shop-card-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(251, 248, 243, 0.92);
  color: var(--color-sage-dark);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
}
.shop-card-badges {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}
.shop-card-badge {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--color-terracotta);
  color: var(--color-white);
}
.shop-card-badge.is-bundle { background: var(--color-sage-dark); }
.shop-card-badge.is-out { background: var(--color-charcoal); }
.shop-card-price-old {
  text-decoration: line-through;
  opacity: 0.55;
  margin-right: 6px;
  font-size: 0.92rem;
}
.shop-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.shop-card-name { font-size: 1.02rem; margin-bottom: 4px; }
.shop-card-name a { color: inherit; text-decoration: none; }
.shop-card-name a:hover { color: var(--color-terracotta); }
.shop-card-price {
  font-family: var(--font-display);
  color: var(--color-terracotta);
  font-size: 1.05rem;
  margin-bottom: 16px;
}
.shop-card-add {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--color-charcoal);
  background: transparent;
  color: var(--color-charcoal);
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.shop-card-add:hover { background: var(--color-charcoal); color: var(--color-white); }
.shop-card-add.is-added { background: var(--color-terracotta); border-color: var(--color-terracotta); color: var(--color-white); }
.shop-card-add:disabled { opacity: 0.5; cursor: not-allowed; }
.shop-card-add:disabled:hover { background: transparent; color: var(--color-charcoal); }
.shop-card-add svg { width: 15px; height: 15px; }

/* ===== Responsive ===== */
@media (max-width: 1000px) {
  .shop-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .shop-grid { grid-template-columns: repeat(2, 1fr); }
  .cart-item { grid-template-columns: 56px 1fr auto; }
}
@media (max-width: 460px) {
  .shop-grid { grid-template-columns: 1fr; }
}

/* ===== Fiche produit ===== */
.product-breadcrumb {
  font-size: 0.85rem;
  color: var(--color-charcoal-soft);
  margin-bottom: 24px;
}
.product-breadcrumb a { color: var(--color-charcoal-soft); }
.product-breadcrumb a:hover { color: var(--color-terracotta); }

.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}
.product-media {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/3.4;
  background: var(--color-cream-dark);
  box-shadow: var(--shadow-soft);
}
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.product-media--contain { aspect-ratio: 1/1; }
.product-media--contain img { object-fit: contain; }
.product-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.product-thumb {
  width: 64px;
  height: 64px;
  padding: 0;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  overflow: hidden;
  cursor: pointer;
  background: var(--color-cream-dark);
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-thumb.is-active { border-color: var(--color-terracotta); }
.product-media-tag {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(251, 248, 243, 0.92);
  color: var(--color-sage-dark);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 6px 13px;
  border-radius: 999px;
}

.product-info { padding-top: 4px; }
.product-name {
  font-size: clamp(1.7rem, 2.6vw, 2.3rem);
  margin-bottom: 10px;
}
.product-badges { display: flex; gap: 8px; margin-bottom: 10px; }
.product-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--color-terracotta);
  color: var(--color-white);
}
.product-badge.is-bundle { background: var(--color-sage-dark); }
.product-price {
  font-family: var(--font-display);
  color: var(--color-terracotta);
  font-size: 1.5rem;
  margin-bottom: 22px;
}
.product-price-old {
  text-decoration: line-through;
  opacity: 0.5;
  margin-right: 8px;
  font-size: 1.1rem;
}
.product-stock { font-size: 0.85rem; color: var(--color-charcoal-soft); margin-bottom: 18px; }
.product-stock.is-out { color: var(--color-terracotta); font-weight: 600; }
.product-bundle-items { margin: 0 0 22px; padding-left: 1.1rem; color: var(--color-charcoal-soft); font-size: 0.92rem; }
.product-description {
  color: var(--color-charcoal-soft);
  line-height: 1.7;
  margin-bottom: 28px;
}

.product-qty-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}
.product-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(43, 39, 34, 0.18);
  border-radius: 999px;
  overflow: hidden;
}
.product-qty button {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--color-charcoal);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
.product-qty button:hover { background: var(--color-cream-dark); }
.product-qty span {
  min-width: 36px;
  text-align: center;
  font-weight: 600;
}
.product-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.product-add-feedback {
  margin-top: 14px;
  font-size: 0.88rem;
  color: var(--color-terracotta);
  font-weight: 600;
}
.product-add-feedback[hidden] { display: none; }

.product-not-found {
  text-align: center;
  padding: 60px 0;
}
.product-not-found a { color: var(--color-terracotta); font-weight: 600; }

@media (max-width: 860px) {
  .product-layout { grid-template-columns: 1fr; gap: 28px; }
}
