/* ─── CART SIDEBAR — Navy Glass Ultra ─── */

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4,8,20,.6);
  z-index: 399;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}
.cart-overlay.open { opacity: 1; pointer-events: auto; }

/* Panel — solid fallback, then glass via @supports */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 100vw;
  height: 100vh;
  background: rgba(12,22,44,.96);
  border-left: none;
  border: 1px solid rgba(160,190,255,.3);
  z-index: 400;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  box-shadow:
    0 30px 70px -22px rgba(0,0,0,.9),
    0 0 50px -20px rgba(80,130,255,.4),
    inset 0 1px 0 rgba(255,255,255,.28);
  overflow: hidden;
}
@supports (backdrop-filter: blur(1px)) {
  .cart-sidebar {
    background: linear-gradient(165deg,
      rgba(120,160,255,.16),
      rgba(40,70,140,.1) 45%,
      rgba(230,193,90,.1));
    -webkit-backdrop-filter: blur(18px) saturate(1.6);
    backdrop-filter: blur(18px) saturate(1.6);
  }
}

/* Top sheen — fades over upper 45% of panel */
.cart-sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 45%;
  background: linear-gradient(180deg, rgba(255,255,255,.18), transparent);
  pointer-events: none;
  z-index: -1;
}

.cart-sidebar.open { transform: translateX(0); }

/* ── Header ── */
.cart-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid rgba(160,190,255,.16);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}
.cart-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  flex: 1;
  color: #fff;
}
.cart-item-count {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  color: rgba(255,255,255,.7);
}
.cart-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(160,190,255,.35);
  color: #fff;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.85rem;
}
.cart-close:hover { background: var(--color-ink); color: var(--color-paper); }

/* ── Items scroll area ── */
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.cart-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid rgba(160,190,255,.16);
}
.cart-item:last-child { border-bottom: none; }

.cart-item-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: linear-gradient(140deg, #1E3C78, #0E1F44);
  border: 1px solid rgba(160,190,255,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.cart-item-info { flex: 1; }
.cart-item-name {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cart-item-price {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 700;
  color: #E6C15A;
  text-shadow: 0 0 14px rgba(230,193,90,.5);
  margin-top: var(--space-1);
}
.cart-item-remove {
  opacity: 0;
  transition: opacity var(--transition-fast);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(160,190,255,.35);
  color: #fff;
  font-size: 0.7rem;
  cursor: pointer;
}
.cart-item:hover .cart-item-remove { opacity: 1; }
.cart-item-remove:hover { background: var(--color-red); color: #fff; border-color: var(--color-red); }

/* Touch devices: always show remove button */
@media (hover: none) {
  .cart-item-remove { opacity: 1; width: 36px; height: 36px; }
}

/* ── Empty state ── */
.cart-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-8);
  text-align: center;
  color: rgba(255,255,255,.75);
}
.cart-empty[hidden] { display: none; }
.cart-empty-icon { font-size: 3rem; }
.cart-empty p { font-family: var(--font-heading); font-weight: 600; font-size: var(--text-base); }
.cart-empty-sub { color: rgba(255,255,255,.5); font-weight: 400; font-size: var(--text-sm); }

/* ── Footer ── */
.cart-footer {
  padding: var(--space-5) var(--space-6);
  border-top: 1px solid rgba(160,190,255,.16);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex-shrink: 0;
  background: transparent;
}
.cart-footer[hidden] { display: none; }

/* Subtotal / Discount rows */
.cart-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-lg);
  color: #B9CBF2;
}

/* Total row — white label, gold gradient value, top rule */
.cart-footer .cart-subtotal:has(#cart-total) {
  border-top: 1px solid rgba(160,190,255,.22);
  padding-top: var(--space-3);
  color: #fff;
}
#cart-total {
  background: linear-gradient(100deg, #F5DFA0, #E6C15A 45%, #C8963E);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 12px rgba(230,193,90,.45));
  color: transparent !important; /* override inline style="color:var(--color-gold)" */
}

.cart-php-equiv {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: rgba(185,203,242,.7);
  text-align: right;
}

/* ── Promo ── */
.cart-promo {
  display: flex;
  gap: var(--space-2);
}
.cart-promo .form-input {
  flex: 1;
  font-size: var(--text-sm);
  padding: 0.6em 0.8em;
  background: rgba(6,13,30,.65);
  border: 1px solid rgba(160,190,255,.32);
  color: #fff;
}
.cart-promo .form-input::placeholder { color: rgba(185,203,242,.45); }
#promo-apply {
  background: rgba(255,255,255,.07);
  border: 1px solid #E6C15A;
  color: #E6C15A;
  padding: 0.6em 1em;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-family: var(--font-heading);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
}
#promo-apply:hover { background: rgba(230,193,90,.15); }

.cart-promo-msg {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  min-height: 20px;
}
.cart-promo-msg.success { color: var(--color-success); }
.cart-promo-msg.error   { color: var(--color-red); }

/* ── Trust badges ── */
.cart-trust {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  padding: var(--space-3) 0;
  border-top: 1px solid rgba(160,190,255,.22);
  border-bottom: 1px solid rgba(160,190,255,.22);
}
.cart-trust span {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  color: rgba(185,203,242,.8);
}

/* ── Checkout CTA — polished metal gold ── */
#cart-checkout {
  background: linear-gradient(180deg,
    #F9E7A8 0%, #E6C15A 18%, #B5852A 42%,
    #8F6A1C 50%, #C89A38 62%, #F2D488 84%, #D9AD4B 100%);
  color: #241A05;
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
  box-shadow:
    0 14px 30px -8px rgba(0,0,0,.75),
    inset 0 1px 1px rgba(255,255,255,.75),
    inset 0 -2px 4px rgba(90,60,10,.45);
  border: none;
  position: relative;
  overflow: hidden;
}
/* Light sweep — skewed strip animating left→right every 3.2s */
#cart-checkout::after {
  content: '';
  position: absolute;
  top: -60%;
  left: -40%;
  width: 28%;
  height: 220%;
  background: rgba(255,255,255,.38);
  transform: skewX(-18deg) translateX(-100%);
  animation: cart-sweep 3.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes cart-sweep {
  0%,  8% { transform: skewX(-18deg) translateX(-100%); }
  38%      { transform: skewX(-18deg) translateX(520%);  }
  100%     { transform: skewX(-18deg) translateX(520%);  }
}
@media (prefers-reduced-motion: reduce) {
  #cart-checkout::after { animation: none; }
}

/* ── Continue shopping ── */
#continue-shopping-btn {
  color: rgba(220,230,255,.65);
  text-decoration: underline;
  background: transparent;
  border: none;
}
#continue-shopping-btn:hover { color: rgba(220,230,255,.9); }

/* Video Modal */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}
.video-modal.open { opacity: 1; pointer-events: auto; }
.video-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 699;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}
.video-overlay.open { opacity: 1; pointer-events: auto; }

.video-modal-inner {
  position: relative;
  width: 100%;
  max-width: 800px;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16/9;
}
.video-modal-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}
.video-embed-wrap { width: 100%; height: 100%; }
.video-embed-wrap iframe { width: 100%; height: 100%; border: none; }

/* ── Phone cart fixes ──────────────────────────────────────────────────────────
   1) .cart-subtotal sets display:flex, which beat the [hidden] attribute → an empty "Discount" row showed
      with no promo. Respect [hidden] on every drawer row.
   2) Prices used the monospace font, whose full-width comma read as "₱1, 299" — use the heading font with
      tabular numerals and no letter-spacing for every ₱ amount in the drawer.
   3) Thumbnails are now the product's real card image (cart.js) — fill the 56px tile. */
.cart-sidebar [hidden] { display: none !important; }
.cart-item-price,
#cart-subtotal,
#cart-total,
#cart-discount,
.cart-php-equiv {
  font-family: var(--font-heading);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  word-spacing: 0;
}
.cart-item-icon { overflow: hidden; }
.cart-item-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
