/* ═══════════════════════════════════════════════════════════
   Faswell LIVE SHOPPING — Design System
   TikTok-style live shopping platform
   ═══════════════════════════════════════════════════════════ */

/* ─── CSS Variables ─── */
:root {
  --gold: #FFD700;
  --gold-dark: #C9A600;
  --gold-glow: rgba(255, 215, 0, 0.3);
  --red: #EE4D5B;
  --red-dark: #D43442;
  --red-glow: rgba(238, 77, 91, 0.3);
  --tiktok-pink: #FF0050;
  --green: #27AE60;
  --bg-dark: #000000;
  --bg-card: #FFFFFF;
  --bg-glass: rgba(0, 0, 0, 0.45);
  --bg-glass-light: rgba(255, 255, 255, 0.1);
  --bg-glass-white: rgba(255, 255, 255, 0.95);
  --text-white: #FFFFFF;
  --text-dark: #1A1A2E;
  --text-muted: #8E8E93;
  --text-gold: #E6C200;
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-light: 0 2px 12px rgba(0, 0, 0, 0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 50px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --z-video: 1;
  --z-overlay: 10;
  --z-header: 20;
  --z-chat: 15;
  --z-product: 25;
  --z-panel: 50;
  --z-modal: 100;
}

/* ─── Reset ─── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  background: var(--bg-dark);
  color: var(--text-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  -webkit-user-select: none;
}

/* ═══════════════════════════════════════════════════════════
   LIVE CONTAINER — Mobile-first, centered
   ═══════════════════════════════════════════════════════════ */
.live-container {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--bg-dark);
}

/* ═══════════════════════════════════════════════════════════
   VIDEO
   ═══════════════════════════════════════════════════════════ */
.video-wrapper {
  position: absolute;
  inset: 0;
  z-index: var(--z-video);
  background: linear-gradient(135deg, #0a0a1a 0%, #1a1a2e 50%, #16213e 100%);
}

.live-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-gradient-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
  z-index: 2;
  pointer-events: none;
}

.video-gradient-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 250px;
  background: linear-gradient(to top, rgba(0,0,0,0.75), transparent);
  z-index: 2;
  pointer-events: none;
}

.tap-area {
  position: absolute;
  inset: 80px 70px 220px 0;
  z-index: 3;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════
   HEARTS ANIMATION
   ═══════════════════════════════════════════════════════════ */
.hearts-container {
  position: absolute;
  bottom: 200px;
  right: 20px;
  width: 60px;
  height: 300px;
  z-index: var(--z-overlay);
  pointer-events: none;
  overflow: visible;
}

.floating-heart {
  position: absolute;
  bottom: 0;
  animation: floatHeart 3s ease-out forwards;
  font-size: 28px;
  opacity: 1;
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(255, 77, 106, 0.5));
}

@keyframes floatHeart {
  0% {
    transform: translateY(0) scale(0.5) rotate(0deg);
    opacity: 0;
  }
  10% {
    transform: translateY(-20px) scale(1.2) rotate(-5deg);
    opacity: 1;
  }
  30% {
    transform: translateY(-80px) scale(1) rotate(10deg);
    opacity: 1;
  }
  60% {
    transform: translateY(-180px) scale(0.9) rotate(-8deg);
    opacity: 0.7;
  }
  100% {
    transform: translateY(-320px) scale(0.4) rotate(15deg);
    opacity: 0;
  }
}

/* ═══════════════════════════════════════════════════════════
   HEADER OVERLAY
   ═══════════════════════════════════════════════════════════ */
.header-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 12px 12px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.host-info {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-full);
  padding: 4px 4px 4px 4px;
}

.host-avatar {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.host-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.host-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 0;
}

.host-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-white);
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.host-likes {
  font-size: 10px;
  color: #ccc;
  display: flex;
  align-items: center;
  gap: 2px;
}

.btn-follow {
  background: var(--tiktok-pink);
  color: var(--text-white);
  border: none;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.viewer-count {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-full);
}

.viewer-avatars {
  display: flex;
  align-items: center;
}

.v-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.5);
  margin-left: -8px;
}
.v-avatar:first-child {
  margin-left: 0;
}

.viewer-number {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-white);
}

.btn-close-live {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: none;
  color: var(--text-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text-white);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  border: 1px solid var(--border);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ═══════════════════════════════════════════════════════════
   SIDE ACTIONS (Like, Share, Fullscreen)
   ═══════════════════════════════════════════════════════════ */
.side-actions {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: var(--z-overlay);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.btn-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-white);
  cursor: pointer;
  transition: var(--transition);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.btn-side:hover {
  transform: scale(1.15);
}

.btn-side:active {
  transform: scale(0.9);
}

.btn-like svg {
  transition: var(--transition);
}

.btn-like.liked svg {
  fill: var(--red);
  stroke: var(--red);
  animation: heartBeat 0.4s ease;
}

@keyframes heartBeat {
  0% { transform: scale(1); }
  25% { transform: scale(1.3); }
  50% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.action-count {
  font-size: 11px;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════
   CHAT OVERLAY
   ═══════════════════════════════════════════════════════════ */
.chat-overlay {
  position: absolute;
  bottom: 180px;
  left: 0;
  right: 70px;
  max-height: 280px;
  z-index: var(--z-chat);
  pointer-events: none;
  overflow: hidden;
  padding: 0 12px;
  mask-image: linear-gradient(to bottom, transparent 0%, black 20%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 20%);
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: flex-end;
  min-height: 100%;
}

.chat-msg {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-lg);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  max-width: 85%;
  animation: msgSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  word-break: break-word;
  border: 1px solid rgba(255,255,255,0.06);
}

.chat-msg.ai-msg {
  background: linear-gradient(135deg, rgba(230, 194, 0, 0.2), rgba(255, 215, 0, 0.1));
  border: 1px solid rgba(255, 215, 0, 0.25);
}

.chat-msg-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
  flex-shrink: 0;
}

.chat-msg.ai-msg .chat-msg-name {
  color: var(--gold);
}

.chat-msg-text {
  font-size: 13px;
  color: var(--text-white);
  line-height: 1.4;
}

@keyframes msgSlideIn {
  from {
    opacity: 0;
    transform: translateX(-30px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* ═══════════════════════════════════════════════════════════
   PRODUCT PIN BAR
   ═══════════════════════════════════════════════════════════ */
.product-pin {
  position: absolute;
  bottom: 60px; /* Above the bottom bar */
  left: 12px;
  right: 12px;
  z-index: var(--z-product);
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-pin-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 8px 10px;
  box-shadow: var(--shadow);
}

.product-pin-image-wrapper {
  position: relative;
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #f0f0f0;
}

.product-pin-image {
  width: 100%;
  height: 100%;
}

.product-pin-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pin-order {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 10px;
  font-weight: bold;
  padding: 1px 4px;
  border-radius: 4px;
}

.product-pin-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pin-title {
  font-size: 12px;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mall-badge {
  background: #000;
  color: #fff;
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 2px;
  margin-right: 4px;
}

.pin-tags {
  font-size: 10px;
  color: #27ae60;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tag-shipping {
  font-weight: 500;
}

.tag-discount {
  color: var(--tiktok-pink);
}

.pin-promo {
  font-size: 10px;
  color: #888;
}

.product-pin-price {
  display: flex;
  align-items: center;
  gap: 4px;
}

.price-sale {
  font-size: 15px;
  font-weight: 700;
  color: #000;
}

.price-original {
  font-size: 10px;
  color: #999;
  text-decoration: line-through;
}

.price-discount-badge {
  font-size: 10px;
  color: var(--tiktok-pink);
  font-weight: 600;
}

.product-pin-action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  height: 60px;
  flex-shrink: 0;
}

.pin-close-small {
  background: transparent;
  border: none;
  color: #999;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  margin-right: -4px;
}

.btn-buy-pin {
  background: var(--tiktok-pink);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════
   BOTTOM BAR
   ═══════════════════════════════════════════════════════════ */
.bottom-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-product);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.btn-shopping-bag {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--gold);
  color: var(--text-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
  box-shadow: 0 0 16px var(--gold-glow), 0 4px 12px rgba(0,0,0,0.3);
}

.btn-shopping-bag:hover {
  transform: scale(1.1);
  box-shadow: 0 0 24px var(--gold-glow), 0 4px 16px rgba(0,0,0,0.4);
}

.btn-shopping-bag:active {
  transform: scale(0.9);
}

.btn-shopping-bag.bounce {
  animation: bagBounce 0.6s ease;
}

@keyframes bagBounce {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.25) rotate(-5deg); }
  50% { transform: scale(0.9) rotate(3deg); }
  75% { transform: scale(1.1); }
}

.bag-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--red);
  color: white;
  font-size: 10px;
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-dark);
  animation: badgePop 0.3s ease;
}

@keyframes badgePop {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

.chat-input-wrapper {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 4px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-full);
  padding: 8px 12px;
}

.chat-input-name {
  display: none;
}

.chat-input-msg {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-white);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  min-width: 0;
}

.chat-input-msg::placeholder {
  color: rgba(255,255,255,0.7);
  font-weight: 500;
}

.bottom-right-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-action-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.btn-action-icon:hover {
  background: rgba(255,255,255,0.1);
}

.btn-volume {
  /* Inherits from btn-action-icon now */
}

/* ═══════════════════════════════════════════════════════════
   PURCHASE NOTIFICATION TOAST
   ═══════════════════════════════════════════════════════════ */
.purchase-toast {
  position: absolute;
  top: 80px;
  left: 12px;
  right: 12px;
  z-index: var(--z-header);
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(0,0,0,0.6));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  border: 1px solid rgba(255, 215, 0, 0.2);
  animation: toastSlide 0.4s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.toast-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.toast-text {
  font-size: 12px;
  color: var(--text-white);
  line-height: 1.4;
}

.toast-text span {
  font-weight: 700;
  color: var(--gold);
}

@keyframes toastSlide {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══════════════════════════════════════════════════════════
   PANELS (Products, Detail, Checkout)
   ═══════════════════════════════════════════════════════════ */
.panel {
  position: absolute;
  inset: 0;
  z-index: var(--z-panel);
  display: flex;
  align-items: flex-end;
}

.panel-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.panel-sheet {
  position: relative;
  width: 100%;
  max-height: 65vh;
  background: var(--bg-card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow-y: auto;
  animation: sheetUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-dark);
  -webkit-overflow-scrolling: touch;
}

.panel-sheet-full {
  max-height: 85vh;
}

@keyframes sheetUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.panel-handle {
  width: 36px;
  height: 4px;
  background: #D1D1D6;
  border-radius: 2px;
  margin: 10px auto 0;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid #F0F0F0;
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 2;
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
  flex: 1;
}

.panel-flash-badge {
  background: var(--red);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  animation: flashPulse 2s infinite;
}

.panel-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #F0F0F0;
  color: var(--text-dark);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.panel-close:hover {
  background: #E0E0E0;
}

/* ─── Product List ─── */
.product-list {
  padding: 8px 0;
}

.product-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #F5F5F5;
  cursor: pointer;
  transition: var(--transition);
}

.product-item:hover {
  background: #FAFAFA;
}

.product-item:active {
  background: #F0F0F0;
}

.product-item-img {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: #1a1a2e;
}

.product-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-item-info {
  flex: 1;
  min-width: 0;
}

.product-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 4px;
  line-height: 1.3;
}

.product-item-badges {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.badge-flash {
  font-size: 10px;
  color: var(--red);
  font-weight: 600;
}

.badge-shipping {
  font-size: 10px;
  color: var(--text-muted);
}

.product-item-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-price-sale {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-dark);
}

.product-price-original {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: line-through;
}

.product-discount {
  font-size: 11px;
  color: var(--red);
  font-weight: 700;
}

.product-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-add-item {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #E0E0E0;
  background: white;
  color: var(--text-dark);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-add-item:hover {
  border-color: var(--red);
  color: var(--red);
}

.btn-buy-item {
  background: var(--red);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-buy-item:hover {
  background: var(--red-dark);
  transform: scale(1.05);
}

.btn-buy-item:active {
  transform: scale(0.95);
}

/* ═══════════════════════════════════════════════════════════
   PRODUCT DETAIL PANEL
   ═══════════════════════════════════════════════════════════ */
.detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #F0F0F0;
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 2;
}

.detail-shop-name {
  font-size: 14px;
  font-weight: 600;
  flex: 1;
}

.detail-flash-timer {
  font-size: 11px;
  background: var(--red);
  color: white;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.detail-cart-icon,
.detail-share-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-tabs {
  display: flex;
  border-bottom: 1px solid #F0F0F0;
  position: sticky;
  top: 56px;
  background: var(--bg-card);
  z-index: 2;
}

.tab {
  flex: 1;
  padding: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}

.tab.active {
  color: var(--text-dark);
  font-weight: 700;
  border-bottom-color: var(--text-dark);
}

.detail-body {
  padding-bottom: 80px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.detail-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: #F8F8F8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.detail-category {
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 32px;
  font-weight: 900;
  color: #DDD;
  letter-spacing: 12px;
  text-transform: uppercase;
  z-index: 1;
}

.detail-image {
  width: 70%;
  height: 70%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.detail-image-count {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0,0,0,0.5);
  color: white;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.detail-badges {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  flex-wrap: wrap;
}

.detail-badge {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  border: none;
  cursor: default;
}

.detail-badge.green {
  background: #E8F5E9;
  color: #2E7D32;
}

.detail-badge.red {
  background: #FFEBEE;
  color: #C62828;
}

.detail-badge.outline {
  background: transparent;
  border: 1px solid #DDD;
  color: var(--text-dark);
}

.detail-sale-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #D44000, #FF6B35);
  color: white;
  padding: 12px 16px;
  margin: 0 16px;
  border-radius: var(--radius-sm);
}

.sale-banner-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sale-discount {
  background: var(--gold);
  color: var(--text-dark);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
}

.sale-price {
  font-size: 22px;
  font-weight: 800;
}

.sale-original {
  font-size: 13px;
  text-decoration: line-through;
  opacity: 0.7;
}

.sale-banner-right {
  text-align: right;
  font-size: 12px;
}

.sale-countdown {
  display: block;
  font-size: 16px;
  font-weight: 700;
}

.detail-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
}

.detail-price-red {
  font-size: 20px;
  font-weight: 800;
  color: var(--red);
}

.detail-price-strike {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: line-through;
}

.detail-discount-tag {
  font-size: 11px;
  color: var(--red);
  font-weight: 700;
  background: #FFF0F0;
  padding: 2px 8px;
  border-radius: 4px;
}

.detail-desc {
  padding: 0 16px 12px;
  font-size: 13px;
  color: var(--text-dark);
  line-height: 1.5;
}

.detail-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.detail-rating .star {
  font-size: 14px;
}

.detail-rating .separator {
  color: #DDD;
}

/* ─── Reviews Tab ─── */
.reviews-summary {
  text-align: center;
  padding: 24px 16px;
  border-bottom: 1px solid #F0F0F0;
}

.review-score {
  font-size: 48px;
  font-weight: 800;
  color: var(--text-dark);
}

.review-stars {
  font-size: 18px;
  margin: 4px 0;
}

.review-count {
  font-size: 13px;
  color: var(--text-muted);
}

.reviews-list {
  padding: 12px 16px;
}

.review-item {
  padding: 12px 0;
  border-bottom: 1px solid #F5F5F5;
}

.review-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.review-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #F0F0F0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.review-name {
  font-size: 12px;
  font-weight: 600;
}

.review-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

.review-stars-small {
  font-size: 11px;
  color: #FFC107;
  margin-bottom: 4px;
}

.review-text {
  font-size: 13px;
  color: #555;
  line-height: 1.4;
}

/* ─── Description Tab ─── */
.desc-full {
  padding: 16px;
  font-size: 13px;
  line-height: 1.6;
  color: #555;
}

.desc-full h3 {
  font-size: 15px;
  color: var(--text-dark);
  margin: 16px 0 8px;
}

.desc-full ul {
  padding-left: 20px;
  margin: 8px 0;
}

.desc-full li {
  margin-bottom: 4px;
}

/* ─── Detail Bottom Actions ─── */
.detail-bottom-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: stretch;
  background: var(--bg-card);
  border-top: 1px solid #F0F0F0;
  z-index: 3;
}

.detail-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 10px;
  background: none;
  border: none;
  border-right: 1px solid #F0F0F0;
  color: var(--text-dark);
  font-size: 10px;
  cursor: pointer;
  transition: var(--transition);
  min-width: 55px;
}

.detail-action-btn:hover {
  background: #FAFAFA;
}

.btn-buy-now {
  flex: 1;
  background: var(--red);
  color: white;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-buy-now:hover {
  background: var(--red-dark);
}

/* ═══════════════════════════════════════════════════════════
   CHECKOUT PANEL
   ═══════════════════════════════════════════════════════════ */
.checkout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #F0F0F0;
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 2;
}

.checkout-header h2 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-dark);
}

.checkout-body {
  padding: 16px;
  padding-bottom: 40px;
}

.checkout-order-summary {
  background: #FAFAF8;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  border: 1px solid #F0EDE8;
}

.order-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.order-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.btn-change-package {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold-dark);
  background: none;
  border: none;
  cursor: pointer;
  letter-spacing: 1px;
}

.order-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.order-item-img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: #1a1a2e;
}

.order-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.order-item-info {
  flex: 1;
}

.order-item-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.order-item-price {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.order-original {
  text-decoration: line-through;
}

.order-sale {
  font-weight: 700;
  color: var(--text-dark);
}

.order-item-total {
  font-size: 20px;
  font-weight: 800;
  color: var(--red);
  flex-shrink: 0;
}

/* ─── Quantity Control ─── */
.checkout-quantity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid #F0F0F0;
  margin-bottom: 20px;
}

.checkout-quantity label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid #DDD;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.qty-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: #FAFAFA;
  color: var(--text-dark);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.qty-btn:hover {
  background: #F0F0F0;
}

.qty-value {
  width: 40px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  border-left: 1px solid #DDD;
  border-right: 1px solid #DDD;
  padding: 6px 0;
}

/* ─── Checkout Form ─── */
.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
}

.section-label {
  font-size: 15px !important;
  font-weight: 700 !important;
  margin-top: 8px;
}

.required {
  color: var(--red);
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 12px 14px;
  border: 1px solid #E0E0E0;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  color: var(--text-dark);
  background: #FAFAFA;
  transition: var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
  background: white;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-group.half {
  flex: 1;
}

/* ─── Payment Options ─── */
.payment-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.payment-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #E0E0E0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
}

.payment-option:has(input:checked) {
  border-color: var(--gold);
  background: rgba(255, 215, 0, 0.05);
}

.payment-option input[type="radio"] {
  display: none;
}

.payment-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #CCC;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.payment-option:has(input:checked) .payment-radio {
  border-color: var(--gold);
}

.payment-option:has(input:checked) .payment-radio::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
}

/* ─── Checkout Total ─── */
.checkout-total-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #F0F0F0;
}

.checkout-line {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 6px 0;
  color: var(--text-muted);
}

.discount-line span:last-child {
  color: var(--green);
  font-weight: 600;
}

.total-line {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-dark);
  border-top: 1px solid #DDD;
  margin-top: 8px;
  padding-top: 12px;
}

.btn-checkout-pay {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--red), #FF6B81);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 20px;
  letter-spacing: 1px;
  box-shadow: 0 4px 16px var(--red-glow);
}

.btn-checkout-pay:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--red-glow);
}

.btn-checkout-pay:active {
  transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════
   SUCCESS MODAL
   ═══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: absolute;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.success-modal {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  animation: modalPop 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow);
  overflow: hidden;
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.success-icon {
  font-size: 56px;
  margin-bottom: 12px;
  animation: successBounce 0.6s ease 0.3s;
}

@keyframes successBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

.success-modal h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.success-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.success-details {
  text-align: left;
  background: #FAFAF8;
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 20px;
}

.success-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #F0F0F0;
  font-size: 12px;
  color: var(--text-muted);
}

.success-row:last-child {
  border-bottom: none;
}

.success-value {
  font-weight: 700;
  color: var(--text-dark);
  font-size: 12px;
}

.success-value.highlight {
  color: var(--red);
  font-size: 14px;
}

.status-paid {
  color: var(--green) !important;
}

.btn-success-close {
  width: 100%;
  padding: 14px;
  background: var(--text-dark);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-success-close:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* ─── Confetti ─── */
.success-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  top: -10px;
  animation: confettiFall 3s ease-in forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(-10px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(400px) rotate(720deg);
    opacity: 0;
  }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE / DESKTOP
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 481px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0a;
  }

  .live-container {
    height: 100vh;
    border-radius: 0;
    box-shadow: 0 0 60px rgba(0,0,0,0.5);
  }
}

/* ═══════════════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════════════ */
.panel-sheet::-webkit-scrollbar,
.checkout-body::-webkit-scrollbar {
  width: 4px;
}

.panel-sheet::-webkit-scrollbar-track,
.checkout-body::-webkit-scrollbar-track {
  background: transparent;
}

.panel-sheet::-webkit-scrollbar-thumb,
.checkout-body::-webkit-scrollbar-thumb {
  background: #DDD;
  border-radius: 2px;
}

/* ═══════════════════════════════════════════════════════════
   VIDEO PLACEHOLDER (when no video loaded)
   ═══════════════════════════════════════════════════════════ */
.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
  color: rgba(255,255,255,0.3);
  gap: 12px;
}

.video-placeholder-icon {
  font-size: 64px;
  animation: placeholderPulse 2s ease infinite;
}

@keyframes placeholderPulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.05); }
}

.video-placeholder-text {
  font-size: 14px;
  text-align: center;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════
   ANIMATED BACKGROUND (when no video)
   ═══════════════════════════════════════════════════════════ */
.animated-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.animated-bg::before {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  background: conic-gradient(from 0deg, #1a1a2e, #16213e, #0f3460, #1a1a2e, #16213e);
  animation: bgRotate 20s linear infinite;
}

@keyframes bgRotate {
  to { transform: rotate(360deg); }
}

.animated-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.7) 100%);
}
