/* ================= Panier partagé (tiroir + page panier) ================= */

.cart-badge {
  position: absolute;
  top: -6px;
  right: -10px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #C9578F;
  color: #FBF5EC;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(18, 63, 66, 0.45);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 280ms var(--ease-spring);
}
.cart-overlay[hidden] { display: none; }
.cart-overlay.is-open { opacity: 1; }

.cart-drawer {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 100%;
  max-width: 26rem;
  background: #FBF5EC;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 340ms var(--ease-spring);
  border-radius: 0;
}
.cart-overlay.is-open .cart-drawer { transform: translateX(0); }

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 1.5rem 1rem;
  border-bottom: 1px solid rgba(23,38,42,0.08);
}

.cart-drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}

.cart-drawer-footer {
  padding: 1.1rem 1.5rem 1.5rem;
  border-top: 1px solid rgba(23,38,42,0.08);
}

.cart-empty {
  color: rgba(23,38,42,0.55);
  font-size: 0.92rem;
  padding: 1.5rem 0;
  text-align: center;
}
[data-cart-empty] { display: none; }
[data-cart-empty].is-visible { display: block; }

.cart-line {
  display: flex;
  gap: 0.85rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid rgba(23,38,42,0.07);
}
.cart-line:first-child { padding-top: 0; }

.cart-line-img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
  flex-shrink: 0;
  box-shadow: var(--shadow-card);
}

.cart-line-info { flex: 1; min-width: 0; }
.cart-line-name {
  font-family: 'Fraunces', serif;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 0.2rem;
}
.cart-line-price { font-size: 0.82rem; color: rgba(23,38,42,0.55); margin-bottom: 0.55rem; }

.cart-qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid rgba(23,38,42,0.14);
  border-radius: 999px;
  overflow: hidden;
}
.cart-qty-stepper button {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  color: #1E6E72;
}
.cart-qty-stepper button:hover { background: rgba(30,110,114,0.1); }
.cart-qty-stepper span {
  min-width: 1.6rem;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
}

.cart-line-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  flex-shrink: 0;
}
.cart-line-subtotal { font-size: 0.9rem; font-weight: 600; }
.cart-line-remove { color: rgba(23,38,42,0.4); }
.cart-line-remove:hover { color: #C9578F; }

.cart-promo {
  display: block;
  margin-bottom: 1rem;
}
.cart-input {
  width: 100%;
  border: 1.5px solid rgba(23,38,42,0.14);
  border-radius: 12px;
  padding: 0.6rem 0.85rem;
  font-family: 'Work Sans', sans-serif;
  font-size: 0.88rem;
  background: #fff;
}
.cart-input:disabled { color: rgba(23,38,42,0.4); background: rgba(23,38,42,0.03); }

.cart-total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-family: 'Fraunces', serif;
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 1.1rem;
}

/* ================= Page panier (pleine page) ================= */

.cart-page-items .cart-line { padding: 1.25rem 0; }
.cart-page-items .cart-line-img { width: 84px; height: 84px; }

/* ================= Cartes produit (pages famille) ================= */

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}
@media (min-width: 640px) { .shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.75rem; } }
@media (min-width: 1024px) { .shop-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.75rem; } }

.shop-card {
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 300ms var(--ease-spring), box-shadow 300ms var(--ease-spring);
}
.shop-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-floating); }

.shop-card-img-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.shop-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 420ms var(--ease-spring);
}
.shop-card:hover .shop-card-img { transform: scale(1.06); }

.shop-card-body {
  padding: 1rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.shop-card-name {
  font-family: 'Fraunces', serif;
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 0.3rem;
}
.shop-card-price {
  font-size: 0.85rem;
  color: rgba(23,38,42,0.6);
  margin-bottom: 0.85rem;
}
.shop-card-add {
  margin-top: auto;
  width: 100%;
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}
.shop-card-add.is-added { background: #175559; }

.shop-subheading {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  font-weight: 500;
  margin: 2.5rem 0 1.25rem;
}
.shop-subheading:first-of-type { margin-top: 0; }
