@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,500;0,600;0,700;0,800;1,500;1,600&family=Inter:wght@400;500;600;700&display=swap');

/* =========================================================
   Warm-editorial book-library theme
   Palette + display typography are the design foundation.
   Admin-overridable hues: --color-primary*, --color-accent*
   (set per-page in <style id="theme-vars"> from DB settings).
   ========================================================= */
:root {
  --color-primary:       #1d3c5c;   /* deep navy-blue — nav, buttons, headings */
  --color-primary-dark:  #142a40;
  --color-primary-light: #2f5d82;
  --color-accent:        #ef5a24;   /* warm orange */
  --color-accent-dark:   #d2461a;
  --color-accent-light:  #f6a079;
  --color-text:          #21303d;
  --color-text-muted:    #6c7c89;
  --color-bg:            #ffffff;   /* white canvas */
  --color-bg-light:      #dce8ef;   /* powder-blue section band */
  --color-surface:       #ffffff;
  --color-border:        #e2e9ef;
  --color-success:       #2f8f5b;
  --color-danger:        #d2401f;
  --font-primary:        'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-display:        'Playfair Display', Georgia, 'Times New Roman', serif;
  --border-radius:       0.75rem;
  --shadow-sm:           0 1px 3px rgba(20,38,56,.06), 0 1px 2px rgba(20,38,56,.05);
  --shadow-md:           0 8px 24px rgba(20,38,56,.10), 0 2px 6px rgba(20,38,56,.05);
  --shadow-lg:           0 18px 44px rgba(20,38,56,.16), 0 6px 12px rgba(20,38,56,.07);
  --transition:          all .3s cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; }

body {
  font-family:      var(--font-primary);
  color:            var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--color-primary);
}

a {
  color: var(--color-primary);
  transition: var(--transition);
  text-decoration: none;
}
a:hover { color: var(--color-accent); }

.text-accent { color: var(--color-accent) !important; }
.bg-band     { background: var(--color-bg-light); }
.serif       { font-family: var(--font-display); }

/* ----- Buttons ----- */
.btn {
  transition: var(--transition);
  font-weight: 600;
  letter-spacing: .015em;
  border-radius: 999px;
  padding: .55rem 1.4rem;
}
.btn-lg { padding: .8rem 1.9rem; font-size: 1rem; }
.btn-sm { padding: .4rem 1rem; }
.btn-primary {
  background-color: var(--color-primary);
  border-color:     var(--color-primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(20,38,56,.22);
}
.btn-primary:hover {
  background-color: var(--color-primary-dark);
  border-color:     var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(20,38,56,.30);
}
.btn-accent {
  background-color: var(--color-accent);
  border-color:     var(--color-accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(239,90,36,.32);
}
.btn-accent:hover {
  background-color: var(--color-accent-dark);
  border-color:     var(--color-accent-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(239,90,36,.42);
}
.btn-outline-accent {
  border: 1.5px solid var(--color-accent);
  color: var(--color-accent);
  background: transparent;
}
.btn-outline-accent:hover {
  background: var(--color-accent);
  color: #fff;
  transform: translateY(-2px);
}
.btn-outline-light:hover { transform: translateY(-2px); }

/* ----- Announcement / top strip ----- */
.topbar {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,.82);
  font-size: .78rem;
  letter-spacing: .02em;
}
.topbar a { color: var(--color-accent-light); }
.topbar a:hover { color: #fff; }

/* ----- Top Navbar ----- */
.site-navbar {
  background: var(--color-primary);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1030;
}
.site-navbar .navbar-brand,
.site-navbar .nav-link { color: #fff !important; }
.site-navbar .navbar-brand {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -.02em;
  font-size: 1.7rem;
}
.site-navbar .navbar-brand .brand-dot { color: var(--color-accent-light); }
.site-navbar .form-control {
  border: none;
  border-radius: 999px 0 0 999px;
  padding-left: 1.1rem;
  box-shadow: none;
  background: rgba(255,255,255,.96);
}
.site-navbar .form-control:focus { box-shadow: 0 0 0 3px rgba(120,170,205,.35); }
.site-navbar .input-group .btn { border-radius: 0 999px 999px 0; padding: 0 1.25rem; }
.site-navbar .nav-link:hover { color: var(--color-accent-light) !important; }

/* ----- Category Navbar (with dropdowns) ----- */
.category-navbar {
  background-color: var(--color-primary-dark);
  position: sticky;
  top: 60px;
  z-index: 1020;
}
.category-navbar .nav-row { display: flex; flex-wrap: wrap; gap: 0; }
.category-navbar .menu-item { position: relative; }
.category-navbar .menu-link {
  display: inline-block;
  color: rgba(255,255,255,.88);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .7rem 1.1rem;
  text-decoration: none;
  transition: var(--transition);
  border-bottom: 2px solid transparent;
}
.category-navbar .menu-link:hover,
.category-navbar .menu-item:hover .menu-link {
  color: var(--color-accent-light);
  border-bottom-color: var(--color-accent);
  background: rgba(255,255,255,.05);
}
.category-navbar .menu-link .caret { font-size: .9rem; margin-left: .45rem; opacity: .8; }

.dropdown-panel {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: var(--color-surface);
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  box-shadow: var(--shadow-lg);
  padding: .5rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .25s, transform .25s, visibility .25s;
  z-index: 1100;
}
/* Desktop only: reveal the flyout on hover/focus. On touch/mobile the
   category menu is a tap-to-open accordion (see the max-width:991px block),
   so this must NOT fire there or panels leak open. */
@media (min-width: 992px) {
  .menu-item:hover > .dropdown-panel,
  .menu-item:focus-within > .dropdown-panel {
    opacity: 1; visibility: visible; transform: translateY(0);
  }
}
.dropdown-panel a {
  display: block;
  padding: .55rem 1.1rem;
  color: var(--color-text);
  text-decoration: none;
  font-size: .875rem;
  border-left: 3px solid transparent;
  transition: var(--transition);
}
.dropdown-panel a:hover {
  background: var(--color-bg-light);
  color: var(--color-primary);
  border-left-color: var(--color-accent);
  padding-left: 1.4rem;
}
.dropdown-panel .panel-header {
  padding: .25rem 1.1rem .5rem;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: .25rem;
}

/* ----- Hero Slider ----- */
.hero-slider {
  position: relative;
  overflow: hidden;
  background: var(--color-primary-dark);
}
.hero-slider .carousel,
.hero-slider .carousel-inner,
.hero-slider .carousel-item { height: clamp(420px, 60vw, 680px); }
.hero-slider .hero-img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(.62) saturate(1.05) sepia(.12);
  transform: scale(1.04);
  transition: transform 9s ease;
}
.hero-slider .carousel-item.active .hero-img { transform: scale(1.13); }
.hero-slider .carousel-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(36,25,16,.82) 0%, rgba(36,25,16,.45) 45%, rgba(36,25,16,.12) 100%),
    linear-gradient(180deg, transparent 45%, rgba(36,25,16,.7) 100%);
  pointer-events: none;
}
.hero-caption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  padding: 0 8%;
  color: #fff;
  z-index: 2;
}
.hero-caption .hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--color-accent-light);
  font-family: var(--font-primary);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
  animation: heroIn .8s ease-out;
}
.hero-caption .hero-eyebrow::before {
  content: '';
  width: 34px; height: 2px;
  background: var(--color-accent);
  display: inline-block;
}
.hero-caption h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5.2vw, 4.4rem);
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.04;
  margin-bottom: 1rem;
  max-width: 760px;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0,0,0,.35);
  animation: heroIn .9s ease-out .12s backwards;
}
.hero-caption h1 em { font-style: italic; color: var(--color-accent-light); }
.hero-caption p {
  font-family: var(--font-primary);
  font-size: clamp(.98rem, 1.5vw, 1.25rem);
  max-width: 540px;
  margin-bottom: 1.8rem;
  opacity: .92;
  line-height: 1.6;
  animation: heroIn .9s ease-out .28s backwards;
}
.hero-caption .btn { animation: heroIn .9s ease-out .44s backwards; }
.hero-slider .carousel-indicators { margin-bottom: 1.8rem; }
.hero-slider .carousel-indicators [data-bs-target] {
  width: 30px; height: 4px;
  border-radius: 4px;
  background-color: rgba(255,255,255,.4);
  border: none; margin: 0 4px;
  transition: var(--transition);
}
.hero-slider .carousel-indicators .active { background-color: var(--color-accent); width: 48px; }
.hero-slider .carousel-control-prev,
.hero-slider .carousel-control-next { width: 5%; opacity: .5; transition: var(--transition); }
.hero-slider .carousel-control-prev:hover,
.hero-slider .carousel-control-next:hover { opacity: 1; }
.hero-slider .carousel-control-prev-icon,
.hero-slider .carousel-control-next-icon {
  background-color: rgba(0,0,0,.3);
  border-radius: 50%; padding: 20px; background-size: 45%;
}
@media (max-width: 576px) {
  .hero-caption { padding: 0 1.5rem; }
  .hero-slider .carousel-control-prev,
  .hero-slider .carousel-control-next { display: none; }
}

/* ----- Section heading (editorial: eyebrow + serif title) ----- */
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--font-primary);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: .5rem;
}
.section-eyebrow::before {
  content: '';
  width: 26px; height: 2px;
  background: var(--color-accent);
  display: inline-block;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  color: var(--color-primary);
  letter-spacing: -.015em;
  margin-bottom: .35rem;
}
.section-title em { font-style: italic; color: var(--color-accent); }
.section-sub { color: var(--color-text-muted); font-size: .98rem; max-width: 640px; }

/* Legacy heading kept for inner pages */
.section-heading {
  font-family: var(--font-display);
  border-left: 4px solid var(--color-accent);
  padding-left: .85rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 1.5rem;
  font-size: 1.55rem;
  letter-spacing: -.01em;
}

/* ----- Product (book) card ----- */
.product-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-6px);
  border-color: transparent;
}
.product-card .img-wrap {
  position: relative;
  overflow: hidden;
  background: var(--color-bg-light);
  aspect-ratio: 3 / 4;
}
.product-card .img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .6s cubic-bezier(.4,0,.2,1);
}
.product-card:hover .img-wrap img { transform: scale(1.07); }
.product-card .img-wrap::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(36,25,16,.28) 100%);
  opacity: 0; transition: var(--transition);
}
.product-card:hover .img-wrap::after { opacity: 1; }
.product-card .card-author {
  font-size: .72rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.product-card .card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .98rem;
  line-height: 1.25;
  color: var(--color-primary);
}
.product-card .price { color: var(--color-accent); font-weight: 700; font-size: 1.05rem; }
.product-card .mrp { color: var(--color-text-muted); text-decoration: line-through; font-size: .8rem; }
.product-card .discount-badge {
  background-color: var(--color-accent);
  color: #fff; font-size: .68rem; font-weight: 700;
  padding: .2rem .5rem; border-radius: 999px;
  letter-spacing: .02em;
  box-shadow: 0 2px 8px rgba(239,90,36,.4);
}
.product-card .wish-btn {
  position: absolute; top: 10px; right: 10px;
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.92);
  color: var(--color-primary);
  border: none;
  opacity: 0; transform: translateY(-6px);
  transition: var(--transition);
  z-index: 2;
}
.product-card:hover .wish-btn { opacity: 1; transform: translateY(0); }
.product-card .wish-btn:hover { background: var(--color-accent); color: #fff; }
.product-card .btn-cart {
  background-color: transparent;
  color: var(--color-primary);
  font-size: .82rem; font-weight: 600;
  border: 1.5px solid var(--color-border);
  width: 100%; padding: .55rem;
  border-radius: 999px;
  transition: var(--transition);
  letter-spacing: .02em;
}
.product-card .btn-cart:hover {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  transform: translateY(-1px);
}

/* ----- Category tiles ----- */
.category-tile {
  background: var(--color-surface);
  border: 1px solid var(--color-border) !important;
  border-radius: var(--border-radius);
  transition: var(--transition);
  cursor: pointer;
}
.category-tile:hover {
  border-color: var(--color-accent) !important;
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}
.category-tile .cat-ico {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--color-bg-light);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.6rem; margin-bottom: .5rem;
  transition: var(--transition);
}
.category-tile:hover .cat-ico { background: var(--color-accent); transform: rotate(-6deg) scale(1.05); }

/* ----- Deal / highlight banner ----- */
.deal-banner {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--border-radius) * 1.5);
  background:
    radial-gradient(ellipse at 80% 20%, rgba(120,170,205,.22), transparent 55%),
    linear-gradient(120deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: #fff;
  padding: clamp(2rem, 5vw, 3.5rem);
}
.deal-banner h2 { color: #fff; font-size: clamp(1.6rem, 3.4vw, 2.6rem); }
.deal-banner h2 em { font-style: italic; color: var(--color-accent-light); }
.deal-banner::before {
  content: '';
  position: absolute; right: -60px; bottom: -80px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(255,255,255,.06), transparent 70%);
  border-radius: 50%;
}

/* ----- Feature strip ----- */
.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 1.6rem 1.2rem;
  height: 100%;
  transition: var(--transition);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--color-accent); }
.feature-card .feat-ico {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--color-bg-light);
  color: var(--color-accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin-bottom: .9rem;
}

.cart-badge {
  background-color: var(--color-accent);
  color: #fff; border-radius: 50%;
  font-size: .7rem; min-width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; animation: pop .3s ease-out;
}

/* ----- CMS / rich content ----- */
.content-body { line-height: 1.8; font-size: 1.02rem; color: var(--color-text); }
.content-body h2, .content-body h3, .content-body h4 {
  font-family: var(--font-display); color: var(--color-primary); font-weight: 700;
}
.content-body h2 { font-size: 1.7rem; margin: 1.6em 0 .6em; }
.content-body h3 { font-size: 1.3rem; margin: 1.4em 0 .5em; }
.content-body h4 { font-size: 1.12rem; margin: 1.2em 0 .4em; }
.content-body p { margin: 0 0 1em; }
.content-body ul, .content-body ol { margin: 0 0 1em; padding-left: 1.6em; }
.content-body li { margin-bottom: .35em; }
.content-body a { color: var(--color-accent); text-decoration: underline; text-underline-offset: 2px; }
.content-body a:hover { color: var(--color-accent-dark); }
.content-body blockquote {
  border-left: 4px solid var(--color-accent);
  background: var(--color-bg-light);
  padding: 1em 1.2em; margin: 1.4em 0;
  border-radius: 0 8px 8px 0;
  font-family: var(--font-display);
  font-style: italic; font-size: 1.1rem;
  color: var(--color-primary);
}
.content-body table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: .95rem; }
.content-body th, .content-body td { padding: 10px 14px; border: 1px solid var(--color-border); text-align: left; vertical-align: top; }
.content-body th { background: var(--color-bg-light); font-weight: 700; color: var(--color-primary); }
.content-body img { max-width: 100%; height: auto; border-radius: 8px; margin: 1em 0; }
.content-body hr { border: none; border-top: 2px solid var(--color-border); margin: 2em 0; }
.content-body code { background: var(--color-bg-light); padding: 2px 6px; border-radius: 4px; font-size: .9em; }

/* ----- Floating WhatsApp ----- */
.wa-float {
  position: fixed; bottom: 24px; right: 24px;
  width: 56px; height: 56px; border-radius: 50%;
  background: #25D366; color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(37,211,102,.45), 0 2px 6px rgba(0,0,0,.15);
  z-index: 1100;
  transition: transform .25s ease, box-shadow .25s ease;
  text-decoration: none;
}
.wa-float:hover { transform: scale(1.1); box-shadow: 0 8px 28px rgba(37,211,102,.6), 0 4px 10px rgba(0,0,0,.2); color: #fff; }
.wa-float::before {
  content: ''; position: absolute; inset: -6px;
  border-radius: 50%; border: 2px solid #25D366;
  opacity: .55; animation: wa-pulse 2s ease-out infinite;
}
@keyframes wa-pulse {
  0%   { transform: scale(.95); opacity: .55; }
  70%  { transform: scale(1.3);  opacity: 0; }
  100% { transform: scale(1.3);  opacity: 0; }
}
.wa-float .wa-tooltip {
  position: absolute; right: 70px; top: 50%; transform: translateY(-50%);
  background: var(--color-surface); color: var(--color-text);
  font-size: .8rem; font-weight: 600;
  padding: .4rem .75rem; border-radius: 6px;
  box-shadow: var(--shadow-md); white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.wa-float:hover .wa-tooltip { opacity: 1; transform: translateY(-50%) translateX(-4px); }

/* ----- Header cart pill ----- */
.header-cart-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.12); color: #fff;
  text-decoration: none; padding: 6px 12px;
  border-radius: 999px; font-size: .85rem; font-weight: 500;
  border: 1px solid rgba(255,255,255,.18);
  transition: var(--transition);
}
.header-cart-pill:hover { background: var(--color-accent); border-color: var(--color-accent); color: #fff; transform: translateY(-1px); }

/* ----- Footer ----- */
.site-footer {
  background:
    radial-gradient(ellipse at 15% 0%, rgba(239,90,36,.14), transparent 50%),
    linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: rgba(255,255,255,.78);
  margin-top: 4rem;
}
.site-footer h5, .site-footer h6 { color: #fff; font-family: var(--font-display); letter-spacing: -.01em; }
.site-footer a { color: rgba(255,255,255,.68); transition: var(--transition); text-decoration: none; }
.site-footer a:hover { color: var(--color-accent-light); padding-left: 4px; }
.site-footer hr { border-color: rgba(255,255,255,.1); }

/* ----- TipTap rich editor ----- */
.tiptap-editor { font-size: 14px; }
.tiptap-editor .ProseMirror { outline: none; min-height: 200px; padding: 12px; }
.tiptap-editor .ProseMirror p { margin: 0 0 .5em; }
.tiptap-editor .ProseMirror h2 { font-size: 1.4em; font-weight: 700; margin: 1em 0 .5em; }
.tiptap-editor .ProseMirror h3 { font-size: 1.15em; font-weight: 700; margin: 1em 0 .5em; }
.tiptap-editor .ProseMirror ul, .tiptap-editor .ProseMirror ol { padding-left: 1.5em; }
.tiptap-editor .ProseMirror blockquote {
  border-left: 3px solid var(--color-accent); padding-left: 1em;
  color: var(--color-text-muted); font-style: italic; margin: .8em 0;
}

/* ----- Forms ----- */
.form-control, .form-select {
  border-radius: .55rem;
  border-color: var(--color-border);
  background: var(--color-surface);
  transition: var(--transition);
}
.form-control:focus, .form-select:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(239,90,36,.14);
}
.card { border-radius: var(--border-radius); border-color: var(--color-border); background: var(--color-surface); }
.badge { font-weight: 600; letter-spacing: .02em; }
.breadcrumb { font-size: .85rem; }
.page-link { color: var(--color-primary); border-color: var(--color-border); }
.page-item.active .page-link { background: var(--color-accent); border-color: var(--color-accent); }

/* ----- Animations ----- */
@keyframes heroIn  { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp{ from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop     { 0% { transform: scale(.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes float   { 0%,100% { transform: translate(0,0) rotate(0deg); } 50% { transform: translate(-26px,18px) rotate(180deg); } }

.fade-in    { animation: fadeIn .5s ease-out; }
.fade-in-up { animation: fadeInUp .6s ease-out backwards; }
.stagger > *:nth-child(1) { animation-delay: .05s; }
.stagger > *:nth-child(2) { animation-delay: .1s; }
.stagger > *:nth-child(3) { animation-delay: .15s; }
.stagger > *:nth-child(4) { animation-delay: .2s; }
.stagger > *:nth-child(5) { animation-delay: .25s; }
.stagger > *:nth-child(6) { animation-delay: .3s; }
.stagger > *:nth-child(7) { animation-delay: .35s; }
.stagger > *:nth-child(8) { animation-delay: .4s; }
.stagger > *:nth-child(n+9) { animation-delay: .45s; }

/* ----- Reveal on scroll (driven by /js/site.js) ----- */
[data-reveal] {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity .8s ease, transform .8s cubic-bezier(.22,1,.36,1);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}
[data-reveal="left"]  { transform: translateX(-40px); }
[data-reveal="right"] { transform: translateX(40px); }
[data-reveal="zoom"]  { transform: scale(.92); }
[data-reveal].is-visible { opacity: 1; transform: none; }

/* legacy .reveal kept working */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s cubic-bezier(.4,0,.2,1); }
.reveal.visible, .reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  [data-reveal], .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .hero-slider .hero-img { transition: none; }
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--color-bg-light); }
::-webkit-scrollbar-thumb { background: var(--color-accent-light); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-accent); }

/* (mobile category-nav behaviour is handled in the MOBILE NAV block below) */

/* =========================================================
   HOME 2 LAYOUT
   ========================================================= */

/* ----- Split hero ----- */
.hero2 {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: clamp(460px, 52vw, 640px);
  background:
    radial-gradient(circle at 88% 12%, rgba(255,255,255,.55), transparent 42%),
    linear-gradient(135deg, #e4edf3 0%, #d3e2ec 55%, #c7d9e6 100%);
  padding: clamp(3rem, 6vw, 5rem) 0 0;
}
.hero2::before,
.hero2::after {
  content: '';
  position: absolute;
  border-radius: 42% 58% 63% 37% / 45% 38% 62% 55%;
  background: var(--color-accent);
  opacity: .08;
  z-index: 0;
  animation: float 22s ease-in-out infinite;
}
.hero2::before { width: 320px; height: 320px; top: -90px; right: 30%; }
.hero2::after  { width: 200px; height: 200px; bottom: 40%; left: 4%; animation-duration: 28s; }
.hero2 .container { position: relative; z-index: 2; }
.hero2-content { max-width: 600px; }
.hero2 .hero2-eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-style: italic; font-weight: 600;
  font-size: 1.3rem; color: var(--color-accent);
  margin-bottom: .6rem;
}
.hero2 h1 {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 5.4vw, 4.4rem);
  line-height: 1.05; letter-spacing: -.02em; margin-bottom: 1.1rem;
}
.hero2 h1 em { font-style: italic; color: var(--color-accent); }
.hero2 .lead { font-size: clamp(1rem, 1.5vw, 1.2rem); color: var(--color-text-muted); max-width: 480px; margin-bottom: 1.6rem; }

/* Full-bleed book image anchored to the hero's bottom-right edge */
.hero-books {
  position: absolute;
  right: 0; bottom: 0;
  width: min(56vw, 780px);
  max-height: 90%;
  object-fit: contain;
  object-position: right bottom;
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 16px 26px rgba(20,38,56,.18));
  animation: heroIn 1s ease-out .15s backwards;
}
@media (max-width: 991px) {
  .hero2 { text-align: center; min-height: 0; padding-bottom: 0; }
  .hero2-content { max-width: 100%; margin: 0 auto; }
  .hero-books {
    position: static; display: block;
    width: 100%; max-width: 560px; max-height: none;
    margin: 1.8rem auto 0;
    filter: none;
  }
}

/* ----- Promo banners (3 across) ----- */
.promo-card {
  position: relative; overflow: hidden;
  border-radius: var(--border-radius);
  min-height: 240px; padding: 1.8rem 1.9rem;
  display: flex; flex-direction: column; justify-content: center;
  color: #fff; height: 100%;
  background-color: var(--color-primary);
  background-size: cover; background-position: center;
  transition: var(--transition);
}
.promo-card::after {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(115deg, rgba(20,38,56,.93) 0%, rgba(29,60,92,.74) 52%, rgba(29,60,92,.32) 100%);
}
.promo-card > * { position: relative; z-index: 1; }
.promo-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.promo-card .promo-off {
  font-size: .72rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--color-accent-light); margin-bottom: .25rem;
}
.promo-card h5 { color: #fff; font-size: 1.3rem; margin: 0 0 1rem; max-width: 72%; line-height: 1.2; }
.promo-card .promo-btn {
  align-self: flex-start;
  background: #fff; color: var(--color-primary);
  font-size: .76rem; font-weight: 700;
  padding: .5rem 1.1rem; border-radius: 999px;
  transition: var(--transition);
}
.promo-card .promo-btn:hover { background: var(--color-accent); color: #fff; transform: translateX(3px); }

/* ----- Horizontal book slider ----- */
.book-slider {
  display: flex; gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 1rem;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.book-slider > * { scroll-snap-align: start; flex: 0 0 auto; width: clamp(170px, 42vw, 220px); }
.book-slider--wide > * { width: clamp(290px, 86vw, 380px); }
.book-slider.book-slider--featured > * { width: min(690px, 92vw); }
.book-slider.book-slider--bestseller > * { width: clamp(340px, 90vw, 460px); }
.author-slider > * { width: clamp(210px, 44vw, 244px); }
/* exactly 5 cards in view (responsive down to 2) */
.book-slider.book-slider--five > * { width: calc((100% - 4 * 1rem) / 5); }
@media (max-width: 991px) { .book-slider.book-slider--five > * { width: calc((100% - 2 * 1rem) / 3); } }
@media (max-width: 575px) { .book-slider.book-slider--five > * { width: calc((100% - 1rem) / 2); } }
.book-slider::-webkit-scrollbar { height: 6px; }

/* ----- Best-seller compact row card ----- */
.bestseller-card {
  display: flex; gap: 1.25rem; align-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 1.4rem; min-height: 224px; height: 100%;
  transition: var(--transition);
}
.bestseller-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: transparent; }
.bestseller-card .bs-img { width: 128px; height: 176px; flex-shrink: 0; border-radius: .5rem; overflow: hidden; background: var(--color-bg-light); }
.bestseller-card .bs-img img { width: 100%; height: 100%; object-fit: cover; }
.bestseller-card .bs-title { font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; line-height: 1.25; color: var(--color-primary); }
.bestseller-card .bs-author { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--color-text-muted); }
.bestseller-card .bs-price { color: var(--color-accent); font-weight: 700; }
.bestseller-rank { font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; color: var(--color-border); }

/* ----- Benefit row ----- */
.benefit-item { display: flex; align-items: center; gap: 1rem; }
.benefit-item .b-ico {
  width: 54px; height: 54px; border-radius: 50%; flex-shrink: 0;
  background: var(--color-bg-light); color: var(--color-accent);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem;
  transition: var(--transition);
}
.benefit-item:hover .b-ico { background: var(--color-accent); color: #fff; }
.benefit-item h6 { margin: 0; font-family: var(--font-display); font-size: 1.02rem; }
.benefit-item p { margin: 0; font-size: .8rem; color: var(--color-text-muted); }

/* ----- Featured authors ----- */
.author-card {
  text-align: center;
  background: var(--color-surface);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem 1.1rem 1.6rem;
  transition: var(--transition);
}
.author-card:hover { box-shadow: var(--shadow-md); transform: translateY(-5px); }
.author-medal {
  position: relative;
  width: 100%; height: 180px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: -36px;          /* let the plate tuck under the medal */
}
.author-medal::before {
  content: ''; position: absolute; inset: 0;
  background: url('/img/laurel.svg') center/contain no-repeat;
}
.author-medal .author-avatar {
  position: relative; z-index: 1;
  width: 116px; height: 116px;
  border-radius: 50%; overflow: hidden;
  background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 1.7rem;
}
.author-medal .author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-plate {
  border: 2px dashed var(--color-accent-light);
  border-radius: 8px;
  padding: 1rem .75rem .85rem;
  background: var(--color-surface);
  position: relative; z-index: 0;
}
.author-card .author-name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--color-primary); }
.author-card .author-count { font-size: .82rem; color: var(--color-text-muted); margin-top: .25rem; }

/* ----- Slider wrapper + nav arrows ----- */
.slider-wrap { position: relative; }
.slider-nav {
  position: absolute; top: 42%; transform: translateY(-50%);
  width: 50px; height: 50px; border-radius: 50%;
  border: none; z-index: 5;
  background: var(--color-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}
.slider-nav:hover { background: var(--color-accent); transform: translateY(-50%) scale(1.08); }
.slider-nav-prev { left: -10px; }
.slider-nav-next { right: -10px; }
@media (max-width: 575px) { .slider-nav { display: none; } }

/* ----- Journal / latest news ----- */
.journal-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  overflow: hidden; height: 100%;
  display: flex; flex-direction: column;
  transition: var(--transition);
}
.journal-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: transparent; }
.journal-card .j-img { aspect-ratio: 16 / 10; background: var(--color-bg-light); overflow: hidden; }
.journal-card .j-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.journal-card:hover .j-img img { transform: scale(1.06); }
.journal-card .j-tag {
  display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--color-accent); margin-bottom: .4rem;
}
.journal-card .j-title { font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; line-height: 1.3; color: var(--color-primary); }
.journal-card .j-meta { font-size: .76rem; color: var(--color-text-muted); }

/* ----- Product-card enrichments (category tag + author avatar) ----- */
.product-card .card-tag {
  display: inline-block;
  font-size: .64rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: var(--color-bg-light);
  padding: .2rem .55rem; border-radius: 999px;
  margin-bottom: .5rem;
}
.product-card .card-byline { display: flex; align-items: center; gap: .4rem; margin-top: .5rem; }
.author-avatar-xs {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
  color: #fff; font-size: .6rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ----- Wide featured-book card (cover left / details right) ----- */
.book-wide {
  display: flex; gap: 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 1.25rem;
  height: 334px;
  transition: var(--transition);
  overflow: hidden;
}
.book-wide:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); border-color: transparent; }
.book-wide .bw-cover {
  width: 220px; flex-shrink: 0; border-radius: .5rem; overflow: hidden;
  background: var(--color-bg-light); position: relative; align-self: stretch;
}
.book-wide .bw-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-wide .bw-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.book-wide .bw-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.book-wide .bw-tag {
  font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #fff; background: var(--color-primary);
  padding: .25rem .65rem; border-radius: 6px;
}
.book-wide .bw-rating { color: var(--color-accent); font-size: 1rem; letter-spacing: 1px; white-space: nowrap; }
.book-wide .bw-rating .empty { color: var(--color-border); }
.book-wide .bw-title {
  font-family: var(--font-display); font-weight: 700; font-size: 1.4rem;
  line-height: 1.2; color: var(--color-primary);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.book-wide .bw-author { display: flex; align-items: center; gap: .55rem; font-size: .85rem; color: var(--color-text-muted); margin-top: .7rem; }
.book-wide .bw-author .author-avatar-xs { width: 28px; height: 28px; font-size: .68rem; }
.book-wide .bw-buy { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: auto; padding-top: 1rem; }
.book-wide .bw-buy-left { flex: 1; min-width: 0; }
.book-wide .bw-price { color: var(--color-primary); font-weight: 700; font-size: 1.5rem; }
.book-wide .bw-stock-bar { height: 6px; border-radius: 4px; background: var(--color-border); overflow: hidden; margin-top: .55rem; }
.book-wide .bw-stock-bar > span { display: block; height: 100%; background: var(--color-accent); border-radius: 4px; }
.book-wide .bw-stock-txt { font-size: .8rem; color: var(--color-text-muted); margin-top: .35rem; }
.book-wide .bw-cart {
  width: 52px; height: 52px; border-radius: 50%; border: none; flex-shrink: 0;
  background: var(--color-primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.book-wide .bw-cart:hover { background: var(--color-accent); transform: scale(1.08); }

/* Add-to-cart actions hidden site-wide (enquiry-based flow) */
.add-to-cart-btn { display: none !important; }

/* =========================================================
   MOBILE NAV (hamburger toggle)
   ========================================================= */
.navbar-toggle {
  display: none;
  background: transparent;
  border: 1.5px solid rgba(255,255,255,.45);
  color: #fff;
  border-radius: 8px;
  width: 44px; height: 40px;
  align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}
.navbar-toggle:hover { background: rgba(255,255,255,.12); border-color: var(--color-accent); }

@media (max-width: 991px) {
  /* top bar: brand + toggle on row 1, search full-width on row 2 */
  .site-navbar .container-fluid { flex-wrap: wrap; row-gap: .6rem; align-items: center; }
  .site-navbar .navbar-brand { order: 1; font-size: 1.45rem; }
  .navbar-toggle { display: inline-flex; order: 2; margin-left: auto; }
  .site-navbar form.site-search { order: 3; flex: 0 0 100%; max-width: 100% !important; margin: 0 !important; }

  /* category nav becomes a collapsible vertical menu */
  .category-navbar { position: static; }
  .category-navbar .nav-row { display: none; flex-direction: column; padding: .25rem 0; }
  .category-navbar .nav-row.open { display: flex; animation: fadeIn .25s ease-out; }
  .category-navbar .menu-item { width: 100%; }
  .category-navbar .menu-link {
    display: block; width: 100%;
    text-transform: none;
    font-size: .95rem; letter-spacing: normal;
    padding: .7rem 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .category-navbar .menu-link:hover,
  .category-navbar .menu-item:hover .menu-link { border-bottom-color: rgba(255,255,255,.08); }
  .category-navbar .menu-link .caret { float: right; font-size: 1.25rem; line-height: 1.2; opacity: .9; transition: transform .25s ease; }
  .category-navbar .menu-item.open > .menu-link .caret { transform: rotate(180deg); }

  /* sub-category panels collapse into an accordion (tap parent to open) */
  .category-navbar .dropdown-panel {
    position: static; box-shadow: none; transform: none;
    border-radius: 0; background: rgba(0,0,0,.22);
    overflow: hidden;
    max-height: 0; opacity: 0; visibility: hidden; padding: 0;
    transition: max-height .35s ease, opacity .25s ease, padding .25s ease;
  }
  .category-navbar .menu-item.open > .dropdown-panel {
    max-height: 80vh; opacity: 1; visibility: visible;
    padding: .25rem 0 .5rem;
    overflow-y: auto;
  }
  .category-navbar .dropdown-panel a { color: rgba(255,255,255,.85); }
  .category-navbar .dropdown-panel a:hover { background: rgba(255,255,255,.06); }
  .category-navbar .dropdown-panel .panel-header { color: rgba(255,255,255,.55); border-bottom-color: rgba(255,255,255,.1); }
}

/* ============================================================
   Product-detail image gallery + zoom lightbox (.pd-*)
   Recovered after the theme swap so the lightbox controls are
   hidden until opened and styled correctly.
   ============================================================ */
.pd-main-wrap {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius, 10px);
}
.pd-main-img {
  max-height: 400px;
  width: 100%;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform .5s ease;
}
.pd-main-wrap:hover .pd-main-img { transform: scale(1.03); }
.pd-zoom-hint {
  position: absolute;
  bottom: 10px; right: 10px;
  background: rgba(15,27,48,.78);
  color: #fff;
  font-size: .72rem;
  padding: .3rem .65rem;
  border-radius: 999px;
  letter-spacing: .03em;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.pd-main-wrap:hover .pd-zoom-hint { opacity: 1; transform: translateY(0); }

.pd-thumb {
  transition: outline-color .2s ease, transform .2s ease;
  outline: 2px solid transparent;
  outline-offset: 1px;
}
.pd-thumb:hover { transform: translateY(-2px); }
.pd-thumb.active { outline-color: var(--color-accent, #f59e0b); }

.pd-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 22, .92);
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn .25s ease-out;
}
.pd-lightbox.open { display: flex; }
.pd-lb-stage {
  position: relative;
  width: 90vw;
  height: 82vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#pd-lb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: zoom-in;
  transform-origin: center center;
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  user-select: none;
  -webkit-user-drag: none;
}
.pd-lb-close,
.pd-lb-nav,
.pd-lb-tools button {
  background: rgba(255,255,255,.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.pd-lb-close:hover,
.pd-lb-nav:hover,
.pd-lb-tools button:hover { background: rgba(255,255,255,.22); transform: scale(1.05); }
.pd-lb-close {
  position: absolute;
  top: 18px; right: 22px;
  width: 44px; height: 44px;
  font-size: 1.5rem;
  line-height: 1;
  z-index: 2;
}
.pd-lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  font-size: 1.3rem;
  z-index: 2;
}
.pd-lb-prev { left: 22px; }
.pd-lb-next { right: 22px; }
.pd-lb-tools {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255,255,255,.08);
  border-radius: 999px;
  padding: .35rem .5rem;
  backdrop-filter: blur(6px);
  z-index: 2;
}
.pd-lb-tools button {
  width: 38px; height: 38px;
  font-size: 1rem;
  border-radius: 999px;
}
.pd-lb-tools button:last-child { width: auto; padding: 0 .9rem; font-size: .8rem; }
#pd-lb-zlabel {
  color: #fff;
  font-size: .8rem;
  min-width: 48px;
  text-align: center;
}
@media (max-width: 576px) {
  .pd-lb-nav { width: 38px; height: 38px; }
  .pd-lb-prev { left: 8px; } .pd-lb-next { right: 8px; }
  .pd-lb-close { top: 10px; right: 12px; }
}
