/* Tiroir panier — slide depuis la droite */

.ss-drawer-root[hidden] {
  display: none !important;
}

.ss-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--ss-overlay, rgba(7, 26, 42, 0.45));
  border: 0;
  cursor: pointer;
  animation: ssDrawerFade 0.22s ease both;
}

.ss-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 81;
  width: min(420px, 100vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  /* --ss-panel = blanc opaque (light) / dégradé opaque (dark) — pas --ss-surface (glass) */
  background: var(--ss-panel);
  color: var(--ss-text);
  border-left: 1px solid var(--ss-line);
  box-shadow: -18px 0 48px rgba(7, 26, 42, 0.22);
  animation: ssDrawerIn 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

html[data-theme="dark"] .ss-drawer {
  box-shadow: -18px 0 48px rgba(0, 0, 0, 0.55);
}

@keyframes ssDrawerIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes ssDrawerFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ss-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--ss-line);
}

.ss-drawer-head h2 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.ss-drawer-close {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid var(--ss-line);
  background: var(--ss-surface-2);
  color: var(--ss-text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.ss-drawer-body {
  flex: 1;
  overflow: auto;
  padding: 0.85rem 1.1rem 1rem;
}

.ss-drawer-empty {
  margin: 1.5rem 0;
  color: var(--ss-muted);
  text-align: center;
  line-height: 1.5;
}

.ss-drawer-line {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 0.65rem;
  align-items: start;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--ss-line);
}

.ss-drawer-line-main {
  min-width: 0;
}

.ss-drawer-qty {
  display: inline-grid;
  grid-template-columns: 28px 1fr 28px;
  align-items: center;
  justify-items: center;
  width: 7.25rem;
  height: 32px;
  margin-top: 0.55rem;
  padding: 2px;
  border-radius: 999px;
  border: 1px solid var(--ss-line);
  background: var(--ss-surface-2);
  box-sizing: border-box;
}

.ss-drawer-step {
  appearance: none;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ss-surface);
  color: var(--ss-text);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.ss-drawer-step:hover:not(:disabled) {
  color: var(--ss-cyan);
}

.ss-drawer-step:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.ss-drawer-qty-val {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ss-text);
  font-variant-numeric: tabular-nums;
}

.ss-drawer-line img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--ss-surface-2);
}

.ss-drawer-line strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 0.15rem;
}

.ss-drawer-line-main > span {
  display: block;
  min-height: 2.5em;
  font-size: 0.8rem;
  color: var(--ss-muted);
  line-height: 1.35;
}

.ss-drawer-line-side {
  min-width: 5.75rem;
}

.ss-drawer-line-total {
  font-variant-numeric: tabular-nums;
  min-width: 5.5rem;
}

.ss-drawer-line em {
  display: block;
  margin-top: 0.25rem;
  font-style: normal;
  font-weight: 700;
  font-size: 0.9rem;
}

.ss-drawer-rm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ss-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.ss-drawer-rm svg {
  width: 16px;
  height: 16px;
  display: block;
}

.ss-drawer-rm:hover {
  color: var(--ss-orange);
  background: rgba(234, 88, 12, 0.08);
}

.ss-drawer-foot {
  padding: 0.95rem 1.1rem 1.2rem;
  border-top: 1px solid var(--ss-line);
  background: var(--ss-surface-2);
}

.ss-drawer-totals {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  font-size: 0.9rem;
}

.ss-drawer-totals div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--ss-muted);
}

.ss-drawer-totals .is-ttc {
  margin-top: 0.25rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--ss-line);
  color: var(--ss-text);
  font-weight: 800;
  font-size: 1.05rem;
}

.ss-drawer-deposit-hint {
  margin: -0.15rem 0 0.35rem;
  font-size: 0.75rem;
  color: var(--ss-muted);
  line-height: 1.35;
}

.ss-drawer-cta {
  width: 100%;
  justify-content: center;
}

.ss-drawer-cta[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.ss-drawer-continue {
  display: block;
  margin-top: 0.65rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--ss-cyan);
  text-decoration: none;
}

body.ss-drawer-open {
  overflow: hidden;
}

button.ss-cart-chip {
  font: inherit;
  cursor: pointer;
}
