/* Dar Al Maaref Al Hekmiya — storefront design system (RTL) */
:root {
  --ink: #0d2235;
  --ink-2: #2a3f55;
  --brand: #0070b0;
  --brand-600: #005a8f;
  --brand-50: #e7f1f8;
  --brand-bright: #3a9bd5;
  --grey-brand: #9a9796;
  --gold: #b0843a;
  --gold-50: #f7efe0;
  --paper: #faf7f0;
  --surface: #ffffff;
  --line: #e6dfd0;
  --muted: #6d6a60;
  --danger: #b4372f;
  --danger-50: #fbecea;
  --success: #2c7a4b;
  --success-50: #e7f4ec;
  --warning: #a8670c;
  --warning-50: #fdf3e2;
  --whatsapp: #1fa855;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(13, 34, 53, .06), 0 6px 20px rgba(13, 34, 53, .06);
  --shadow-lg: 0 12px 40px rgba(13, 34, 53, .14);
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-title: "Amiri", "Traditional Arabic", serif;
  --container: 1220px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.75; color: var(--ink);
  background: var(--paper); direction: rtl; text-align: right;
}
img { max-width: 100%; height: auto; display: block; }
svg.icon { width: 1.2em; height: 1.2em; flex: none; vertical-align: -0.2em; }
svg.icon-xl { width: 44px; height: 44px; color: var(--gold); }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); }
h1, h2, h3, h4 { font-family: var(--font-title); line-height: 1.35; margin: 0 0 .5em; color: var(--ink); font-weight: 700; }
h1 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
h2 { font-size: clamp(1.45rem, 2.4vw, 2rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brand-bright); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.section { padding-top: 56px; padding-bottom: 56px; }
.section-sm { padding-top: 32px; padding-bottom: 32px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head p { margin: 4px 0 0; color: var(--muted); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--gold); font-weight: 600; font-size: .9rem; letter-spacing: 0; }
.eyebrow::before { content: ""; width: 22px; height: 2px; background: currentColor; border-radius: 2px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.grid { display: grid; gap: 20px; }
.stack > * + * { margin-top: 16px; }
.flex { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px;
  border-radius: 999px; border: 1.5px solid transparent; font-weight: 600; font-size: .95rem; cursor: pointer;
  text-decoration: none; transition: background .15s, color .15s, border-color .15s, transform .1s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); color: #fff; }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: #95702f; color: #fff; }
.btn-outline { border-color: var(--line); background: var(--surface); color: var(--ink); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--brand-50); }
.btn-whatsapp { background: var(--whatsapp); color: #fff; }
.btn-whatsapp:hover { background: #178a45; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: .875rem; }
.btn-lg { min-height: 52px; padding: 12px 28px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }

/* Forms */
.form-field { margin-bottom: 16px; }
.form-field label, .label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 120px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(0, 112, 176, .12); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .85rem; margin-top: 4px; }
.hint { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 4px; accent-color: var(--brand); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid transparent; }
.alert-success { background: var(--success-50); color: var(--success); border-color: #cbe7d6; }
.alert-error { background: var(--danger-50); color: var(--danger); border-color: #f2cdc9; }
.alert-info { background: var(--brand-50); color: var(--brand-600); border-color: #cfe6e6; }
.alert-warning { background: var(--warning-50); color: var(--warning); border-color: #f3dfbb; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card-flat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--brand-50); color: var(--brand-600); }
.badge-gold { background: var(--gold-50); color: #8a6526; }
.badge-danger { background: var(--danger-50); color: var(--danger); }
.badge-success { background: var(--success-50); color: var(--success); }
.badge-muted { background: #efece4; color: var(--muted); }

/* Top bar & header */
.topbar { background: var(--ink); color: #d3dfeb; font-size: .85rem; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 38px; }
.topbar a { color: #fff; }
.topbar .tb-items { display: flex; gap: 18px; align-items: center; }
.topbar svg { width: 15px; height: 15px; vertical-align: -3px; margin-left: 4px; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-main { display: flex; align-items: center; gap: 20px; min-height: 76px; }
.logo { display: flex; align-items: center; gap: 12px; color: var(--ink); flex: none; }
.logo:hover { color: var(--ink); }
.logo-mark { width: 54px; height: auto; flex: none; }
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-text strong { font-family: var(--font-title); font-size: 1.45rem; }
.logo-text span { font-size: .72rem; color: var(--muted); letter-spacing: .5px; direction: ltr; text-align: right; }
.logo-img { height: 54px; width: auto; }
.header-search { flex: 1; max-width: 520px; position: relative; }
.header-search input { width: 100%; height: 46px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); padding: 0 48px 0 18px; }
.header-search input:focus { outline: none; border-color: var(--brand); background: #fff; }
.header-search button { position: absolute; top: 4px; right: 4px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; cursor: pointer; }
.header-search button svg { width: 18px; height: 18px; }
.suggest-box { position: absolute; top: calc(100% + 6px); right: 0; left: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); overflow: hidden; z-index: 60; }
.suggest-box a { display: flex; gap: 10px; align-items: center; padding: 8px 12px; color: var(--ink); }
.suggest-box a:hover, .suggest-box a.active { background: var(--brand-50); }
.suggest-box img { width: 34px; height: 48px; object-fit: cover; border-radius: 4px; }
.suggest-box .s-meta { font-size: .8rem; color: var(--muted); }
.header-actions { display: flex; align-items: center; gap: 6px; margin-right: auto; }
.icon-btn { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 12px; border-radius: 999px; color: var(--ink); background: transparent; border: 0; cursor: pointer; font-weight: 500; font-size: .9rem; }
.icon-btn:hover { background: var(--brand-50); color: var(--brand-600); }
.icon-btn svg { width: 22px; height: 22px; }
.cart-count { position: absolute; top: 2px; left: 2px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--gold); color: #fff; font-size: .72rem; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.cart-count[data-count="0"] { display: none; }
.main-nav { border-top: 1px solid var(--line); }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.main-nav > .container > ul > li { position: relative; }
.main-nav a { display: block; padding: 12px 14px; color: var(--ink); font-weight: 500; font-size: .95rem; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a.active { color: var(--brand); border-bottom-color: var(--brand); }
.main-nav .has-sub > .sub { display: none; position: absolute; top: 100%; right: 0; min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 6px; z-index: 55; }
.main-nav .has-sub:hover > .sub, .main-nav .has-sub:focus-within > .sub { display: block; }
.main-nav .sub a { border: 0; border-radius: 6px; padding: 8px 12px; display: flex; justify-content: space-between; }
.main-nav .sub a:hover { background: var(--brand-50); }
.main-nav .nav-ebooks a { color: var(--gold); }
.menu-toggle { display: none; }

/* Hero */
.hero { position: relative; overflow: hidden; background: radial-gradient(1200px 500px at 85% -10%, rgba(58, 155, 213, .28), transparent 60%), linear-gradient(160deg, #0b1d2e 0%, #0e2c47 55%, #0f3a5e 100%); color: #e8eff6; }
.hero::after { content: ""; position: absolute; inset: 0; background-image: url("../images/pattern.svg"); background-size: 120px; opacity: .06; pointer-events: none; }
.hero .container { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; padding-top: 64px; padding-bottom: 64px; }
.hero h1 { color: #fff; font-size: clamp(2rem, 4.4vw, 3.3rem); margin-bottom: 16px; }
.hero p { color: #c5d5e4; font-size: 1.1rem; max-width: 560px; }
.hero .eyebrow { color: #e5c07b; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero .btn-outline { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.hero .btn-outline:hover { border-color: #fff; color: #fff; }
.hero-stats { display: flex; gap: 32px; margin-top: 36px; flex-wrap: wrap; }
.hero-stats strong { display: block; font-family: var(--font-title); font-size: 2rem; color: #fff; line-height: 1.1; }
.hero-stats span { font-size: .9rem; color: #a3bbd1; }
.hero-books { position: relative; height: 380px; }
.hero-books .hb { position: absolute; width: 190px; border-radius: 6px 12px 12px 6px; box-shadow: 0 25px 50px rgba(0, 0, 0, .45); overflow: hidden; background: #234; aspect-ratio: 2/3; transition: transform .4s; }
.hero-books .hb img { width: 100%; height: 100%; object-fit: cover; }
.hero-books .hb:nth-child(1) { right: 34%; top: 0; z-index: 3; transform: rotate(-2deg); }
.hero-books .hb:nth-child(2) { right: 4%; top: 40px; z-index: 2; transform: rotate(6deg) scale(.9); }
.hero-books .hb:nth-child(3) { right: 62%; top: 50px; z-index: 1; transform: rotate(-9deg) scale(.86); }
.hero-books:hover .hb:nth-child(1) { transform: rotate(0) translateY(-6px); }

/* Series tiles */
.series-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.series-tile { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 150px; padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--ink); overflow: hidden; transition: transform .2s, box-shadow .2s; }
.series-tile::before { content: ""; position: absolute; inset: auto -30px -60px auto; width: 150px; height: 150px; border-radius: 50%; background: var(--brand-50); transition: transform .3s; }
.series-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: var(--ink); }
.series-tile:hover::before { transform: scale(1.3); }
.series-tile h3 { position: relative; margin: 0; font-size: 1.5rem; }
.series-tile span { position: relative; color: var(--muted); font-size: .9rem; }
.series-tile .st-icon { position: absolute; top: 18px; left: 18px; width: 40px; height: 40px; color: var(--gold); }

/* Book grid & cards */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 24px 20px; }
.book-card { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; transition: transform .2s, box-shadow .2s; }
.book-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.book-cover { position: relative; display: block; aspect-ratio: 2/3; background: linear-gradient(135deg, #efe9dc, #e2d9c6); overflow: hidden; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.book-card:hover .book-cover img { transform: scale(1.04); }
.book-badges { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.book-badges .badge { box-shadow: 0 2px 8px rgba(0, 0, 0, .12); background: #fff; }
.book-badges .badge-ebook { background: var(--ink); color: #f1d9a8; }
.book-badges .badge-sale { background: var(--danger); color: #fff; }
.book-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 14px 16px; flex: 1; }
.book-title { font-family: var(--font-title); font-size: 1.12rem; line-height: 1.4; margin: 0; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-title a { color: inherit; }
.book-author { font-size: .85rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.book-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price { font-weight: 700; color: var(--brand-600); font-size: 1.05rem; white-space: nowrap; }
.price del { color: var(--muted); font-weight: 400; font-size: .85rem; margin-left: 4px; }
.price-ebook { font-size: .8rem; color: var(--gold); font-weight: 600; }
.add-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--brand-50); color: var(--brand-600); display: grid; place-items: center; cursor: pointer; transition: background .15s, color .15s; flex: none; }
.add-btn:hover { background: var(--brand); color: #fff; }
.add-btn svg { width: 20px; height: 20px; }
.add-btn.added { background: var(--success); color: #fff; }

/* Shop layout */
.page-head { background: var(--surface); border-bottom: 1px solid var(--line); padding: 28px 0; }
.page-head h1 { margin: 0; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb span::before { content: "‹"; margin-left: 6px; }
.shop-layout { display: grid; grid-template-columns: 270px 1fr; gap: 28px; align-items: start; }
.filters { position: sticky; top: 140px; }
.filters .card-flat + .card-flat { margin-top: 16px; }
.filters h4 { font-family: var(--font); font-size: .95rem; margin-bottom: 10px; }
.filter-list { list-style: none; margin: 0; padding: 0; }
.filter-list a { display: flex; justify-content: space-between; padding: 6px 10px; border-radius: 8px; color: var(--ink); font-size: .93rem; }
.filter-list a:hover { background: var(--brand-50); }
.filter-list a.active { background: var(--brand); color: #fff; }
.filter-list .count { color: var(--muted); font-size: .8rem; }
.filter-list a.active .count { color: #d3e6f3; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.toolbar .select { width: auto; min-height: 40px; padding: 6px 12px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .85rem; color: var(--ink); }
.chip:hover { border-color: var(--danger); color: var(--danger); }
.filters-toggle { display: none; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty svg { width: 64px; height: 64px; margin: 0 auto 12px; color: var(--line); }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 36px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 42px; height: 42px; display: grid; place-items: center; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 500; }
.pagination a:hover { border-color: var(--brand); color: var(--brand); }
.pagination .current { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination .gap { border: 0; background: transparent; }

/* Book page */
.book-page { display: grid; grid-template-columns: 380px 1fr; gap: 48px; align-items: start; }
.book-gallery { position: sticky; top: 140px; }
.book-gallery .cover-frame { border-radius: 8px 16px 16px 8px; overflow: hidden; box-shadow: 0 30px 60px rgba(13, 34, 53, .25); aspect-ratio: 2/3; background: #eee7d8; }
.book-gallery .cover-frame img { width: 100%; height: 100%; object-fit: cover; }
.book-info h1 { margin-bottom: 8px; }
.book-meta-line { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); margin-bottom: 20px; }
.book-meta-line a { font-weight: 600; }
.formats { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin: 20px 0; }
.format-opt { position: relative; display: block; padding: 18px; border-radius: var(--radius); border: 2px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.format-opt input { position: absolute; opacity: 0; }
.format-opt:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(0, 112, 176, .1); }
.format-opt.disabled { opacity: .55; cursor: not-allowed; }
.format-opt .fo-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.format-opt .fo-title { font-weight: 700; display: flex; gap: 8px; align-items: center; }
.format-opt .fo-title svg { width: 20px; height: 20px; color: var(--brand); }
.format-opt .fo-price { font-weight: 700; font-size: 1.2rem; color: var(--brand-600); }
.format-opt .fo-desc { font-size: .85rem; color: var(--muted); margin-top: 6px; }
.buy-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; height: 48px; }
.qty button { width: 42px; height: 100%; border: 0; background: transparent; cursor: pointer; font-size: 1.2rem; color: var(--ink); }
.qty input { width: 44px; border: 0; text-align: center; background: transparent; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.specs { width: 100%; border-collapse: collapse; margin: 8px 0 24px; }
.specs th, .specs td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: right; }
.specs th { width: 38%; color: var(--muted); font-weight: 500; }
.prose { font-size: 1.05rem; line-height: 1.95; }
.prose h2, .prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-right: 1.4em; padding-left: 0; }
.prose blockquote { margin: 1em 0; padding: 12px 18px; border-right: 4px solid var(--gold); background: var(--gold-50); border-radius: 8px; }
.prose img { border-radius: 10px; }
.prose table { width: 100%; border-collapse: collapse; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px; }
.ebook-note { display: flex; gap: 14px; padding: 16px 18px; border-radius: var(--radius); background: linear-gradient(135deg, #0d2235, #12395c); color: #d8e4ef; margin: 20px 0; }
.ebook-note svg { width: 34px; height: 34px; color: #e5c07b; flex: none; }
.ebook-note strong { color: #fff; }
.ebook-note a { color: #f1d9a8; text-decoration: underline; }

/* Cart & checkout */
.cart-layout { display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: start; }
.cart-item { display: grid; grid-template-columns: 76px 1fr auto; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cart-item:last-child { border-bottom: 0; }
.cart-item img { width: 76px; aspect-ratio: 2/3; object-fit: cover; border-radius: 6px; }
.cart-item h3 { font-size: 1.1rem; margin: 0 0 4px; }
.cart-item .ci-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.cart-item .qty { height: 38px; }
.cart-item .qty button { width: 34px; }
.link-danger { background: none; border: 0; color: var(--danger); cursor: pointer; font-size: .85rem; padding: 0; }
.summary { position: sticky; top: 140px; }
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; }
.summary-total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; font-weight: 700; font-size: 1.2rem; }
.pay-opts { display: grid; gap: 10px; }
.pay-opt { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: #fff; cursor: pointer; }
.pay-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.pay-opt input { accent-color: var(--brand); width: 18px; height: 18px; }
.steps { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.steps li { list-style: none; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; }
.steps li b { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #ece6d8; color: var(--muted); font-size: .85rem; }
.steps li.on { color: var(--ink); font-weight: 600; }
.steps li.on b { background: var(--brand); color: #fff; }
.steps li + li::before { content: ""; width: 26px; height: 2px; background: var(--line); }
.confirm-hero { text-align: center; padding: 48px 20px; }
.confirm-hero .ok-icon { width: 76px; height: 76px; margin: 0 auto 16px; border-radius: 50%; background: var(--success-50); color: var(--success); display: grid; place-items: center; }
.confirm-hero .ok-icon svg { width: 40px; height: 40px; }
.order-table { width: 100%; border-collapse: collapse; }
.order-table th, .order-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.order-table th { color: var(--muted); font-weight: 500; font-size: .9rem; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 22px 16px 0; }
.timeline li::before { content: ""; position: absolute; right: 4px; top: 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.timeline li::after { content: ""; position: absolute; right: 8px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }

/* Auth / account */
.auth-wrap { max-width: 460px; margin: 48px auto; }
.auth-wrap .card { padding: 32px; }
.account-layout { display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: start; }
.account-nav { list-style: none; margin: 0; padding: 8px; }
.account-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--ink); font-weight: 500; }
.account-nav a:hover { background: var(--brand-50); }
.account-nav a.active { background: var(--brand); color: #fff; }
.account-nav svg { width: 18px; height: 18px; }

/* Authors */
.author-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.author-card { display: flex; gap: 12px; align-items: center; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.author-card:hover { border-color: var(--brand); box-shadow: var(--shadow); color: var(--ink); }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--gold-50); color: #8a6526; display: grid; place-items: center; font-family: var(--font-title); font-size: 1.3rem; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-card strong { display: block; line-height: 1.4; }
.author-card span { font-size: .82rem; color: var(--muted); }

/* E-book promo band */
.ebook-band { background: linear-gradient(135deg, #0b1d2e, #0f3456); color: #d5e2ee; border-radius: 24px; padding: 44px; display: grid; grid-template-columns: 1.2fr .8fr; gap: 32px; align-items: center; position: relative; overflow: hidden; }
.ebook-band h2 { color: #fff; }
.ebook-band .eyebrow { color: #e5c07b; }
.feature-list { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 12px; }
.feature-list li { display: flex; gap: 12px; align-items: flex-start; }
.feature-list svg { width: 22px; height: 22px; color: #e5c07b; flex: none; margin-top: 3px; }
.device-mock { justify-self: center; width: 240px; aspect-ratio: 9/17; border-radius: 34px; background: #08182a; border: 8px solid #213f5c; box-shadow: 0 30px 60px rgba(0, 0, 0, .4); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.device-mock .dm-page { flex: 1; border-radius: 12px; background: #fbf8f1; padding: 16px 14px; position: relative; overflow: hidden; }
.device-mock .dm-line { height: 7px; border-radius: 4px; background: #e2dccd; margin-bottom: 9px; }
.device-mock .dm-line.s { width: 70%; }
.device-mock .dm-wm { position: absolute; inset: 0; display: grid; place-items: center; transform: rotate(-30deg); color: rgba(0, 112, 176, .14); font-weight: 700; font-size: .8rem; white-space: nowrap; }
.device-mock .dm-bar { height: 26px; border-radius: 8px; background: #14324f; display: flex; align-items: center; justify-content: center; color: #9bb9b6; font-size: .7rem; }

/* Steps how-it-works */
.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; counter-reset: how; }
.how .card-flat { position: relative; padding-top: 52px; }
.how .card-flat::before { counter-increment: how; content: counter(how); position: absolute; top: 16px; right: 20px; width: 30px; height: 30px; border-radius: 50%; background: var(--gold-50); color: #8a6526; display: grid; place-items: center; font-weight: 700; }
.how h3 { font-family: var(--font); font-size: 1.05rem; }

/* Footer */
.site-footer { background: var(--ink); color: #b4c5d6; margin-top: 64px; }
.site-footer a { color: #dde8f2; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 32px; padding: 52px 0 36px; }
.site-footer h4 { color: #fff; font-family: var(--font); font-size: 1rem; margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer .logo { color: #fff; }
.site-footer .logo-text span { color: #8ea9c2; }
.footer-contact li { display: flex; gap: 10px; align-items: flex-start; }
.footer-contact svg { width: 18px; height: 18px; color: #e5c07b; flex: none; margin-top: 5px; }
.socials { display: flex; gap: 8px; margin-top: 14px; }
.socials a { width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, .08); display: grid; place-items: center; }
.socials a:hover { background: var(--brand); }
.socials svg { width: 18px; height: 18px; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding: 18px 0; font-size: .85rem; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Floating WhatsApp */
.wa-float { position: fixed; left: 20px; bottom: 20px; z-index: 70; width: 58px; height: 58px; border-radius: 50%; background: var(--whatsapp); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 30px rgba(31, 168, 85, .45); transition: transform .2s; }
.wa-float:hover { transform: scale(1.07); color: #fff; }
.wa-float svg { width: 30px; height: 30px; }

/* Toast */
.toast { position: fixed; bottom: 24px; right: 50%; transform: translateX(50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 90; display: flex; gap: 12px; align-items: center; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(50%) translateY(0); pointer-events: auto; }
.toast a { color: #f1d9a8; font-weight: 600; }

/* Responsive */
@media (max-width: 980px) {
  .shop-layout { grid-template-columns: 1fr; }
  .filters { position: fixed; inset: 0 0 0 auto; width: min(340px, 90vw); background: var(--paper); z-index: 80; padding: 16px; overflow-y: auto; transform: translateX(105%); transition: transform .25s; box-shadow: var(--shadow-lg); top: 0; }
  .filters.open { transform: translateX(0); }
  .filters-toggle { display: inline-flex; }
  .book-page { grid-template-columns: 300px 1fr; gap: 32px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .cart-layout { grid-template-columns: 1fr; }
  .summary { position: static; }
}
@media (max-width: 860px) {
  .topbar .tb-hide-sm { display: none; }
  .header-main { flex-wrap: wrap; gap: 8px 10px; min-height: 64px; padding-top: 8px; padding-bottom: 10px; }
  .logo-text span { display: none; }
  .logo { gap: 8px; }
  .icon-btn { padding: 0 8px; }
  .header-search { order: 3; max-width: none; flex-basis: 100%; }
  .logo-mark { width: 46px; }
  .logo-text strong { font-size: 1.2rem; }
  .icon-btn .lbl { display: none; }
  .menu-toggle { display: inline-flex; }
  .main-nav { display: none; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 0; padding: 8px 0; }
  .main-nav a { border-bottom: 0; padding: 10px 4px; }
  .main-nav .has-sub > .sub { display: block; position: static; box-shadow: none; border: 0; padding: 0 12px 0 0; }
  .hero .container { grid-template-columns: 1fr; padding-top: 40px; padding-bottom: 40px; }
  .hero-books { height: 260px; }
  .hero-books .hb { width: 140px; }
  .book-page { grid-template-columns: 1fr; }
  .book-gallery { position: static; max-width: 280px; margin: 0 auto; }
  .ebook-band { grid-template-columns: 1fr; padding: 28px 20px; }
  .device-mock { width: 200px; }
  .account-layout { grid-template-columns: 1fr; }
  .section { padding-top: 40px; padding-bottom: 40px; }
}
@media (max-width: 560px) {
  .book-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .book-body { padding: 10px 10px 12px; }
  .book-title { font-size: 1rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .cart-item { grid-template-columns: 60px 1fr; }
  .cart-item img { width: 60px; }
  .cart-item .ci-side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .auth-wrap .card { padding: 22px; }
  .hero-stats { gap: 20px; }
}
@media print {
  .site-header, .site-footer, .topbar, .wa-float { display: none !important; }
}

/* Hide floating WhatsApp where it would cover checkout actions */
.no-wa .wa-float { display: none; }

/* Real logo (uploaded in CMS settings): white silhouette on the dark footer */
.logo-img.logo-invert { filter: brightness(0) invert(1); opacity: .92; height: 50px; }
@media (max-width: 860px) { .logo-img { height: 42px; } }
