/* ═══════════════════════════════════════════════════════════════
   VividHome — Component Styles (Cart Drawer, Back-to-Top, Cookie)
   Design system: #1A1A1A headings, #4A4A4A body, #8A8A8A muted,
   #E5E2DD borders, #F5F0EB bg, DM Sans body
   ═══════════════════════════════════════════════════════════════ */

/* ── Cart Drawer Overlay ── */
.vh-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,26,26,0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 9990;
  opacity: 0;
  pointer-events: none;
}

/* ── Cart Drawer Panel ── */
.vh-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 100vw;
  height: 100%;
  z-index: 9991;
  background: #fff;
  box-shadow: -4px 0 32px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  transform: translate3d(100%, 0, 0);
}

/* ── Drawer Header ── */
.vh-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #E5E2DD;
  flex-shrink: 0;
}
.vh-drawer-title {
  font-family: 'Onest', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #1A1A1A;
  display: flex;
  align-items: center;
  gap: 8px;
}
.vh-drawer-title svg { width: 20px; height: 20px; color: #1A1A1A; }
.vh-drawer-count {
  font-size: 12px;
  font-weight: 600;
  color: #8A8A8A;
}

.vh-drawer-close {
  width: 36px;
  height: 36px;
  border: none;
  background: #F5F0EB;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  color: #4A4A4A;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  line-height: 1;
}
.vh-drawer-close:hover { background: #E5E2DD; color: #1A1A1A; }

/* ── Free Shipping Progress Bar ── */
.vh-drawer-shipping {
  padding: 14px 24px;
  border-bottom: 1px solid #E5E2DD;
  flex-shrink: 0;
  background: #FAF9F7;
}
.vh-drawer-shipping-text {
  font-family: 'Onest', system-ui, sans-serif;
  font-size: 12px;
  color: #4A4A4A;
  margin-bottom: 8px;
  text-align: center;
  line-height: 1.4;
}
.vh-drawer-shipping-text strong { color: #1A1A1A; font-weight: 700; }
.vh-drawer-shipping-text.is-free { color: #059669; }
.vh-drawer-shipping-text.is-free strong { color: #059669; }

.vh-drawer-ship-bar {
  height: 4px;
  background: #E5E2DD;
  border-radius: 4px;
  overflow: hidden;
}
.vh-drawer-ship-fill {
  height: 100%;
  background: #1A1A1A;
  border-radius: 4px;
  transition: width 0.4s ease, background 0.3s ease;
  width: 0;
}
.vh-drawer-ship-fill.is-full { background: #059669; }

/* ── Drawer Items ── */
.vh-drawer-items {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}
.vh-drawer-items::-webkit-scrollbar { width: 4px; }
.vh-drawer-items::-webkit-scrollbar-track { background: transparent; }
.vh-drawer-items::-webkit-scrollbar-thumb { background: #E5E2DD; border-radius: 4px; }

.vh-drawer-empty {
  padding: 60px 24px;
  text-align: center;
  color: #8A8A8A;
  font-family: 'Onest', system-ui, sans-serif;
  font-size: 14px;
}

/* ── Single Cart Item ── */
.vh-drawer-item {
  display: flex;
  gap: 14px;
  padding: 16px 24px;
  border-bottom: 1px solid #F0EDE8;
  position: relative;
  transition: background 0.15s;
}
.vh-drawer-item:last-child { border-bottom: none; }
.vh-drawer-item:hover { background: #FAF9F7; }

.vh-drawer-item-thumb {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #E5E2DD;
  flex-shrink: 0;
}

.vh-drawer-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vh-drawer-item-name {
  font-family: 'Onest', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #1A1A1A;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.vh-drawer-item-name a {
  color: inherit;
  text-decoration: none;
}
.vh-drawer-item-name a:hover { text-decoration: underline; }

.vh-drawer-item-variant {
  font-family: 'Onest', system-ui, sans-serif;
  font-size: 11px;
  color: #8A8A8A;
}

/* Qty controls inline */
.vh-drawer-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 4px;
}

.vh-drawer-qty {
  display: flex;
  align-items: center;
  border: 1.5px solid #E5E2DD;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  height: 30px;
}

.vh-drawer-qty-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #4A4A4A;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  padding: 0;
  font-family: 'Onest', system-ui, sans-serif;
}
.vh-drawer-qty-btn:hover { background: #F5F0EB; color: #1A1A1A; }

.vh-drawer-qty-val {
  width: 32px;
  text-align: center;
  font-family: 'Onest', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #1A1A1A;
  border-left: 1.5px solid #E5E2DD;
  border-right: 1.5px solid #E5E2DD;
  line-height: 28px;
}

.vh-drawer-item-price {
  font-family: 'Onest', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #1A1A1A;
  white-space: nowrap;
}

/* Remove button */
.vh-drawer-item-remove {
  position: absolute;
  top: 12px;
  right: 20px;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #B0B0B0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  padding: 0;
}
.vh-drawer-item-remove:hover { color: #1A1A1A; background: #F5F0EB; }
.vh-drawer-item-remove svg { width: 14px; height: 14px; }

/* ── Cart drawer promo block (trust ticker + shipping urgency + progress) ──
 * Reuses the EXACT same .trust-ticker / .shipping-urgency / .shipping-progress
 * classes from the product sidebar so the visuals are identical.
 * Class definitions live in product-page-shared.css (loaded globally below).
 */
.vh-drawer-promo {
  flex-shrink: 0;
  padding: 12px 24px 16px;
  background: #FFFFFF;
}
.vh-drawer-promo .trust-ticker      { margin-bottom: 12px; }
.vh-drawer-promo .shipping-urgency  { margin-bottom: 12px; }
.vh-drawer-promo .shipping-progress { margin-bottom: 0;    }


/* ═══════════════════════════════════════════════════════════════════════
   PRODUCT-SIDEBAR PROMO BLOCKS — shared between product page and cart drawer
   1:1 port from page-product.css so the cart drawer can reuse them.
   ═══════════════════════════════════════════════════════════════════════ */

@keyframes vh-ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.trust-ticker {
  overflow: hidden;
  padding: 10px 0;
  border-top: 1px solid var(--vh-sand, #E5E2DD);
  border-bottom: 1px solid var(--vh-sand, #E5E2DD);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.trust-ticker__track {
  display: flex;
  align-items: center;
  gap: 0;
  width: max-content;
  animation: vh-ticker-scroll 12s linear infinite;
}
.trust-ticker:hover .trust-ticker__track {
  animation-play-state: paused;
}
.trust-ticker__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-family: var(--vh-font-body, 'Onest', system-ui, sans-serif);
  font-size: var(--vh-text-xs, 12px);
  font-weight: 500;
  color: var(--vh-charcoal, #4A4A4A);
  letter-spacing: 0.01em;
}
.trust-ticker__item svg {
  flex-shrink: 0;
  color: var(--vivid-purple, #7B2D8E);
}
.trust-ticker__sep {
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  font-size: 10px;
  background: var(--vivid-gradient-main, linear-gradient(135deg, #1B3A8C, #7B2D8E, #D41B6B));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.shipping-urgency {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(27,58,140,0.04), rgba(123,45,142,0.06), rgba(212,27,107,0.04));
  border: 1px solid rgba(123,45,142,0.10);
  font-family: var(--vh-font-body, 'Onest', system-ui, sans-serif);
  font-size: var(--vh-text-xs, 12px);
  color: var(--vh-charcoal, #4A4A4A);
  line-height: 1;
}
.shipping-urgency__ship,
.shipping-urgency__countdown {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  justify-content: center;
}
.shipping-urgency__text {
  line-height: 1.4;
  text-align: center;
}
.shipping-urgency__text strong {
  display: inline-block;
  font-size: 1.05em;
}
.shipping-urgency__ship svg,
.shipping-urgency__countdown svg {
  flex-shrink: 0;
  color: var(--vivid-purple, #7B2D8E);
}
.shipping-urgency__ship strong {
  font-weight: 700;
  color: var(--vh-ink, #1A1A1A);
}
.shipping-urgency__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--vivid-purple, #7B2D8E);
  opacity: 0.4;
  flex-shrink: 0;
}

@keyframes vh-countdown-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}
.countdown-value {
  display: inline-block;
  font-weight: 700;
  background: var(--vivid-gradient-main, linear-gradient(135deg, #1B3A8C, #7B2D8E, #D41B6B));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: vh-countdown-pulse 2s ease-in-out infinite;
}

.shipping-progress {
  background: var(--vh-linen, #F5F0EB);
  border-radius: var(--vh-radius-md, 12px);
  padding: 12px 16px;
}
.shipping-progress-text {
  font-family: var(--vh-font-body, 'Onest', system-ui, sans-serif);
  font-size: var(--vh-text-sm, 13px);
  color: var(--vh-charcoal, #4A4A4A);
  margin-bottom: 8px;
  line-height: 1.5;
  text-align: center;
  transition: opacity 0.3s ease;
}
.shipping-progress-text strong {
  font-weight: 700;
  display: inline-block;
  background: var(--vivid-gradient-main, linear-gradient(135deg, #1B3A8C, #7B2D8E, #D41B6B));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.shipping-progress-bar {
  height: 4px;
  background: var(--vh-sand, #E5E2DD);
  border-radius: var(--vh-radius-full, 9999px);
  overflow: hidden;
}
.shipping-progress-fill {
  height: 100%;
  background: var(--vivid-gradient-main, linear-gradient(135deg, #1B3A8C, #7B2D8E, #D41B6B));
  border-radius: var(--vh-radius-full, 9999px);
  transition: width 0.6s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: width;
}
.shipping-free-icon {
  display: inline-block;
  font-size: 1.4em;
  vertical-align: middle;
  animation: shipping-celebrate 2s ease infinite;
}
@keyframes shipping-celebrate {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25%      { transform: scale(1.25) rotate(-10deg); }
  50%      { transform: scale(1.3)  rotate(8deg); }
  75%      { transform: scale(1.25) rotate(-5deg); }
}


/* ── Drawer Footer ── */
.vh-drawer-foot {
  padding: 20px 24px;
  border-top: 2px solid #E5E2DD;
  flex-shrink: 0;
  background: #FAF9F7;
}

.vh-drawer-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.vh-drawer-subtotal-label {
  font-family: 'Onest', system-ui, sans-serif;
  font-size: 13px;
  color: #8A8A8A;
}
.vh-drawer-subtotal-val {
  font-family: 'Onest', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #1A1A1A;
}

.vh-drawer-tax-note {
  font-family: 'Onest', system-ui, sans-serif;
  font-size: 11px;
  color: #B0B0B0;
  margin-bottom: 16px;
}

.vh-drawer-btn-checkout {
  display: block;
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 8px;
  background: #1A1A1A;
  color: #fff;
  font-family: 'Onest', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.2s, transform 0.15s;
  margin-bottom: 10px;
}
.vh-drawer-btn-checkout:hover { background: #333; transform: translateY(-1px); }

.vh-drawer-btn-continue {
  display: block;
  width: 100%;
  height: 40px;
  border: 1.5px solid #E5E2DD;
  border-radius: 8px;
  background: transparent;
  color: #4A4A4A;
  font-family: 'Onest', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.vh-drawer-btn-continue:hover { border-color: #1A1A1A; color: #1A1A1A; }

@media (max-width: 440px) {
  .vh-drawer { width: 100vw; }
  .vh-drawer-item-thumb { width: 60px; height: 60px; }
}

/* ── Back-to-Top Button ── */
.vh-btt {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: #1A1A1A;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 490;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s;
}
.vh-btt.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.vh-btt:hover { transform: translateY(-3px) !important; background: #333; box-shadow: 0 6px 24px rgba(0,0,0,0.25); }
.vh-btt svg { width: 20px; height: 20px; }

@media (max-width: 1023px) {
  .vh-btt { bottom: 80px; }
}

/* ── Cookie Banner ── */
.vh-cookie {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9980;
  background: rgba(26,26,26,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 18px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,0.06);
  animation: vh-ck-slide-in 0.4s ease both;
}
@keyframes vh-ck-slide-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
.vh-cookie.is-hiding { animation: vh-ck-slide-out 0.35s ease forwards; }
@keyframes vh-ck-slide-out { to { transform: translateY(100%); } }

.vh-cookie-text {
  flex: 1;
  min-width: 200px;
  font-family: 'Onest', system-ui, sans-serif;
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  line-height: 1.55;
}
.vh-cookie-text a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.vh-cookie-btns { display: flex; gap: 10px; flex-shrink: 0; }

.vh-ck-accept {
  padding: 10px 22px;
  border: none;
  border-radius: 8px;
  background: #fff;
  color: #1A1A1A;
  font-family: 'Onest', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.vh-ck-accept:hover { opacity: 0.9; }

.vh-ck-manage {
  padding: 10px 20px;
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  background: transparent;
  color: rgba(255,255,255,0.85);
  font-family: 'Onest', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s;
}
.vh-ck-manage:hover { border-color: #fff; color: #fff; }
