/* ============================================================
   BKMRK | BookMarks — Mijoz do'koni uslublari
   Zamonaviy "Aurora Glass" dizayn · 3D · animatsiya
   ============================================================ */
:root {
  --blue-900: #0b1e4b;
  --blue-800: #102a5e;
  --blue-700: #16357f;
  --blue-600: #1e40af;
  --blue-500: #2563eb;
  --blue-400: #3b82f6;
  --blue-300: #60a5fa;
  --blue-200: #93c5fd;
  --blue-100: #dbeafe;
  --blue-50: #eff6ff;
  --sky: #0ea5e9;
  --cyan: #22d3ee;
  --teal: #14b8a6;
  --violet: #6366f1;
  --white: #ffffff;
  --ink: #0b1220;
  --muted: #5b6b83;
  --border: #e6ecf6;
  --accent: #2563eb;
  --card: #ffffff;
  --navy: #0a1a44;
  --grad-primary: linear-gradient(135deg, #1d4ed8, #2563eb 45%, #0ea5e9);
  --grad-cyan: linear-gradient(135deg, #0ea5e9, #22d3ee);
  --grad-gold: linear-gradient(135deg, #f59e0b, #f97316);
  --shadow-soft: 0 18px 50px rgba(26, 60, 155, 0.10);
  --shadow-soft-sm: 0 8px 24px rgba(26, 60, 155, 0.08);
  --shadow-blue: 0 24px 70px rgba(37, 99, 235, 0.30);
  --shadow-glow: 0 0 0 1px rgba(37, 99, 235, 0.12), 0 20px 60px rgba(37, 99, 235, 0.22);
  --radius: 20px;
  --font: 'Manrope', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-display: 'Sora', 'Manrope', 'Segoe UI', sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-bounce: cubic-bezier(.2, .9, .3, 1.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 500px at 12% -8%, rgba(37, 99, 235, 0.10), transparent 60%),
    radial-gradient(900px 480px at 90% 8%, rgba(14, 165, 233, 0.10), transparent 55%),
    radial-gradient(800px 600px at 50% 110%, rgba(34, 211, 238, 0.08), transparent 60%),
    #f6f9ff;
  background-attachment: fixed;
  overflow-x: hidden;
  line-height: 1.6;
  padding-top: 69px;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 75%);
  pointer-events: none;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }

::selection { background: rgba(37, 99, 235, 0.2); color: var(--blue-900); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--blue-300), var(--sky));
  border-radius: 99px;
  border: 2px solid #f6f9ff;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--blue-500), var(--sky)); }

/* ---------- Scroll progress ---------- */
#scrollBar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: var(--grad-primary);
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.7);
  z-index: 1000;
  border-radius: 0 99px 99px 0;
}

/* ---------- Cursor glow ---------- */
#cursorGlow {
  position: fixed;
  top: 0; left: 0;
  width: 380px; height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.14), transparent 65%);
  pointer-events: none;
  z-index: 5;
  transform: translate(-50%, -50%);
  will-change: transform;
  display: none;
}
@media (hover: hover) and (pointer: fine) { #cursorGlow { display: block; } }

/* ---------- 3D scene helpers ---------- */
.perspective { perspective: 1200px; }
.preserve { transform-style: preserve-3d; }
.tilt-scene { perspective: 900px; }

/* ---------- Animated background ---------- */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
#particleCanvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .8;
}

.bg-orbs span {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .55;
  animation: floatOrb 20s ease-in-out infinite;
}
.bg-orbs span:nth-child(1) {
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.45), transparent 70%);
  top: -140px; left: -120px;
}
.bg-orbs span:nth-child(2) {
  width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.4), transparent 70%);
  top: 26%; right: -160px;
  animation-delay: -7s;
}
.bg-orbs span:nth-child(3) {
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.28), transparent 70%);
  bottom: -140px; left: 28%;
  animation-delay: -13s;
}
@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.1); }
  66% { transform: translate(-30px, 30px) scale(0.94); }
}

/* ---------- Header ---------- */
.header {
  position: fixed;
  top: 0;
  left: 0; right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid rgba(230, 236, 246, 0.8);
  transition: box-shadow .35s ease, background .35s ease;
}
.header.scrolled {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 34px rgba(20, 46, 120, 0.10);
}
.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 6px 24px;
  height: 63px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: padding .35s ease;
  flex-wrap: nowrap;
}
.header-inner .logo { overflow: visible; flex-shrink: 0; }
.header-inner .nav { flex-shrink: 0; }
.header-inner .hdr-actions { flex-shrink: 0; display: flex; align-items: center; gap: 9px; }
.header.scrolled .header-inner { padding: 6px 24px; }

.logo { display: flex; align-items: center; gap: 11px; font-weight: 800; position: relative; cursor: pointer; }
.logo .logo-3d {
  width: 140px; height: 140px;
  transform-style: preserve-3d;
  animation: logoSpin 9s linear infinite;
  filter: drop-shadow(0 8px 16px rgba(30, 64, 175, 0.35));
}
.logo .logo-3d img { width: 100%; height: 100%; border-radius: 15px; }
@keyframes logoSpin {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}
.logo-book-burst {
  position: absolute;
  width: 16px; height: 22px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 200;
  opacity: 0;
  animation: bookBurst .7s ease-out forwards;
}
@keyframes bookBurst {
  0% { opacity: 1; transform: translate(0,0) scale(1) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--bx), var(--by)) scale(0.3) rotate(var(--br)); }
}
.logo b { font-size: 22px; color: var(--blue-800); letter-spacing: -0.6px; font-family: var(--font-display); }
.logo b span {
  background: var(--grad-cyan);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a {
  padding: 8px 15px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--muted);
  position: relative;
  transition: color .3s ease, background .3s ease, transform .2s ease;
}
.nav a:hover { color: var(--blue-600); background: rgba(37, 99, 235, 0.08); transform: translateY(-1px); }
.nav a.active {
  color: #fff;
  background: var(--grad-primary);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.32);
}

/* Nav kategoriyalar qatori */
.nav-cats-toggle { position: relative; }
.nav-cats-toggle.active { color: #fff; background: var(--grad-primary); box-shadow: 0 8px 20px rgba(37, 99, 235, 0.32); }
.nav-cats-bar {
  position: fixed;
  top: 63px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(59, 130, 246, 0.08);
  box-shadow: 0 12px 40px rgba(8, 20, 55, 0.08);
  z-index: 99;
  overflow-x: auto;
  overflow-y: hidden;
  opacity: 0;
  max-height: 0;
  pointer-events: none;
  transition: .3s var(--ease-bounce);
}
.nav-cats-bar.open { opacity: 1; max-height: 52px; height: 52px; pointer-events: all; padding: 0 24px; }
.nav-cats-bar button {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--blue-800);
  cursor: pointer;
  transition: .25s;
  white-space: nowrap;
}
.nav-cats-bar button:hover { border-color: var(--blue-400); background: var(--blue-50); transform: translateY(-2px); }
.nav-cats-bar button.active { background: var(--grad-primary); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3); }
.nav-cats-bar button .nd-ico { font-size: 14px; }

/* Dark mode */
html[data-theme="dark"] .nav-cats-bar { background: rgba(15, 23, 42, 0.95); border-color: rgba(59, 130, 246, 0.1); }
html[data-theme="dark"] .nav-cats-bar button { color: #94a3b8; border-color: rgba(59, 130, 246, 0.15); background: rgba(30, 41, 59, 0.5); }
html[data-theme="dark"] .nav-cats-bar button:hover { border-color: rgba(59, 130, 246, 0.4); background: rgba(37, 99, 235, 0.15); color: #60a5fa; }

.search-box {
  position: relative;
  flex: 1 1 180px;
  max-width: 260px;
}
.search-box input {
  width: 100%;
  padding: 11px 42px 11px 18px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: rgba(255, 255, 255, 0.85);
  transition: .3s ease;
  box-shadow: inset 0 1px 3px rgba(20, 46, 120, 0.04);
}
.search-box input:focus {
  border-color: var(--blue-400);
  box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.14), inset 0 1px 3px rgba(20, 46, 120, 0.04);
}
.search-box .s-icon {
  position: absolute;
  right: 15px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search-dropdown {
  position: fixed;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.12);
  max-height: 400px;
  overflow-y: auto;
  display: none;
  z-index: 9999;
  backdrop-filter: blur(12px);
}
.search-dropdown.open { display: block; }
.sd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .2s;
  border-bottom: 1px solid rgba(0,0,0,.04);
}
.sd-item:last-child { border-bottom: none; }
.sd-item:hover { background: rgba(59,130,246,.06); }
.sd-cover {
  width: 44px; height: 60px;
  border-radius: 8px;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.sd-info { flex: 1; min-width: 0; }
.sd-title { font-weight: 700; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-author { font-size: 12px; color: var(--muted); margin-top: 2px; }
.sd-price { font-weight: 700; font-size: 13px; color: var(--accent); white-space: nowrap; }

.hdr-actions { display: flex; align-items: center; gap: 9px; flex-shrink: 0; flex-wrap: nowrap; }
.icon-btn {
  position: relative;
  width: 45px; height: 45px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--blue-700);
  background: rgba(37, 99, 235, 0.08);
  transition: .3s ease;
  flex-shrink: 0;
}
.icon-btn:hover { background: rgba(37, 99, 235, 0.16); transform: translateY(-2px) scale(1.03); }
.icon-btn .badge {
  position: absolute;
  top: -5px; right: -5px;
  min-width: 20px; height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--grad-gold);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 10px rgba(249, 115, 22, 0.4);
}

.btn-primary {
  position: relative;
  overflow: hidden;
  background: var(--grad-primary);
  background-size: 160% 160%;
  color: #fff;
  padding: 11px 24px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  font-family: var(--font-display);
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.34);
  transition: transform .3s var(--ease-out), box-shadow .3s ease;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: -75%;
  width: 50%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  transition: left .6s ease;
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.44);
}
.btn-primary:hover::before { left: 125%; }
.btn-primary:active { transform: translateY(-1px) scale(.98); }

.btn-ghost {
  padding: 10px 19px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  color: var(--blue-700);
  border: 1.5px solid var(--blue-200);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(6px);
  transition: .3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-ghost:hover { background: var(--blue-50); border-color: var(--blue-400); transform: translateY(-2px); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  padding: 84px 24px 96px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 40px;
  align-items: center;
}
.hero::before {
  content: '';
  position: absolute;
  left: 50%; top: -6%;
  width: 680px; height: 420px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(37, 99, 235, 0.16), transparent 70%);
  filter: blur(30px);
  z-index: -1;
}
.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--blue-600);
  font-size: 13px;
  font-weight: 800;
  border: 1px solid rgba(37, 99, 235, 0.18);
  box-shadow: var(--shadow-soft-sm);
  margin-bottom: 24px;
  animation: chipIn .8s var(--ease-out) both;
}
.hero-chip .pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--sky); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(14,165,233,.55);} 50% { box-shadow: 0 0 0 9px rgba(14,165,233,0);} }
@keyframes chipIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.hero h1 {
  font-size: clamp(36px, 5.2vw, 62px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -2px;
  color: var(--blue-900);
  font-family: var(--font-display);
  animation: heroUp .9s var(--ease-out) both;
  animation-delay: .05s;
}
.hero h1 .grad {
  background: linear-gradient(120deg, var(--blue-500) 0%, var(--sky) 35%, var(--cyan) 60%, var(--violet) 100%);
  background-size: 220% 220%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
  animation: gradShift 7s ease infinite;
}
@keyframes gradShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.hero p.lead {
  margin: 22px 0 32px;
  color: var(--muted);
  font-size: 17px;
  max-width: 490px;
  animation: heroUp .9s var(--ease-out) both;
  animation-delay: .15s;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; animation: heroUp .9s var(--ease-out) both; animation-delay: .25s; }
@keyframes heroUp { from { opacity: 0; transform: translateY(34px); } to { opacity: 1; transform: none; } }

.hero-stats { display: flex; gap: 20px; margin-top: 44px; animation: heroUp .9s var(--ease-out) both; animation-delay: .35s; }
.stat {
  flex: 1;
  max-width: 150px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 16px;
  padding: 14px 18px;
  box-shadow: var(--shadow-soft-sm);
  transition: .3s ease;
}
.stat:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); border-color: rgba(37, 99, 235, 0.25); }
.stat b {
  font-size: 26px;
  color: var(--blue-800);
  display: block;
  font-family: var(--font-display);
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat span { font-size: 12.5px; color: var(--muted); font-weight: 700; }

/* Hero 3D stage */
.hero-stage { position: relative; height: 540px; }
.stage-ring {
  position: absolute;
  inset: 34px 22px;
  border: 2px dashed rgba(59, 130, 246, 0.3);
  border-radius: 50%;
  animation: spinRing 46s linear infinite;
}
@keyframes spinRing { to { transform: rotate(360deg); } }
.stage-ring::after {
  content: '';
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  border: 1.5px dashed rgba(14, 165, 233, 0.25);
  animation: spinRing 34s linear infinite reverse;
}
.stage-ring::before {
  content: '';
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(219, 234, 254, 0.5), transparent 70%);
}
.stage-glow {
  position: absolute;
  inset: 64px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.4), transparent 65%);
  filter: blur(36px);
  animation: glowPulse 5s ease-in-out infinite;
}
@keyframes glowPulse { 0%,100%{opacity:.55; transform:scale(1);} 50%{opacity:1; transform:scale(1.1);} }

.book-fly {
  position: absolute;
  aspect-ratio: 3 / 4.2;
  transform-style: preserve-3d;
  filter: drop-shadow(0 24px 30px rgba(15, 23, 42, 0.3));
  animation: bookTurn 9s ease-in-out infinite;
}
.book-fly:hover { z-index: 6; filter: drop-shadow(0 30px 40px rgba(15, 23, 42, 0.4)) brightness(1.08); }
.book-fly .b3d {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  animation: floatBook 6.5s ease-in-out infinite;
}
@keyframes bookTurn {
  0%, 100% { transform: rotateY(-26deg) rotateX(5deg); }
  50% { transform: rotateY(26deg) rotateX(-2deg); }
}
@keyframes floatBook {
  0%,100% { transform: translateY(0) rotateX(3deg); }
  50% { transform: translateY(-20px) rotateX(-1deg); }
}
.book-fly:nth-child(2) .b3d { animation-delay: -2.2s; }
.book-fly:nth-child(3) .b3d { animation-delay: -4.4s; }
.book-fly:nth-child(2) { animation-delay: -3s; }
.book-fly:nth-child(3) { animation-delay: -6s; }
.b3d .face, .b3d .spine { position: absolute; border-radius: 4px 12px 12px 4px; overflow: hidden; }
.b3d .face {
  inset: 0;
  transform: translateZ(10px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
  color: #fff;
  border-radius: 6px 12px 12px 6px;
  box-shadow: inset -4px 0 8px rgba(0,0,0,.18);
}
.b3d .spine { top: 0; left: 0; }
.b3d .face::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, rgba(255,255,255,.22), transparent 45%);
  pointer-events: none;
}
.b3d .face .bk-title { font-size: 12px; font-weight: 800; line-height: 1.25; text-shadow: 0 2px 6px rgba(0,0,0,.3); }
.b3d .face .bk-author { font-size: 9px; opacity: .85; }
.b3d .face .bk-brand { position: absolute; bottom: 10px; font-size: 9px; font-weight: 800; letter-spacing: 1px; opacity: .75; }

/* ---------- Sections ---------- */
.section { max-width: 1240px; margin: 0 auto; padding: 78px 24px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 40px; }
.section-head::after {
  content: '';
  width: 64px; height: 4px;
  border-radius: 99px;
  background: var(--grad-primary);
  margin-bottom: 10px;
}
.section-head h2 {
  font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 800;
  color: var(--blue-900);
  letter-spacing: -1px;
  font-family: var(--font-display);
  position: relative;
}
.section-head h2 span {
  background: var(--grad-cyan);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.section-head p { color: var(--muted); margin-top: 8px; font-size: 14px; }

/* ---------- Categories ---------- */
.cats {
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.cats-track {
  display: flex;
  gap: 18px;
  width: max-content;
  animation: catScroll 25s linear infinite;
}
.cat-card {
  min-width: 180px;
  max-width: 180px;
  min-height: 160px;
}
.cats:hover .cats-track { animation-play-state: paused; }
@keyframes catScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.cat-card {
  position: relative;
  padding: 28px 18px 24px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  text-align: center;
  cursor: pointer;
  transition: .4s var(--ease-out);
  transform-style: preserve-3d;
  overflow: hidden;
  box-shadow: var(--shadow-soft-sm);
}
.cat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-primary);
  opacity: 0;
  transition: opacity .4s ease;
}
.cat-card::after {
  content: '';
  position: absolute;
  top: -60%; left: -60%;
  width: 60%; height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  transform: rotate(25deg);
  transition: left .7s ease;
  pointer-events: none;
}
.cat-card:hover { transform: translateY(-10px) rotateX(8deg) scale(1.02); box-shadow: var(--shadow-glow); border-color: transparent; }
.cat-card:hover::before { opacity: 1; }
.cat-card:hover::after { left: 160%; }
.cat-card > * { position: relative; z-index: 1; }
.cat-card .cat-ico {
  width: 58px; height: 58px;
  margin: 0 auto 14px;
  border-radius: 17px;
  background: linear-gradient(135deg, var(--blue-50), var(--blue-100));
  display: grid;
  place-items: center;
  font-size: 26px;
  transition: .4s var(--ease-bounce);
}
.cat-card:hover .cat-ico { background: rgba(255,255,255,.18); transform: rotateY(360deg) scale(1.08); }
.cat-card h3 { font-size: 15.5px; color: var(--blue-800); font-weight: 800; transition: .3s; font-family: var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-card p { font-size: 12px; color: var(--muted); margin-top: 4px; transition: .3s; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-card:hover h3, .cat-card:hover p { color: #fff; }

/* ---------- Filters / toolbar ---------- */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 32px; }
.filter-chip {
  padding: 9px 19px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid var(--border);
  transition: .3s ease;
  box-shadow: var(--shadow-soft-sm);
}
.filter-chip:hover { border-color: var(--blue-300); color: var(--blue-600); transform: translateY(-2px); }
.filter-chip.active {
  background: var(--grad-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}
.toolbar select {
  padding: 10px 16px;
  border-radius: 13px;
  border: 1.5px solid var(--border);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--blue-800);
  background: rgba(255, 255, 255, 0.9);
  outline: none;
  box-shadow: var(--shadow-soft-sm);
  transition: .3s;
}
.toolbar select:focus { border-color: var(--blue-400); box-shadow: 0 0 0 4px rgba(59,130,246,.12); }
.type-tabs { display: flex; gap: 6px; }
.type-tab {
  padding: 10px 20px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 800;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid var(--border);
  transition: .3s ease;
  box-shadow: var(--shadow-soft-sm);
  cursor: pointer;
  font-family: var(--font-display);
}
.type-tab:hover { border-color: var(--blue-300); color: var(--blue-600); transform: translateY(-2px); }
.type-tab.active {
  background: var(--grad-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}

/* ---------- Book grid ---------- */
.books-section-wrap { position: relative; }
.books-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 28px; }
.books-grid.carousel-mode { display: flex; flex-direction: column; gap: 20px; overflow: hidden; position: relative; padding: 10px 0; mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); }
.books-carousel-row { overflow: hidden; }
.books-track { display: flex; gap: 0; width: max-content; }
.track-left { animation: booksScroll 50s linear infinite; }
.track-right { animation: booksScrollReverse 50s linear infinite; }
.books-track:hover { animation-play-state: paused; }
.books-track-block { display: flex; flex-direction: column; gap: 20px; flex-shrink: 0; }
.books-track-row { display: flex; gap: 20px; flex-shrink: 0; padding-right: 20px; }
@keyframes booksScroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
@keyframes booksScrollReverse { 0% { transform: translateX(-50%); } 100% { transform: translateX(0); } }
.books-grid.carousel-mode .book-card { min-width: 200px; max-width: 200px; flex-shrink: 0; }
.book-card { position: relative; }
.tilt-wrap {
  position: relative;
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft-sm);
  transition: transform 0.25s ease, box-shadow .35s ease, border-color .35s ease;
  transform-style: preserve-3d;
  will-change: transform;
}
.tilt-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(37,99,235,.12), transparent 40%, rgba(14,165,233,.1));
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
}
.tilt-wrap:hover { box-shadow: 0 32px 70px rgba(26, 60, 155, 0.22); border-color: rgba(37, 99, 235, 0.25); }
.tilt-wrap:hover::before { opacity: 1; }
.book-cover-wrap { perspective: 700px; margin-bottom: 15px; }
.book-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4.2;
  border-radius: 12px;
  transform-style: preserve-3d;
  transition: transform 0.55s var(--ease-out);
  cursor: pointer;
  filter: drop-shadow(0 18px 22px rgba(15,23,42,.26));
}
.book-cover:hover { transform: rotateY(-26deg) rotateX(7deg) translateZ(24px) scale(1.02); }
.book-cover .face {
  position: absolute;
  inset: 0;
  border-radius: 6px 14px 14px 6px;
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 14px;
  overflow: hidden;
}
.book-cover .face::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, rgba(255,255,255,.2), transparent 40%, transparent 70%, rgba(0,0,0,.14));
  pointer-events: none;
}
.book-cover .face .bk-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(11, 30, 75, 0.78) 0%, rgba(11, 30, 75, 0.3) 40%, rgba(11, 30, 75, 0) 70%);
  pointer-events: none;
  z-index: 0;
}
.book-cover .face .bk-tag, .book-cover .face .bk-ct, .book-cover .face .bk-title, .book-cover .face .bk-author, .book-cover .face .bk-price { position: relative; z-index: 1; }
.book-cover .spine {
  position: absolute;
  left: -10px; top: 0; bottom: 0;
  width: 10px;
  transform: rotateY(-90deg);
  transform-origin: right;
  border-radius: 2px;
  box-shadow: inset -2px 0 4px rgba(0,0,0,.3);
}
.book-cover .top {
  position: absolute;
  left: 0; right: 0; top: -7px;
  height: 7px;
  transform: rotateX(90deg);
  transform-origin: bottom;
}
.book-cover .bk-tag {
  position: absolute;
  top: 13px; left: 13px;
  background: rgba(255,255,255,.25);
  backdrop-filter: blur(6px);
  font-size: 9px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: .6px;
}
.book-cover .bk-ct { position: absolute; right: 13px; top: 13px; font-size: 10px; font-weight: 700; opacity: .9; }
.book-cover .bk-title { margin-top: auto; font-size: 14.5px; font-weight: 800; line-height: 1.3; text-shadow: 0 2px 10px rgba(0,0,0,.35); }
.book-cover .bk-author { font-size: 11px; opacity: .85; margin-top: 3px; }
.book-cover .bk-price { font-size: 12.5px; font-weight: 800; margin-top: 7px; }

.book-info { padding: 2px 4px; }
.book-info .rate { color: #f59e0b; font-size: 13px; font-weight: 700; }
.book-info .rate small { color: var(--muted); font-weight: 700; }
.book-info .b-title { font-size: 15.5px; font-weight: 800; color: var(--blue-900); margin-top: 5px; line-height: 1.35; font-family: var(--font-display); }
.book-info .b-author { font-size: 13px; color: var(--muted); }
.book-row { display: flex; align-items: center; justify-content: space-between; margin-top: 11px; }
.book-row .price { font-size: 16px; font-weight: 800; color: var(--blue-600); }
.book-row .price s { font-size: 12px; color: var(--muted); font-weight: 600; margin-left: 6px; }
.add-btn {
  width: 40px; height: 40px;
  border-radius: 13px;
  background: var(--grad-primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 19px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .35);
  transition: .3s var(--ease-bounce);
}
.add-btn:hover { transform: scale(1.14) rotate(90deg); box-shadow: 0 12px 24px rgba(37, 99, 235, .45); }
.badge-sale {
  position: absolute;
  top: 16px; right: -7px;
  background: var(--grad-gold);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 6px 2px 2px 6px;
  box-shadow: 0 5px 14px rgba(249, 115, 22, .4);
  z-index: 2;
  animation: salePulse 2.4s ease-in-out infinite;
}
@keyframes salePulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }

/* ---------- Promo / CTA ---------- */
.promo {
  background:
    radial-gradient(600px 300px at 85% -10%, rgba(34, 211, 238, 0.35), transparent 60%),
    radial-gradient(500px 300px at 0% 110%, rgba(37, 99, 235, 0.5), transparent 60%),
    linear-gradient(120deg, #0b1e4b, #16357f 40%, #1e40af 70%, #0ea5e9);
  background-size: 200% 200%;
  animation: promoGradient 12s ease infinite;
  border-radius: 30px;
  padding: 58px 50px;
  color: #fff;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  box-shadow: 0 40px 90px rgba(11, 30, 75, 0.4);
}
@keyframes promoGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.promo::before, .promo::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.09);
  animation: promoOrb 9s ease-in-out infinite;
}
.promo::after { animation-delay: -4.5s; }
@keyframes promoOrb {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(-40px,30px) scale(1.18); }
}
.promo::before { width: 360px; height: 360px; right: -90px; top: -130px; }
.promo::after { width: 240px; height: 240px; right: 210px; bottom: -130px; }
.promo h2 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; margin-bottom: 12px; font-family: var(--font-display); letter-spacing: -1px; }
.promo p { opacity: .95; max-width: 480px; margin-bottom: 28px; font-size: 15px; }
.promo .btn-white {
  background: #fff;
  color: var(--blue-700);
  padding: 14px 32px;
  border-radius: 999px;
  font-weight: 800;
  font-family: var(--font-display);
  box-shadow: 0 12px 34px rgba(0,0,0,.25);
  transition: .3s var(--ease-bounce);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.promo .btn-white:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 18px 44px rgba(0,0,0,.32); }
.promo-emoji {
  position: absolute;
  right: 60px; bottom: 24px;
  font-size: 128px;
  animation: floatBook 5s ease-in-out infinite;
  transform: rotate(-8deg);
  filter: drop-shadow(0 24px 36px rgba(0,0,0,.35));
}
.promo-anim { position: absolute; inset: 0; pointer-events: none; }
.promo-anim .pa { position: absolute; color: rgba(255,255,255,.45); font-size: 26px; animation: paFloat 7s ease-in-out infinite; }
.pa-1 { left: 6%; top: 18%; }
.pa-2 { left: 14%; bottom: 22%; font-size: 18px; animation-delay: -1.4s; }
.pa-3 { right: 30%; top: 14%; font-size: 20px; animation-delay: -2.6s; }
.pa-4 { right: 12%; top: 40%; font-size: 16px; animation-delay: -4s; }
.pa-5 { right: 44%; bottom: 12%; font-size: 34px; animation-delay: -3.2s; }
.pa-6 { left: 40%; top: 12%; font-size: 28px; animation-delay: -5s; }
@keyframes paFloat {
  0%,100% { transform: translateY(0) rotate(0deg); opacity: .25; }
  50% { transform: translateY(-28px) rotate(22deg); opacity: .7; }
}

/* ---------- Reviews ---------- */
.rv-carousel { position: relative; }
.rv-viewport { overflow: hidden; padding: 6px 2px; }
.rv-track { display: flex; transition: transform 0.7s var(--ease-out); }
.rv-slide { flex: 0 0 100%; display: flex; gap: 20px; }
.review-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  transition: .35s var(--ease-out);
  box-shadow: var(--shadow-soft-sm);
  overflow: hidden;
}
.review-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad-primary);
  opacity: 0;
  transition: opacity .35s ease;
}
.review-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-soft); border-color: rgba(37,99,235,.2); }
.review-card:hover::after { opacity: 1; }
.review-card .stars { color: #f59e0b; margin-bottom: 10px; font-size: 14px; }
.review-card p { font-size: 14px; color: var(--muted); margin-bottom: 16px; line-height: 1.65; }
.review-card .rv-user { display: flex; align-items: center; gap: 12px; }
.review-card .rv-ava {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--grad-primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .3);
}
.review-card .rv-name { font-weight: 800; font-size: 14px; color: var(--blue-800); }
.review-card .rv-role { font-size: 12px; color: var(--muted); }
.review-card::before {
  content: '\201C';
  position: absolute;
  top: 2px; right: 22px;
  font-size: 90px;
  font-family: Georgia, serif;
  line-height: 1;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: .35;
}
.rv-book {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--blue-50), #eef6ff);
  border-radius: 12px;
  padding: 8px 11px;
  margin-bottom: 13px;
  border: 1px solid rgba(37,99,235,.08);
}
.rv-book .rb-cover {
  width: 32px; height: 44px;
  border-radius: 4px;
  flex-shrink: 0;
  box-shadow: 0 5px 10px rgba(15,23,42,.25);
}
.rv-book .rb-title { font-size: 12px; font-weight: 800; color: var(--blue-800); line-height: 1.25; }
.rv-book .rb-ct { font-size: 11px; color: var(--muted); font-weight: 700; }
.review-card .stars .off { color: #e6ecf6; }

.rv-arrow {
  position: absolute;
  top: 42%;
  transform: translateY(-50%);
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
  color: var(--blue-800);
  font-size: 24px; line-height: 1;
  cursor: pointer;
  z-index: 3;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.14);
  transition: .3s var(--ease-bounce);
  display: grid;
  place-items: center;
  backdrop-filter: blur(6px);
}
.rv-arrow:hover { background: var(--grad-primary); color: #fff; border-color: transparent; transform: translateY(-50%) scale(1.1); }
.rv-prev { left: -20px; }
.rv-next { right: -20px; }
.rv-dots { display: flex; justify-content: center; gap: 8px; margin-top: 26px; }
.rv-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #d6e2f5;
  cursor: pointer;
  transition: .35s var(--ease-out);
  padding: 0; border: none;
}
.rv-dot:hover { background: var(--blue-300); }
.rv-dot.active { width: 30px; border-radius: 6px; background: var(--grad-primary); box-shadow: 0 3px 10px rgba(37,99,235,.4); }

/* ---------- Footer ---------- */
.footer {
  margin-top: 70px;
  background:
    radial-gradient(700px 300px at 80% -20%, rgba(37, 99, 235, 0.35), transparent 60%),
    linear-gradient(180deg, #0a1a44, #0b1e4b);
  color: #aebad3;
  padding: 64px 24px 30px;
  border-top: 1px solid rgba(37, 99, 235, 0.35);
  position: relative;
}
.footer::before {
  content: '';
  position: absolute;
  top: -1px; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.7), transparent);
}
.footer-inner { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 34px; }
.footer h4 { color: #fff; margin-bottom: 16px; font-size: 15px; font-family: var(--font-display); }
.footer a { display: block; font-size: 14px; padding: 5px 0; transition: .2s; color: #aebad3; }
.footer a:hover { color: var(--cyan); transform: translateX(4px); }
.footer .about p { font-size: 14px; margin-top: 12px; line-height: 1.7; }
.footer .logo-3d {
  width: 66px; height: 66px;
  transform-style: preserve-3d;
  animation: logoSpin 9s linear infinite;
  filter: drop-shadow(0 8px 16px rgba(255, 255, 255, 0.2));
}
.footer .logo-3d img { width: 100%; height: 100%; border-radius: 14px; }
.footer .bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  margin-top: 44px;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: #7486a8;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 20, 55, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  width: min(920px, 92vw);
  max-height: 88vh;
  overflow: auto;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 26px;
  padding: 36px;
  transform: translateY(34px) scale(0.95);
  transition: transform .4s var(--ease-out);
  position: relative;
  box-shadow: 0 50px 120px rgba(8, 20, 55, 0.45);
  border: 1px solid rgba(255,255,255,.4);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal .m-close {
  position: absolute;
  top: 18px; right: 18px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--blue-50);
  color: var(--blue-700);
  font-size: 17px;
  display: grid;
  place-items: center;
  transition: .3s var(--ease-bounce);
  z-index: 2;
}
.modal .m-close:hover { background: #fee2e2; color: #ef4444; transform: rotate(90deg) scale(1.05); }

.book-detail { display: grid; grid-template-columns: 300px 1fr; gap: 36px; }
.bd-cover { perspective: 900px; }
.bd-cover .book-cover {
  aspect-ratio: 3/4.2;
  transform: rotateY(-18deg) rotateX(4deg);
  animation: detailSway 6s ease-in-out infinite;
  border-radius: 14px;
}
@keyframes detailSway {
  0%,100% { transform: rotateY(-18deg) rotateX(4deg); }
  50% { transform: rotateY(-10deg) rotateX(2deg) translateY(-9px); }
}
.bd-info h2 { font-size: 27px; color: var(--blue-900); font-weight: 800; font-family: var(--font-display); letter-spacing: -0.5px; }
.bd-info .author { color: var(--muted); margin: 6px 0 14px; font-weight: 600; }
.bd-info .meta { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 16px; }
.bd-info .meta div {
  font-size: 13px;
  color: var(--muted);
  background: var(--blue-50);
  padding: 7px 13px;
  border-radius: 10px;
  border: 1px solid rgba(37,99,235,.1);
}
.bd-info .meta b { color: var(--blue-700); }
.bd-info .desc { font-size: 15px; color: var(--ink); margin-bottom: 20px; line-height: 1.7; }
.bd-price { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.bd-price .now { font-size: 31px; font-weight: 800; color: var(--blue-600); font-family: var(--font-display); }
.bd-price .was { font-size: 17px; color: var(--muted); text-decoration: line-through; }
.bd-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.qty-box { display: flex; align-items: center; border: 1.5px solid var(--border); border-radius: 13px; overflow: hidden; background: #fff; }
.qty-box button { width: 40px; height: 44px; font-size: 18px; color: var(--blue-700); transition: .2s; }
.qty-box button:hover { background: var(--blue-50); }
.qty-box input { width: 46px; text-align: center; border: none; font-size: 15px; font-weight: 700; font-family: inherit; outline: none; color: var(--blue-900); }

/* ---------- Reviews in detail ---------- */
.rv-list { margin-top: 24px; border-top: 1px dashed var(--border); padding-top: 18px; }
.rv-list h4 { font-size: 15px; font-weight: 800; color: var(--blue-900); margin-bottom: 12px; font-family: var(--font-display); }
.rv-item { padding: 13px 0; border-bottom: 1px solid #f1f5f9; animation: rowIn .4s var(--ease-out) both; }
.rv-item .rv-top { display: flex; align-items: center; gap: 10px; }
.rv-item .rv-top .rv-ava {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--grad-primary); color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 800;
}
.rv-item .rv-top .rv-name { font-weight: 800; font-size: 13px; color: var(--blue-800); }
.rv-item .rv-top .rv-date { font-size: 11px; color: var(--muted); }
.rv-item .stars { font-size: 13px; color: #f59e0b; margin: 6px 0 4px; }
.rv-item .stars .off { color: #e6ecf6; }
.rv-item p { font-size: 13.5px; color: var(--muted); line-height: 1.6; }

.rv-form {
  margin-top: 18px;
  background: linear-gradient(135deg, var(--blue-50), #f0f7ff);
  border-radius: 16px;
  padding: 18px;
  border: 1px solid rgba(37,99,235,.1);
}
.rv-form label { font-size: 13px; font-weight: 800; color: var(--blue-800); display: block; margin-bottom: 9px; }
.star-picker { display: flex; gap: 4px; margin-bottom: 11px; font-size: 26px; cursor: pointer; }
.star-picker span { color: #e6ecf6; transition: .2s var(--ease-bounce); }
.star-picker span:hover, .star-picker span.lit { color: #f59e0b; transform: scale(1.2); text-shadow: 0 3px 10px rgba(245,158,11,.4); }
.rv-form textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 11px 13px;
  font-size: 13.5px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: .25s;
  background: #fff;
}
.rv-form textarea:focus { border-color: var(--blue-400); box-shadow: 0 0 0 5px rgba(59,130,246,.13); }
.rv-form .btn-primary { margin-top: 11px; }

/* ---------- Cart drawer ---------- */
.drawer-overlay { position: fixed; inset: 0; background: rgba(8,20,55,.55); backdrop-filter: blur(6px); z-index: 210; opacity: 0; pointer-events: none; transition: .35s; }
.drawer-overlay.open { opacity: 1; pointer-events: all; }
.drawer {
  position: fixed;
  top: 0; right: 0;
  width: min(430px, 94vw);
  height: 100vh;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  z-index: 220;
  transform: translateX(100%);
  transition: transform 0.45s var(--ease-out);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -30px 0 80px rgba(8, 20, 55, 0.3);
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(135deg, var(--blue-50), #f2f8ff);
}
.drawer-head h3 { color: var(--blue-900); font-family: var(--font-display); }
.drawer-body { flex: 1; overflow: auto; padding: 18px 24px; }
.cart-item {
  display: flex; gap: 14px; padding: 15px 0;
  border-bottom: 1px dashed var(--border);
  animation: rowIn .35s var(--ease-out) both;
}
.cart-item .ci-cover { width: 56px; height: 78px; border-radius: 7px; flex-shrink: 0; box-shadow: 0 6px 14px rgba(15,23,42,.18); }
.cart-item .ci-name { font-weight: 800; font-size: 14px; color: var(--blue-900); }
.cart-item .ci-price { font-size: 13px; color: var(--blue-600); font-weight: 800; }
.cart-item .ci-controls { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.cart-item .ci-controls button {
  width: 27px; height: 27px; border-radius: 8px;
  background: var(--blue-50); color: var(--blue-700); font-weight: 800; transition: .2s;
}
.cart-item .ci-controls button:hover { background: var(--blue-100); }
.cart-item .ci-rm { margin-left: auto; color: #ef4444; font-size: 12px; font-weight: 700; }
.cart-item .ci-rm:hover { text-decoration: underline; }
.drawer-foot {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  overflow-y: auto; max-height: 72vh;
  background: #fff;
}
.drawer-foot .total {
  display: flex; justify-content: space-between;
  font-weight: 800; color: var(--blue-900); margin-bottom: 14px; font-size: 17px;
  font-family: var(--font-display);
}
.drawer-foot .total span:last-child { color: var(--blue-600); }
.empty-cart { text-align: center; padding: 54px 10px; color: var(--muted); }
.empty-cart .big {
  font-size: 60px; margin-bottom: 14px;
  animation: floatBook 4s ease-in-out infinite;
  display: inline-block;
}

/* ---------- Checkout (to'lov) ---------- */
.pay-label { display: block; font-size: 13px; font-weight: 800; color: var(--blue-900); margin-bottom: 6px; }
.pay-options { display: grid; gap: 10px; margin-top: 16px; }
.pay-opt {
  display: flex; align-items: center; gap: 14px;
  border: 2px solid var(--border); border-radius: 15px;
  padding: 14px 16px; cursor: pointer; background: #fff;
  transition: border-color .2s, box-shadow .25s, transform .2s var(--ease-out);
}
.pay-opt:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-soft-sm); }
.pay-opt.on { border-color: var(--accent); box-shadow: 0 10px 28px rgba(59,130,246,.2); background: linear-gradient(135deg, #f6faff, #eef5ff); }
.pay-ico {
  width: 48px; height: 48px; flex: 0 0 48px; border-radius: 13px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  display: grid; place-items: center; font-size: 23px;
  transition: .25s;
}
.pay-opt.on .pay-ico { background: linear-gradient(135deg, #dbeafe, #bfdbfe); transform: scale(1.06); }
.pay-txt { flex: 1; }
.pay-txt b { display: block; color: var(--blue-900); font-size: 15px; font-family: var(--font-display); }
.pay-txt span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.pay-radio {
  width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%;
  border: 2px solid #cbd5e1; position: relative; transition: border-color .2s;
}
.pay-opt.on .pay-radio { border-color: var(--accent); }
.pay-opt.on .pay-radio::after {
  content: ''; position: absolute; inset: 3px; border-radius: 50%;
  background: var(--accent);
  animation: popIn .25s var(--ease-bounce);
}
@keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }

/* ---------- Auth inputs (injected class styling) ---------- */
.auth-inp {
  background: #fff;
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 28px; left: 50%;
  transform: translate(-50%, 130px);
  background: var(--navy);
  color: #fff;
  padding: 15px 28px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  z-index: 300;
  box-shadow: 0 20px 50px rgba(8, 20, 55, 0.5);
  transition: transform .5s var(--ease-bounce);
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255,255,255,.12);
}
.toast.show { transform: translate(-50%, 0); }
.toast .tick { color: #4ade80; font-size: 18px; }

/* ---------- Support chat ---------- */
.chat-fab {
  position: fixed;
  right: 24px; bottom: 24px;
  width: 60px; height: 60px;
  border-radius: 50%;
  border: none;
  cursor: grab;
  background: var(--grad-primary);
  color: #fff;
  font-size: 25px;
  display: grid;
  place-items: center;
  box-shadow: 0 16px 40px rgba(37, 99, 235, .5);
  z-index: 150;
  transition: .35s var(--ease-bounce);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.chat-fab::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(37, 99, 235, 0.4);
  animation: fabRing 2.6s ease-out infinite;
}
@keyframes fabRing { 0% { transform: scale(.9); opacity: 1; } 100% { transform: scale(1.45); opacity: 0; } }
.chat-fab:hover { transform: translateY(-4px) scale(1.07) rotate(8deg); box-shadow: 0 20px 50px rgba(37, 99, 235, .55); }
.chat-fab.open { background: linear-gradient(135deg, #334155, #475569); }
.chat-fab.open::after { display: none; }
.chat-fab-ico { pointer-events: none; }
.chat-fab-badge {
  position: absolute;
  top: -5px; right: -5px;
  min-width: 23px; height: 23px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid #fff;
  animation: popIn .3s var(--ease-bounce);
}
.chat-widget {
  position: fixed;
  right: 24px; bottom: 96px;
  width: min(370px, calc(100% - 32px));
  height: 490px;
  max-height: calc(100vh - 130px);
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 30px 90px rgba(8, 20, 55, 0.35);
  border: 1px solid rgba(255,255,255,.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 150;
  opacity: 0;
  transform: translateY(24px) scale(.95);
  pointer-events: none;
  transition: .4s var(--ease-bounce);
  transform-origin: bottom right;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.chat-widget.open { opacity: 1; transform: none; pointer-events: all; }
.chat-head {
  background: var(--grad-primary);
  color: #fff;
  padding: 17px 19px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-ava {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.25);
}
.chat-title { font-weight: 800; font-size: 15px; font-family: var(--font-display); }
.chat-status { font-size: 11.5px; opacity: .9; }
.chat-status .dot { color: #4ade80; }
.chat-close {
  margin-left: auto;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 13px;
  transition: .2s;
}
.chat-close:hover { background: rgba(255, 255, 255, .32); transform: rotate(90deg); }
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  background:
    radial-gradient(400px 200px at 100% 0%, rgba(37, 99, 235, 0.05), transparent 60%),
    #f6f9ff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cb { max-width: 82%; display: flex; flex-direction: column; animation: popIn .3s var(--ease-out); }
.cb-me { align-self: flex-end; align-items: flex-end; }
.cb-them { align-self: flex-start; align-items: flex-start; }
.cb-txt {
  padding: 11px 15px;
  border-radius: 17px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
}
.cb-me .cb-txt {
  background: var(--grad-primary);
  color: #fff;
  border-bottom-right-radius: 5px;
  box-shadow: 0 6px 18px rgba(37, 99, 235, .3);
}
.cb-them .cb-txt {
  background: #fff; color: var(--blue-900);
  border: 1px solid var(--border);
  border-bottom-left-radius: 5px;
  box-shadow: 0 3px 10px rgba(15, 23, 42, .06);
}
.cb-meta { font-size: 10.5px; color: #94a3b8; margin-top: 4px; }
.chat-empty { text-align: center; color: #94a3b8; font-size: 13px; padding: 30px 10px; }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); background: #fff; flex-shrink: 0; }
.chat-input input {
  flex: 1;
  border: 1.5px solid #e2e8f0;
  border-radius: 13px;
  padding: 11px 15px;
  font-size: 13.5px;
  outline: none;
  font-family: inherit;
  transition: .25s;
  background: #f8fafc;
}
.chat-input input:focus { border-color: var(--blue-400); box-shadow: 0 0 0 4px rgba(59, 130, 246, .12); background: #fff; }
.chat-input button {
  flex-shrink: 0;
  width: 46px;
  height: 42px;
  border: none;
  border-radius: 13px;
  background: var(--grad-primary);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: .25s var(--ease-bounce);
  display: grid;
  place-items: center;
}
.chat-input button:hover { transform: translateX(2px) scale(1.05); }

/* ---------- Reveal animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(44px) scale(.98);
  transition: opacity .8s ease, transform .8s var(--ease-out);
}
.reveal.visible { opacity: 1; transform: translateY(0) scale(1); }
.reveal-delay-1 { transition-delay: .12s; }
.reveal-delay-2 { transition-delay: .24s; }
.reveal-delay-3 { transition-delay: .36s; }

/* ---------- Generic row entrance ---------- */
@keyframes rowIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Mobile menu ---------- */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: rgba(37,99,235,.08);
  padding: 10px;
  cursor: pointer;
  z-index: 60;
}
.mobile-menu-btn span {
  display: block;
  width: 100%; height: 2.5px;
  border-radius: 2px;
  background: var(--blue-800);
  transition: .3s var(--ease-out);
}
.mobile-menu-btn.on span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.mobile-menu-btn.on span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.on span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.mobile-overlay {
  position: fixed; inset: 0;
  background: rgba(8,20,55,.55);
  backdrop-filter: blur(6px);
  z-index: 300;
  opacity: 0; pointer-events: none;
  transition: .35s;
}
.mobile-overlay.open { opacity: 1; pointer-events: all; }

.mobile-drawer {
  position: fixed;
  top: 0; left: 0;
  width: min(300px, 82vw);
  height: 100vh;
  background: #fff;
  z-index: 310;
  transform: translateX(-100%);
  transition: transform .4s var(--ease-out);
  display: flex;
  flex-direction: column;
  box-shadow: 20px 0 60px rgba(8,20,55,.3);
}
.mobile-drawer.open { transform: translateX(0); }
.md-head {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.md-close {
  margin-left: auto;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--blue-50);
  color: var(--blue-700);
  font-size: 15px;
  display: grid; place-items: center;
  transition: .2s;
}
.md-close:hover { background: #fee2e2; color: #ef4444; }
.md-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 14px;
  overflow-y: auto;
}
.md-nav a {
  padding: 13px 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  color: var(--blue-800);
  transition: .25s;
}
.md-nav a:hover, .md-nav a.active { background: var(--grad-primary); color: #fff; }
.md-foot { padding: 14px; border-top: 1px solid var(--border); }

/* Mobil drawer kategoriyalar sub-menu */
.md-nav-parent { display: flex; flex-direction: column; }
.md-nav-parent > a { display: flex; align-items: center; justify-content: space-between; }
.md-nav-parent > a::after { content: ''; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 5px solid currentColor; transition: transform .2s; }
.md-nav-parent.open > a::after { transform: rotate(180deg); }
.md-sub-cats {
  display: none;
  padding: 4px 0 4px 20px;
  flex-direction: column;
  gap: 2px;
}
.md-nav-parent.open .md-sub-cats { display: flex; }
.md-sub-cats button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue-800);
  cursor: pointer;
  transition: .2s;
  text-align: left;
}
.md-sub-cats button:hover { background: rgba(37, 99, 235, 0.08); }
.md-sub-cats button .nd-ico { font-size: 15px; width: 20px; text-align: center; }
.md-sub-cats button.active { background: var(--grad-primary); color: #fff; }

/* ============================================================
   DARK MODE
   ============================================================ */
html[data-theme="dark"] {
  color-scheme: dark;
  --card: #1e293b;
  --border: rgba(59, 130, 246, 0.15);
  --ink: #e2e8f0;
  --muted: #94a3b8;
}
html[data-theme="dark"] body {
  color: #e2e8f0;
  background:
    radial-gradient(1100px 500px at 12% -8%, rgba(37, 99, 235, 0.15), transparent 60%),
    radial-gradient(900px 480px at 90% 8%, rgba(14, 165, 233, 0.12), transparent 55%),
    radial-gradient(800px 600px at 50% 110%, rgba(34, 211, 238, 0.08), transparent 60%),
    #0b1220;
}
html[data-theme="dark"] body::before {
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.06) 1px, transparent 1px);
}
html[data-theme="dark"] ::selection { background: rgba(59, 130, 246, 0.35); color: #e2e8f0; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #1e40af, #0ea5e9); border-color: #1a2744; }

/* Header dark */
html[data-theme="dark"] .header {
  background: rgba(11, 18, 32, 0.82);
  border-bottom-color: rgba(30, 64, 175, 0.2);
}
html[data-theme="dark"] .header.scrolled {
  background: rgba(11, 18, 32, 0.92);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
}

/* Nav dark */
html[data-theme="dark"] .nav a { color: #94a3b8; }
html[data-theme="dark"] .nav a:hover, html[data-theme="dark"] .nav a.active { color: #fff; }

/* Search dark */
html[data-theme="dark"] .search-box input {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(59, 130, 246, 0.2);
  color: #e2e8f0;
}
html[data-theme="dark"] .search-box input::placeholder { color: #64748b; }
html[data-theme="dark"] .search-box .s-icon { color: #64748b; }

/* Icon buttons dark */
html[data-theme="dark"] .icon-btn { color: #94a3b8; background: rgba(30, 41, 59, 0.5); }
html[data-theme="dark"] .icon-btn:hover { background: rgba(37, 99, 235, 0.25); color: #fff; }

/* Buttons dark */
html[data-theme="dark"] .btn-primary {
  background: linear-gradient(135deg, #1d4ed8, #2563eb 45%, #0ea5e9);
}
html[data-theme="dark"] .btn-ghost { color: #94a3b8; }
html[data-theme="dark"] .btn-ghost:hover { color: #fff; background: rgba(37, 99, 235, 0.15); }

/* Hero dark */
html[data-theme="dark"] .hero h1 { color: #f1f5f9; }
html[data-theme="dark"] .hero p.lead { color: #94a3b8; }
html[data-theme="dark"] .hero-chip { background: rgba(30, 41, 59, 0.7); border-color: rgba(59, 130, 246, 0.2); color: #93c5fd; }
html[data-theme="dark"] .stat { background: rgba(30, 41, 59, 0.5); border-color: rgba(59, 130, 246, 0.12); }
html[data-theme="dark"] .stat b { color: #60a5fa; }

/* Sections dark */
html[data-theme="dark"] .section-head h2 { color: #f1f5f9; }
html[data-theme="dark"] .section-head h2 span { color: #60a5fa; }
html[data-theme="dark"] .section-head p { color: #64748b; }

/* Category cards dark */
html[data-theme="dark"] .cat-card {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(59, 130, 246, 0.15);
}
html[data-theme="dark"] .cat-card h3 { color: #e2e8f0; }
html[data-theme="dark"] .cat-card p { color: #64748b; }
html[data-theme="dark"] .cat-card:hover { border-color: rgba(59, 130, 246, 0.4); }

/* Filter chips dark */
html[data-theme="dark"] .filter-chip {
  background: rgba(30, 41, 59, 0.5);
  border-color: rgba(59, 130, 246, 0.15);
  color: #94a3b8;
}
html[data-theme="dark"] .filter-chip:hover, html[data-theme="dark"] .filter-chip.active {
  background: rgba(37, 99, 235, 0.3);
  color: #fff;
}

/* Type tabs dark */
html[data-theme="dark"] .type-tab {
  background: rgba(30, 41, 59, 0.5);
  border-color: rgba(59, 130, 246, 0.15);
  color: #94a3b8;
}
html[data-theme="dark"] .type-tab:hover, html[data-theme="dark"] .type-tab.active {
  background: rgba(37, 99, 235, 0.3);
  color: #fff;
}

/* Sort select dark */
html[data-theme="dark"] #sortSelect {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(59, 130, 246, 0.2);
  color: #e2e8f0;
}

/* Book cards dark */
html[data-theme="dark"] .tilt-wrap {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(59, 130, 246, 0.12);
}
html[data-theme="dark"] .tilt-wrap:hover { border-color: rgba(59, 130, 246, 0.35); }
html[data-theme="dark"] .book-info .b-title { color: #e2e8f0; }
html[data-theme="dark"] .book-info .b-author { color: #64748b; }
html[data-theme="dark"] .book-info .rate { color: #f59e0b; }
html[data-theme="dark"] .book-info .rate small { color: #64748b; }
html[data-theme="dark"] .price s { color: #475569; }
html[data-theme="dark"] .add-btn { background: rgba(37, 99, 235, 0.2); color: #60a5fa; }
html[data-theme="dark"] .add-btn:hover { background: rgba(37, 99, 235, 0.4); color: #fff; }

/* Reviews dark */
html[data-theme="dark"] .review-card {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(59, 130, 246, 0.12);
}
html[data-theme="dark"] .review-card p { color: #94a3b8; }
html[data-theme="dark"] .review-card .rv-name { color: #e2e8f0; }
html[data-theme="dark"] .review-card .rv-role { color: #475569; }

/* Promo dark */
html[data-theme="dark"] .promo {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(14, 165, 233, 0.15));
  border-color: rgba(59, 130, 246, 0.2);
}
html[data-theme="dark"] .promo h2 { color: #f1f5f9; }
html[data-theme="dark"] .promo p { color: #94a3b8; }

/* Footer dark */
html[data-theme="dark"] .footer {
  background: rgba(5, 10, 22, 0.95);
  border-top-color: rgba(59, 130, 246, 0.1);
}
html[data-theme="dark"] .footer h4 { color: #e2e8f0; }
html[data-theme="dark"] .footer a { color: #94a3b8; }
html[data-theme="dark"] .footer a:hover { color: #60a5fa; }
html[data-theme="dark"] .footer .about p { color: #64748b; }
html[data-theme="dark"] .footer .bottom { border-top-color: rgba(59, 130, 246, 0.1); color: #475569; }

/* Modal dark */
html[data-theme="dark"] .modal-overlay { background: rgba(0, 0, 0, 0.7); }
html[data-theme="dark"] .modal {
  background: #0f172a;
  border-color: rgba(59, 130, 246, 0.2);
}
html[data-theme="dark"] .modal h2, html[data-theme="dark"] .modal h3 { color: #e2e8f0; }
html[data-theme="dark"] .m-close { background: rgba(30, 41, 59, 0.7); color: #94a3b8; }
html[data-theme="dark"] .m-close:hover { background: rgba(239, 68, 68, 0.3); color: #ef4444; }

/* Auth dark */
html[data-theme="dark"] .auth-inp {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(59, 130, 246, 0.2);
  color: #e2e8f0;
}
html[data-theme="dark"] .auth-inp::placeholder { color: #475569; }
html[data-theme="dark"] .auth-inp:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

/* Drawer dark */
html[data-theme="dark"] .drawer {
  background: #0f172a;
  border-left-color: rgba(59, 130, 246, 0.15);
}
html[data-theme="dark"] .drawer-head { border-bottom-color: rgba(59, 130, 246, 0.1); }
html[data-theme="dark"] .drawer-head h3 { color: #e2e8f0; }
html[data-theme="dark"] .drawer-foot { background: #0c1322; border-top-color: rgba(59, 130, 246, 0.1); }
html[data-theme="dark"] .total { color: #e2e8f0; }
html[data-theme="dark"] .total span:last-child { color: #60a5fa; }

/* Cart items dark */
html[data-theme="dark"] .cart-item { border-color: rgba(59, 130, 246, 0.1); }
html[data-theme="dark"] .cart-item .ci-name { color: #e2e8f0; }
html[data-theme="dark"] .cart-item .ci-price { color: #94a3b8; }

/* Pay options dark */
html[data-theme="dark"] .pay-opt {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(59, 130, 246, 0.15);
}
html[data-theme="dark"] .pay-opt:hover { border-color: rgba(59, 130, 246, 0.4); }
html[data-theme="dark"] .pay-opt b { color: #e2e8f0; }
html[data-theme="dark"] .pay-opt span { color: #64748b; }
html[data-theme="dark"] .pay-radio { border-color: rgba(59, 130, 246, 0.3); }
html[data-theme="dark"] .pay-label { color: #94a3b8; }
html[data-theme="dark"] #storeCardShow { background: rgba(15, 23, 42, 0.6) !important; border-color: rgba(59, 130, 246, 0.2) !important; color: #60a5fa !important; }

/* Receipt dark */
html[data-theme="dark"] #receiptDropZone { background: rgba(15, 23, 42, 0.4); border-color: rgba(59, 130, 246, 0.2); }
html[data-theme="dark"] #receiptDropZone:hover { background: rgba(30, 41, 59, 0.5); }

/* Book detail dark */
html[data-theme="dark"] .book-detail { background: #0f172a; }
html[data-theme="dark"] .bd-info h2 { color: #e2e8f0; }
html[data-theme="dark"] .bd-info .meta div { background: rgba(30, 41, 59, 0.5); border-color: rgba(59, 130, 246, 0.15); color: #94a3b8; }
html[data-theme="dark"] .bd-price .now { color: #60a5fa; }
html[data-theme="dark"] .bd-price s { color: #475569; }
html[data-theme="dark"] .bd-btns .btn-ghost { color: #94a3b8; border-color: rgba(59, 130, 246, 0.2); }

/* Chat dark */
html[data-theme="dark"] .chat-widget {
  background: #0f172a;
  border-color: rgba(59, 130, 246, 0.15);
}
html[data-theme="dark"] .chat-head { background: rgba(15, 23, 42, 0.8); border-bottom-color: rgba(59, 130, 246, 0.1); }
html[data-theme="dark"] .chat-title { color: #e2e8f0; }
html[data-theme="dark"] .chat-status { color: #22c55e; }
html[data-theme="dark"] .chat-body { background: #0b1220; }
html[data-theme="dark"] .chat-empty { color: #475569; }
html[data-theme="dark"] .cb-me .cb-txt { background: rgba(37, 99, 235, 0.3); color: #e2e8f0; }
html[data-theme="dark"] .cb-them .cb-txt { background: rgba(30, 41, 59, 0.6); color: #e2e8f0; }
html[data-theme="dark"] .chat-input { background: rgba(15, 23, 42, 0.8); border-top-color: rgba(59, 130, 246, 0.1); }
html[data-theme="dark"] .chat-input input { background: rgba(30, 41, 59, 0.5); border-color: rgba(59, 130, 246, 0.2); color: #e2e8f0; }
html[data-theme="dark"] .chat-input input::placeholder { color: #475569; }
html[data-theme="dark"] .chat-input button { background: rgba(37, 99, 235, 0.3); color: #60a5fa; }

/* Toast dark */
html[data-theme="dark"] .toast { background: #1e293b; color: #e2e8f0; border-color: rgba(59, 130, 246, 0.2); }

/* Map dark */
html[data-theme="dark"] #mapSearchInput { background: rgba(30, 41, 59, 0.6); border-color: rgba(59, 130, 246, 0.2); color: #e2e8f0; }

/* Theme toggle + lang select */
.theme-toggle {
  width: 38px; height: 38px;
  border-radius: 11px;
  border: 1.5px solid rgba(59, 130, 246, 0.15);
  background: rgba(255, 255, 255, 0.5);
  color: var(--blue-700);
  font-size: 17px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: .25s;
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}
.lang-select {
  width: 48px; height: 38px;
  border-radius: 11px;
  border: 1.5px solid rgba(59, 130, 246, 0.15);
  background: rgba(255, 255, 255, 0.5);
  color: var(--blue-700);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: .25s;
  backdrop-filter: blur(8px);
  flex-shrink: 0;
  text-align: center;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding: 0 4px;
}
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .lang-select {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}
.theme-toggle:hover, .lang-select:hover {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
}
/* .lang-select defined above */

/* Mobile drawer dark */
html[data-theme="dark"] .mobile-drawer {
  background: #0f172a;
}
html[data-theme="dark"] .md-head { border-bottom-color: rgba(59, 130, 246, 0.1); }
html[data-theme="dark"] .md-head span { color: #e2e8f0 !important; }
html[data-theme="dark"] .md-close { background: rgba(30, 41, 59, 0.6); color: #94a3b8; }
html[data-theme="dark"] .md-nav a { color: #94a3b8; }
html[data-theme="dark"] .md-nav a:hover, html[data-theme="dark"] .md-nav a.active { background: rgba(37, 99, 235, 0.3); color: #fff; }
html[data-theme="dark"] .md-foot { border-top-color: rgba(59, 130, 246, 0.1); }
html[data-theme="dark"] .mobile-overlay { background: rgba(0, 0, 0, 0.6); }

/* Scrollbar dark */
html[data-theme="dark"] ::-webkit-scrollbar-track { background: #0b1220; }

/* Background orbs dark */
html[data-theme="dark"] .bg-orbs span { opacity: .3; }

/* Particles dark */
html[data-theme="dark"] #particleCanvas { opacity: .4; }

/* Responsive dark + lang */
@media (max-width: 768px) {
  .theme-toggle, .lang-select { width: 34px; height: 34px; font-size: 15px; }
  .lang-select { padding: 0 4px; font-size: 12px; }
}

/* ---------- Responsive ---------- */
/* --- Tablet (≤ 1024px) --- */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 44px; gap: 24px; }
  .hero p.lead { margin-left: auto; margin-right: auto; }
  .hero-cta, .hero-stats { justify-content: center; }
  .hero-stage { height: 380px; }
  .nav { display: none; }
  .mobile-menu-btn { display: flex; }
  .hdr-actions .search-box { display: none; }
  .hdr-actions .btn-primary { display: none; }
  .book-detail { grid-template-columns: 1fr; }
  .bd-cover { max-width: 240px; margin: 0 auto; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 28px; }
  .promo-emoji { display: none; }
  .rv-prev { left: 4px; }
  .rv-next { right: 4px; }
  .rv-slide { gap: 14px; }
  .promo { padding: 44px 32px; border-radius: 24px; }
}

/* --- Mobile (≤ 768px) --- */
@media (max-width: 768px) {
  .header-inner { padding: 6px 14px; gap: 10px; }
  .logo .logo-3d { width: 52px; height: 52px; }
  .hdr-actions { gap: 6px; }
  .hdr-actions .btn-ghost { display: none; }
  .hdr-actions .btn-primary { display: none; }
  .icon-btn { width: 38px; height: 38px; border-radius: 11px; }
  .icon-btn svg { width: 17px; height: 17px; }
  .search-box { max-width: 180px; }
  .hero { padding: 54px 16px 64px; }
  .hero h1 { letter-spacing: -1px; }
  .hero-stage { height: 300px; }
  .hero-stage .stage-ring { inset: 20px 14px; }
  .hero-stage .stage-glow { inset: 40px; }
  .book-fly { width: 110px; }
  .section { padding: 54px 16px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .books-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 14px; }
  .books-grid.carousel-mode .book-card { min-width: 155px; max-width: 155px; }
  .tilt-wrap { padding: 14px 14px 12px; }
  .book-cover .bk-title { font-size: 13px; }
  .book-info .b-title { font-size: 14px; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .footer { padding: 44px 16px 24px; }
  .footer .bottom { flex-direction: column; text-align: center; gap: 6px; }
  .promo { padding: 36px 20px; border-radius: 20px; }
  .promo h2 { font-size: clamp(22px, 5vw, 30px); }
  .rv-slide { gap: 10px; }
  .review-card { padding: 18px 14px; }
  .review-card .stars { font-size: 12px; }
  .review-card p { font-size: 13px; }
  .review-card .rv-ava { width: 36px; height: 36px; font-size: 13px; }
  .rv-arrow { width: 38px; height: 38px; font-size: 18px; }
  .chat-widget { width: min(340px, calc(100% - 24px)); right: 12px; bottom: 86px; height: 420px; max-height: calc(100vh - 110px); touch-action: none; }
  .chat-fab { width: 52px; height: 52px; font-size: 22px; right: 16px; bottom: 16px; touch-action: none; }
  .drawer { width: min(380px, 96vw); }
  .drawer-head { padding: 16px 18px; }
  .drawer-body { padding: 14px 18px; }
  .drawer-foot { padding: 16px 18px; }
  .modal { width: min(92vw, 540px); padding: 24px; border-radius: 20px; }
  .bd-cover { max-width: 200px; margin: 0 auto; }
  .bd-info h2 { font-size: 22px; }
  .bd-price .now { font-size: 26px; }
  .cart-item .ci-cover { width: 48px; height: 66px; }
  .type-tabs { gap: 4px; flex-wrap: wrap; }
  .type-tab { padding: 8px 14px; font-size: 12.5px; border-radius: 10px; }
}

/* --- Small mobile (≤ 560px) --- */
@media (max-width: 560px) {
  .section { padding: 42px 14px; }
  .hero { padding: 38px 14px 48px; }
  .hdr-actions .btn-primary { display: none; }
  .hdr-actions .search-box { display: none; }
  .hero-stats { gap: 8px; flex-wrap: wrap; }
  .stat { padding: 10px 12px; flex: 1 1 45%; max-width: none; }
  .stat b { font-size: 21px; }
  .books-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .books-grid.carousel-mode .book-card { min-width: 140px; max-width: 140px; }
  .tilt-wrap { padding: 12px; border-radius: 16px; }
  .book-cover .face { padding: 10px; }
  .book-cover .bk-title { font-size: 12px; }
  .book-cover .bk-price { font-size: 11px; }
  .book-info .b-title { font-size: 13px; }
  .book-info .b-author { font-size: 12px; }
  .book-row .price { font-size: 14px; }
  .add-btn { width: 34px; height: 34px; font-size: 16px; border-radius: 10px; }
  .promo { padding: 28px 16px; border-radius: 16px; }
  .promo h2 { font-size: 22px; }
  .promo p { font-size: 13.5px; margin-bottom: 20px; }
  .promo .btn-white { padding: 12px 24px; font-size: 13px; }
  .rv-slide { gap: 8px; }
  .review-card { padding: 14px 12px; border-radius: 16px; }
  .review-card .rv-name { font-size: 13px; }
  .rv-book { padding: 6px 8px; }
  .rv-book .rb-title { font-size: 11px; }
  .cat-card { min-width: 150px; max-width: 150px; min-height: 140px; padding: 22px 14px 20px; }
  .cat-card h3 { font-size: 14px; }
  .filter-chip { padding: 7px 14px; font-size: 12px; }
  .toast { padding: 12px 20px; font-size: 13px; max-width: 88vw; text-align: center; border-radius: 14px; }
}

/* --- Extra small (≤ 380px) --- */
@media (max-width: 380px) {
  body { padding-top: 76px; }
  .logo .logo-3d { width: 68px; height: 68px; }
  .header-inner { height: 70px; }
  .hero { padding: 32px 12px 40px; }
  .hero h1 { font-size: 28px; }
  .hero p.lead { font-size: 14px; }
  .hero-stage { height: 240px; }
  .book-fly { width: 85px; }
  .hero-cta .btn-primary { padding: 10px 18px; font-size: 13px; }
  .hero-stats { gap: 6px; }
  .stat { padding: 8px 10px; }
  .stat b { font-size: 18px; }
  .stat span { font-size: 11px; }
  .books-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .books-grid.carousel-mode { grid-template-columns: none; }
  .books-grid.carousel-mode .book-card { min-width: 160px; max-width: 160px; }
  .tilt-wrap { padding: 10px; }
  .book-cover .face { padding: 8px; }
  .book-cover .bk-tag { font-size: 8px; padding: 2px 6px; }
  .book-cover .bk-title { font-size: 11px; }
  .book-cover .bk-price { font-size: 10px; }
  .book-info .rate { font-size: 11px; }
  .book-info .b-title { font-size: 12.5px; }
  .book-info .b-author { font-size: 11px; }
  .book-row .price { font-size: 13px; }
  .section-head h2 { font-size: 22px; }
  .promo { padding: 24px 14px; }
  .promo h2 { font-size: 20px; }
  .promo .btn-white { padding: 11px 20px; font-size: 12px; }
  .modal { width: 98vw; padding: 18px; border-radius: 16px; }
  .modal .m-close { width: 34px; height: 34px; font-size: 14px; }
  .bd-info h2 { font-size: 19px; }
  .bd-info .meta div { font-size: 12px; padding: 5px 10px; }
  .bd-price .now { font-size: 22px; }
  .bd-btns { flex-direction: column; }
  .bd-btns .btn-primary { width: 100%; justify-content: center; }
  .rv-form textarea { min-height: 80px; }
  .drawer { width: 100%; }
  .drawer-head h3 { font-size: 16px; }
  .cart-item { gap: 10px; }
  .cart-item .ci-name { font-size: 13px; }
  .cart-item .ci-price { font-size: 12px; }
  .chat-widget { width: calc(100% - 16px); right: 8px; bottom: 78px; height: calc(100vh - 100px); max-height: none; border-radius: 16px; touch-action: none; }
  .chat-fab { width: 48px; height: 48px; font-size: 20px; right: 12px; bottom: 12px; touch-action: none; }
  .cat-card { min-width: 130px; max-width: 130px; min-height: 120px; }
  .footer { padding: 36px 12px 20px; }
  .footer h4 { font-size: 14px; }
  .footer a { font-size: 13px; }
}

/* Karusel qo'lda surish (drag/swipe) */
.books-track { cursor: grab; }
.books-track:active { cursor: grabbing; }

/* Karusel telefon optimizatsiyasi — GPU tezlashtirish */
.books-track { will-change: transform; transform: translateZ(0); backface-visibility: hidden; }
.books-carousel-row { contain: layout paint; }

/* ============================================================
   TELEFON/PLANSHET — og'ir GPU filtrlarini yengillashtirish
   Bezaklar va animatsiyalar SAQLANADI, faqat blur kamaytiriladi
   ============================================================ */
@media (max-width: 1024px) {
  /* Header blur — 18px juda og'ir, telefonda 8px yetarli (ko'rinishi bir xil) */
  .header {
    backdrop-filter: blur(8px) saturate(140%);
    -webkit-backdrop-filter: blur(8px) saturate(140%);
  }
  /* Katta blur'li glow — telefonda kichikroq radius (GPU tejamkorligi) */
  .stage-glow { filter: blur(18px); }
  /* Statlardagi backdrop blur yengillashtiriladi */
  .stat { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
  /* Animatsiyalanayotgan elementlarni GPU qatlamiga aniq joylash */
  .logo-3d, .book-fly, .book-fly .b3d, .stage-ring, .stage-glow,
  .float-orb, [class*="orb"] {
    will-change: transform;
    transform: translateZ(0);
  }
}

/* ============================================================
   TELEFON/PLANSHET — karusel kartalarini yengillashtirish
   drop-shadow (og'ir blur) o'rniga box-shadow. 3D/harakat saqlanadi.
   ============================================================ */
@media (max-width: 1024px) {
  /* Har kartadagi drop-shadow filtri eng og'ir yuk — oddiy soyaga almashtiramiz */
  .book-cover {
    filter: none;
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.22);
  }
  /* Aylanayotgan track kartalarini GPU qatlamiga aniq joylash */
  .books-track .tilt-wrap { will-change: auto; }
  .book-cover, .book-cover-wrap { transform: translateZ(0); }
}
