/* sf.css (P1): the cart drawer and other sf.js UI on theme pages. Served as /_sf/<hash>/sf.css.
   Neutral by default; a theme (or the core theme's settings) sets --sf-drawer-bg, --sf-drawer-text, --sf-accent,
   --sf-radius and --sf-font on :root to match its look. Class names all start with sf- so themes can't collide. */
html.sf-drawer-open { overflow: hidden; }

.sf-drawer[hidden] { display: none !important; }
.sf-drawer {
  --_bg: var(--sf-drawer-bg, #ffffff);
  --_text: var(--sf-drawer-text, #1f2024);
  --_muted: color-mix(in srgb, var(--_text) 62%, transparent);
  --_line: color-mix(in srgb, var(--_text) 14%, transparent);
  --_accent: var(--sf-accent, #1f2024);
  --_radius: var(--sf-radius, 8px);
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  font-family: var(--sf-font, inherit);
}
.sf-drawer__backdrop { position: absolute; inset: 0; background: rgba(12, 13, 18, 0.45); }
.sf-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--_bg);
  color: var(--_text);
  box-shadow: -12px 0 32px rgba(0, 0, 0, 0.18);
  outline: none;
  animation: sf-drawer-in 0.18s ease-out;
}
@keyframes sf-drawer-in { from { transform: translateX(24px); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .sf-drawer__panel { animation: none; } }

.sf-drawer__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--_line); }
.sf-drawer__title { margin: 0; font-size: 18px; font-weight: 500; line-height: 1.3; }
.sf-drawer__close {
  appearance: none; border: 1px solid var(--_line); background: transparent; color: inherit; cursor: pointer;
  width: 36px; height: 36px; border-radius: var(--_radius); font-size: 22px; line-height: 1;
}
.sf-drawer__notice:empty { display: none; }
.sf-drawer__notice { margin: 12px 20px 0; padding: 10px 12px; border-radius: var(--_radius); font-size: 14px; background: color-mix(in srgb, var(--_accent) 10%, transparent); }
.sf-drawer__notice--error { background: rgba(200, 40, 40, 0.1); color: #a31c1c; }
.sf-drawer__body { flex: 1; overflow-y: auto; padding: 4px 20px; }
.sf-drawer__lines { list-style: none; margin: 0; padding: 0; }
.sf-drawer__empty { margin: 32px 0; text-align: center; color: var(--_muted); }

.sf-line { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--_line); }
.sf-line:last-child { border-bottom: 0; }
.sf-line__image { width: 64px; height: 64px; object-fit: cover; border-radius: calc(var(--_radius) - 2px); background: var(--_line); display: block; }
.sf-line__info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sf-line__name { color: inherit; text-decoration: none; font-weight: 500; overflow-wrap: anywhere; }
a.sf-line__name:hover { text-decoration: underline; }
.sf-line__price, .sf-line__reason { font-size: 13px; color: var(--_muted); }
.sf-line__variant { font-size: 13px; color: var(--_muted); overflow-wrap: anywhere; }
.sf-line--gone .sf-line__name { color: var(--_muted); }
.sf-line__end { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.sf-line__total { font-weight: 500; white-space: nowrap; }
.sf-line__remove { appearance: none; border: 0; background: none; padding: 0; color: var(--_muted); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }

.sf-qty { display: inline-flex; align-items: center; margin-top: 4px; border: 1px solid var(--_line); border-radius: var(--_radius); width: max-content; }
.sf-qty__step { appearance: none; border: 0; background: none; color: inherit; width: 32px; height: 32px; font-size: 18px; line-height: 1; cursor: pointer; }
.sf-qty__step:disabled { opacity: 0.35; cursor: default; }
.sf-drawer__close, .sf-qty__step { display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.sf-icon { display: block; flex: none; }
.sf-qty__value { min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; }

.sf-drawer__foot { padding: 16px 20px 20px; border-top: 1px solid var(--_line); display: grid; gap: 10px; }
.sf-drawer__foot[hidden] { display: none; }
.sf-drawer__subtotal { display: flex; justify-content: space-between; margin: 0; font-size: 16px; }
.sf-drawer__small { margin: 0; font-size: 13px; color: var(--_muted); }
.sf-drawer__button {
  display: block; text-align: center; padding: 12px 16px; border-radius: var(--_radius); border: 1px solid var(--_line);
  color: inherit; text-decoration: none; font-weight: 500;
}
.sf-drawer__button--primary { background: var(--_accent); border-color: var(--_accent); color: var(--sf-accent-text, #ffffff); }
.sf-drawer__close:focus-visible, .sf-drawer__button:focus-visible, .sf-qty__step:focus-visible, .sf-line__remove:focus-visible, .sf-line__name:focus-visible {
  outline: 2px solid var(--_accent); outline-offset: 2px;
}
.sf-drawer__panel[aria-busy="true"] .sf-drawer__body { opacity: 0.6; }
