/* =================== hc-cart-drawer.css =================== */
/* hc-cart-drawer - premium right-side cart drawer. Toggled by header cart
 * icon via Alpine `cartOpen`. Panel slides in from the right with backdrop
 * blur. Has head, body (cart items + upsells), and footer (totals + CTA).
 * Strictly .hc-cart-drawer / .hc-cart-drawer__*. */

/* host overlay (the dimmer behind the panel) — uses .hc-drawer wrapper from
 * Alpine; we style the variant .hc-cart-drawer scoped to its own class.
 * The wrapper opens on `body[data-body] [x-show=cartOpen]`; CSS just handles
 * the visual layers. */
.hc-cart-drawer {
  position: relative;
}

.hc-cart-drawer__panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: var(--hc-z-drawer, 80);
  display: flex;
  flex-direction: column;
  width: min(440px, 92vw);
  background: linear-gradient(180deg, var(--hc-paper, #ffffff) 0%, rgba(252, 248, 240, 0.96) 100%);
  border-left: 0.5px solid rgba(141, 109, 71, 0.22);
  box-shadow: -32px 0 80px -20px rgba(40, 30, 15, 0.32);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.hc-cart-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px;
  border-bottom: 0.5px solid rgba(141, 109, 71, 0.16);
  background:
    radial-gradient(circle at 100% 0%, rgba(212, 184, 150, 0.18), transparent 50%),
    rgba(255, 252, 247, 0.86);
}
.hc-cart-drawer__title {
  margin: 0;
  font-family: var(--hc-serif, "Playfair Display", Georgia, serif);
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.005em;
  color: var(--hc-ink, #1a1714);
}
.hc-cart-drawer__count {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 3px 8px;
  background: var(--hc-accent-dark, #5d4d3a);
  color: var(--hc-paper, #ffffff);
  border-radius: var(--hc-r-pill);
  font-family: var(--hc-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.hc-cart-drawer__close {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0.5px solid rgba(141, 109, 71, 0.18);
  border-radius: 10px;
  color: var(--hc-ink-soft, rgba(26, 23, 20, 0.7));
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.hc-cart-drawer__close:hover {
  background: var(--hc-ink, #1a1714);
  color: var(--hc-paper, #ffffff);
  border-color: var(--hc-ink);
  transform: rotate(90deg);
}

.hc-cart-drawer__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 22px;
  display: grid;
  gap: 14px;
}
.hc-cart-drawer__loading {
  display: grid;
  place-items: center;
  padding: 48px 0;
}

/* one cart line */
.hc-cart-drawer__line {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: start;
  gap: 14px;
  padding: 14px;
  background: rgba(255, 252, 247, 0.86);
  border: 0.5px solid rgba(141, 109, 71, 0.14);
  border-radius: 14px;
  transition: border-color 0.22s ease, box-shadow 0.22s ease;
}
.hc-cart-drawer__line:hover {
  border-color: var(--hc-gold-border, rgba(212, 184, 150, 0.4));
  box-shadow: 0 8px 18px -8px rgba(184, 154, 111, 0.18);
}
.hc-cart-drawer__thumb {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #f7f3ea 0%, #efe8da 100%);
  border-radius: 10px;
  overflow: hidden;
}
.hc-cart-drawer__thumb img,
.hc-cart-drawer__thumb svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}
.hc-cart-drawer__line-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.hc-cart-drawer__line-name {
  font-family: var(--hc-serif);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--hc-ink, #1a1714);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hc-cart-drawer__line-series {
  font-family: var(--hc-mono);
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--hc-accent-dark, #7a6548);
}
.hc-cart-drawer__line-qty {
  display: inline-flex;
  align-items: center;
  margin-top: 4px;
  border: 0.5px solid rgba(141, 109, 71, 0.22);
  border-radius: var(--hc-r-pill);
  overflow: hidden;
}
.hc-cart-drawer__line-qty button {
  width: 28px;
  height: 28px;
  background: transparent;
  border: 0;
  font-size: 14px;
  color: var(--hc-ink, #1a1714);
  cursor: pointer;
  transition: background 0.16s ease;
}
.hc-cart-drawer__line-qty button:hover {
  background: rgba(212, 184, 150, 0.22);
}
.hc-cart-drawer__line-qty input {
  width: 32px;
  height: 28px;
  text-align: center;
  background: transparent;
  border: 0;
  font: inherit;
  font-family: var(--hc-mono);
  font-size: 12px;
  font-weight: 600;
}
.hc-cart-drawer__line-price {
  font-family: var(--hc-serif);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  color: var(--hc-ink, #1a1714);
  white-space: nowrap;
}
.hc-cart-drawer__line-remove {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  background: transparent;
  border: 0;
  color: var(--hc-ink-mid, rgba(26, 23, 20, 0.45));
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.18s ease, color 0.18s ease;
}
.hc-cart-drawer__line-remove:hover {
  background: rgba(201, 67, 58, 0.12);
  color: var(--hc-danger, #c9433a);
}

/* empty state */
.hc-cart-drawer__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 36px 24px;
  text-align: center;
}
.hc-cart-drawer__empty-art {
  width: 80px;
  height: 80px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #f7f3ea, #efe8da);
  border-radius: 50%;
}
.hc-cart-drawer__empty strong {
  font-family: var(--hc-serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--hc-ink, #1a1714);
}
.hc-cart-drawer__empty span {
  max-width: 32ch;
  font-size: 13px;
  line-height: 1.55;
  color: var(--hc-ink-soft, rgba(26, 23, 20, 0.62));
}

/* upsells strip */
.hc-cart-drawer__upsell {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 0.5px dashed rgba(141, 109, 71, 0.22);
}
.hc-cart-drawer__upsell h4 {
  margin: 0 0 10px;
  font-family: var(--hc-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hc-accent-dark, #7a6548);
}

/* footer with totals + CTA */
.hc-cart-drawer__foot {
  padding: 18px 22px 22px;
  background: rgba(255, 252, 247, 0.94);
  border-top: 0.5px solid rgba(141, 109, 71, 0.18);
  display: grid;
  gap: 12px;
}
.hc-cart-drawer__sum {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.hc-cart-drawer__sum-label {
  font-family: var(--hc-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--hc-ink-mid, rgba(26, 23, 20, 0.55));
}
.hc-cart-drawer__sum-value {
  font-family: var(--hc-serif);
  font-size: 26px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--hc-ink, #1a1714);
}
.hc-cart-drawer__cta {
  width: 100%;
}
.hc-cart-drawer__view {
  width: 100%;
  text-align: center;
  font-size: 12px;
  color: var(--hc-ink-soft, rgba(26, 23, 20, 0.62));
}
.hc-cart-drawer__view a {
  color: var(--hc-accent-dark, #5d4d3a);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

@media (max-width: 480px) {
  .hc-cart-drawer__panel {
    width: 100vw;
    border-left: 0;
  }
}

/* ──────────────────────────────────────────────────────────────────────
 * Cart drawer items (Sprint 12.65) — source rules for orphan classes
 * (.hc-cart-drawer__item / __row / .qty-form / __remove).
 * ──────────────────────────────────────────────────────────────────── */

.hc-cart-drawer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.hc-cart-drawer__item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 0;
  border-bottom: 0.5px dashed rgba(141, 109, 71, 0.22);
  align-items: start;
}
.hc-cart-drawer__item:last-child {
  border-bottom: 0;
}

.hc-cart-drawer__info {
  min-inline-size: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hc-cart-drawer__name {
  font-family: var(--hc-sans, "Outfit", sans-serif);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.32;
  color: var(--hc-ink, #1a1714);
  text-decoration: none;
  transition: color 0.22s ease;
}
.hc-cart-drawer__name:hover {
  color: var(--hc-accent-dark, #7a6548);
}

.hc-cart-drawer__sub {
  margin: 0;
  font-family: var(--hc-mono, "JetBrains Mono", monospace);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--hc-ink-mid, rgba(26, 23, 20, 0.55));
}
.hc-cart-drawer__sku {
  color: var(--hc-ink, #1a1714);
  font-weight: 600;
}

.hc-cart-drawer__row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

/* qty controls — proper bordered pills around buttons + number */
.qty-form {
  display: inline-grid;
  grid-template-columns: 26px 28px 26px;
  align-items: center;
  border: 0.5px solid rgba(141, 109, 71, 0.28);
  border-radius: 8px;
  overflow: hidden;
  background: var(--hc-paper, #ffffff);
}
.qty-form button {
  width: 26px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  color: var(--hc-ink, #1a1714);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.qty-form button:hover:not(:disabled) {
  background: rgba(212, 184, 150, 0.22);
}
.qty-form button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.qty-form__v {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--hc-mono, "JetBrains Mono", monospace);
  font-size: 12px;
  font-weight: 700;
  border-inline: 0.5px solid rgba(141, 109, 71, 0.18);
}

.hc-cart-drawer__lt {
  text-align: right;
  font-family: var(--hc-serif, "Playfair Display", Georgia, serif);
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--hc-ink, #1a1714);
}

/* Remove button — round 28×28 with hover-red */
.hc-cart-drawer__remove {
  display: inline-flex;
  margin: 0;
  padding: 0;
}
.hc-cart-drawer__remove button {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0.5px solid rgba(141, 109, 71, 0.22);
  border-radius: 50%;
  color: var(--hc-ink-mid, rgba(26, 23, 20, 0.55));
  cursor: pointer;
  transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
}
.hc-cart-drawer__remove button:hover {
  background: #c9433a;
  border-color: #c9433a;
  color: #ffffff;
  transform: scale(1.08);
}

/* Thumb fallback if image missing — show subtle placeholder */
.hc-cart-drawer__thumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(212, 184, 150, 0.16), rgba(184, 154, 111, 0.06));
  border: 0.5px solid rgba(141, 109, 71, 0.18);
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
}
.hc-cart-drawer__thumb img,
.hc-cart-drawer__thumb svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}
