/* ==========================================================================
   Gujarati Law Books — Modern Marketplace
   Hand-written CSS. No framework. Ports cleanly into core PHP partials.
   ========================================================================== */

/* ---- Tokens --------------------------------------------------------------- */
:root {
  /* surfaces & ink (warm-tinted neutrals) */
  --paper:       oklch(0.984 0.005 75);
  --paper-deep:  oklch(0.962 0.006 72);
  --surface:     oklch(0.997 0.003 75);
  --ink:         oklch(0.245 0.012 50);
  --ink-soft:    oklch(0.475 0.012 50);
  --ink-faint:   oklch(0.62 0.010 55);
  --line:        oklch(0.905 0.006 65);
  --line-soft:   oklch(0.945 0.005 68);

  /* brand */
  --maroon:      oklch(0.43 0.115 24);
  --maroon-deep: oklch(0.34 0.10 24);
  --maroon-tint: oklch(0.95 0.022 28);
  --green:       oklch(0.50 0.085 152);
  --green-tint:  oklch(0.95 0.03 150);
  --saffron:     oklch(0.82 0.115 72);
  --saffron-tint:oklch(0.955 0.04 78);

  /* book cover tones */
  --tone-1: oklch(0.40 0.10 24);    /* oxblood  */
  --tone-2: oklch(0.40 0.066 158);  /* forest   */
  --tone-3: oklch(0.40 0.062 250);  /* slate    */
  --tone-4: oklch(0.50 0.094 66);   /* ochre    */
  --tone-5: oklch(0.40 0.078 330);  /* plum     */
  --tone-6: oklch(0.34 0.012 60);   /* charcoal */

  /* type */
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-xs:   0.75rem;
  --fs-sm:   0.8125rem;
  --fs-base: 0.9375rem;
  --fs-md:   1.0625rem;
  --fs-lg:   1.3125rem;
  --fs-xl:   1.6875rem;
  --fs-2xl:  2.1875rem;
  --fs-3xl:  clamp(2.4rem, 4.5vw, 3.5rem);

  /* shape & depth */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;
  --shadow-1: 0 1px 2px oklch(0.3 0.02 50 / 0.06), 0 1px 3px oklch(0.3 0.02 50 / 0.05);
  --shadow-2: 0 4px 10px oklch(0.3 0.02 50 / 0.07), 0 2px 4px oklch(0.3 0.02 50 / 0.05);
  --shadow-3: 0 14px 30px oklch(0.3 0.02 50 / 0.13), 0 5px 12px oklch(0.3 0.02 50 / 0.08);
  --shadow-book: 0 10px 22px oklch(0.25 0.03 40 / 0.28);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --wrap: 1240px;
}

/* ---- Reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--maroon); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.18; letter-spacing: -0.01em; }

/* ---- Layout primitives ---------------------------------------------------- */
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }
.section { padding-block: 56px; }
.section--tight { padding-block: 36px; }
.stack-sm > * + * { margin-top: 8px; }

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin-bottom: 24px;
}
.section-head h2 { font-size: var(--fs-xl); }
.section-head .eyebrow { margin-bottom: 4px; }
.section-head a { font-size: var(--fs-sm); font-weight: 600; color: var(--maroon); white-space: nowrap; }
.section-head a:hover { color: var(--maroon-deep); }

.eyebrow {
  font-family: var(--sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--maroon);
}

/* ---- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-size: var(--fs-sm); font-weight: 600;
  padding: 11px 20px; border-radius: var(--r-sm); border: 1px solid transparent;
  transition: background-color .2s var(--ease), color .2s var(--ease),
              border-color .2s var(--ease), transform .12s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--maroon); color: var(--paper); }
.btn--primary:hover { background: var(--maroon-deep); }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink-faint); background: var(--paper-deep); }
.btn--block { width: 100%; }
.btn--lg { padding: 14px 26px; font-size: var(--fs-base); }
.btn--wa { background: oklch(0.62 0.13 150); color: oklch(0.99 0.01 150); }
.btn--wa:hover { background: oklch(0.55 0.13 150); }

/* ---- Badges --------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--sans); font-size: var(--fs-xs); font-weight: 700;
  letter-spacing: 0.02em; padding: 3px 8px; border-radius: 3px;
}
.badge--off  { background: var(--green-tint); color: var(--green); }
.badge--new  { background: var(--maroon-tint); color: var(--maroon); }
.badge--guj  { background: var(--saffron-tint); color: oklch(0.5 0.1 62); }

/* ---- Promo strip ---------------------------------------------------------- */
.promo {
  background: linear-gradient(180deg, var(--saffron-tint), oklch(0.94 0.05 78));
  border-bottom: 1px solid oklch(0.88 0.06 78);
  font-size: var(--fs-sm);
}
.promo .wrap {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  min-height: 38px; color: oklch(0.42 0.09 60); font-weight: 500;
  text-align: center;
}
.promo strong { font-weight: 700; }
.promo .promo-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; }
.promo-close {
  position: absolute; right: 24px; color: oklch(0.5 0.07 60);
  font-size: 1.1rem; line-height: 1; padding: 4px;
}
.promo .wrap { position: relative; }

/* ---- Header --------------------------------------------------------------- */
.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: 28px;
  padding-block: 16px;
}
.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand__mark {
  width: 40px; height: 40px; border-radius: var(--r-sm);
  background: var(--maroon); display: grid; place-items: center; flex-shrink: 0;
}
.brand__mark svg { width: 22px; height: 22px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name { font-family: var(--serif); font-weight: 700; font-size: 1.0625rem; color: var(--ink); }
.brand__tag { font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }

/* search */
.search {
  flex: 1; display: flex; align-items: center;
  background: var(--paper-deep); border: 1px solid var(--line);
  border-radius: var(--r-sm); transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.search:focus-within { border-color: var(--maroon); box-shadow: 0 0 0 3px var(--maroon-tint); }
.search select {
  border: none; background: transparent; padding: 0 12px; height: 44px;
  font-size: var(--fs-sm); color: var(--ink-soft); border-right: 1px solid var(--line);
  cursor: pointer; max-width: 150px;
}
.search input {
  flex: 1; border: none; background: transparent; padding: 0 14px; height: 44px;
  font-size: var(--fs-sm);
}
.search input::placeholder { color: var(--ink-faint); }
.search button {
  height: 44px; padding: 0 18px; background: var(--maroon); color: var(--paper);
  border-radius: 0 var(--r-sm) var(--r-sm) 0; display: grid; place-items: center;
  transition: background-color .2s var(--ease);
}
.search button:hover { background: var(--maroon-deep); }

.header-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.icon-btn {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-radius: var(--r-sm); color: var(--ink); position: relative;
  transition: background-color .15s var(--ease);
}
.icon-btn:hover { background: var(--paper-deep); }
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn__label { display: flex; flex-direction: column; line-height: 1.15; font-size: var(--fs-xs); }
.icon-btn__label b { font-size: var(--fs-sm); font-weight: 600; }
.icon-btn__label span { color: var(--ink-faint); }
.cart-count {
  position: absolute; top: 2px; left: 24px;
  min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--maroon); color: var(--paper);
  font-size: 0.625rem; font-weight: 700; border-radius: 9px;
  display: grid; place-items: center;
}

/* category nav */
.cat-nav { border-top: 1px solid var(--line-soft); background: var(--surface); }
.cat-nav ul { display: flex; gap: 2px; align-items: center; }
.cat-nav a {
  display: block; padding: 12px 14px; font-size: var(--fs-sm); font-weight: 500;
  color: var(--ink-soft); position: relative; white-space: nowrap;
  transition: color .15s var(--ease);
}
.cat-nav a:hover { color: var(--maroon); }
.cat-nav a[aria-current="page"] { color: var(--maroon); font-weight: 600; }
.cat-nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px;
  height: 2px; background: var(--maroon);
}
.cat-nav .cat-nav__all { color: var(--ink); font-weight: 600; display: flex; align-items: center; gap: 7px; }

.nav-toggle { display: none; }

/* ---- Hero ----------------------------------------------------------------- */
.hero { background: linear-gradient(180deg, var(--paper-deep), var(--paper)); border-bottom: 1px solid var(--line); }
.hero .wrap {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center;
  padding-block: 60px;
}
.hero__title { font-size: var(--fs-3xl); color: var(--ink); margin-block: 14px 18px; }
.hero__title em { font-style: normal; color: var(--maroon); }
.hero__lead { font-size: var(--fs-md); color: var(--ink-soft); max-width: 46ch; }
.hero__search {
  display: flex; margin-top: 26px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-1);
}
.hero__search input { flex: 1; border: none; background: none; padding: 15px 18px; font-size: var(--fs-base); }
.hero__search button { margin: 6px; }
.hero__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip {
  font-size: var(--fs-sm); padding: 7px 13px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft);
  transition: border-color .15s var(--ease), color .15s var(--ease);
}
.chip:hover { border-color: var(--maroon); color: var(--maroon); }
.hero__trust { display: flex; gap: 22px; margin-top: 28px; flex-wrap: wrap; }
.hero__trust div { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--ink-soft); }
.hero__trust svg { width: 18px; height: 18px; color: var(--green); flex-shrink: 0; }

/* hero shelf — overlapping CSS book covers */
.shelf { position: relative; height: 360px; }
.shelf .book__cover {
  position: absolute; width: 168px; box-shadow: var(--shadow-book);
}
.shelf .book__cover:nth-child(1) { left: 4%;  top: 38px; transform: rotate(-7deg); width: 152px; z-index: 1; }
.shelf .book__cover:nth-child(2) { left: 26%; top: 8px;  transform: rotate(-2deg); z-index: 3; }
.shelf .book__cover:nth-child(3) { left: 52%; top: 22px; transform: rotate(4deg);  z-index: 2; }
.shelf .book__cover:nth-child(4) { left: 70%; top: 70px; transform: rotate(9deg);  width: 150px; z-index: 1; }
.shelf::after {
  content: ""; position: absolute; left: -2%; right: -2%; bottom: 30px; height: 14px;
  background: linear-gradient(180deg, oklch(0.78 0.02 60), oklch(0.7 0.025 55));
  border-radius: 2px; box-shadow: var(--shadow-2);
}

/* ---- Book cover (CSS-generated) ------------------------------------------ */
.book__cover {
  position: relative; aspect-ratio: 5 / 7; border-radius: 2px 3px 3px 2px;
  overflow: hidden; background: var(--tone-1);
  display: flex; flex-direction: column; isolation: isolate;
}
.book__cover[data-tone="1"] { background: var(--tone-1); }
.book__cover[data-tone="2"] { background: var(--tone-2); }
.book__cover[data-tone="3"] { background: var(--tone-3); }
.book__cover[data-tone="4"] { background: var(--tone-4); }
.book__cover[data-tone="5"] { background: var(--tone-5); }
.book__cover[data-tone="6"] { background: var(--tone-6); }
/* paper sheen + spine shading */
.book__cover::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(105deg, oklch(1 0 0 / 0.10) 0%, oklch(1 0 0 / 0) 22%),
    linear-gradient(90deg, oklch(0 0 0 / 0.32) 0%, oklch(0 0 0 / 0.12) 7px,
                    oklch(0 0 0 / 0) 16px, oklch(0 0 0 / 0) 100%);
}
.book__cover-frame {
  margin: 9px; flex: 1; border: 1px solid oklch(1 0 0 / 0.28);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 14px 11px; color: oklch(0.96 0.02 82);
}
.book__cover-pub {
  font-family: var(--sans); font-size: 0.5rem; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.78;
}
.book__cover-rule { width: 26px; height: 2px; background: oklch(1 0 0 / 0.4); margin: 9px 0; }
.book__cover-title {
  font-family: var(--serif); font-weight: 600; font-size: 0.9375rem;
  line-height: 1.22; margin-top: auto; margin-bottom: auto;
}
.book__cover-foot {
  font-family: var(--sans); font-size: 0.5rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.7;
}
.book__cover-foot::before {
  content: ""; display: block; width: 18px; height: 1px;
  background: oklch(1 0 0 / 0.35); margin: 0 auto 8px;
}

/* ---- Book card ------------------------------------------------------------ */
.grid-books {
  display: grid; gap: 22px 18px;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
}
.book {
  display: flex; flex-direction: column; position: relative;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 14px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
.book:hover { border-color: var(--line); box-shadow: var(--shadow-3); transform: translateY(-3px); }
.book__media { position: relative; margin-bottom: 13px; }
.book__media .book__cover { box-shadow: var(--shadow-2); }
.book:hover .book__media .book__cover { box-shadow: var(--shadow-book); }
.book__flags { position: absolute; top: 8px; left: 8px; display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.book__wish {
  position: absolute; top: 6px; right: 6px; width: 32px; height: 32px;
  background: var(--surface); border-radius: 50%; display: grid; place-items: center;
  box-shadow: var(--shadow-1); color: var(--ink-faint);
  transition: color .15s var(--ease), transform .15s var(--ease);
}
.book__wish:hover { color: var(--maroon); transform: scale(1.08); }
.book__wish svg { width: 16px; height: 16px; }

.book__pub { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-faint); }
.book__title {
  font-family: var(--serif); font-size: var(--fs-base); font-weight: 600;
  line-height: 1.3; margin: 4px 0 6px; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.book:hover .book__title { color: var(--maroon); }
.book__meta { font-size: var(--fs-xs); color: var(--ink-faint); margin-bottom: 10px; }
.book__rating { display: flex; align-items: center; gap: 5px; font-size: var(--fs-xs); color: var(--ink-soft); margin-bottom: 9px; }
.book__rating .stars { color: var(--saffron); letter-spacing: 1px; }

.price-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.price { font-family: var(--sans); font-size: var(--fs-md); font-weight: 700; color: var(--ink); }
.price--mrp { font-size: var(--fs-sm); color: var(--ink-faint); text-decoration: line-through; }
.price--off { font-size: var(--fs-xs); font-weight: 700; color: var(--green); }

.book__add {
  margin-top: 12px; width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-size: var(--fs-sm); font-weight: 600; padding: 9px;
  border: 1px solid var(--maroon); color: var(--maroon); border-radius: var(--r-sm);
  background: var(--surface);
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.book__add svg { width: 16px; height: 16px; }
.book__add:hover { background: var(--maroon); color: var(--paper); }

/* horizontal rail */
.rail { display: flex; gap: 18px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.rail .book { flex: 0 0 214px; scroll-snap-align: start; }
.rail::-webkit-scrollbar { height: 6px; }
.rail::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

/* ---- Category tiles ------------------------------------------------------- */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cat-tile {
  display: flex; flex-direction: column; gap: 6px;
  padding: 22px 20px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
}
.cat-tile:hover { border-color: var(--maroon); box-shadow: var(--shadow-2); transform: translateY(-2px); }
.cat-tile__icon {
  width: 42px; height: 42px; border-radius: var(--r-sm); margin-bottom: 8px;
  background: var(--maroon-tint); color: var(--maroon); display: grid; place-items: center;
}
.cat-tile__icon svg { width: 22px; height: 22px; }
.cat-tile h3 { font-size: var(--fs-md); }
.cat-tile p { font-size: var(--fs-sm); color: var(--ink-soft); }
.cat-tile__count { font-size: var(--fs-xs); color: var(--maroon); font-weight: 600; margin-top: 4px; }

/* ---- Trust band ----------------------------------------------------------- */
.trust-band { background: var(--surface); border-block: 1px solid var(--line); }
.trust-band .wrap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; padding-block: 32px; }
.trust-item { display: flex; gap: 13px; align-items: flex-start; }
.trust-item__icon { color: var(--maroon); flex-shrink: 0; }
.trust-item__icon svg { width: 26px; height: 26px; }
.trust-item h4 { font-family: var(--sans); font-size: var(--fs-base); font-weight: 700; }
.trust-item p { font-size: var(--fs-sm); color: var(--ink-soft); }

/* ---- Editorial / publishers strip ---------------------------------------- */
.pub-strip { display: flex; flex-wrap: wrap; gap: 12px 36px; align-items: center; justify-content: center; }
.pub-strip span {
  font-family: var(--serif); font-size: var(--fs-lg); font-weight: 600;
  color: var(--ink-faint); letter-spacing: 0.01em;
}

/* ---- Banner (split CTA) --------------------------------------------------- */
.banner {
  background: var(--maroon); color: oklch(0.96 0.02 80); border-radius: var(--r-lg);
  display: grid; grid-template-columns: 1.4fr 1fr; overflow: hidden;
}
.banner__copy { padding: 44px 44px 44px 48px; }
.banner__copy .eyebrow { color: var(--saffron); }
.banner__copy h2 { font-size: var(--fs-2xl); color: oklch(0.97 0.02 80); margin: 10px 0 12px; }
.banner__copy p { color: oklch(0.86 0.02 70); max-width: 44ch; margin-bottom: 22px; }
.banner__copy .btn--ghost { background: oklch(0.97 0.02 80); border-color: transparent; color: var(--maroon); }
.banner__copy .btn--ghost:hover { background: var(--saffron); }
.banner__visual {
  position: relative; background: var(--maroon-deep);
  display: grid; place-items: center; padding: 28px;
}
.banner__visual .book__cover { width: 150px; transform: rotate(-5deg); box-shadow: var(--shadow-book); }

/* ---- Breadcrumb ----------------------------------------------------------- */
.crumb { display: flex; gap: 8px; align-items: center; font-size: var(--fs-sm); color: var(--ink-faint); padding-block: 16px; flex-wrap: wrap; }
.crumb a:hover { color: var(--maroon); }
.crumb span[aria-current] { color: var(--ink-soft); }
.crumb .sep { opacity: 0.5; }

/* ---- Page head ------------------------------------------------------------ */
.page-head { background: var(--paper-deep); border-bottom: 1px solid var(--line); }
.page-head__inner { padding-block: 8px 28px; }
.page-head h1 { font-size: var(--fs-2xl); color: var(--ink); }
.page-head p { color: var(--ink-soft); margin-top: 6px; max-width: 60ch; }
.page-head__row { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }

/* ---- Catalogue layout (filters + grid) ----------------------------------- */
.shop { display: grid; grid-template-columns: 256px 1fr; gap: 36px; align-items: start; padding-block: 32px; }

.filters { position: sticky; top: 128px; }
.filters__card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.filter-group { border-bottom: 1px solid var(--line-soft); padding: 16px 18px; }
.filter-group:last-child { border-bottom: none; }
.filter-group h3 { font-family: var(--sans); font-size: var(--fs-sm); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px; }
.filter-opt { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: var(--fs-sm); color: var(--ink-soft); cursor: pointer; }
.filter-opt:hover { color: var(--ink); }
.filter-opt input { width: 16px; height: 16px; accent-color: var(--maroon); cursor: pointer; }
.filter-opt .count { margin-left: auto; font-size: var(--fs-xs); color: var(--ink-faint); }
.filter-clear { font-size: var(--fs-sm); color: var(--maroon); font-weight: 600; padding: 14px 18px; display: block; }

.shop__main { min-width: 0; }
.shop__toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); margin-bottom: 22px;
}
.shop__toolbar .count-text { font-size: var(--fs-sm); color: var(--ink-soft); }
.shop__toolbar .count-text b { color: var(--ink); font-weight: 700; }
.shop__sort { display: flex; align-items: center; gap: 9px; font-size: var(--fs-sm); color: var(--ink-soft); }
.shop__sort select {
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 11px;
  font-size: var(--fs-sm); background: var(--surface); cursor: pointer;
}
.filter-toggle { display: none; }

.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.active-filters .pill {
  display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-xs);
  background: var(--maroon-tint); color: var(--maroon); padding: 5px 10px; border-radius: 999px; font-weight: 600;
}
.active-filters .pill button { color: var(--maroon); display: grid; place-items: center; }

/* pagination */
.pager { display: flex; justify-content: center; gap: 6px; margin-top: 40px; }
.pager a, .pager span {
  min-width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--r-sm); font-size: var(--fs-sm);
  font-weight: 600; color: var(--ink-soft); background: var(--surface);
  transition: border-color .15s var(--ease), color .15s var(--ease);
}
.pager a:hover { border-color: var(--maroon); color: var(--maroon); }
.pager [aria-current] { background: var(--maroon); color: var(--paper); border-color: var(--maroon); }
.pager .pager__gap { border: none; background: none; }

/* ---- Category banner ------------------------------------------------------ */
.cat-banner {
  background: linear-gradient(110deg, var(--maroon), var(--maroon-deep));
  color: oklch(0.96 0.02 80); border-radius: var(--r-lg);
  padding: 38px 40px; display: flex; justify-content: space-between;
  align-items: center; gap: 30px; margin-bottom: 28px;
}
.cat-banner__text .eyebrow { color: var(--saffron); }
.cat-banner__text h1 { font-size: var(--fs-2xl); color: oklch(0.97 0.02 80); margin: 8px 0 8px; }
.cat-banner__text p { color: oklch(0.85 0.02 70); max-width: 52ch; }
.cat-banner__stat { text-align: center; flex-shrink: 0; }
.cat-banner__stat b { font-family: var(--serif); font-size: 2.6rem; display: block; line-height: 1; }
.cat-banner__stat span { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.8; }

.subcat-rail { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 24px; }
.subcat-rail a {
  font-size: var(--fs-sm); font-weight: 500; padding: 8px 15px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft);
  transition: all .15s var(--ease);
}
.subcat-rail a:hover { border-color: var(--maroon); color: var(--maroon); }
.subcat-rail a[aria-current] { background: var(--maroon); border-color: var(--maroon); color: var(--paper); }

/* ---- Product page --------------------------------------------------------- */
.product { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 48px; padding-block: 12px 40px; align-items: start; }
.product__gallery { position: sticky; top: 130px; }
.product__cover-wrap { display: flex; justify-content: center; padding: 36px; background: var(--paper-deep); border: 1px solid var(--line); border-radius: var(--r-lg); }
.product__cover-wrap .book__cover { width: 248px; box-shadow: var(--shadow-book); }
.product__thumbs { display: flex; gap: 10px; margin-top: 14px; }
.product__thumbs .book__cover { width: 60px; cursor: pointer; border: 2px solid transparent; }
.product__thumbs .book__cover[aria-current] { outline: 2px solid var(--maroon); outline-offset: 1px; }

.product__pub { font-size: var(--fs-sm); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--maroon); }
.product__title { font-size: var(--fs-2xl); color: var(--ink); margin: 8px 0 10px; }
.product__sub { font-size: var(--fs-md); color: var(--ink-soft); }
.product__rating { display: flex; align-items: center; gap: 10px; margin: 14px 0; font-size: var(--fs-sm); color: var(--ink-soft); }
.product__rating .stars { color: var(--saffron); font-size: var(--fs-md); letter-spacing: 1px; }
.product__rating a { color: var(--maroon); font-weight: 600; }

.product__price-box { background: var(--paper-deep); border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px; margin: 20px 0; }
.product__price-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.product__price { font-family: var(--sans); font-size: var(--fs-2xl); font-weight: 800; color: var(--ink); }
.product__price-mrp { font-size: var(--fs-md); color: var(--ink-faint); text-decoration: line-through; }
.product__price-save { font-size: var(--fs-sm); font-weight: 700; color: var(--green); background: var(--green-tint); padding: 4px 9px; border-radius: 3px; }
.product__price-note { font-size: var(--fs-xs); color: var(--ink-faint); margin-top: 7px; }

.spec-list { display: grid; grid-template-columns: auto 1fr; gap: 9px 20px; margin: 20px 0; font-size: var(--fs-sm); }
.spec-list dt { color: var(--ink-faint); }
.spec-list dd { color: var(--ink); font-weight: 600; }

.product__buy { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; margin: 20px 0 12px; max-width: 440px; }
.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.stepper button { width: 34px; height: 42px; font-size: 1.05rem; color: var(--ink-soft); display: grid; place-items: center; }
.stepper button:hover { color: var(--maroon); }
.stepper input { width: 38px; height: 42px; text-align: center; border: none; border-inline: 1px solid var(--line); font-weight: 700; }
.product__buy .btn { flex: 1; min-width: 128px; }
.product__wa { max-width: 440px; }

.product__assure { display: flex; flex-direction: column; gap: 9px; margin-top: 18px; }
.product__assure div { display: flex; gap: 9px; align-items: center; font-size: var(--fs-sm); color: var(--ink-soft); }
.product__assure svg { width: 18px; height: 18px; color: var(--green); flex-shrink: 0; }

/* tabs */
.tabs { border-bottom: 1px solid var(--line); display: flex; gap: 4px; margin-bottom: 22px; }
.tabs button {
  padding: 13px 16px; font-size: var(--fs-base); font-weight: 600; color: var(--ink-faint);
  position: relative; transition: color .15s var(--ease);
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--maroon); }
.tabs button[aria-selected="true"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--maroon);
}
.tab-panel { display: none; }
.tab-panel[data-active] { display: block; }
.tab-panel p { max-width: 68ch; color: var(--ink-soft); margin-bottom: 12px; }
.tab-panel h4 { font-family: var(--sans); font-size: var(--fs-base); margin: 16px 0 8px; }
.toc-list li { padding: 7px 0; border-bottom: 1px dashed var(--line); display: flex; gap: 12px; font-size: var(--fs-sm); }
.toc-list li b { color: var(--maroon); font-variant-numeric: tabular-nums; }

/* review */
.review { padding: 18px 0; border-bottom: 1px solid var(--line-soft); }
.review__head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.review__avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--maroon-tint); color: var(--maroon); display: grid; place-items: center; font-weight: 700; font-size: var(--fs-sm); }
.review__name { font-weight: 700; font-size: var(--fs-sm); }
.review__date { font-size: var(--fs-xs); color: var(--ink-faint); margin-left: auto; }
.review .stars { color: var(--saffron); font-size: var(--fs-sm); }
.review p { font-size: var(--fs-sm); color: var(--ink-soft); }

/* ---- Checkout ------------------------------------------------------------- */
.checkout { display: grid; grid-template-columns: 1fr 380px; gap: 36px; align-items: start; padding-block: 28px 56px; }

.co-step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 18px; overflow: hidden; }
.co-step__head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.co-step__num {
  width: 26px; height: 26px; border-radius: 50%; background: var(--maroon); color: var(--paper);
  font-size: var(--fs-sm); font-weight: 700; display: grid; place-items: center; flex-shrink: 0;
}
.co-step__head h2 { font-family: var(--sans); font-size: var(--fs-md); font-weight: 700; }
.co-step__body { padding: 20px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: var(--fs-sm); font-weight: 600; margin-bottom: 6px; }
.field label .opt { color: var(--ink-faint); font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: var(--fs-sm); background: var(--surface); color: var(--ink);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--maroon); box-shadow: 0 0 0 3px var(--maroon-tint);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row--3 { grid-template-columns: 1fr 1fr 1fr; }
.field-hint { font-size: var(--fs-xs); color: var(--ink-faint); margin-top: 5px; }

.pay-opt {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 10px; cursor: pointer;
  transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.pay-opt:hover { border-color: var(--ink-faint); }
.pay-opt input { width: 18px; height: 18px; accent-color: var(--maroon); }
.pay-opt:has(input:checked) { border-color: var(--maroon); background: var(--maroon-tint); }
.pay-opt__text { display: flex; flex-direction: column; }
.pay-opt__text b { font-size: var(--fs-sm); }
.pay-opt__text span { font-size: var(--fs-xs); color: var(--ink-soft); }
.pay-opt__tag { margin-left: auto; font-size: var(--fs-xs); color: var(--green); font-weight: 700; }

/* order summary */
.summary { position: sticky; top: 128px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.summary__head { padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.summary__head h2 { font-family: var(--sans); font-size: var(--fs-md); font-weight: 700; }
.summary__items { padding: 8px 20px; max-height: 320px; overflow-y: auto; }
.co-item { display: flex; gap: 13px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.co-item:last-child { border-bottom: none; }
.co-item .book__cover { width: 52px; flex-shrink: 0; box-shadow: var(--shadow-1); }
.co-item__info { flex: 1; min-width: 0; }
.co-item__title { font-family: var(--serif); font-size: var(--fs-sm); font-weight: 600; line-height: 1.3; }
.co-item__meta { font-size: var(--fs-xs); color: var(--ink-faint); margin-top: 2px; }
.co-item__qty { font-size: var(--fs-xs); color: var(--ink-soft); margin-top: 4px; }
.co-item__price { font-weight: 700; font-size: var(--fs-sm); white-space: nowrap; }
.co-item__price s { display: block; font-weight: 400; font-size: var(--fs-xs); color: var(--ink-faint); }

.coupon { display: flex; gap: 8px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.coupon input { flex: 1; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: var(--fs-sm); }
.coupon button { padding: 10px 16px; font-size: var(--fs-sm); font-weight: 700; color: var(--maroon); border: 1px solid var(--maroon); border-radius: var(--r-sm); }
.coupon button:hover { background: var(--maroon); color: var(--paper); }

.totals { padding: 16px 20px; }
.totals__row { display: flex; justify-content: space-between; font-size: var(--fs-sm); padding: 6px 0; color: var(--ink-soft); }
.totals__row span:last-child { color: var(--ink); font-weight: 600; }
.totals__row--save span:last-child { color: var(--green); }
.totals__row--grand { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; font-size: var(--fs-md); }
.totals__row--grand span { font-weight: 800 !important; color: var(--ink) !important; }
.totals__row--grand .price-tax { font-size: var(--fs-xs); font-weight: 400; color: var(--ink-faint); }
.summary__cta { padding: 0 20px 20px; }
.summary__assure { font-size: var(--fs-xs); color: var(--ink-faint); text-align: center; margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.summary__assure svg { width: 14px; height: 14px; color: var(--green); }

/* ---- Footer --------------------------------------------------------------- */
.site-footer { background: oklch(0.27 0.012 50); color: oklch(0.82 0.008 60); margin-top: 64px; }
.footer-top { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 36px; padding-block: 52px 40px; }
.footer-brand .brand__name { color: oklch(0.97 0.01 70); }
.footer-brand .brand__tag { color: oklch(0.62 0.01 60); }
.footer-brand p { font-size: var(--fs-sm); margin: 14px 0; max-width: 34ch; color: oklch(0.74 0.01 60); }
.footer-contact { font-size: var(--fs-sm); display: flex; flex-direction: column; gap: 7px; }
.footer-contact a { display: flex; gap: 8px; align-items: center; }
.footer-contact a:hover { color: oklch(0.95 0.01 70); }
.footer-contact svg { width: 16px; height: 16px; color: var(--saffron); flex-shrink: 0; }
.footer-col h4 { font-family: var(--sans); font-size: var(--fs-sm); font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: oklch(0.95 0.01 70); margin-bottom: 14px; }
.footer-col ul { display: flex; flex-direction: column; gap: 9px; }
.footer-col a { font-size: var(--fs-sm); transition: color .15s var(--ease); }
.footer-col a:hover { color: oklch(0.95 0.01 70); }
.footer-bottom {
  border-top: 1px solid oklch(0.36 0.012 50); padding-block: 20px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: var(--fs-xs); color: oklch(0.6 0.01 60);
}
.footer-bottom .pay-methods { display: flex; gap: 10px; }
.footer-bottom .pay-methods span { padding: 3px 8px; border: 1px solid oklch(0.4 0.012 50); border-radius: 3px; }

/* ---- Toast ---------------------------------------------------------------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; z-index: 200;
  background: var(--ink); color: var(--paper); padding: 13px 20px; border-radius: var(--r-md);
  font-size: var(--fs-sm); font-weight: 500; box-shadow: var(--shadow-3);
  display: flex; align-items: center; gap: 10px;
  transform: translate(-50%, 80px); opacity: 0; pointer-events: none;
  transition: transform .4s var(--ease), opacity .3s var(--ease);
}
.toast[data-show] { transform: translate(-50%, 0); opacity: 1; }
.toast svg { width: 18px; height: 18px; color: oklch(0.78 0.13 150); }

/* ---- Newsletter ----------------------------------------------------------- */
.newsletter { background: var(--paper-deep); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 40px; text-align: center; }
.newsletter h2 { font-size: var(--fs-xl); }
.newsletter p { color: var(--ink-soft); margin: 8px auto 20px; max-width: 48ch; }
.newsletter form { display: flex; gap: 10px; max-width: 440px; margin: 0 auto; }
.newsletter input { flex: 1; padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }

/* ---- Mobile drawer -------------------------------------------------------- */
.drawer-backdrop {
  position: fixed; inset: 0; background: oklch(0.2 0.02 50 / 0.5); z-index: 90;
  opacity: 0; pointer-events: none; transition: opacity .25s var(--ease);
}
.drawer-backdrop[data-open] { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 300px; max-width: 84vw;
  background: var(--surface); z-index: 100; padding: 20px;
  transform: translateX(-100%); transition: transform .3s var(--ease); overflow-y: auto;
}
.drawer[data-open] { transform: translateX(0); }
.drawer__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.drawer__head b { font-family: var(--serif); font-size: var(--fs-md); }
.drawer nav a { display: block; padding: 11px 8px; font-size: var(--fs-base); font-weight: 500; border-bottom: 1px solid var(--line-soft); }
.drawer nav a:hover { color: var(--maroon); }

/* ---- Responsive ----------------------------------------------------------- */
@media (max-width: 1080px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 28px; }
  .shelf { height: 300px; max-width: 460px; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .product { grid-template-columns: 0.9fr 1.1fr; gap: 32px; }
  .checkout { grid-template-columns: 1fr; }
  .summary { position: static; }
  .banner { grid-template-columns: 1fr; }
  .banner__visual { display: none; }
}

@media (max-width: 860px) {
  .header-main { gap: 14px; flex-wrap: wrap; }
  .search { order: 3; flex-basis: 100%; }
  .cat-nav { display: none; }
  .nav-toggle {
    display: grid; place-items: center; width: 44px; height: 44px;
    border: 1px solid var(--line); border-radius: var(--r-sm);
  }
  .nav-toggle svg { width: 22px; height: 22px; }
  .icon-btn__label { display: none; }
  .trust-band .wrap { grid-template-columns: repeat(2, 1fr); gap: 22px; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 28px; }
  .shop { grid-template-columns: 1fr; gap: 0; }
  .filters {
    position: fixed; top: 0; bottom: 0; left: 0; width: 320px; max-width: 88vw;
    background: var(--surface); z-index: 100; padding: 16px; overflow-y: auto;
    transform: translateX(-100%); transition: transform .3s var(--ease);
  }
  .filters[data-open] { transform: translateX(0); box-shadow: var(--shadow-3); }
  .filters__mobile-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
  .filter-toggle {
    display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm);
    font-weight: 600; padding: 9px 14px; border: 1px solid var(--line);
    border-radius: var(--r-sm); background: var(--surface);
  }
  .filter-toggle svg { width: 17px; height: 17px; }
  .product { grid-template-columns: 1fr; }
  .product__gallery { position: static; }
  .product__cover-wrap .book__cover { width: 200px; }
  .cat-banner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  .wrap { padding-inline: 16px; }
  .section { padding-block: 40px; }
  .grid-books { grid-template-columns: repeat(2, 1fr); gap: 16px 12px; }
  .book { padding: 10px; }
  .hero__title { font-size: 2.1rem; }
  .hero__trust { gap: 12px 18px; }
  .trust-band .wrap { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: 1fr; }
  .field-row, .field-row--3 { grid-template-columns: 1fr; }
  .newsletter form { flex-direction: column; }
  .product__price { font-size: var(--fs-xl); }
  .banner__copy { padding: 30px 24px; }
  .promo .wrap { font-size: var(--fs-xs); gap: 10px; }
}

.filters__mobile-head { display: none; }
@media (max-width: 860px) { .filters__mobile-head { display: flex; } }
