:root {
  --zsf-cart-ink: #2e2d29;
  --zsf-cart-muted: #6c6a63;
  --zsf-cart-line: #d8d1bf;
  --zsf-cart-soft: #f7f5ef;
  --zsf-cart-soft-2: #efede5;
  --zsf-cart-accent: #284a35;
  --zsf-cart-danger: #8b3a3a;
  --zsf-cart-focus: #2b6cb0;
}

/* On s'assure que tout est calculé avec la bordure incluse */
.zsf-cart-root * {
  box-sizing: border-box;
}

.zsf-cart-root {
  position: fixed;
  right: 12px;
  bottom: 10px;
  z-index: 2147483600;
  max-width: min(230px, calc(100vw - 24px));
}

.zsf-cart-fab {
  appearance: none;
  border: 1px solid #4d5f50;
  background: #334438;
  color: #f3efe4;
  border-radius: 12px;
  padding: 9px 12px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
}

.zsf-cart-fab:hover {
  background: #3b4d40;
}

.zsf-cart-fab:focus-visible,
.zsf-cart-btn:focus-visible,
.zsf-cart-close:focus-visible,
.zsf-cart-remove:focus-visible,
.zsf-cart-qty-btn:focus-visible,
.zsf-cart-qty-input:focus-visible {
  outline: 2px solid var(--zsf-cart-focus);
  outline-offset: 2px;
}

.zsf-cart-fab-main {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.zsf-cart-fab-label {
  font-size: 1.02rem;
  font-weight: 700;
}

.zsf-cart-fab-count::before {
  content: "(";
}

.zsf-cart-fab-count::after {
  content: ")";
}

.zsf-cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 15, 0.32);
  z-index: 2147483601;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.zsf-cart-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.zsf-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(470px, 100vw);
  background: var(--zsf-cart-soft);
  z-index: 2147483602;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--zsf-cart-line);
  box-shadow: -8px 0 28px rgba(0, 0, 0, 0.14);
  transform: translateX(100%);
  transition: transform 0.22s ease;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
}

.zsf-cart-drawer.is-open {
  transform: translateX(0);
}

.zsf-cart-drawer-head,
.zsf-cart-drawer-foot {
  padding: 16px;
}

.zsf-cart-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--zsf-cart-line);
}

.zsf-cart-drawer-head h2 {
  margin: 0;
  font-size: 2rem;
  line-height: 1;
  color: var(--zsf-cart-ink);
  font-family: "Cormorant Garamond", "Times New Roman", serif;
  font-weight: 500;
}

.zsf-cart-close {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  color: var(--zsf-cart-muted);
}

.zsf-cart-drawer-body {
  padding: 10px 14px;
  overflow: auto;
}

.zsf-cart-drawer-foot {
  margin-top: auto;
  border-top: 1px solid var(--zsf-cart-line);
  background: #fff;
}

.zsf-cart-items[aria-busy="true"] {
  opacity: 0.65;
  pointer-events: none;
}

.zsf-cart-empty {
  border: 1px dashed var(--zsf-cart-line);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  color: var(--zsf-cart-muted);
  background: #fff;
}

.zsf-cart-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.zsf-cart-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--zsf-cart-line);
}

.zsf-cart-item-main {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 10px 12px;
  align-items: start;
}

.zsf-cart-item-media {
  width: 70px;
  height: 70px;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--zsf-cart-line);
}

.zsf-cart-item-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.zsf-cart-item-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.zsf-cart-item-name {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--zsf-cart-ink);
}

.zsf-cart-item-name a {
  color: var(--zsf-cart-ink);
  text-decoration: none;
}

.zsf-cart-item-name a:hover {
  text-decoration: underline;
}

.zsf-cart-item-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.95rem;
  color: var(--zsf-cart-muted);
}

.zsf-cart-item-line-total {
  color: var(--zsf-cart-ink);
  font-weight: 700;
}

.zsf-cart-item-variation {
  margin-top: 4px;
  color: var(--zsf-cart-muted);
  font-size: 0.86rem;
}

.zsf-cart-item-variation dl.variation {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
}

.zsf-cart-item-variation dl.variation dt {
  margin: 0;
  font-weight: 600;
}

.zsf-cart-item-variation dl.variation dd {
  margin: 0;
}

.zsf-cart-qty-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* --- SECTION QUANTITÉ NETTOYÉE --- */
.zsf-cart-qty-control {
  display: inline-flex;
  align-items: stretch;
  height: 38px;
  border: 1px solid var(--zsf-cart-line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.zsf-cart-qty-btn {
  appearance: none;
  border: 0;
  background: #f5f2e9;
  width: 36px;
  height: 100%;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: #3d4038;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.zsf-cart-qty-btn:hover {
  background: #ebe5d6;
}

.zsf-cart-qty-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.zsf-cart-qty-icon {
  width: 14px;
  height: 14px;
  display: block;
  pointer-events: none;
}

.zsf-cart-qty-icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.zsf-cart-qty-input {
  width: 54px;
  height: 100%;
  padding: 0;
  margin: 0;
  /* On force la suppression de tout effet de bordure ou d'ombre interne */
  border: 0 !important; 
  outline: 0 !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: textfield !important;
  
  text-align: center;
  background: #fff;
  color: var(--zsf-cart-ink);
  font-weight: 700;
  font-size: 1rem;
}

/* Suppression définitive des flèches sur Chrome/Safari/Edge */
.zsf-cart-qty-input::-webkit-outer-spin-button,
.zsf-cart-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.zsf-cart-remove {
  appearance: none;
  border: 1px solid #d8c2c2;
  background: #fff;
  color: var(--zsf-cart-danger);
  cursor: pointer;
  font-size: 0.88rem;
  line-height: 1;
  padding: 0 16px;
  height: 38px;
  border-radius: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  transition: all 0.2s;
}

.zsf-cart-remove:hover {
  color: #6f2d2d;
  border-color: #c9a7a7;
  background: #fff7f7;
}
/* --- FIN SECTION QUANTITÉ --- */

.zsf-cart-notice {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  font-size: 0.9rem;
  line-height: 1.35;
}

.zsf-cart-notice.is-success {
  background: #ecf7ef;
  color: #225534;
  border: 1px solid #c7e6d0;
}

.zsf-cart-notice.is-error {
  background: #fff3f3;
  color: #7c2b2b;
  border: 1px solid #eac4c4;
}

.zsf-cart-totals {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.zsf-cart-total-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.zsf-cart-total-row.is-grand {
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--zsf-cart-ink);
}

.zsf-cart-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.zsf-cart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--zsf-cart-line);
  text-decoration: none;
  color: var(--zsf-cart-ink);
  font-weight: 600;
  flex: 1 1 180px;
  background: #fff;
}

.zsf-cart-btn:hover {
  border-color: #b9b09b;
}

.zsf-cart-btn-primary {
  background: var(--zsf-cart-accent);
  border-color: var(--zsf-cart-accent);
  color: #fff;
}

.zsf-cart-btn-primary:hover {
  background: #203d2c;
  border-color: #203d2c;
}

.zsf-cart-btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.zsf-cart-page {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px;
  color: var(--zsf-cart-ink);
}

.zsf-cart-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.zsf-cart-page-head h1 {
  margin: 0.2rem 0;
  font-size: 2.4rem;
  line-height: 1;
  font-family: "Cormorant Garamond", "Times New Roman", serif;
  font-weight: 500;
}

.zsf-cart-page-foot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--zsf-cart-line);
}

html.zsf-cart-open,
html.zsf-cart-open body {
  overflow: hidden;
}

html.zsf-cart-open .zsf-cart-root .zsf-cart-fab {
  display: none;
}

.zsf-cart-count-bump {
  animation: zsfCartCountBump 0.42s ease;
}

@keyframes zsfCartCountBump {
  0% { transform: scale(1); }
  35% { transform: scale(1.25); }
  70% { transform: scale(0.92); }
  100% { transform: scale(1); }
}

@media (max-width: 820px) {
  .zsf-cart-root {
    right: 10px;
    max-width: min(200px, calc(100vw - 20px));
  }

  .zsf-cart-fab {
    padding: 8px 10px;
  }

  .zsf-cart-drawer {
    width: 100vw;
  }

  .zsf-cart-item-main {
    grid-template-columns: 60px 1fr;
    gap: 9px 10px;
  }

  .zsf-cart-item-media {
    width: 60px;
    height: 60px;
  }

  .zsf-cart-qty-control {
    height: 34px;
  }

  .zsf-cart-qty-btn {
    width: 34px;
  }

  .zsf-cart-qty-input {
    width: 44px;
  }

  .zsf-cart-remove {
    height: 34px;
    padding: 0 10px;
  }
}

@media (max-width: 1024px) {
  /* Masquer le panier flottant sur tablette et mobile */
  .zsf-cart-fab {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .zsf-cart-overlay,
  .zsf-cart-drawer,
  .zsf-cart-fab {
    transition: none !important;
  }
}
