/* ============================================================
   ONE PIECE THEME OVERRIDE
   وضع نهاري: خريطة كنز ذهبية / بيج دافئ
   وضع ليلي (body.dark): بحر ليلي داكن / جمجمة القراصنة
   ============================================================ */

/* ───── الوضع النهاري (Light — خريطة الكنز) ───── */
:root {
  --bg: #f5ede0;
  --surface: #fffaf3;
  --surface-alt: #fef3e2;
  --border: #d4a84b55;
  --text: #1a0e02;
  --text-muted: #6b4f28;
  --primary: #b8730a;
  --primary-hover: #955d08;
  --primary-soft: rgba(184,115,10,0.14);
  --accent: #c0392b;
  --accent-soft: rgba(192,57,43,0.14);
  --danger: #c0392b;
  --danger-soft: rgba(192,57,43,0.12);
  --success: #1e7e34;
  --success-soft: rgba(30,126,52,0.13);
  --whatsapp: #1e7e34;
  --shadow-sm: 0 2px 8px rgba(80,40,0,0.12);
  --shadow-md: 0 10px 32px rgba(80,40,0,0.18);
  --radius: 16px;
  --radius-sm: 10px;
}

body:not(.dark) {
  background:
    linear-gradient(155deg, rgba(245,237,224,0.18) 0%, rgba(240,226,204,0.24) 100%),
    url('../assets/bg-onepiece.jpg') center / cover no-repeat fixed;
}

/* ───── الوضع الليلي (Dark — بحر القراصنة) ───── */
body.dark {
  --bg: #060c1a;
  --surface: #0d1424;
  --surface-alt: #131e35;
  --border: #1e3055;
  --text: #f5e6c8;
  --text-muted: #8aaac8;
  --primary: #c8960c;
  --primary-hover: #a8780a;
  --primary-soft: rgba(200,150,12,0.18);
  --accent: #dc2626;
  --accent-soft: rgba(220,38,38,0.18);
  --danger: #ef4444;
  --danger-soft: rgba(239,68,68,0.15);
  --success: #22c55e;
  --success-soft: rgba(34,197,94,0.14);
  --whatsapp: #16a34a;
  --shadow-sm: 0 2px 10px rgba(0,0,0,0.6);
  --shadow-md: 0 14px 40px rgba(0,0,0,0.75);

  background:
    linear-gradient(160deg, rgba(3,7,18,0.18) 0%, rgba(6,12,26,0.26) 100%),
    url('../assets/bg-onepiece.jpg') center / cover no-repeat fixed;
}

/* Video Background */
.bg-video {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

.app-shell {
  position: relative;
  z-index: 1;
}

body.has-video-bg {
  background: #060c1a !important;
}

/* Product images: stretch to fit */
.product-emoji {
  overflow: hidden;
  flex-shrink: 0;
}
.product-img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  border-radius: inherit;
  display: block;
}

/* ═══════════ SHARED ELEMENT OVERRIDES ═══════════ */

/* Topbar */
body:not(.dark) .topbar {
  background: linear-gradient(90deg, #fff8ee 0%, #fffaf3 50%, #fff8ee 100%);
  border-bottom: 2px solid #d4a84b88;
  box-shadow: 0 4px 16px rgba(180,120,0,0.1);
}
body.dark .topbar {
  background: linear-gradient(90deg, #0a1628 0%, #0d1424 50%, #0a1628 100%);
  border-bottom: 2px solid #c8960c55;
  box-shadow: 0 4px 20px rgba(200,150,12,0.12);
}

/* Store title gradient */
body:not(.dark) .brand h1 {
  background: linear-gradient(90deg, #7a3d00, #b8730a, #7a3d00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
body.dark .brand h1 {
  background: linear-gradient(90deg, #f5c518, #c8960c, #f5c518);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Sidebar */
body:not(.dark) .sidebar {
  background: linear-gradient(180deg, #fff8ee 0%, #fdf3e3 100%);
  border-left: 2px solid #d4a84b55;
}
body.dark .sidebar {
  background: linear-gradient(180deg, #0a1628 0%, #060e1c 100%);
  border-left: 2px solid #c8960c33;
}

body:not(.dark) .sidebar .nav-item.active {
  background: rgba(184,115,10,0.14);
  color: #7a3d00;
  border-right: 3px solid #b8730a;
}
body.dark .sidebar .nav-item.active {
  background: rgba(200,150,12,0.18);
  color: #f5c518;
  border-right: 3px solid #f5c518;
}

/* Category pills */
body:not(.dark) .cat-pill.active {
  background: linear-gradient(90deg, #b8730a, #955d08);
  border-color: #b8730a;
  color: #fff;
}
body.dark .cat-pill.active {
  background: linear-gradient(90deg, #c8960c, #a8780a);
  border-color: #c8960c;
  box-shadow: 0 0 12px rgba(200,150,12,0.4);
}

/* Product cards */
body:not(.dark) .product-card {
  background: linear-gradient(145deg, #fffaf3 0%, #fef6e9 100%);
  border: 1px solid #d4a84b44;
}
body:not(.dark) .product-card:hover {
  border-color: #b8730a;
  box-shadow: 0 4px 16px rgba(184,115,10,0.18);
}
body.dark .product-card {
  background: linear-gradient(145deg, #131e35 0%, #0d1424 100%);
  border: 1px solid #c8960c33;
}
body.dark .product-card:hover {
  border-color: #c8960c;
  box-shadow: 0 0 18px rgba(200,150,12,0.3);
}

/* Primary buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: #fff8ee;
  font-weight: 800;
}
body:not(.dark) .btn-primary { color: #fff; }
body.dark .btn-primary {
  color: #060c1a;
  box-shadow: 0 4px 14px rgba(200,150,12,0.4);
}

/* Cart panel */
body:not(.dark) .pos-cart {
  background: linear-gradient(180deg, #fffaf3 0%, #fef3e2 100%);
  border: 1px solid #d4a84b55;
}
body.dark .pos-cart {
  background: linear-gradient(180deg, #0d1424 0%, #090f1e 100%);
  border: 1px solid #c8960c33;
  box-shadow: -4px 0 24px rgba(0,0,0,0.5);
}

/* Price */
.price-tag { color: var(--primary); }
body.dark .price-tag { color: #f5c518; }
body.dark .total-row strong { color: #f5c518; }

/* Bottom nav */
body:not(.dark) .bottom-nav {
  background: linear-gradient(90deg, #fff8ee, #fffaf3, #fff8ee);
  border-top: 2px solid #d4a84b55;
}
body:not(.dark) .bottom-nav .nav-item.active { color: #7a3d00; }
body.dark .bottom-nav {
  background: linear-gradient(90deg, #0a1628, #0d1424, #0a1628);
  border-top: 2px solid #c8960c44;
}
body.dark .bottom-nav .nav-item.active { color: #f5c518; }

/* Modal */
body:not(.dark) .modal-box {
  background: linear-gradient(180deg, #fffaf3, #fef3e2);
  border: 1px solid #d4a84b66;
}
body.dark .modal-box {
  background: linear-gradient(180deg, #0d1424, #090f1e);
  border: 1px solid #c8960c55;
}

/* Inv/list rows */
body:not(.dark) .inv-row,
body:not(.dark) .list-row {
  background: linear-gradient(145deg, #fffaf3, #fef6e9);
  border-color: #d4a84b44;
}
body.dark .inv-row,
body.dark .list-row {
  background: linear-gradient(145deg, #131e35, #0d1424);
  border-color: #1e3055;
}

/* Stat cards */
body:not(.dark) .stat-card {
  background: linear-gradient(145deg, #fffaf3, #fef6e9);
  border-color: #d4a84b44;
}
body.dark .stat-card {
  background: linear-gradient(145deg, #131e35, #0d1424);
  border-color: #1e3055;
}

/* Toast */
body:not(.dark) .toast {
  background: linear-gradient(90deg, #2d1a00, #3d2200);
  color: #f5c518;
  border: 1px solid #d4a84b66;
}
body.dark .toast {
  background: linear-gradient(90deg, #0a1628, #0d1424);
  color: #f5c518;
  border: 1px solid #c8960c55;
}

/* Skull watermark */
.main-content::before {
  content: "☠";
  position: fixed;
  bottom: 10vh;
  right: 50%;
  transform: translateX(50%);
  font-size: 22vw;
  opacity: 0.04;
  pointer-events: none;
  color: var(--primary);
  z-index: 0;
  user-select: none;
}

/* Scrollbars */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary); opacity: 0.5; border-radius: 3px; }

/* Mobile adjustments */
@media (max-width: 520px) {
  .main-content::before { font-size: 55vw; }
}
