/* ===================== SHARED SIDE CART ===================== */
/* Variables fall back to the product-page palette when --vars are absent. */
.sc-invalid { border-color: #e53e3e !important; box-shadow: 0 0 0 3px rgba(229,62,62,.15) !important; }

.sc-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 1200;
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--brand, #0a5cff); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(10,92,255,.35);
}
.sc-fab:hover { background: var(--brand-dark, #0741b8); }
.sc-fab-count {
  position: absolute; top: -4px; right: -4px;
  min-width: 20px; height: 20px; padding: 0 5px;
  background: var(--accent, #ff7a00); color: #fff; font-size: 12px; font-weight: 700;
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}

.sc-overlay {
  position: fixed; inset: 0; z-index: 1300;
  background: rgba(15,23,42,.5); opacity: 0; visibility: hidden;
  transition: opacity .25s ease;
}
.sc-overlay.show { opacity: 1; visibility: visible; }

.side-cart {
  position: fixed; top: 0; right: 0; z-index: 1400;
  width: 400px; max-width: 92vw; height: 100%;
  background: #fff; box-shadow: -6px 0 28px rgba(15,23,42,.18);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .28s ease;
}
.side-cart.open { transform: translateX(0); }

.sc-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--line, #e4e8ef);
}
.sc-head h2 { margin: 0; font-size: 18px; color: var(--ink, #1a1f2b); }
.sc-close {
  background: none; border: 0; font-size: 26px; line-height: 1;
  color: var(--muted, #5b6472); cursor: pointer;
}
.sc-close:hover { color: var(--ink, #1a1f2b); }

.sc-body { flex: 1; overflow-y: auto; padding: 16px 20px; }

.sc-empty { text-align: center; color: var(--muted, #5b6472); padding: 60px 10px; }
.sc-empty .ic { font-size: 38px; }
.sc-empty p { margin: 12px 0 4px; font-weight: 600; color: var(--ink, #1a1f2b); }
.sc-empty span { font-size: 13px; }

.sc-item {
  display: flex; gap: 12px; padding: 14px 0;
  border-bottom: 1px solid var(--line, #e4e8ef);
}
.sc-item-img {
  width: 60px; height: 60px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--line, #e4e8ef); flex: 0 0 auto; background: #f4f6fb;
}
.sc-item-info { flex: 1; min-width: 0; }
.sc-item-name { font-weight: 700; color: var(--ink, #1a1f2b); font-size: 14px; }
.sc-item-meta { font-size: 12px; color: var(--muted, #5b6472); margin-top: 2px; }
.sc-item-price { font-weight: 700; color: var(--ink, #1a1f2b); white-space: nowrap; }
.sc-item-price.free { color: var(--good, #1aa34a); font-size: 13px; }

.sc-qty { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.sc-qty button {
  width: 26px; height: 26px; border: 1px solid var(--line, #e4e8ef); background: #f4f6fb;
  border-radius: 6px; cursor: pointer; font-size: 15px; line-height: 1; color: var(--ink, #1a1f2b);
}
.sc-qty button:hover { background: #e8ecf5; }
.sc-qty > span { min-width: 22px; text-align: center; font-weight: 600; font-size: 14px; }
.sc-qty .sc-remove {
  width: auto; padding: 0 8px; margin-left: auto; border: 0; background: none;
  color: var(--muted, #5b6472); font-size: 12px; text-decoration: underline;
}
.sc-qty .sc-remove:hover { color: #e53e3e; background: none; }

.sc-foot { border-top: 1px solid var(--line, #e4e8ef); padding: 16px 20px; }
.sc-totline {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 14px; color: var(--muted, #5b6472); padding: 4px 0;
}
.sc-totline b { color: var(--ink, #1a1f2b); }
.sc-totline.green b { color: var(--good, #1aa34a); }
.sc-due {
  display: flex; justify-content: space-between; align-items: center;
  margin: 10px 0 14px; padding-top: 12px; border-top: 1px solid var(--line, #e4e8ef);
}
.sc-due .l { font-weight: 700; color: var(--ink, #1a1f2b); }
.sc-due .v { font-weight: 800; font-size: 20px; color: var(--ink, #1a1f2b); }

/* Reuse the page's .cta-btn styling for the checkout button; provide a fallback. */
.side-cart .cta-btn {
  display: block; width: 100%; text-align: center; font-size: 16px; font-weight: 700;
  padding: 14px; border-radius: 10px; border: 0; cursor: pointer; margin-bottom: 10px;
  background: var(--accent, #ff7a00); color: #fff;
}
.side-cart .cta-btn:hover { background: var(--brand-dark, #e66e00); }

.sc-continue {
  display: block; width: 100%; text-align: center; background: none; border: 0;
  color: var(--muted, #5b6472); font-size: 13px; cursor: pointer; padding: 6px; text-decoration: underline;
}
.sc-continue:hover { color: var(--ink, #1a1f2b); }

@media (max-width: 480px) {
  .side-cart { width: 100%; max-width: 100%; }
}
