/* ==========================================================
   اللسانات — متجر الكتب والمستلزمات
   ========================================================== */
:root {
  --navy-900: #071a3d;
  --navy-800: #0b2554;
  --navy-700: #12336f;
  --navy-600: #1b4489;
  --navy-50: #eef2f9;
  --gold-600: #c9870f;
  --gold-500: #e09f1f;
  --gold-400: #f0b43c;
  --gold-50: #fdf6e7;
  --ink: #1d2433;
  --ink-2: #4a5263;
  --ink-3: #7b8292;
  --line: #e4e7ee;
  --line-2: #eef0f4;
  --bg: #f6f7f9;
  --white: #fff;
  --red: #d23b3b;
  --green: #1f8a4c;
  --radius: 8px;
  --radius-sm: 5px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 2px 10px rgba(16, 24, 40, .07);
  --container: 1280px;
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-serif: "Amiri", "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  direction: rtl;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; font-weight: 700; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
svg.i { width: 20px; height: 20px; flex: none; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font-weight: 600; font-size: 15px;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--navy-800); color: #fff; }
.btn-primary:hover { background: var(--navy-700); }
.btn-gold { background: var(--gold-500); color: var(--navy-900); }
.btn-gold:hover { background: var(--gold-400); }
.btn-outline { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--navy-700); color: var(--navy-700); }
.btn-ghost { background: transparent; color: var(--navy-700); padding: 0 8px; height: auto; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ---------- Topbar ---------- */
.topbar { background: var(--navy-900); color: #c7d1e6; font-size: 13px; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; height: 38px; }
.topbar a { display: inline-flex; align-items: center; gap: 6px; }
.topbar a:hover { color: #fff; }
.topbar .sep { width: 1px; height: 14px; background: rgba(255,255,255,.18); }
.topbar .group { display: flex; align-items: center; gap: 16px; }
.topbar svg.i { width: 15px; height: 15px; }

/* ---------- Header ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: relative; z-index: 30; }
.header-main .container { display: flex; align-items: center; gap: 32px; height: 92px; }
.logo { display: flex; align-items: center; gap: 12px; flex: none; }
.logo img { height: 66px; width: auto; border-radius: 6px; }
.logo .logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.logo .logo-text b { font-size: 22px; color: var(--navy-800); letter-spacing: -.2px; }
.logo .logo-text span { font-size: 12px; color: var(--ink-3); }

.search {
  flex: 1; display: flex; height: 48px; border: 2px solid var(--navy-800);
  border-radius: var(--radius); overflow: hidden; background: #fff; max-width: 680px;
}
.search select {
  border: 0; background: var(--navy-50); padding: 0 14px; font-size: 14px; color: var(--ink-2);
  border-left: 1px solid var(--line); outline: none; cursor: pointer;
}
.search input { flex: 1; border: 0; padding: 0 16px; outline: none; min-width: 0; font-size: 15px; }
.search button { border: 0; background: var(--navy-800); color: #fff; width: 58px; display: grid; place-items: center; }
.search button:hover { background: var(--navy-700); }

.header-actions { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.h-action {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius);
  color: var(--ink); position: relative;
}
.h-action:hover { background: var(--bg); }
.h-action svg.i { width: 26px; height: 26px; color: var(--navy-800); }
.h-action .lbl { display: flex; flex-direction: column; line-height: 1.25; font-size: 12px; color: var(--ink-3); }
.h-action .lbl b { font-size: 14px; color: var(--ink); font-weight: 600; }
.h-action .count {
  position: absolute; top: 2px; right: 26px; min-width: 19px; height: 19px; border-radius: 10px;
  background: var(--gold-500); color: var(--navy-900); font-size: 11px; font-weight: 700;
  display: grid; place-items: center; padding: 0 5px; border: 2px solid #fff;
}
.menu-toggle { display: none; border: 0; background: none; padding: 6px; color: var(--navy-800); }

/* ---------- Nav ---------- */
.main-nav { background: #fff; border-top: 1px solid var(--line-2); }
.main-nav .container { display: flex; align-items: stretch; height: 50px; }
.cat-trigger {
  display: flex; align-items: center; gap: 10px; background: var(--navy-800); color: #fff;
  padding: 0 20px; font-weight: 600; border: 0; min-width: 230px; position: relative;
}
.cat-trigger:hover { background: var(--navy-700); }
.cat-menu {
  position: absolute; top: 100%; right: 0; width: 260px; background: #fff; border: 1px solid var(--line);
  border-top: 0; box-shadow: var(--shadow); display: none; z-index: 40; color: var(--ink); text-align: right;
}
.cat-wrap { position: relative; display: flex; }
.cat-wrap:hover .cat-menu, .cat-wrap:focus-within .cat-menu { display: block; }
.cat-menu a { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line-2); font-size: 14px; font-weight: 500; }
.cat-menu a:hover { background: var(--navy-50); color: var(--navy-700); }
.cat-menu a svg.i { width: 18px; height: 18px; color: var(--ink-3); }
.nav-links { display: flex; align-items: center; gap: 4px; padding-inline-start: 12px; }
.nav-links a { display: flex; align-items: center; gap: 7px; padding: 0 14px; height: 100%; font-weight: 500; font-size: 14.5px; color: var(--ink-2); border-bottom: 2px solid transparent; }
.nav-links a:hover, .nav-links a.active { color: var(--navy-800); border-bottom-color: var(--gold-500); }
.nav-links svg.i { width: 18px; height: 18px; }
.nav-extra { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.nav-extra a { display: flex; align-items: center; gap: 6px; color: var(--navy-700); font-weight: 600; }
.nav-extra .pill { background: var(--gold-50); color: var(--gold-600); border: 1px solid #f4dfae; font-size: 12px; padding: 2px 8px; border-radius: 20px; font-weight: 600; }

/* ---------- Hero ---------- */
.hero { position: relative; background: var(--navy-900); overflow: hidden; }
.hero-slides { position: relative; height: 430px; }
.hero-slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity .7s ease; visibility: hidden;
  background-size: cover; background-position: center;
}
.hero-slide.active { opacity: 1; visibility: visible; }
.hero-slide::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(270deg, rgba(7,26,61,.94) 0%, rgba(7,26,61,.82) 38%, rgba(7,26,61,.25) 70%, rgba(7,26,61,0) 100%);
}
.hero-slide .container { position: relative; z-index: 2; height: 100%; display: flex; align-items: center; }
.hero-content { max-width: 560px; color: #fff; }
.hero-kicker { display: inline-block; font-size: 13px; font-weight: 600; color: var(--gold-400); letter-spacing: .3px; margin-bottom: 14px; border-inline-start: 3px solid var(--gold-500); padding-inline-start: 10px; }
.hero h1 { font-size: 44px; font-weight: 700; line-height: 1.25; }
.hero h1 em { font-style: normal; color: var(--gold-400); }
.hero p { margin-top: 14px; font-size: 17px; color: #d3dbea; max-width: 480px; }
.hero .hero-cta { display: flex; gap: 12px; margin-top: 26px; }
.hero .btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.hero .btn-outline-light:hover { border-color: #fff; }
.hero-dots { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 3; }
.hero-dots button { width: 28px; height: 4px; border: 0; border-radius: 2px; background: rgba(255,255,255,.35); padding: 0; }
.hero-dots button.active { background: var(--gold-500); }
.hero-arrows button {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.3); background: rgba(7,26,61,.35); color: #fff; display: grid; place-items: center;
}
.hero-arrows button:hover { background: rgba(7,26,61,.7); }
.hero-arrows .prev { right: 18px; }
.hero-arrows .next { left: 18px; }

/* ---------- Trust strip ---------- */
.trust { background: #fff; border-bottom: 1px solid var(--line); }
.trust .container { display: grid; grid-template-columns: repeat(4, 1fr); }
.trust-item { display: flex; align-items: center; gap: 14px; padding: 20px 18px; }
.trust-item + .trust-item { border-inline-start: 1px solid var(--line-2); }
.trust-item .ic { width: 46px; height: 46px; border-radius: 50%; background: var(--navy-50); color: var(--navy-700); display: grid; place-items: center; flex: none; }
.trust-item b { display: block; font-size: 15px; }
.trust-item span { font-size: 13px; color: var(--ink-3); }

/* ---------- Sections ---------- */
.section { padding: 44px 0 0; }
.section:last-of-type { padding-bottom: 56px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; gap: 16px; }
.section-head h2 { font-size: 24px; position: relative; padding-bottom: 10px; }
.section-head h2::after { content: ""; position: absolute; bottom: 0; right: 0; width: 48px; height: 3px; background: var(--gold-500); border-radius: 2px; }
.section-head .sub { font-size: 14px; color: var(--ink-3); margin-top: 2px; }
.more-link { display: inline-flex; align-items: center; gap: 6px; color: var(--navy-700); font-weight: 600; font-size: 14px; }
.more-link:hover { color: var(--gold-600); }

.tabs { display: flex; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px; }
.tabs button { border: 0; background: none; padding: 6px 14px; border-radius: 5px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.tabs button.active { background: var(--navy-800); color: #fff; }

/* ---------- Category tiles ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.cat-tile {
  position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/5; background: #ddd;
  display: flex; align-items: flex-end; color: #fff; isolation: isolate;
}
.cat-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .5s ease; }
.cat-tile::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(7,26,61,.88) 0%, rgba(7,26,61,.25) 50%, rgba(7,26,61,0) 75%); }
.cat-tile:hover img { transform: scale(1.05); }
.cat-tile .meta { padding: 16px; width: 100%; }
.cat-tile b { font-size: 17px; display: block; }
.cat-tile span { font-size: 13px; color: #cfd8ea; display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Book cover (generated) ---------- */
.cover {
  position: relative; aspect-ratio: 2/3; overflow: hidden; border-radius: 2px 4px 4px 2px;
  background: var(--c, #234); color: #fff; container-type: inline-size; isolation: isolate;
  box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 6px 14px -6px rgba(0,0,0,.35);
}
.cover::after { /* spine */
  content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 6%; z-index: 5;
  background: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(255,255,255,.18) 35%, rgba(0,0,0,.22) 70%, rgba(0,0,0,.08) 100%);
  pointer-events: none;
}
.cover .c-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
.cover .c-title { font-family: var(--font-serif); font-weight: 700; line-height: 1.15; font-size: 13cqi; }
.cover .c-author { font-size: 5.6cqi; font-weight: 500; opacity: .92; }
.cover .c-pub { font-size: 4.2cqi; opacity: .75; letter-spacing: .5px; }
.cover .c-tag { font-size: 4.6cqi; font-weight: 600; }

/* t1: full photo, dark fade, title top */
.cover.t1::before { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(180deg, rgba(0,0,0,.65) 0%, rgba(0,0,0,.1) 45%, rgba(0,0,0,.55) 100%); }
.cover.t1 .c-inner { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: 12cqi 10cqi 9cqi; text-align: center; }
.cover.t1 .c-title { font-size: 14cqi; text-shadow: 0 2px 8px rgba(0,0,0,.35); }

/* t2: color band top, photo bottom */
.cover.t2 .c-inner { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; }
.cover.t2 .c-band { background: var(--c); padding: 11cqi 9cqi 8cqi; height: 52%; display: flex; flex-direction: column; justify-content: space-between; }
.cover.t2 .c-band .c-title { font-size: 12.5cqi; }
.cover.t2 .c-photo { flex: 1; position: relative; }
.cover.t2 .c-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover.t2 .c-pub { position: absolute; bottom: 5cqi; left: 0; right: 0; text-align: center; z-index: 2; background: rgba(0,0,0,.35); padding: 1.5cqi 0; }

/* t3: typographic */
.cover.t3 { background: var(--c); }
.cover.t3 .c-inner { position: relative; z-index: 1; height: 100%; padding: 10cqi; display: flex; flex-direction: column; align-items: center; text-align: center; border: 2.4cqi solid var(--c); outline: 1px solid rgba(255,255,255,.35); outline-offset: -4.5cqi; }
.cover.t3 .c-tag { color: var(--a, #f0b43c); margin-top: 4cqi; }
.cover.t3 .c-title { margin-top: 7cqi; font-size: 13.5cqi; }
.cover.t3 .c-rule { width: 22cqi; height: 2px; background: var(--a, #f0b43c); margin: 6cqi 0; }
.cover.t3 .c-medal { width: 40cqi; height: 40cqi; border-radius: 50%; overflow: hidden; margin-top: auto; border: 1.4cqi solid rgba(255,255,255,.85); }
.cover.t3 .c-medal img { width: 100%; height: 100%; object-fit: cover; }
.cover.t3 .c-author { margin-top: 5cqi; }

/* t4: photo with light box */
.cover.t4 .c-inner { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 9cqi; }
.cover.t4 .c-box { background: #fbf8f1; color: #1d2433; padding: 9cqi 7cqi; text-align: center; width: 100%; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.cover.t4 .c-box .c-title { color: var(--c); font-size: 12.5cqi; }
.cover.t4 .c-box .c-author { color: #4a5263; margin-top: 3cqi; display: block; }
.cover.t4 .c-pub { position: absolute; bottom: 6cqi; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.5); }

/* t5: split vertical (left color strip) */
.cover.t5 { background: #f4efe4; color: #1d2433; }
.cover.t5 .c-inner { position: relative; z-index: 1; height: 100%; display: grid; grid-template-rows: auto 1fr auto; padding: 10cqi 9cqi 8cqi; }
.cover.t5 .c-title { color: var(--c); font-size: 13cqi; }
.cover.t5 .c-author { color: #4a5263; margin-top: 3cqi; display: block; }
.cover.t5 .c-photo { margin: 7cqi -9cqi 6cqi; position: relative; overflow: hidden; }
.cover.t5 .c-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover.t5 .c-pub { color: var(--c); font-weight: 700; opacity: 1; }

/* ---------- Product card ---------- */
.grid { display: grid; gap: 18px; }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
  display: flex; flex-direction: column; position: relative; transition: border-color .15s, box-shadow .15s;
}
.card:hover { border-color: #cfd5e1; box-shadow: var(--shadow); }
.card .thumb { display: block; position: relative; margin-bottom: 12px; }
.card.book .thumb { padding: 6px 10px 0; background: linear-gradient(180deg, #f4f5f8 0, #f4f5f8 80%, transparent 80%); border-radius: 4px; }
.card.prod .thumb { aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--bg); }
.card.prod .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card.prod:hover .thumb img { transform: scale(1.04); }
.badges { position: absolute; top: 8px; right: 8px; z-index: 6; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.badge { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 3px; line-height: 1.6; }
.badge-sale { background: var(--red); color: #fff; }
.badge-new { background: var(--navy-800); color: #fff; }
.badge-pdf { background: var(--gold-500); color: var(--navy-900); }
.wish-btn {
  position: absolute; top: 18px; left: 18px; z-index: 6; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: var(--ink-3);
}
.wish-btn svg.i { width: 17px; height: 17px; }
.wish-btn:hover { color: var(--red); }
.wish-btn.on { color: var(--red); border-color: #f3c8c8; background: #fff5f5; }
.wish-btn.on svg { fill: currentColor; }
.card .cat-name { font-size: 12px; color: var(--ink-3); }
.card h3 { font-size: 15px; font-weight: 600; margin: 2px 0 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; line-height: 1.35; }
.card h3 a:hover { color: var(--navy-700); }
.card .author { font-size: 13px; color: var(--ink-2); }
.rating { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.stars { display: inline-flex; color: #e2a80f; letter-spacing: -1px; font-size: 13px; }
.stars .off { color: #d8dce4; }
.price-row { display: flex; align-items: baseline; gap: 8px; margin-top: auto; padding-top: 10px; }
.price { font-size: 18px; font-weight: 700; color: var(--navy-800); }
.price small { font-size: 12px; font-weight: 500; }
.old-price { font-size: 13px; color: var(--ink-3); text-decoration: line-through; }
.card .add-btn { margin-top: 10px; height: 38px; font-size: 14px; }
.card .fmt { font-size: 12px; color: var(--green); display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.card .fmt svg.i { width: 14px; height: 14px; }

/* ---------- Steps ---------- */
.steps { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); display: grid; grid-template-columns: 1.2fr repeat(3, 1fr); overflow: hidden; }
.steps-intro { background: var(--navy-800); color: #fff; padding: 30px 28px; }
.steps-intro h2 { font-size: 22px; }
.steps-intro p { color: #c4cee3; font-size: 14px; margin-top: 8px; }
.steps-intro .btn { margin-top: 18px; }
.step { padding: 30px 26px; position: relative; }
.step + .step { border-inline-start: 1px solid var(--line-2); }
.step .num { font-size: 13px; font-weight: 700; color: var(--gold-600); }
.step .ic { width: 50px; height: 50px; border-radius: 10px; background: var(--gold-50); color: var(--gold-600); display: grid; place-items: center; margin: 10px 0 14px; }
.step .ic svg.i { width: 26px; height: 26px; }
.step b { font-size: 16px; display: block; }
.step p { font-size: 14px; color: var(--ink-2); margin-top: 4px; }

/* ---------- Promo banners ---------- */
.promos { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.promo { position: relative; border-radius: var(--radius); overflow: hidden; min-height: 220px; display: flex; align-items: center; color: #fff; isolation: isolate; }
.promo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.promo::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(270deg, rgba(7,26,61,.92) 0%, rgba(7,26,61,.6) 50%, rgba(7,26,61,.05) 100%); }
.promo.gold::before { background: linear-gradient(270deg, rgba(110,68,4,.92) 0%, rgba(150,95,10,.55) 50%, rgba(0,0,0,0) 100%); }
.promo .in { padding: 28px 32px; max-width: 360px; }
.promo small { font-size: 13px; color: var(--gold-400); font-weight: 600; }
.promo.gold small { color: #ffe1a1; }
.promo h3 { font-size: 26px; margin: 6px 0 8px; }
.promo p { font-size: 14px; color: #dbe2ef; margin-bottom: 16px; }

/* ---------- Best sellers block ---------- */
.bs-wrap { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; }
.featured {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px;
  display: grid; grid-template-columns: 200px 1fr; gap: 28px; align-items: center;
}
.featured .tag { display: inline-block; font-size: 12px; font-weight: 700; color: var(--gold-600); background: var(--gold-50); padding: 3px 10px; border-radius: 3px; }
.featured h3 { font-size: 24px; margin: 10px 0 4px; font-family: var(--font-serif); }
.featured .author { color: var(--ink-2); font-size: 14px; }
.featured .desc { font-size: 14px; color: var(--ink-2); margin: 12px 0 14px; }
.featured .facts { display: flex; gap: 18px; font-size: 13px; color: var(--ink-3); margin-bottom: 16px; flex-wrap: wrap; }
.featured .facts b { color: var(--ink); display: block; font-size: 14px; }
.featured .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rank-list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.rank-list .hd { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.rank-list .hd b { font-size: 17px; }
.rank-item { display: grid; grid-template-columns: 28px 52px 1fr auto; gap: 14px; align-items: center; padding: 11px 20px; border-bottom: 1px solid var(--line-2); }
.rank-item:last-child { border-bottom: 0; }
.rank-item .n { font-size: 20px; font-weight: 700; color: #c5cbd7; text-align: center; }
.rank-item:nth-child(-n+4) .n { color: var(--gold-500); }
.rank-item .t { font-size: 14px; font-weight: 600; line-height: 1.35; }
.rank-item .a { font-size: 12.5px; color: var(--ink-3); }
.rank-item .p { font-weight: 700; color: var(--navy-800); font-size: 15px; }

/* ---------- Newsletter ---------- */
.newsletter { background: var(--navy-800); color: #fff; margin-top: 56px; }
.newsletter .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 30px; }
.newsletter h3 { font-size: 20px; }
.newsletter p { color: #c4cee3; font-size: 14px; }
.newsletter form { display: flex; gap: 8px; flex: 0 1 460px; }
.newsletter input { flex: 1; height: 46px; border-radius: var(--radius-sm); border: 0; padding: 0 16px; outline: none; color: var(--ink); min-width: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-900); color: #aab6cf; font-size: 14px; }
.footer-top { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1.2fr; gap: 32px; padding: 44px 0 32px; }
.footer-top h4 { color: #fff; font-size: 16px; margin-bottom: 16px; }
.footer-top li { margin-bottom: 9px; }
.footer-top a:hover { color: var(--gold-400); }
.footer-about img { height: 64px; border-radius: 6px; margin-bottom: 14px; }
.footer-about p { font-size: 13.5px; line-height: 1.8; }
.footer-contact li { display: flex; gap: 10px; align-items: flex-start; }
.footer-contact svg.i { width: 18px; height: 18px; color: var(--gold-500); margin-top: 3px; }
.socials { display: flex; gap: 8px; margin-top: 16px; }
.socials a { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,.15); display: grid; place-items: center; color: #c7d1e6; }
.socials a:hover { background: var(--gold-500); color: var(--navy-900); border-color: var(--gold-500); }
.socials svg { width: 16px; height: 16px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); }
.footer-bottom .container { display: flex; align-items: center; justify-content: space-between; padding-block: 16px; font-size: 13px; gap: 16px; flex-wrap: wrap; }
.pay-methods { display: flex; gap: 6px; flex-wrap: wrap; }
.pay-methods span { background: #fff; color: var(--navy-900); font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 4px; }

/* ---------- Breadcrumb / page head ---------- */
.page-head { background: #fff; border-bottom: 1px solid var(--line); padding: 22px 0; }
.page-head h1 { font-size: 26px; }
.crumbs { display: flex; gap: 8px; font-size: 13px; color: var(--ink-3); margin-bottom: 6px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--navy-700); }
.crumbs span.sep { color: #c5cbd7; }

/* ---------- Shop ---------- */
.shop { display: grid; grid-template-columns: 270px 1fr; gap: 24px; padding: 28px 0 56px; align-items: start; }
.filters { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); position: sticky; top: 16px; }
.filter-block { padding: 18px 20px; border-bottom: 1px solid var(--line-2); }
.filter-block:last-child { border-bottom: 0; }
.filter-block h4 { font-size: 15px; margin-bottom: 12px; }
.check { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 14px; cursor: pointer; color: var(--ink-2); }
.check input { width: 17px; height: 17px; accent-color: var(--navy-800); margin: 0; }
.check .cnt { margin-inline-start: auto; font-size: 12px; color: var(--ink-3); background: var(--bg); padding: 0 7px; border-radius: 10px; }
.price-inputs { display: flex; gap: 8px; align-items: center; }
.price-inputs input { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 10px; outline: none; }
.price-inputs input:focus { border-color: var(--navy-700); }
.shop-bar { display: flex; align-items: center; justify-content: space-between; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.shop-bar .found { font-size: 14px; color: var(--ink-2); }
.shop-bar .found b { color: var(--ink); }
.select { height: 38px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 12px; background: #fff; outline: none; font-size: 14px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--navy-50); color: var(--navy-700); border: 0; border-radius: 20px; padding: 4px 12px; font-size: 13px; font-weight: 500; }
.empty { background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); padding: 50px 20px; text-align: center; color: var(--ink-2); }
.empty svg.i { width: 48px; height: 48px; color: #c5cbd7; margin: 0 auto 12px; }
.empty h3 { font-size: 18px; color: var(--ink); margin-bottom: 6px; }
.filters-toggle { display: none; }

/* ---------- Product page ---------- */
.pd { display: grid; grid-template-columns: 420px 1fr 300px; gap: 28px; padding: 28px 0; align-items: start; }
.pd-media { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 36px 56px; position: relative; }
.pd-media.book { background: linear-gradient(180deg, #eef1f6, #f8f9fb); }
.pd-media .cover { box-shadow: 0 2px 4px rgba(0,0,0,.12), 0 22px 40px -14px rgba(7,26,61,.55); }
.pd-media.prod { padding: 0; overflow: hidden; }
.pd-media.prod .main-img { aspect-ratio: 1; width: 100%; object-fit: cover; }
.pd-thumbs { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.pd-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 5px; border: 2px solid transparent; cursor: pointer; }
.pd-thumbs img.on { border-color: var(--navy-700); }
.pd-info h1 { font-size: 28px; font-family: var(--font-serif); line-height: 1.3; }
.pd-info.prod h1 { font-family: var(--font); font-size: 24px; }
.pd-info .by { font-size: 15px; color: var(--ink-2); margin-top: 6px; }
.pd-info .by a { color: var(--navy-700); font-weight: 600; }
.pd-info .rating { font-size: 13px; margin-top: 8px; }
.pd-info .rating .stars { font-size: 16px; }
.pd-info .short { color: var(--ink-2); margin: 16px 0; font-size: 15px; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.spec-table td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); }
.spec-table tr:last-child td { border-bottom: 0; }
.spec-table td:first-child { color: var(--ink-3); width: 38%; background: #fafbfc; }
.spec-table td:last-child { font-weight: 500; }
.opt-group { margin: 16px 0; }
.opt-group > b { display: block; font-size: 14px; margin-bottom: 8px; }
.opts { display: flex; gap: 8px; flex-wrap: wrap; }
.opts button { min-width: 44px; height: 38px; padding: 0 12px; border: 1px solid var(--line); background: #fff; border-radius: var(--radius-sm); font-size: 14px; }
.opts button.on { border-color: var(--navy-800); background: var(--navy-50); color: var(--navy-800); font-weight: 600; }
.opts .swatch { width: 32px; min-width: 32px; height: 32px; border-radius: 50%; padding: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
.opts .swatch.on { outline: 2px solid var(--navy-800); outline-offset: 2px; background-color: inherit; }
.buy-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; position: sticky; top: 16px; }
.buy-box .price { font-size: 30px; }
.buy-box .save { font-size: 13px; color: var(--red); font-weight: 600; }
.buy-box .fmt-line { display: flex; align-items: center; gap: 8px; margin: 14px 0; padding: 10px 12px; background: var(--gold-50); border: 1px solid #f4dfae; border-radius: var(--radius-sm); font-size: 13.5px; color: #7a520a; }
.buy-box .btn { margin-top: 8px; }
.buy-box ul { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.buy-box li { display: flex; gap: 10px; font-size: 13.5px; color: var(--ink-2); padding: 5px 0; align-items: center; }
.buy-box li svg.i { width: 18px; height: 18px; color: var(--green); }
.qty { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; height: 40px; }
.qty button { width: 36px; border: 0; background: var(--bg); font-size: 18px; }
.qty input { width: 46px; border: 0; text-align: center; outline: none; }
.stock { font-size: 13px; color: var(--green); font-weight: 600; margin: 8px 0; display: block; }

.pd-tabs { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; }
.pd-tabs .tab-heads { display: flex; border-bottom: 1px solid var(--line); padding: 0 12px; overflow-x: auto; }
.pd-tabs .tab-heads button { border: 0; background: none; padding: 14px 16px; font-weight: 600; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.pd-tabs .tab-heads button.active { color: var(--navy-800); border-bottom-color: var(--gold-500); }
.pd-tabs .tab-body { padding: 24px; display: none; color: var(--ink-2); }
.pd-tabs .tab-body.active { display: block; }
.pd-tabs .tab-body p + p { margin-top: 12px; }
.toc li { padding: 8px 0; border-bottom: 1px dashed var(--line); display: flex; justify-content: space-between; font-size: 14px; }
.review { padding: 16px 0; border-bottom: 1px solid var(--line-2); }
.review:last-child { border-bottom: 0; }
.review .who { display: flex; align-items: center; gap: 10px; }
.review .av { width: 38px; height: 38px; border-radius: 50%; background: var(--navy-50); color: var(--navy-700); display: grid; place-items: center; font-weight: 700; }
.review .who b { font-size: 14px; color: var(--ink); }
.review .who small { display: block; font-size: 12px; color: var(--ink-3); }
.review p { margin-top: 8px; font-size: 14px; }
.rating-summary { display: flex; gap: 32px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.rating-summary .big { font-size: 44px; font-weight: 700; color: var(--ink); line-height: 1; }
.bars { flex: 1; max-width: 340px; }
.bars div { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.bars span.b { flex: 1; height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; }
.bars span.b i { display: block; height: 100%; background: #e2a80f; }

/* ---------- Modal (sample reader) ---------- */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(7,15,30,.6); display: none; align-items: center; justify-content: center; padding: 20px; }
.modal.open { display: flex; }
.modal-box { background: #fff; border-radius: var(--radius); width: 100%; max-width: 820px; max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-hd { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-hd b { font-size: 16px; }
.modal-hd button { border: 0; background: none; color: var(--ink-3); padding: 4px; }
.reader { background: #e9ebef; padding: 24px; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.page-sheet { background: #fffdf8; width: 100%; max-width: 560px; aspect-ratio: 1/1.38; box-shadow: 0 2px 8px rgba(0,0,0,.12); padding: 48px 46px; font-family: var(--font-serif); font-size: 17px; line-height: 2; color: #2b2b2b; position: relative; }
.page-sheet h2 { font-size: 24px; text-align: center; margin-bottom: 18px; font-family: var(--font-serif); }
.page-sheet .pn { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; font-size: 13px; color: #999; font-family: var(--font); }
.page-sheet p { text-align: justify; }
.reader-lock { text-align: center; padding: 16px; background: #fff; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; font-size: 14px; }

/* ---------- Cart ---------- */
.cart-layout { display: grid; grid-template-columns: 1fr 360px; gap: 24px; padding: 28px 0 56px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.panel-hd { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.panel-hd h3 { font-size: 17px; }
.panel-bd { padding: 20px; }
.cart-row { display: grid; grid-template-columns: 84px 1fr auto auto 30px; gap: 18px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.cart-row:last-child { border-bottom: 0; }
.cart-row .im { width: 84px; }
.cart-row .im img { aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.cart-row .t { font-weight: 600; font-size: 15px; }
.cart-row .s { font-size: 13px; color: var(--ink-3); }
.cart-row .tagline { font-size: 12px; font-weight: 600; display: inline-flex; gap: 4px; align-items: center; margin-top: 4px; }
.cart-row .tagline.dig { color: var(--gold-600); }
.cart-row .tagline.phy { color: var(--navy-600); }
.cart-row .tagline svg.i { width: 14px; height: 14px; }
.cart-row .lp { font-weight: 700; color: var(--navy-800); min-width: 90px; text-align: left; }
.rm { border: 0; background: none; color: var(--ink-3); padding: 4px; }
.rm:hover { color: var(--red); }
.sum-line { display: flex; justify-content: space-between; padding: 7px 0; font-size: 14.5px; color: var(--ink-2); }
.sum-line.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; font-size: 18px; font-weight: 700; color: var(--ink); }
.coupon { display: flex; gap: 8px; margin: 14px 0; }
.coupon input, .field input, .field select, .field textarea {
  flex: 1; height: 42px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 12px; outline: none; background: #fff; width: 100%; min-width: 0;
}
.field textarea { height: 90px; padding: 10px 12px; resize: vertical; }
.coupon input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(18,51,111,.08); }
.note { font-size: 13px; color: var(--ink-3); display: flex; gap: 8px; align-items: flex-start; }
.note svg.i { width: 16px; height: 16px; margin-top: 3px; }

/* ---------- Forms / checkout ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.field .err { font-size: 12px; color: var(--red); display: none; }
.field.invalid input { border-color: var(--red); }
.field.invalid .err { display: block; }
.pay-opts { display: grid; gap: 10px; }
.pay-opt { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 13px 14px; cursor: pointer; }
.pay-opt:has(input:checked) { border-color: var(--navy-700); background: var(--navy-50); }
.pay-opt input { accent-color: var(--navy-800); width: 17px; height: 17px; margin: 0; }
.pay-opt b { font-size: 14.5px; }
.pay-opt small { display: block; font-size: 12.5px; color: var(--ink-3); }
.pay-opt .logos { margin-inline-start: auto; display: flex; gap: 4px; }
.pay-opt .logos span { font-size: 10.5px; font-weight: 700; border: 1px solid var(--line); border-radius: 3px; padding: 1px 6px; background: #fff; color: var(--navy-800); }
.card-fields { margin-top: 12px; display: none; }
.card-fields.show { display: grid; }
.checkout-steps { display: flex; gap: 0; margin-bottom: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.checkout-steps div { flex: 1; text-align: center; padding: 12px; font-size: 14px; font-weight: 600; color: var(--ink-3); border-inline-start: 1px solid var(--line-2); }
.checkout-steps div:first-child { border: 0; }
.checkout-steps div.on { color: var(--navy-800); background: var(--navy-50); }
.mini-item { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.mini-item img { aspect-ratio: 1; object-fit: cover; border-radius: 4px; }
.mini-item .q { font-size: 12px; color: var(--ink-3); }

.success { text-align: center; padding: 40px 20px; }
.success .ok { width: 72px; height: 72px; border-radius: 50%; background: #e7f5ec; color: var(--green); display: grid; place-items: center; margin: 0 auto 16px; }
.success .ok svg.i { width: 38px; height: 38px; }
.success h2 { font-size: 24px; }
.success p { color: var(--ink-2); margin-top: 6px; }

/* ---------- Library ---------- */
.lib-head { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.lib-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 24px 0; }
.lib-stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; gap: 14px; align-items: center; }
.lib-stat .ic { width: 44px; height: 44px; border-radius: 8px; background: var(--navy-50); color: var(--navy-700); display: grid; place-items: center; }
.lib-stat b { font-size: 22px; display: block; line-height: 1.2; }
.lib-stat span { font-size: 13px; color: var(--ink-3); }
.lib-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; grid-template-columns: 96px 1fr auto; gap: 20px; align-items: center; }
.lib-item + .lib-item { margin-top: 12px; }
.lib-item h3 { font-size: 17px; font-family: var(--font-serif); }
.lib-item .meta { font-size: 13px; color: var(--ink-3); margin-top: 4px; display: flex; gap: 14px; flex-wrap: wrap; }
.lib-item .actions { display: flex; flex-direction: column; gap: 8px; min-width: 170px; }
.progress { height: 5px; background: var(--line-2); border-radius: 3px; margin-top: 10px; max-width: 260px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--gold-500); }
.dl-count { font-size: 12px; color: var(--ink-3); text-align: center; }

/* ---------- Auth ---------- */
.auth-wrap { display: grid; grid-template-columns: 1fr 1fr; min-height: 560px; margin: 32px auto 56px; max-width: 980px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.auth-side { position: relative; color: #fff; padding: 40px; display: flex; flex-direction: column; justify-content: flex-end; isolation: isolate; }
.auth-side img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.auth-side::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(7,26,61,.95), rgba(7,26,61,.35)); }
.auth-side h2 { font-size: 26px; }
.auth-side p { color: #cfd8ea; margin-top: 8px; font-size: 14.5px; }
.auth-form { padding: 40px; }
.auth-tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.auth-tabs button { flex: 1; border: 0; background: none; padding: 12px; font-weight: 600; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 15px; }
.auth-tabs button.active { color: var(--navy-800); border-bottom-color: var(--gold-500); }
.auth-form form { display: grid; gap: 14px; }
.auth-form .row { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; }
.auth-form .row a { color: var(--navy-700); font-weight: 600; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 13px; margin: 6px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; bottom: 22px; left: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--navy-900); color: #fff; padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; display: flex; align-items: center; gap: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: tin .25s ease; max-width: 360px; }
.toast svg.i { color: var(--gold-400); width: 18px; height: 18px; }
.toast a { color: var(--gold-400); font-weight: 600; margin-inline-start: auto; white-space: nowrap; }
@keyframes tin { from { transform: translateY(10px); opacity: 0; } }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 24px; padding: 28px 0 56px; }
.contact-info .ci { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line-2); }
.contact-info .ci:last-child { border-bottom: 0; }
.contact-info .ic { width: 42px; height: 42px; border-radius: 8px; background: var(--navy-50); color: var(--navy-700); display: grid; place-items: center; flex: none; }
.contact-info b { display: block; font-size: 14.5px; }
.contact-info span { font-size: 14px; color: var(--ink-2); }
.faq details { border-bottom: 1px solid var(--line-2); padding: 14px 0; }
.faq summary { font-weight: 600; cursor: pointer; font-size: 15px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; color: var(--gold-600); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin-top: 8px; font-size: 14px; color: var(--ink-2); }

/* ---------- Mobile drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 90; display: none; }
.drawer.open { display: block; }
.drawer .shade { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.drawer .panel-in { position: absolute; top: 0; right: 0; bottom: 0; width: 290px; background: #fff; overflow-y: auto; }
.drawer .panel-in .dh { background: var(--navy-800); color: #fff; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; }
.drawer .panel-in .dh button { border: 0; background: none; color: #fff; }
.drawer .panel-in a { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line-2); font-weight: 500; }
.drawer .panel-in a svg.i { color: var(--ink-3); width: 19px; height: 19px; }

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 1200px) {
  .grid-6 { grid-template-columns: repeat(5, 1fr); }
  .pd { grid-template-columns: 340px 1fr; }
  .pd .buy-col { grid-column: 2; }
  .footer-top { grid-template-columns: 1.4fr 1fr 1fr 1.2fr; }
  .footer-top .f-hide { display: none; }
}
@media (max-width: 1024px) {
  .nav-links a:nth-child(n+5) { display: none; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .cat-tile { aspect-ratio: 16/10; }
  .grid-6, .grid-5 { grid-template-columns: repeat(4, 1fr); }
  .steps { grid-template-columns: 1fr 1fr; }
  .steps-intro { grid-column: 1 / -1; }
  .step:nth-child(2) { border-inline-start: 0; }
  .bs-wrap { grid-template-columns: 1fr; }
  .shop { grid-template-columns: 1fr; }
  .filters { position: fixed; top: 0; right: 0; bottom: 0; width: 300px; z-index: 95; overflow-y: auto; border-radius: 0; transform: translateX(105%); transition: transform .25s; }
  .filters.open { transform: none; box-shadow: -10px 0 30px rgba(0,0,0,.2); }
  .filters-toggle { display: inline-flex; }
  .cart-layout { grid-template-columns: 1fr; }
  .h-action .lbl { display: none; }
  .h-action .count { right: 4px; }
  .header-main .container { gap: 18px; }
  .trust .container { grid-template-columns: repeat(2, 1fr); }
  .trust-item:nth-child(3) { border-inline-start: 0; }
  .trust-item:nth-child(n+3) { border-top: 1px solid var(--line-2); }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .main-nav { display: none; }
  .menu-toggle { display: block; }
  .header-main .container { flex-wrap: wrap; height: auto; padding-block: 12px; gap: 10px 14px; }
  .logo img { height: 50px; }
  .logo .logo-text b { font-size: 19px; }
  .search { order: 5; flex-basis: 100%; max-width: none; height: 44px; }
  .search select { display: none; }
  .hero-slides { height: 400px; }
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 15px; }
  .hero-slide::after { background: linear-gradient(0deg, rgba(7,26,61,.95) 15%, rgba(7,26,61,.55) 100%); }
  .hero-slide .container { align-items: flex-end; padding-bottom: 54px; }
  .hero-arrows { display: none; }
  .grid-6, .grid-5, .grid-4 { grid-template-columns: repeat(3, 1fr); }
  .promos { grid-template-columns: 1fr; }
  .pd { grid-template-columns: 1fr; }
  .pd .buy-col { grid-column: auto; }
  .pd-media { max-width: 420px; width: 100%; margin-inline: auto; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
  .newsletter .container { flex-direction: column; align-items: stretch; text-align: center; }
  .newsletter form { flex-basis: auto; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { min-height: 200px; }
  .lib-stats { grid-template-columns: 1fr; }
  .featured { grid-template-columns: 150px 1fr; gap: 20px; padding: 20px; }
  .topbar .hide-sm { display: none; }
}
@media (max-width: 600px) {
  .container { padding-inline: 16px; }
  body { font-size: 14.5px; }
  .grid { gap: 12px; }
  .grid-6, .grid-5, .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cat-tile { aspect-ratio: 1; }
  .card { padding: 10px; }
  .card h3 { font-size: 14px; }
  .price { font-size: 16px; }
  .wish-btn { top: 12px; left: 12px; width: 30px; height: 30px; }
  .section-head { flex-wrap: wrap; }
  .section-head h2 { font-size: 20px; }
  .tabs { width: 100%; overflow-x: auto; }
  .tabs button { white-space: nowrap; }
  .steps { grid-template-columns: 1fr; }
  .step + .step { border-inline-start: 0; border-top: 1px solid var(--line-2); }
  .trust .container { grid-template-columns: 1fr 1fr; }
  .trust-item { padding: 14px 6px; gap: 10px; }
  .trust-item .ic { width: 38px; height: 38px; }
  .trust-item span { display: none; }
  .trust-item b { font-size: 13.5px; }
  .hero .hero-cta { flex-wrap: wrap; }
  .featured { grid-template-columns: 1fr; text-align: center; }
  .featured .cover { max-width: 170px; margin: 0 auto; }
  .featured .facts, .featured .actions { justify-content: center; }
  .rank-item { padding: 10px 14px; gap: 10px; grid-template-columns: 22px 44px 1fr auto; }
  .cart-row { grid-template-columns: 70px 1fr 30px; gap: 12px; padding: 14px; }
  .cart-row .im { width: 70px; }
  .cart-row .qty, .cart-row .lp { grid-column: 2; }
  .cart-row .lp { text-align: right; }
  .cart-row .rm { grid-column: 3; grid-row: 1; }
  .form-grid { grid-template-columns: 1fr; }
  .lib-item { grid-template-columns: 76px 1fr; gap: 14px; }
  .lib-item .actions { grid-column: 1 / -1; flex-direction: row; min-width: 0; }
  .lib-item .actions .btn { flex: 1; }
  .auth-form, .auth-side { padding: 24px; }
  .footer-top { grid-template-columns: 1fr; gap: 24px; }
  .page-sheet { padding: 28px 24px; font-size: 15px; }
  .pd-media { padding: 28px 48px; }
  .header-actions { gap: 0; }
  .h-action { padding: 8px; }
  .logo .logo-text span { display: none; }
  .topbar .group:first-child a span { display: none; }
}

/* ---------- Refinements ---------- */
.cover .c-title { overflow-wrap: anywhere; }
.card.book .thumb { padding-top: 34px; background: linear-gradient(180deg, #f4f5f8 0, #f4f5f8 82%, transparent 82%); }
.card.book .badges { flex-direction: row; top: 22px; right: 24px; }
.card.book .wish-btn { top: 19px; left: 22px; width: 28px; height: 28px; }
.card.book .wish-btn svg.i { width: 15px; height: 15px; }
.hero-arrows { display: none; }
@media (max-width: 600px) {
  .card.book .thumb { padding: 30px 6px 0; }
  .card.book .badges { top: 16px; right: 16px; }
  .card.book .wish-btn { top: 14px; left: 14px; }
}
.h-action .count[hidden]{display:none}

/* ==========================================================
   Simplified look (v2)
   ========================================================== */
/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.header-main .container { height: 76px; gap: 28px; }
.logo img { height: 52px; width: auto; border-radius: 0; }
.search { border: 1px solid var(--line); border-radius: 6px; height: 42px; max-width: 560px; background: #fafbfc; }
.search:focus-within { border-color: var(--navy-700); background: #fff; }
.search input { background: transparent; font-size: 14.5px; }
.search button { background: transparent; color: var(--ink-3); width: 46px; }
.search button:hover { background: transparent; color: var(--navy-800); }
.header-actions { gap: 4px; }
.h-action { gap: 6px; padding: 6px 10px; color: var(--ink-2); background: transparent !important; flex-direction: row; }
.h-action svg.i { width: 22px; height: 22px; color: currentColor; }
.h-action .lbl { font-size: 14px; color: inherit; font-weight: 500; }
.h-action:hover { color: var(--navy-700); }
.h-action .count { top: 0; right: 22px; min-width: 17px; height: 17px; font-size: 10.5px; background: var(--navy-800); color: #fff; border: 0; }
.main-nav { border-top: 1px solid var(--line-2); }
.main-nav .container { height: 46px; }
.nav-links { padding-inline-start: 0; gap: 0; }
.nav-links a { padding: 0 14px; border-bottom: 0; font-size: 14.5px; color: var(--ink-2); }
.nav-links a:first-child { padding-inline-start: 0; }
.nav-links a:hover, .nav-links a.active { color: var(--navy-700); border-bottom: 0; }
.nav-links a.active { font-weight: 600; }
.nav-extra a { color: var(--gold-600); font-weight: 600; }
.nav-extra a:hover, .nav-extra a.active { color: var(--navy-700); }
.nav-extra svg.i { width: 17px; height: 17px; }

/* Section tabs: text only */
.tabs { background: none; border: 0; padding: 0; gap: 18px; }
.tabs button { padding: 4px 0; border-radius: 0; color: var(--ink-3); }
.tabs button:hover { color: var(--navy-700); }
.tabs button.active { background: none; color: var(--navy-800); font-weight: 600; box-shadow: inset 0 -2px 0 var(--gold-500); }

/* Cards: shorter and quieter */
.card { padding: 12px; }
.card:hover { box-shadow: none; border-color: #cdd3de; }
.card.book .thumb { padding: 4px 0 0; background: none; width: 74%; margin: 0 auto 10px; }
.card.book .badges { top: 12px; right: 12px; flex-direction: column; }
.card.book .wish-btn, .card .wish-btn { top: 10px; left: 10px; width: 30px; height: 30px; border: 0; background: transparent; }
.card .wish-btn:hover { background: transparent; }
.card .wish-btn.on { background: transparent; }
.card.prod .thumb { aspect-ratio: 4/3; margin-bottom: 10px; }
.card .cat-name { display: none; }
.card h3 { min-height: 0; font-size: 14.5px; -webkit-line-clamp: 1; margin: 0; }
.card .author { font-size: 12.5px; }
.card .rating { margin-top: 2px; }
.card .fmt { display: none; }
.price-row { padding-top: 6px; }
.price { font-size: 16px; }
.card .add-btn { height: 34px; margin-top: 8px; font-size: 13.5px; background: transparent; color: var(--navy-800); border: 1px solid var(--line); }
.card .add-btn:hover { background: transparent; color: var(--gold-600); border-color: var(--line); }

/* Footer */
.footer-brand { display: block; color: #fff; font-size: 22px; margin-bottom: 10px; }
.footer-bottom .container { justify-content: center; }

/* Publish-your-book banner */
.publish-cta { display: flex; align-items: center; justify-content: space-between; gap: 24px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 30px; }
.publish-cta .txt { display: flex; gap: 16px; align-items: center; }
.publish-cta .ic { width: 52px; height: 52px; border-radius: 50%; background: var(--gold-50); color: var(--gold-600); display: grid; place-items: center; flex: none; }
.publish-cta h3 { font-size: 19px; }
.publish-cta p { color: var(--ink-2); font-size: 14px; margin-top: 2px; }

/* Upload page */
.upload-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; padding: 28px 0 56px; align-items: start; }
.dropzone { border: 1.5px dashed #c5cbd7; border-radius: var(--radius); padding: 28px 20px; text-align: center; cursor: pointer; background: #fafbfc; transition: border-color .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--navy-700); }
.dropzone svg.i { width: 34px; height: 34px; color: var(--ink-3); margin: 0 auto 8px; }
.dropzone b { display: block; font-size: 15px; }
.dropzone span { font-size: 13px; color: var(--ink-3); }
.dropzone .file-name { margin-top: 10px; font-size: 14px; color: var(--green); font-weight: 600; }
.dropzone.invalid { border-color: var(--red); }
.terms-box { background: #fafbfc; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; font-size: 13.5px; color: var(--ink-2); max-height: 170px; overflow-y: auto; line-height: 1.8; }
.terms-box ol { margin: 6px 0 0; padding-inline-start: 18px; }
.agree { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink); cursor: pointer; padding: 6px 0; }
.agree input { width: 17px; height: 17px; margin: 3px 0 0; accent-color: var(--navy-800); flex: none; }
.agree.invalid { color: var(--red); }
.side-steps li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; color: var(--ink-2); }
.side-steps li:last-child { border-bottom: 0; }
.side-steps .n { width: 26px; height: 26px; border-radius: 50%; background: var(--navy-50); color: var(--navy-700); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.upload-progress { height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; margin-top: 12px; display: none; }
.upload-progress i { display: block; height: 100%; width: 0; background: var(--navy-700); transition: width .2s; }

@media (max-width: 1024px) {
  .h-action .lbl { display: none; }
  .upload-layout { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .header-main .container { height: auto; }
  .logo img { height: 44px; }
  .publish-cta { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 600px) {
  .card.book .thumb { width: 82%; }
}
.card .badges { display: none; }

/* Uploaded cover / orders / payment */
.cover.cover-photo .c-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.status-badge { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 2px 10px; border-radius: 20px; white-space: nowrap; }
.order-card { padding: 16px 18px; margin-bottom: 12px; }
.order-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.order-head > div { display: flex; flex-direction: column; line-height: 1.4; }
.order-head > div span { font-size: 12.5px; color: var(--ink-3); }
.order-total { margin-inline-start: auto; color: var(--navy-800); }
.order-items { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13.5px; color: var(--ink-2); }
.pay-box { border: 1px solid #f4dfae; background: var(--gold-50); border-radius: var(--radius-sm); padding: 14px 16px; margin-top: 12px; display: grid; gap: 8px; }
.pay-box-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.pay-box-row span { color: var(--ink-2); }
.pay-ref-form label { font-size: 13px; color: var(--ink-2); }
.pay-box .btn-ghost { justify-self: start; }
.field input, .field select, .field textarea { flex: none; }
.field textarea { min-height: 90px; }
.proof-form label { font-size: 13px; color: var(--ink-2); display: block; margin-bottom: 6px; }
.proof-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.proof-row input[type=file], #f-proof { font-size: 13.5px; padding: 8px; border: 1px dashed #c5cbd7; border-radius: var(--radius-sm); background: #fff; height: auto !important; flex: 1; min-width: 0; }
.pay-box .field label { font-size: 13px; }
