:root {
  --bg: #f7f4ed;
  --paper: #fffdf8;
  --ink: #1d2a2a;
  --muted: #5e6a68;
  --line: #dfd7c8;
  --brand: #0f766e;
  --brand-deep: #0a4f4a;
  --accent: #a16207;
  --radius: 14px;
  --shadow: 0 12px 24px rgba(29, 42, 42, 0.08);
  --font-english: Calibri, "Segoe UI", Arial, sans-serif;
  --font-arabic: "Jameel Noori Nastaleeq", "Nafees Nastaleeq", "Urdu Typesetting", "Microsoft Uighur", Tahoma, "Arial Unicode MS", serif;
  --font-salawat: "Noto Naskh Arabic", "Noto Sans Arabic", "Arabic Typesetting", "Scheherazade New", "Amiri", "Geeza Pro", "Arial Unicode MS", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html:focus-within { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 0%, #efe7d4 0%, transparent 35%),
    linear-gradient(#f7f4ed, #f7f4ed);
  color: var(--ink);
  font-family: var(--font-english), var(--font-arabic);
  line-height: 1.6;
}
.skip-link {
  position: absolute;
  left: 12px;
  top: -44px;
  z-index: 1500;
  background: #ffffff;
  color: var(--brand-deep);
  border: 1px solid var(--brand);
  border-radius: 8px;
  padding: 0.45rem 0.72rem;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 10px;
}

.container {
  width: min(1160px, 92%);
  margin-inline: auto;
}

.top-strip {
  background: var(--brand-deep);
  color: #e6faf8;
  font-size: 0.9rem;
}

.top-strip-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 0;
  flex-wrap: wrap;
}

.top-strip-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.top-strip-inner p {
  margin: 0;
}

.top-strip a { color: #c6f3ef; }

.shop-branding {
  display: none;
}

.shop-branding-inner {
  padding: 0.45rem 0;
}

.shop-branding-logo {
  width: min(680px, 100%);
  height: auto;
  display: block;
}

.nav-wrap {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.55rem 0 1rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
  width: 100%;
  min-height: 94px;
}

.brand::before {
  content: "";
  display: block;
  width: min(520px, 70vw);
  height: 94px;
  background: url("../img/islamic-kutab-logo.webp") no-repeat center center / contain;
  flex: 0 0 auto;
}

/* Safety: nav row me agar koi stray direct link inject ho jaye (e.g. extra Home), hide it */
.nav-wrap > a:not(.brand) {
  display: none !important;
}

@media (min-width: 941px) {
  .main-nav > a[href="index.html"] {
    display: none !important;
  }
}

.brand-copy {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.brand strong {
  display: block;
  font-size: 1.72rem;
  line-height: 1.1;
  letter-spacing: 0.01em;
  font-family: var(--font-english);
}

.brand small {
  color: var(--muted);
  line-height: 1.2;
}

.brand-mark {
  display: none;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: flex-start;
  width: 100%;
  border-top: 1px solid var(--line);
  padding-top: 0.7rem;
  position: relative;
  font-family: var(--font-english);
}

.main-nav a {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-english);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
}

.nav-cart-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-inline-start: 0.28rem;
  padding: 0 0.42rem;
  border-radius: 999px;
  background: #b42318;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  vertical-align: middle;
}

.main-nav a:hover { color: var(--brand); }

.nav-submenu {
  position: relative;
}

.nav-submenu summary {
  list-style: none;
  cursor: pointer;
  font-family: var(--font-english);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
}

.nav-submenu summary::-webkit-details-marker {
  display: none;
}

.nav-submenu summary::marker {
  content: "";
}

.nav-submenu summary::after {
  content: "";
  font-size: 0.8em;
  color: var(--muted);
}

.submenu-chevron {
  display: inline-block;
  margin-inline-start: 0.28rem;
  font-size: 0.82em;
  color: var(--muted);
}

.nav-submenu-list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 180px;
  padding: 0.4rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.12);
  display: grid;
  gap: 0.12rem;
  z-index: 1300;
}

.nav-submenu-list a {
  padding: 0.42rem 0.48rem;
  border-radius: 7px;
}

.nav-submenu-list a:hover {
  background: #f4fbfa;
}

.breadcrumb-wrap {
  display: none !important;
}

.breadcrumb-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0.45rem 0.1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.breadcrumb-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.breadcrumb-list li + li::before {
  content: "/";
  color: #9f9582;
  margin-right: 0.1rem;
}

.breadcrumb-list a {
  color: var(--brand-deep);
  text-decoration: none;
  font-weight: 600;
}

.breadcrumb-list span {
  color: var(--ink);
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  margin-left: 0;
  margin-top: 0.35rem;
}

.user-session-badge {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.25rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.user-session-badge-shell {
  visibility: hidden;
  pointer-events: none;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #cbd5e1;
  color: #0f172a;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.86rem;
}

.user-session-badge.is-logged-in .user-avatar {
  background: var(--brand);
  color: #fff;
}

.user-session-copy {
  display: grid;
  gap: 0.05rem;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.user-session-copy:hover strong {
  color: var(--brand);
}

.user-session-copy strong {
  font-size: 0.92rem;
  line-height: 1.1;
}

.user-session-copy small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.1;
}

.user-session-logout {
  margin-left: auto;
  min-height: 36px;
  padding: 0.32rem 0.72rem;
}

.header-profile-icon,
.header-cart-icon {
  display: none;
}

.lang-switcher-btn {
  border: 1px solid var(--brand);
  background: #fff;
  color: var(--brand);
  border-radius: 999px;
  padding: 0.33rem 0.75rem;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  margin-inline-start: auto;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.header-search input {
  width: 220px;
  padding: 0.55rem 0.7rem;
  border-radius: 999px;
}

.header-search button {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  border-radius: 999px;
  padding: 0.52rem 0.8rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.header-search-advanced {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.55rem;
  position: relative;
}

.search-simple-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
}

.search-simple-row input {
  min-width: 0;
}

.search-advanced-toggle {
  min-height: 52px;
  white-space: nowrap;
}

.advanced-search-panel {
  margin-top: 0.55rem;
}

.advanced-search-panel.is-collapsed {
  display: none;
}

.header-search-advanced .search-grid {
  grid-template-columns: 2fr 1fr 1fr;
}

.advanced-filter-grid {
  margin-top: 0.55rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.advanced-filter-grid .btn {
  width: 100%;
  text-align: center;
  padding: 0.72rem 0.7rem;
}

.header-search-advanced .muted {
  margin: 0.45rem 0 0 0;
  min-height: 1.35rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1rem;
  margin-top: 0.4rem;
  align-items: start;
}

.hero-copy, .hero-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 2rem 1.7rem;
  min-height: 0;
}

.hero-card {
  padding: 1.4rem;
  min-height: 470px;
  contain: layout paint;
}

.hero-ad-slider {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 430px;
}

.hero-ad-track-wrap {
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--line);
  aspect-ratio: 4 / 3;
  height: auto;
  min-height: 0;
  background: #f8f3e8;
}

.hero-ad-track {
  display: flex;
  height: 100%;
  transition: transform 0.35s ease;
}

.hero-ad-slide {
  height: 100%;
  min-width: 100%;
}

.hero-ad-slide a {
  display: block;
  height: 100%;
  position: relative;
  color: inherit;
  text-decoration: none;
}

.hero-ad-slide img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  aspect-ratio: 4 / 3;
  background: #eee4d1;
}

.hero-ad-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.8rem 0.95rem;
  min-height: 64px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.02), rgba(15, 23, 42, 0.78));
}

.hero-ad-title {
  font-family: var(--font-english);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
  color: #fffef9;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.hero-ad-dots {
  display: flex;
  justify-content: center;
  gap: 0.12rem;
}

.hero-ad-dot {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.hero-ad-dot::after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #c9c9c9;
}

.hero-ad-dot.active::after {
  background: var(--brand);
}

.home-page .is-loading-shell {
  position: relative;
}

.home-page .is-loading-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(239, 231, 212, 0.55), rgba(255, 253, 248, 0.92), rgba(239, 231, 212, 0.55));
  background-size: 220% 100%;
  animation: ik-shell-glow 1.4s ease-in-out infinite;
}

.home-page #heroAdSlider.is-loading-shell {
  min-height: 430px;
  border-radius: 12px;
  overflow: hidden;
}

.home-page #categoryChips.is-loading-shell {
  min-height: 112px;
  border-radius: 999px;
}

.home-page #categorySliders.is-loading-shell {
  min-height: 540px;
  border-radius: 14px;
}

.home-page #bookGrid.is-loading-shell {
  min-height: 760px;
  border-radius: 14px;
}

.home-page #featuredGrid.is-loading-shell,
.home-page #salesGrid.is-loading-shell {
  min-height: 620px;
  border-radius: 14px;
}

.home-page #authorsGrid.is-loading-shell,
.home-page #latestArticlesGrid.is-loading-shell,
.home-page #latestReviewsGrid.is-loading-shell {
  min-height: 380px;
  border-radius: 14px;
}

.home-page main > section.container.section {
  content-visibility: auto;
  contain-intrinsic-size: 1px 820px;
}

.home-page #categories,
.home-page #category-showcase,
.home-page #all-books,
.home-page #featured,
.home-page #sales-books,
.home-page #authors,
.home-page #blog,
.home-page #reviews {
  min-height: 720px;
}

.home-page #categories {
  min-height: 190px;
}

.home-page #category-showcase {
  min-height: 650px;
}

.home-page #all-books {
  min-height: 960px;
}

.home-page #featured,
.home-page #sales-books {
  min-height: 760px;
}

.home-page #authors,
.home-page #blog,
.home-page #reviews {
  min-height: 520px;
}

@keyframes ik-shell-glow {
  0% { background-position: 200% 0; }
  100% { background-position: -20% 0; }
}

.eyebrow {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}

h1, h2, h3 {
  font-family: var(--font-english), var(--font-arabic);
  line-height: 1.1;
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 3.3vw, 3.2rem);
  margin-top: 0.2rem;
}

.hero-copy p { margin-top: 0.8rem; }

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
}

.btn {
  display: inline-block;
  padding: 0.68rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-ghost {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.section { margin-top: 1.5rem; }
.section-head {
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.section-head h2 {
  font-size: 2rem;
  font-family: var(--font-english);
  font-weight: 700;
  line-height: 1.1;
}
.section-head .btn,
.section-head .category-view-all {
  font-family: var(--font-english);
  font-size: 0.95rem;
  font-weight: 700;
}
body.lang-ur .section-head h2 {
  font-family: var(--font-arabic);
  font-weight: 700;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  background: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}

.chip-category {
  display: inline-flex;
  align-items: center;
  min-height: 56px;
  padding: 0.65rem 0.95rem;
  background: linear-gradient(180deg, #fffefb 0%, #fff 100%);
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.chip-category:hover,
.chip-category:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.1);
  border-color: rgba(15, 118, 110, 0.28);
}

.chip-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  line-height: 1.15;
}

.chip-copy strong {
  font-size: 0.93rem;
  font-weight: 800;
  color: var(--ink);
}

.chip-copy small {
  font-size: 0.73rem;
  color: var(--muted);
  font-weight: 700;
}

.home-category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.home-category-card {
  display: flex;
  flex-direction: column;
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(180deg, #fffefc 0%, #fff 100%);
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.06);
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.home-category-card:hover,
.home-category-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(15, 118, 110, 0.12);
  border-color: rgba(15, 118, 110, 0.2);
}

.home-category-card.tone-green {
  background: linear-gradient(180deg, #fffefc 0%, #f3fff8 100%);
}

.home-category-card.tone-blue {
  background: linear-gradient(180deg, #fffefc 0%, #f3f8ff 100%);
}

.home-category-card.tone-gold {
  background: linear-gradient(180deg, #fffefc 0%, #fff8ee 100%);
}

.home-category-card.tone-purple {
  background: linear-gradient(180deg, #fffefc 0%, #faf5ff 100%);
}

.home-category-card.tone-emerald {
  background: linear-gradient(180deg, #fffefc 0%, #f2fbf7 100%);
}

.home-category-card.tone-orange {
  background: linear-gradient(180deg, #fffefc 0%, #fff6ef 100%);
}

.home-category-card-main {
  flex: 1;
  display: grid;
  place-items: center;
  gap: 0.65rem;
  padding: 1.3rem 1rem 0.95rem;
  text-align: center;
}

.home-category-icon {
  width: 78px;
  height: 78px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(15, 118, 110, 0.12);
  color: var(--brand-deep);
}

.home-category-copy {
  display: grid;
  gap: 0.45rem;
}

.home-category-copy strong {
  display: block;
  color: var(--ink);
  font-family: var(--font-english);
  font-size: 1.6rem;
  line-height: 1.05;
}

.home-category-copy small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  min-height: 34px;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--brand-deep);
  background: rgba(255,255,255,0.84);
  border: 1px solid rgba(15, 118, 110, 0.15);
}

.home-category-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.95rem 1rem;
  border-top: 1px solid rgba(15, 118, 110, 0.12);
  color: var(--brand-deep);
  font-weight: 800;
  background: rgba(255,255,255,0.45);
}

.home-category-cta span:last-child {
  font-size: 1.1rem;
}

.home-category-simple {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-height: 48px;
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--brand-deep);
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(15, 118, 110, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.home-category-simple:hover,
.home-category-simple:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.1);
  border-color: rgba(15, 118, 110, 0.22);
}

.home-category-simple-name {
  font-size: 1rem;
  line-height: 1.2;
}

.home-category-simple-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0.18rem 0.65rem;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--brand-deep);
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid rgba(15, 118, 110, 0.12);
}

.search-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}

.books-page #mainContent > .search-panel + .search-panel {
  margin-top: 1.15rem;
}

.search-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 0.6rem;
  position: relative;
}

input, select {
  width: 100%;
  border: 1px solid #d8cfbd;
  border-radius: 10px;
  padding: 0.78rem;
  min-height: 46px;
  font: inherit;
  background: #fff;
}

.shop-address-field {
  font-family: "Noto Nastaliq Urdu", "Noto Naskh Arabic", "Noto Sans Arabic", "Microsoft Uighur", Tahoma, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  letter-spacing: 0.01em;
}

textarea,
select[multiple] {
  width: 100%;
  border: 1px solid #d8cfbd;
  border-radius: 10px;
  padding: 0.78rem;
  font: inherit;
  background: #fff;
}

select[multiple] {
  min-height: 128px;
}

input:focus, select:focus {
  border-color: var(--brand);
  outline: 2px solid rgba(15, 118, 110, 0.2);
}

.search-suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: min(100%, 560px);
  max-height: 420px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  z-index: 1200;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.12);
}

.search-suggest-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #ece5d8;
  background: #fff;
  text-align: left;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 0.55rem;
  padding: 0.55rem 0.6rem;
  cursor: pointer;
}

.search-suggest-item:last-child {
  border-bottom: 0;
}

.search-suggest-item.active,
.search-suggest-item:hover {
  background: #f7fdfc;
}

.search-suggest-item img {
  width: 42px;
  height: 54px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid #e8decb;
}

.search-suggest-copy {
  display: grid;
  gap: 0.14rem;
}

.search-suggest-copy strong {
  font-size: 1.05rem;
  color: var(--ink);
  line-height: 1.2;
}

.search-suggest-copy small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.85rem;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  margin-top: 1rem;
}

.pagination-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.pagination-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.pagination-btn.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  color: #9f9582;
  font-weight: 900;
  letter-spacing: 0.08em;
  user-select: none;
}

.author-inline-link {
  color: var(--brand);
  font-weight: 800;
  text-decoration: none !important;
}

.author-inline-link:hover,
.author-inline-link:focus,
.author-inline-link:visited {
  color: var(--brand-deep);
  text-decoration: none !important;
}

.book-card-author-meta .author-inline-link {
  text-decoration: none !important;
}

.author-editor-box {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.06), rgba(255, 252, 245, 0.96));
}

.author-editor-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(320px, 1.25fr);
  gap: 1rem;
}

.author-editor-profile,
.author-editor-books {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.9rem;
}

.author-editor-profile img {
  width: 130px;
  height: 130px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf8;
  margin-bottom: 0.75rem;
}

.author-editor-books-list {
  display: grid;
  gap: 0.65rem;
  max-height: 620px;
  overflow: auto;
  padding-right: 0.25rem;
}

.author-book-control-row {
  display: grid;
  grid-template-columns: 74px minmax(180px, 1fr);
  gap: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf8;
  padding: 0.7rem;
}

.author-book-control-row img {
  width: 74px;
  height: 96px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.author-book-control-actions {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  gap: 0.45rem;
  align-items: center;
  margin-top: 0.55rem;
}

.author-book-control-actions input {
  min-width: 0;
}

@media (max-width: 820px) {
  .author-editor-layout,
  .author-book-control-actions {
    grid-template-columns: 1fr;
  }
}

.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 212px;
  z-index: 1050;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 3px solid #fff;
  background: var(--brand);
  color: #fff;
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--brand-deep);
}

.mobile-layout-toggle {
  display: none;
}

.category-slider-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem;
  margin-bottom: 0.9rem;
}

.category-slider-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.7rem;
}

.category-slider-head h3 {
  font-size: 1.8rem;
}

.category-view-all {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.category-slider-track-wrap {
  overflow: hidden;
}

.category-slider-track {
  display: flex;
  transition: transform 0.25s ease;
}

.home-book-slider {
  display: block;
}

.category-slide {
  min-width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(230px, 1fr));
  gap: 0.85rem;
}

.mini-book {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mini-book .book-cover {
  margin-bottom: 0.45rem;
}

.mini-book-title {
  margin: 0;
  font-size: 1.36rem;
  line-height: 1.2;
}

.mini-book .meta {
  margin: 0.18rem 0;
}

.mini-book .card-actions {
  margin-top: 0.25rem;
}

.mini-book .buy-btn {
  margin-top: 0;
  font-size: 0.92rem;
  padding: 0.65rem 0.9rem;
}

.slider-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.6rem;
}

.slider-arrow {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.slider-dots {
  display: flex;
  gap: 0.12rem;
}

.slider-dot {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.slider-dot::after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #c6c6c6;
}

.slider-dot.active::after {
  background: var(--brand);
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.card h3 {
  font-size: 1.34rem;
  margin-top: 0.2rem;
}

.book-grid .card,
.category-slide .card,
.home-book-slider .card,
.mini-book {
  min-height: 640px;
  height: 100%;
}

.category-slide {
  align-items: stretch;
}

.card-title-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.book-cover-wrap {
  position: relative;
  display: block;
}

.book-grid .card .book-cover,
.category-slide .card .book-cover,
.home-book-slider .card .book-cover,
.mini-book .book-cover {
  height: 300px;
  object-fit: contain;
}

.book-grid .card h3,
.category-slide .card h3,
.home-book-slider .card h3,
.mini-book-title {
  min-height: 3.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-card-title {
  display: grid !important;
  gap: 0.16rem;
  min-height: 4.85rem !important;
}

.book-card-title-ur,
.book-card-title-en {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-card-title-ur {
  min-height: 1.45rem;
  max-height: 1.45rem;
  -webkit-line-clamp: 1;
  direction: rtl;
  text-align: right;
  font-family: var(--font-arabic);
  font-size: 0.9em;
  line-height: 1.45;
  font-weight: 700;
}

.book-card-title-en {
  min-height: 3.05rem;
  max-height: 3.05rem;
  -webkit-line-clamp: 2;
  font-family: var(--font-english);
  font-size: 0.78em;
  line-height: 1.48;
  font-weight: 800;
  letter-spacing: 0;
}

.book-grid .card .meta,
.category-slide .card .meta,
.home-book-slider .card .meta,
.mini-book .meta {
  min-height: 1.45rem;
}

.book-grid .card .meta,
.category-slide .card .meta,
.home-book-slider .card .meta,
.mini-book .meta {
  display: -webkit-box;
  max-height: 1.45rem;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-grid .card .price-row,
.category-slide .card .price-row,
.home-book-slider .card .price-row,
.mini-book .price-row {
  min-height: 2.1rem;
  margin-top: 0.65rem;
}

.book-grid .card .card-actions,
.category-slide .card .card-actions,
.home-book-slider .card .card-actions,
.mini-book .card-actions {
  margin-top: auto;
}

.meta {
  margin: 0.25rem 0;
  color: var(--muted);
  font-family: var(--font-english), var(--font-arabic);
  font-size: 0.86rem;
  line-height: 1.6;
}

.price-row {
  margin-top: 0.7rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.price {
  font-weight: 800;
  color: var(--brand);
  letter-spacing: 0;
}

.pos-grand-total {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  background: #fff8e7;
  border: 1px solid var(--line);
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  color: var(--brand-deep);
}

.pos-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.95fr);
  gap: 1rem;
  align-items: start;
}

.pos-main-panel,
.pos-side-panel {
  display: grid;
  gap: 1rem;
}

.pos-card {
  background: #fffdf9;
  border: 1px solid rgba(209, 186, 147, 0.72);
  border-radius: 22px;
  padding: 1rem;
  box-shadow: 0 8px 20px rgba(58, 36, 15, 0.05);
}

.pos-card-soft {
  background: #fffaf2;
}

.pos-card-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

.pos-card-head h3 {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
}

.pos-card-head .meta {
  margin: 0;
}

.checkout-grid.pos-profile-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.checkout-grid.pos-customer-grid,
.checkout-grid.pos-payment-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.checkout-grid.pos-search-grid {
  grid-template-columns: 1fr;
}

.pos-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.pos-kpi-box {
  border-radius: 18px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  background: #fff;
  padding: 0.9rem 1rem;
  display: grid;
  gap: 0.28rem;
}

.pos-kpi-box span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.pos-kpi-box strong {
  color: var(--brand-deep);
  font-size: 1.2rem;
}

.checkout-grid.pos-adjust-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pos-adjust-actions,
.pos-action-grid {
  margin-top: 0.75rem;
}

.pos-entry-actions {
  margin: 0.35rem 0 0.65rem;
  justify-content: flex-start;
  gap: 0.65rem;
}

.pos-action-grid .btn,
.pos-adjust-actions .btn,
.pos-entry-actions .btn {
  flex: 1 1 180px;
}

.checkout-grid.pos-search-grid input,
.checkout-grid.pos-customer-grid input {
  width: 100%;
}

.checkout-grid.pos-customer-grid {
  margin-top: 0.15rem;
}

.checkout-grid.pos-search-grid + .checkout-grid.pos-search-grid {
  margin-top: 0.15rem;
}

.pos-card .checkout-grid {
  gap: 0.75rem;
}

.pos-adjust-meta {
  margin: 0.65rem 0 0;
  min-height: 1.25rem;
}

.pos-total-strip {
  margin-top: 0.9rem;
  padding: 0.95rem 1rem;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(15,118,110,0.09), rgba(255,248,230,0.85));
  border: 1px solid rgba(15, 118, 110, 0.12);
}

.pos-total-strip > span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.pos-total-strip .pos-grand-total {
  margin-top: 0;
  width: 100%;
  display: block;
  background: transparent;
  border: 0;
  padding: 0;
}

.pos-summary-card #recentInvoicesBox,
#recentInvoicesBox {
  background: rgba(255,255,255,0.72);
  border-radius: 18px;
}

.pos-shell {
  display: grid;
  gap: 1rem;
}

.pos-page-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.pos-page-head h1 {
  margin: 0.1rem 0 0.25rem;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
}

.pos-page-actions {
  justify-content: flex-end;
}

.pos-kpi-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.pos-feature-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.75fr);
  gap: 1rem;
  align-items: start;
}

.pos-list-card {
  min-height: 100%;
}

.pos-mini-list {
  display: grid;
  gap: 0.7rem;
}

.pos-mini-item {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: start;
  padding: 0.85rem 0.95rem;
  border-radius: 18px;
  border: 1px solid rgba(209, 186, 147, 0.62);
  background: rgba(255,255,255,0.86);
}

.pos-mini-item strong {
  display: block;
  margin-bottom: 0.22rem;
}

.pos-mini-item .meta {
  margin: 0;
}

.pos-shortcut-strip {
  display: grid;
  gap: 0.55rem;
}

.pos-shortcut-strip p {
  margin: 0;
  padding: 0.8rem 0.9rem;
  border-radius: 16px;
  border: 1px solid rgba(15, 118, 110, 0.12);
  background: rgba(255,255,255,0.82);
}

.pos-setup-accordion {
  padding: 0;
  overflow: hidden;
}

.pos-setup-summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  cursor: pointer;
}

.pos-setup-summary::-webkit-details-marker {
  display: none;
}

.pos-setup-summary h3 {
  margin: 0 0 0.2rem;
}

.pos-setup-summary .meta {
  margin: 0;
}

.pos-setup-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  padding: 0.6rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  background: rgba(255,255,255,0.85);
  color: var(--brand-deep);
  font-weight: 800;
  font-size: 0.9rem;
}

.pos-setup-accordion[open] .pos-setup-toggle {
  background: rgba(15, 118, 110, 0.08);
}

.pos-setup-accordion[open] .pos-setup-toggle::after {
  content: "Close";
}

.pos-setup-accordion:not([open]) .pos-setup-toggle::after {
  content: "";
}

.pos-setup-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid rgba(209, 186, 147, 0.45);
}

@media (max-width: 1100px) {
  .pos-workspace {
    grid-template-columns: 1fr;
  }
  .pos-feature-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .pos-page-head,
  .pos-mini-item {
    grid-template-columns: 1fr;
    display: grid;
  }
  .pos-kpi-strip,
  .checkout-grid.pos-profile-grid,
  .checkout-grid.pos-customer-grid,
  .checkout-grid.pos-payment-grid,
  .checkout-grid.pos-adjust-grid,
  .pos-kpi-grid,
  .pos-entry-grid {
    grid-template-columns: 1fr;
  }
}

.stock {
  font-size: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  background: #fff;
  color: var(--muted);
  white-space: nowrap;
}

.stock-in {
  border-color: rgba(15, 118, 110, 0.25);
  color: var(--brand);
  background: #effaf6;
}

.stock-low {
  border-color: rgba(180, 103, 0, 0.28);
  color: #a65f00;
  background: #fff6df;
}

.stock-out {
  border-color: rgba(170, 35, 35, 0.25);
  color: #9f2929;
  background: #fff0f0;
}

.buy-btn {
  display: inline-block;
  margin-top: 0.65rem;
  font-family: var(--font-english), var(--font-arabic);
  font-size: 0.84rem;
  border: 1px solid var(--brand);
  color: var(--brand);
  border-radius: 999px;
  padding: 0.52rem 0.78rem;
  min-height: 42px;
  text-decoration: none;
  font-weight: 700;
}

.buy-btn:hover {
  background: var(--brand);
  color: #fff;
}

.buy-btn-solid {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.buy-btn-solid:hover {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  color: #fff;
}

.buy-now-btn {
  background: #a16207 !important;
  border-color: #a16207 !important;
  color: #fff !important;
}

.buy-now-btn:hover {
  background: #7c4706 !important;
  border-color: #7c4706 !important;
}

.card-title-link {
  text-decoration: none;
  color: inherit;
}

.card-title-link:hover h3 {
  color: var(--brand);
}

.buy-btn-fav {
  border-color: var(--accent);
  color: var(--accent);
}

.buy-btn-fav:hover {
  background: var(--accent);
  color: #fff;
}

.buy-btn-compare {
  border-color: #334155;
  color: #334155;
}

.buy-btn-compare:hover {
  background: #334155;
  color: #fff;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.8rem;
  background: #fff;
}

.compare-table th,
.compare-table td {
  border: 1px solid var(--line);
  padding: 0.6rem;
  vertical-align: top;
  text-align: left;
}

.compare-table th {
  background: #f8f6ef;
}

.review-stars {
  color: #c17b00;
  font-weight: 700;
  letter-spacing: 0.06em;
}

#reviewsPageGrid.book-grid {
  align-items: stretch;
  grid-template-columns: repeat(auto-fit, minmax(280px, 340px));
}

.review-page-card {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  min-height: 0;
  height: auto;
}

.review-book-cover {
  display: block;
  width: min(160px, 70%);
  aspect-ratio: 3 / 4;
  align-self: center;
  border: 1px solid #e4d6be;
  border-radius: 14px;
  overflow: hidden;
  background: #f7f1e5;
  box-shadow: 0 10px 22px rgba(37, 41, 39, 0.08);
}

.review-book-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.review-card-body {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 0.32rem;
}

.review-page-card h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.28;
}

#reviewsPageGrid .review-page-card h3,
#reviewsPageGrid .review-page-card .meta,
#reviewsPageGrid .review-comment {
  min-height: 0;
  max-height: none;
  display: block;
  overflow: visible;
  white-space: normal;
  -webkit-line-clamp: unset;
}

.review-comment {
  line-height: 1.55;
}

.review-page-card .buy-btn {
  width: 100%;
  margin-top: 0.35rem;
}

@media (max-width: 560px) {
  #reviewsPageGrid.book-grid {
    grid-template-columns: 1fr;
  }

  .review-book-cover {
    width: 132px;
    border-radius: 12px;
  }
}

.verified-review-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  padding: 0.16rem 0.48rem;
  border: 1px solid rgba(30, 111, 77, 0.22);
  border-radius: 999px;
  background: rgba(30, 111, 77, 0.1);
  color: #1e6f4d;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.book-detail-actions {
  display: grid;
  grid-template-columns: 130px minmax(280px, 1fr);
  gap: 0.85rem;
  align-items: end;
  max-width: 680px;
  margin: 1rem 0 0.35rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.78);
}

.book-qty-field {
  display: grid;
  gap: 0.35rem;
  font-weight: 800;
}

.book-qty-field span {
  color: var(--muted);
  font-size: 0.85rem;
}

.book-qty-field input {
  min-height: 52px;
  font-size: 1rem;
  font-weight: 800;
}

.book-primary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.book-primary-actions .btn {
  min-height: 52px;
  font-size: 1rem;
  font-weight: 900;
}

.book-action-buy {
  background: #a16207;
  border-color: #a16207;
  color: #fff;
}

.book-action-buy:hover {
  background: #7c4a00;
  border-color: #7c4a00;
}

.book-secondary-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.book-screenshot-brand {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  width: fit-content;
  margin-top: 0.35rem;
  padding: 0.65rem 0.95rem;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(180, 83, 9, 0.08));
  color: var(--ink);
}

.book-screenshot-brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 12px;
  background: #fffdf8;
}

.book-screenshot-brand strong,
.book-screenshot-brand span {
  display: block;
  line-height: 1.2;
}

.book-screenshot-brand strong {
  color: var(--brand);
  font-size: 1.02rem;
  font-weight: 900;
}

.book-screenshot-brand span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.book-tabs {
  margin-top: 1.4rem;
}

.book-tab-list {
  display: flex;
  justify-content: center;
  gap: 1.7rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
  overflow-x: auto;
}

.book-tab-btn {
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0.9rem 0.25rem;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.book-tab-btn.is-active {
  color: var(--ink);
  border-bottom-color: #d71920;
}

.book-tab-panel {
  display: none;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 14px 14px;
  padding: 1.5rem;
  line-height: 1.85;
}

.book-tab-panel.is-active {
  display: block;
}

.book-detail-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.book-detail-table div {
  display: grid;
  gap: 0.22rem;
  background: #fffaf0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
}

.book-detail-table strong {
  color: var(--muted);
  font-size: 0.84rem;
}

.book-detail-table span {
  color: var(--ink);
  font-weight: 800;
}

.site-footer {
  margin-top: 2.2rem;
  border-top: 1px solid var(--line);
  background: #efe8d9;
  min-height: 210px;
}

.trust-strip {
  margin-top: 2rem;
  background:
    linear-gradient(120deg, rgba(255,255,255,0.04) 25%, transparent 25%) 0 0/28px 28px,
    linear-gradient(300deg, rgba(255,255,255,0.04) 25%, transparent 25%) 0 0/28px 28px,
    #053e38;
  color: #e9fff8;
  border-top: 1px solid rgba(255,255,255,0.12);
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  padding: 0.95rem 0;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.trust-icon {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 196, 66, 0.13);
  border: 1px solid rgba(255, 196, 66, 0.45);
  color: #f8c44a;
}

.trust-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.trust-item strong {
  display: block;
  color: #fff;
  font-size: 1rem;
}

.trust-item p {
  margin: 0;
  color: #bfe8dd;
  font-size: 0.86rem;
}

.wa-float {
  position: fixed;
  right: 18px;
  bottom: 92px;
  z-index: 1400;
  min-width: 124px;
  height: 52px;
  padding: 0 1rem 0 0.8rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #25d366, #128c4a);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  text-decoration: none;
  font-weight: 800;
  border: 2px solid #ffffff;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.23);
}

.wa-float::before {
  content: "Chat";
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.68rem;
  font-weight: 900;
}

.wa-float:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.25);
}

.pwa-install-btn {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.16);
  line-height: 1;
}

.floating-cart {
  position: fixed;
  right: 18px;
  bottom: 152px;
  z-index: 1402;
  min-width: 74px;
  height: 58px;
  padding: 0 0.85rem;
  border-radius: 999px;
  background: #0f766e;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-decoration: none;
  font-weight: 800;
  border: 2px solid #ffffff;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.23);
}

.floating-cart-icon {
  font-size: 0.9rem;
}

.floating-cart-count {
  position: static;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #b42318;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.74rem;
  border: 1px solid rgba(255, 255, 255, 0.85);
  padding: 0 5px;
}

.floating-cart:not(.has-items) .floating-cart-count {
  background: #64748b;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) repeat(2, minmax(0, 1fr));
  gap: 2rem;
  padding: 2rem 0 1.5rem;
}

.footer-brand h3,
.footer-link-group h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}

.footer-brand > p {
  max-width: 34ch;
  margin: 0.5rem 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.footer-contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.9rem;
  margin-top: 0.7rem;
}

.footer-contact-links a {
  color: var(--brand-deep);
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
}

.footer-contact-links a:hover,
.footer-link-group a:hover {
  text-decoration: underline;
}

.footer-copyright {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

.footer-link-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
}

.footer-link-group a {
  color: var(--brand-deep);
  font-size: 0.88rem;
  text-decoration: none;
}

.muted { color: var(--muted); }
a { color: var(--brand-deep); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.34);
  outline-offset: 2px;
}

@media (max-width: 940px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy {
    min-height: 0;
  }
  .hero-card {
    min-height: 350px;
  }
  .hero-ad-slider {
    min-height: 330px;
  }
  .hero-ad-track-wrap {
    aspect-ratio: 4 / 3;
    height: auto;
    min-height: 0;
  }
  .hero-ad-slide img {
    height: 100%;
  }
  .hero-ad-caption {
    padding: 0.65rem 0.8rem;
    min-height: 56px;
  }
  .hero-ad-title {
    font-size: 1.12rem;
  }
  .home-page #heroAdSlider.is-loading-shell {
    min-height: 330px;
  }
  .home-page #categoryChips.is-loading-shell {
    min-height: 108px;
  }
  .home-page #categorySliders.is-loading-shell {
    min-height: 560px;
  }
  .home-page #bookGrid.is-loading-shell,
  .home-page #featuredGrid.is-loading-shell,
  .home-page #salesGrid.is-loading-shell,
  .home-page #authorsGrid.is-loading-shell,
  .home-page #latestArticlesGrid.is-loading-shell,
  .home-page #latestReviewsGrid.is-loading-shell {
    min-height: 620px;
  }
  .home-page main > section.container.section {
    contain-intrinsic-size: 1px 680px;
  }
  .home-page #categories {
    min-height: 250px;
  }
  .home-page #category-showcase,
  .home-page #all-books,
  .home-page #featured,
  .home-page #sales-books {
    min-height: 760px;
  }
  .home-page #authors,
  .home-page #blog,
  .home-page #reviews {
    min-height: 620px;
  }
  .site-footer {
    min-height: 420px;
  }
  .search-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .trust-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top-strip {
    font-size: 0.85rem;
  }
  .top-strip-inner {
    gap: 0.45rem;
    padding: 0.55rem 0;
  }
  .top-strip-actions { justify-content: flex-end; }
  .nav-wrap {
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0 0.55rem;
  }
  .brand {
    flex: 1 1 auto;
    width: auto;
    justify-content: flex-start;
    min-height: 74px;
  }
  .brand::before {
    width: min(360px, 76vw);
    height: 74px;
  }

  /* Mobile me normal flow rehne dein */
  .nav-wrap > a:not(.brand) {
    display: initial !important;
  }
  .main-nav {
    width: 100%;
    gap: 0.65rem;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 0.35rem;
  }
  .main-nav a {
    font-size: 0.86rem;
    white-space: nowrap;
    border: 1px solid #ddd3c1;
    border-radius: 999px;
    padding: 0.36rem 0.72rem;
    background: #fff;
  }
  .nav-submenu summary {
    font-size: 0.86rem;
    white-space: nowrap;
    border: 1px solid #ddd3c1;
    border-radius: 999px;
    padding: 0.36rem 0.72rem;
    background: #fff;
  }
  .header-actions {
    width: 100%;
    margin-left: 0;
    flex-wrap: wrap;
    margin-top: 0.1rem;
  }
  .user-session-badge {
    padding: 0.4rem 0.5rem;
  }
  .header-search-advanced .search-grid {
    grid-template-columns: 1fr;
  }
  .search-simple-row {
    grid-template-columns: 1fr;
  }
  .advanced-filter-grid {
    grid-template-columns: 1fr;
  }
  .header-search {
    width: 100%;
  }
  .header-search input {
    width: 100%;
  }
  .mobile-layout-toggle {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.7rem;
    flex-wrap: wrap;
  }
  .mobile-layout-toggle span {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
  }
  .layout-btn {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    border-radius: 999px;
    padding: 0.32rem 0.72rem;
    font: inherit;
    font-size: 0.83rem;
    font-weight: 700;
    cursor: pointer;
  }
  .layout-btn.active {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
  }
  body.mobile-books-1 #bookGrid.book-grid {
    grid-template-columns: 1fr;
  }
  body.mobile-books-1 #bookGrid.book-grid .card {
    min-height: 620px;
  }
  body.mobile-books-1 #bookGrid.book-grid .card .book-cover {
    height: 320px;
  }
  body.mobile-books-2 #bookGrid.book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .category-slider-card .category-slide,
  .home-book-slider .category-slide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .category-slide {
    gap: 0.55rem;
  }
  .category-slider-head h3 {
    font-size: 1.55rem;
  }
  .home-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  html,
  html:focus-within {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 520px) {
  .trust-grid { grid-template-columns: 1fr; }
  .card,
  .mini-book {
    height: 100%;
  }
  .card-title-link,
  .mini-book .card-title-link {
    display: flex;
    flex-direction: column;
  }
  .card h3,
  .mini-book-title {
    line-height: 1.18;
  }
  .card .meta,
  .mini-book .meta {
    min-height: 1.2em;
  }
  .card-actions {
    margin-top: auto;
  }
  .home-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }
  .home-category-simple {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.35rem;
    min-height: 54px;
    padding: 0.52rem 0.58rem;
  }
  .home-category-simple-name {
    min-width: 0;
    font-size: 0.82rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }
  .home-category-simple-count {
    min-height: 24px;
    padding: 0.12rem 0.38rem;
    font-size: 0.68rem;
    white-space: nowrap;
  }
  .home-page #categoryChips.is-loading-shell {
    min-height: 246px;
  }
  .home-page #categories {
    min-height: 330px;
  }
  .home-category-card {
    min-height: 0;
  }
  .home-category-copy strong {
    font-size: 1.38rem;
  }
  .card-actions-secondary {
    align-items: stretch;
  }
  .card-actions-secondary .buy-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .wa-float {
    right: 10px;
    bottom: 92px;
    min-width: 54px;
    width: 54px;
    height: 54px;
    padding: 0;
    font-size: 0;
    border-width: 1.5px;
  }
  .top-strip-actions { justify-content: flex-end; }
  .lang-switcher-btn,
  .pwa-install-btn {
    padding: 0.52rem 0.82rem;
    font-size: 0.8rem;
  }
  .wa-float::before {
    content: "WA";
    width: 28px;
    height: 28px;
    font-size: 0.72rem;
  }
  .floating-cart {
    right: 10px;
    bottom: 154px;
    min-width: 56px;
    width: 56px;
    height: 56px;
    padding: 0;
    flex-direction: column;
    gap: 0.15rem;
    border-width: 1.5px;
    position: fixed;
  }
  .floating-cart-icon {
    font-size: 0.7rem;
  }
  .floating-cart-count {
    min-width: 20px;
    height: 20px;
    font-size: 0.68rem;
    padding: 0 4px;
  }
  .back-to-top {
    right: 10px;
    bottom: 140px;
    width: 42px;
    height: 42px;
    font-size: 1.15rem;
    position: fixed;
  }
}

@media (max-width: 520px) {
  .home-page main > section.container.section {
    content-visibility: visible;
    contain-intrinsic-size: none;
  }

  .home-page #featured,
  .home-page #sales-books,
  .home-page #blog {
    min-height: 0;
  }

  .home-page #sales-books,
  .home-page #blog {
    margin-top: 1.1rem;
  }

  .hero {
    overflow: hidden;
  }
  .hero-cta {
    flex-wrap: wrap;
  }
  .hero-cta .btn {
    flex: 1 1 100%;
    text-align: center;
  }
  .mobile-bottom-nav a {
    min-height: 58px;
    font-size: 0.74rem;
  }
  .category-slider-card .category-slide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }
  .home-book-slider .category-slide {
    display: flex;
    gap: 0.5rem;
  }
  .home-book-slider .category-slide > * {
    flex: 0 0 calc(50% - 0.25rem);
    min-width: 0;
  }
  .category-slider-card .category-slide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }
  .category-slider-card {
    padding: 0.65rem;
  }
  .category-slider-head {
    gap: 0.45rem;
  }
  .category-slider-head h3 {
    font-size: 1.35rem;
  }
  .mini-book,
  .home-book-slider .card,
  body.mobile-books-2 .book-grid .card {
    padding: 0.65rem;
    border-radius: 12px;
    min-width: 0;
    min-height: 520px;
  }
  .home-book-slider .card {
    max-width: 100%;
  }
  .mini-book-title,
  .home-book-slider .card h3,
  body.mobile-books-2 .book-grid .card h3 {
    font-size: clamp(1rem, 4.4vw, 1.12rem);
    line-height: 1.15;
    overflow-wrap: anywhere;
  }
  .book-card-title {
    min-height: 4.75rem !important;
    gap: 0.12rem;
  }
  .book-card-title-ur {
    min-height: 1.48rem;
    max-height: 1.48rem;
    line-height: 1.48;
    font-size: 0.82em;
  }
  .book-card-title-en {
    min-height: 2.9rem;
    max-height: 2.9rem;
    line-height: 1.45;
    font-size: 0.84em;
  }
  .mini-book .meta,
  .home-book-slider .card .meta,
  body.mobile-books-2 .book-grid .card .meta {
    font-size: 0.78rem;
    line-height: 1.35;
  }
  .mini-book .book-card-author-meta,
  .home-book-slider .card .book-card-author-meta,
  body.mobile-books-2 .book-grid .card .book-card-author-meta {
    min-height: 1.2em;
    max-height: 1.2em;
    margin-top: 0.1rem;
    margin-bottom: 0.05rem;
    line-height: 1.2;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mini-book .book-card-author-meta .author-inline-link,
  .home-book-slider .card .book-card-author-meta .author-inline-link,
  body.mobile-books-2 .book-grid .card .book-card-author-meta .author-inline-link {
    line-height: inherit;
  }
  .mini-book .price,
  .home-book-slider .card .price,
  body.mobile-books-2 .book-grid .card .price {
    font-size: 0.95rem;
  }
  .mini-book .price-row,
  .home-book-slider .card .price-row,
  body.mobile-books-2 .book-grid .card .price-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .mini-book .stock,
  .home-book-slider .card .stock,
  body.mobile-books-2 .book-grid .card .stock {
    max-width: 100%;
    white-space: normal;
    line-height: 1.2;
  }
  .mini-book .book-cover,
  .home-book-slider .card .book-cover,
  body.mobile-books-2 .book-grid .card .book-cover {
    margin-bottom: 0.35rem;
    aspect-ratio: 4 / 4.8;
    height: 205px;
    object-fit: cover;
  }
  .mini-book .buy-btn,
  .home-book-slider .buy-btn,
  body.mobile-books-2 .book-grid .buy-btn {
    min-width: 0;
    min-height: 40px;
    padding: 0.5rem 0.35rem;
    font-size: 0.74rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }
  .mini-book .card-actions,
  .home-book-slider .card-actions,
  body.mobile-books-2 .book-grid .card-actions {
    gap: 0.38rem;
    padding-top: 0.55rem;
  }
  .mini-book .card-actions-primary,
  .mini-book .card-actions-secondary,
  .home-book-slider .card-actions-primary,
  .home-book-slider .card-actions-secondary,
  body.mobile-books-2 .book-grid .card-actions-primary,
  body.mobile-books-2 .book-grid .card-actions-secondary {
    gap: 0.35rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mini-book .card-actions-primary,
  .home-book-slider .card-actions-primary,
  body.mobile-books-2 .book-grid .card-actions-primary {
    grid-template-columns: 1fr;
  }
  .mini-book .card-actions-secondary .buy-btn,
  .home-book-slider .card-actions-secondary .buy-btn,
  body.mobile-books-2 .book-grid .card-actions-secondary .buy-btn {
    padding-inline: 0.2rem;
    font-size: 0.72rem;
  }
  .home-book-slider .slider-controls {
    margin-top: 0.6rem;
  }

  .home-page #featuredGrid .card,
  .home-page #salesGrid .card,
  .home-page #latestArticlesGrid .card {
    min-height: 0;
    padding: 0.55rem;
    gap: 0.35rem;
    height: auto;
  }

  .home-page #featuredGrid .card .book-cover,
  .home-page #salesGrid .card .book-cover,
  .home-page #latestArticlesGrid .card .book-cover {
    height: 178px;
    object-fit: contain;
  }

  .home-page #featuredGrid .book-cover-wrap,
  .home-page #salesGrid .book-cover-wrap {
    margin-bottom: 0.25rem;
  }

  .home-page #featuredGrid .book-card-title,
  .home-page #salesGrid .book-card-title {
    min-height: 3.75rem !important;
    max-height: 3.75rem;
    overflow: hidden;
  }

  .home-page #featuredGrid .book-card-title-ur,
  .home-page #salesGrid .book-card-title-ur {
    min-height: 1.25rem;
    max-height: 1.25rem;
    line-height: 1.25;
    text-overflow: ellipsis;
  }

  .home-page #featuredGrid .book-card-title-en,
  .home-page #salesGrid .book-card-title-en {
    min-height: 2.35rem;
    max-height: 2.35rem;
    line-height: 1.18;
    text-overflow: ellipsis;
  }

  .home-page #featuredGrid .card .meta,
  .home-page #salesGrid .card .meta,
  .home-page #latestArticlesGrid .card .meta {
    min-height: 1.35em;
    max-height: 1.35em;
    font-size: 0.72rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .home-page #featuredGrid .card .book-card-author-meta,
  .home-page #salesGrid .card .book-card-author-meta {
    min-height: 1.2em;
    max-height: 1.2em;
    line-height: 1.2;
    -webkit-line-clamp: 1;
  }

  .home-page #featuredGrid .card .price-row,
  .home-page #salesGrid .card .price-row {
    min-height: 1.75rem;
    margin-top: 0.35rem;
    gap: 0.28rem;
  }

  .home-page #featuredGrid .card .stock,
  .home-page #salesGrid .card .stock {
    font-size: 0.68rem;
    padding: 0.12rem 0.42rem;
  }

  .home-page #featuredGrid .card-actions,
  .home-page #salesGrid .card-actions {
    gap: 0.3rem;
    padding-top: 0.38rem;
    margin-top: 0.1rem;
  }

  .home-page #featuredGrid .buy-btn,
  .home-page #salesGrid .buy-btn,
  .home-page #latestArticlesGrid .buy-btn {
    min-height: 34px;
    padding: 0.38rem 0.25rem;
    font-size: 0.68rem;
  }

  .home-page #featuredGrid .card-actions-secondary .buy-btn,
  .home-page #salesGrid .card-actions-secondary .buy-btn {
    min-height: 32px;
    font-size: 0.66rem;
  }
}
.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.cart-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, #fffdf8 0%, #f8f1e4 100%);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.cart-hero h1 {
  margin: 0.15rem 0 0.3rem;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
}

.cart-hero-chip {
  min-width: 160px;
  display: grid;
  gap: 0.2rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid #dccdaf;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  text-align: right;
}

.cart-hero-chip strong {
  color: var(--brand);
  font-size: 1.2rem;
}

.cart-hero-chip span {
  color: var(--muted);
  font-size: 0.88rem;
}

.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(290px, 0.72fr);
  gap: 1rem;
  margin-top: 1rem;
}

.cart-summary-panel {
  position: sticky;
  top: 1rem;
  align-self: start;
}

.cart-sheet,
.cart-summary-card,
.cart-checkout-section,
.cart-recommend-section {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.cart-sheet,
.cart-summary-card,
.cart-checkout-section,
.cart-recommend-section {
  padding: 1rem;
}

.cart-sheet-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.9rem;
}

.cart-sheet-head h2,
.cart-summary-card h2 {
  margin: 0;
  font-size: 1.45rem;
}

.cart-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}

.cart-summary-head .price {
  margin: 0.12rem 0 0;
  font-size: 1rem;
}

.cart-inline-action {
  min-height: 40px;
  padding: 0.52rem 0.9rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.1;
}

.cart-coupon-toggle {
  min-height: 34px;
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
  font-size: 0.84rem;
  justify-self: start;
}

.cart-coupon-box[hidden] {
  display: none;
}

.cart-items-list {
  display: grid;
  gap: 0.85rem;
}

.cart-line-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 1rem;
  padding: 0.9rem;
  border: 1px solid #e7dcc7;
  border-radius: 16px;
  background: linear-gradient(180deg, #fffefb 0%, #fbf6eb 100%);
}

.cart-line-cover img {
  width: 120px;
  height: 150px;
  object-fit: cover;
  border-radius: 12px;
  background: #f7f1e5;
  border: 1px solid #e4d6be;
}

.cart-line-copy {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}

.cart-line-top {
  display: flex;
  justify-content: space-between;
  gap: 0.9rem;
  align-items: flex-start;
}

.cart-line-top h3 {
  margin: 0 0 0.35rem;
  font-size: 1.02rem;
}

.cart-line-top h3 a {
  color: var(--ink);
  text-decoration: none;
}

.cart-advance-offer-badge {
  display: inline-flex;
  width: fit-content;
  margin: 0.45rem 0 0;
  padding: 0.32rem 0.55rem;
  border-radius: 999px;
  background: #e8f7f1;
  border: 1px solid #b7ead8;
  color: #08715f;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.25;
}

.cart-remove-btn {
  white-space: nowrap;
}

.cart-line-bottom {
  display: grid;
  grid-template-columns: 150px minmax(180px, 1fr);
  gap: 0.8rem;
  align-items: end;
}

.cart-qty-box,
.cart-price-box {
  display: grid;
  gap: 0.3rem;
}

.cart-qty-box span,
.cart-price-box span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.cart-qty-box input {
  width: 42px;
  min-height: 38px;
  border: 1px solid #d8cfbd;
  border-radius: 8px;
  padding: 0.25rem;
  font: inherit;
  font-weight: 800;
  text-align: center;
  background: #fffdf8;
}

.cart-qty-stepper {
  display: inline-grid;
  grid-template-columns: 30px 42px 30px;
  gap: 0.35rem;
  align-items: center;
}

.cart-qty-adjust {
  width: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid #d8cfbd;
  border-radius: 50%;
  background: #edf8f5;
  color: var(--brand);
  font: inherit;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.cart-qty-adjust:hover,
.cart-qty-adjust:focus-visible {
  background: var(--brand);
  color: #fff;
}

.cart-price-box strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.cart-item-original-price {
  color: #7b8794;
  font-size: 0.84rem;
  font-weight: 700;
}

.cart-price-box .cart-item-discount-price {
  color: #08715f;
}

.cart-line-total strong {
  color: var(--brand);
  font-size: 0.98rem;
}

.cart-coupon-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.55rem;
  margin: 0.8rem 0 0.55rem;
}

.cart-coupon-row input {
  min-height: 42px;
  border: 1px solid #d8cfbd;
  border-radius: 12px;
  padding: 0.62rem 0.8rem;
  font: inherit;
  background: #fff;
  font-size: 0.92rem;
}

.cart-apply-btn {
  min-width: 104px;
}

.cart-remove-coupon-btn {
  min-width: 92px;
}

.cart-totals-stack {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.7rem;
}

.cart-totals-stack div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  color: var(--muted);
  padding: 0.55rem 0;
  border-bottom: 1px solid #eee4d1;
}

.cart-totals-stack strong {
  color: var(--ink);
  white-space: nowrap;
  text-align: right;
}

.cart-totals-stack span {
  min-width: 0;
  line-height: 1.45;
}

.cart-offer-detail-row {
  background: #f4fbf8;
  border-radius: 10px;
  padding-left: 0.65rem !important;
  padding-right: 0.65rem !important;
}

.cart-offer-detail-row span,
.cart-offer-detail-row strong {
  color: #0f766e;
  font-weight: 900;
}

.cart-total-final strong {
  color: var(--brand);
  font-size: 1.15rem;
}

.cart-summary-note,
.cart-checkout-intro {
  color: var(--muted);
  font-size: 0.9rem;
}

.cart-summary-note {
  margin: 0.8rem 0 0;
  padding-top: 0.8rem;
  border-top: 1px solid #eee4d1;
}

.cart-summary-redesign {
  padding: 1.15rem;
  border-radius: 14px;
  background: #fffefb;
}

.cart-summary-heading {
  display: block;
  margin-bottom: 0.85rem;
}

.cart-summary-heading h2 {
  font-size: 1.25rem;
}

.cart-summary-heading p {
  margin: 0.18rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.cart-total-row {
  min-height: 48px;
}

.cart-total-row[hidden],
.cart-offer-detail-row[hidden] {
  display: none;
}

.cart-summary-book-lines {
  display: grid;
  gap: 0;
  margin: 0.7rem 0 0.45rem;
  border-top: 1px solid #eee4d1;
}

.cart-summary-book-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid #eee4d1;
}

.cart-summary-book-line span {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.cart-summary-book-line strong {
  color: #334155;
  font-size: 0.86rem;
}

.cart-summary-book-line small {
  color: var(--muted);
  font-size: 0.75rem;
}

.cart-summary-book-line .cart-summary-book-title {
  color: #425466;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-summary-book-line b {
  color: var(--ink);
  font-size: 0.86rem;
  white-space: nowrap;
}

.cart-total-label {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.42rem;
  color: #34455a;
  font-weight: 700;
}

.cart-total-label small,
.cart-total-final small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.cart-subtotal-row {
  border-top: 1px solid #eee4d1;
}

.cart-summary-redesign .cart-coupon-toggle {
  margin: 0.55rem 0 0.15rem;
  border-radius: 8px;
  color: #08715f;
}

.cart-breakdown-rows {
  margin-top: 0.35rem;
  gap: 0;
}

.cart-breakdown-rows .cart-total-row strong {
  font-size: 0.92rem;
}

.cart-summary-redesign .cart-offer-detail-row {
  margin: 0.55rem 0;
  border: 1px solid #d8eee5;
  border-radius: 8px;
  background: #f1fbf6;
}

.cart-total-final {
  margin-top: 0.7rem;
  padding: 0.85rem 0 !important;
  border-top: 2px solid #e9dfcf;
  border-bottom: 0 !important;
}


.cart-total-final > span {
  display: grid;
  gap: 0.12rem;
  color: var(--ink) !important;
  font-size: 1.02rem;
  font-weight: 900;
}

.cart-total-final strong {
  padding: 0.48rem 0.62rem;
  border-radius: 8px;
  background: #e8f7f1;
  color: #08715f !important;
  font-size: 1.05rem !important;
}

.cart-summary-redesign .cart-summary-note {
  margin-top: 0.2rem;
  padding: 0.72rem;
  border: 0;
  border-radius: 8px;
  background: #f1f7fc;
  color: #325d88;
  line-height: 1.45;
}


.checkout-field {
  display: grid;
  gap: 0.38rem;
}

.checkout-field span {
  font-size: 0.82rem;
  font-weight: 800;
  color: #36524f;
}

.online-payment-box {
  grid-column: 1 / -1;
  padding: 0.9rem;
  border: 1px solid #d8eadf;
  border-radius: 14px;
  background: #f7fcf9;
}

.online-payment-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.45rem;
}

.online-payment-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.online-payment-head span {
  flex: 0 0 auto;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  background: #dff5ec;
  color: #08715f;
  font-size: 0.76rem;
  font-weight: 900;
}

.online-payment-box .meta {
  margin: 0 0 0.45rem;
}

.online-payment-account {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.65rem;
  padding: 0.75rem;
  border: 1px solid #cfe4d8;
  border-radius: 12px;
  background: #fff;
}

.online-payment-account-title {
  display: flex;
  justify-content: space-between;
  gap: 0.55rem;
  align-items: center;
}

.online-payment-account-title > strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.online-payment-account-title > span {
  flex: 0 0 auto;
  color: #0f766e;
  font-size: 0.78rem;
  font-weight: 900;
}

.online-payment-account-grid {
  display: grid;
  gap: 0.45rem;
}

.online-payment-account-grid div {
  display: grid;
  grid-template-columns: minmax(78px, 0.45fr) minmax(0, 1fr);
  gap: 0.5rem;
  align-items: start;
}

.online-payment-account-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.online-payment-account-grid strong {
  min-width: 0;
  color: var(--ink);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.online-payment-empty {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.checkout-field-wide {
  grid-column: 1 / -1;
}

.cart-checkout-form input,
.cart-checkout-form textarea,
.cart-checkout-form select {
  width: 100%;
}

.cart-checkout-form input,
.cart-checkout-form select {
  min-height: 48px;
  border: 1px solid #d8cfbd;
  border-radius: 12px;
  padding: 0.72rem 0.85rem;
  font: inherit;
  background: #fff;
}

.admin-inventory-search-box {
  padding: 1rem;
  border: 1px solid #e7dcc7;
  border-radius: 18px;
  background: linear-gradient(180deg, #fffefb 0%, #fbf6eb 100%);
  margin-bottom: 0.85rem;
}

.admin-inventory-search-box select,
.admin-inventory-search-box input {
  min-height: 46px;
}

.inventory-quick-filters {
  flex-wrap: wrap;
}

.inventory-quick-filters .btn.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.inventory-manager-head {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 0.9rem;
}

.inventory-manager-head h3 {
  margin: 0.2rem 0 0;
}

.inventory-manager-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.inventory-manager-toolbar .btn {
  min-height: 40px;
}

.inventory-report-grid,
.inventory-activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
  margin-top: 0.9rem;
}

.inventory-report-card,
.inventory-activity-card {
  background: #fff;
  border: 1px solid #e7dcc7;
  border-radius: 16px;
  padding: 0.9rem;
}

.inventory-report-card h4,
.inventory-activity-card h4 {
  margin: 0 0 0.7rem;
}

.inventory-report-card p,
.inventory-activity-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f1e8d8;
}

.inventory-activity-item {
  display: grid;
  justify-content: start;
}

.inventory-activity-item strong,
.inventory-activity-item span,
.inventory-activity-item small {
  display: block;
}

.inventory-activity-item span,
.inventory-activity-item small,
.inventory-report-card p span {
  color: var(--muted);
}

.inventory-manager-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.7rem;
}

.inventory-kpi {
  padding: 0.8rem;
  border: 1px solid #e7dcc7;
  border-radius: 14px;
  background: #fff;
  display: grid;
  gap: 0.2rem;
}

.inventory-kpi span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.inventory-kpi strong {
  font-size: 1.25rem;
  color: var(--ink);
}

.inventory-manager-table-wrap {
  overflow: auto;
  border: 1px solid #e7dcc7;
  border-radius: 16px;
  background: #fff;
}

.inventory-manager-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1160px;
}

.inventory-manager-table th,
.inventory-manager-table td {
  padding: 0.85rem;
  border-bottom: 1px solid #efe6d6;
  text-align: left;
  vertical-align: top;
}

.inventory-manager-table th {
  background: #fbf6eb;
  font-size: 0.84rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 2;
}

.inventory-book-cell {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 0.75rem;
  align-items: start;
  min-width: 280px;
}

.inventory-book-cell img {
  width: 54px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #e4d6be;
  background: #f7f1e5;
}

.inventory-book-cell strong,
.inventory-book-cell span {
  display: block;
}

.inventory-book-cell span {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.16rem;
}

.inventory-stock-box {
  display: grid;
  gap: 0.32rem;
}

.inventory-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
}

.inventory-status-in {
  background: #e7f7ef;
  color: #0d7a43;
}

.inventory-status-low {
  background: #fff4de;
  color: #b46a00;
}

.inventory-status-out {
  background: #fde9e8;
  color: #c43c2f;
}

.inventory-stock-actions,
.inventory-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.inventory-stock-actions input,
.inventory-row-actions input {
  width: 76px;
  min-height: 40px;
}

.inventory-manager-table .meta {
  font-size: 0.76rem;
  line-height: 1.3;
}

@media (max-width: 900px) {
  .inventory-manager-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.cart-checkout-form {
  margin-top: 0.25rem;
}

.cart-empty-state {
  display: grid;
  gap: 0.55rem;
  justify-items: start;
  padding: 1rem;
  border: 1px dashed #d8cfbd;
  border-radius: 16px;
  background: #fffaf2;
}

body.lang-ur .cart-hero,
body.lang-ur .cart-sheet,
body.lang-ur .cart-summary-card,
body.lang-ur .cart-checkout-section,
body.lang-ur .cart-recommend-section,
body.lang-ur .cart-line-item,
body.lang-ur .cart-checkout-form input,
body.lang-ur .cart-checkout-form textarea,
body.lang-ur .cart-checkout-form select,
body.lang-ur .cart-coupon-row input,
body.lang-ur .cart-coupon-row button,
body.lang-ur .cart-summary-actions button {
  font-family: "Noto Naskh Arabic", "Noto Sans Arabic", Tahoma, "Segoe UI", sans-serif;
}

body.lang-ur .cart-hero h1,
body.lang-ur .cart-sheet-head h2,
body.lang-ur .cart-summary-card h2,
body.lang-ur .cart-checkout-section h2,
body.lang-ur .cart-recommend-section h2,
body.lang-ur .cart-line-top h3,
body.lang-ur .cart-line-top h3 a {
  font-family: "Noto Naskh Arabic", "Noto Sans Arabic", Tahoma, "Segoe UI", sans-serif;
  line-height: 1.25;
  letter-spacing: 0;
}

body.lang-ur .cart-hero h1 {
  font-size: clamp(1.65rem, 3vw, 2.45rem);
}

body.lang-ur .cart-sheet-head h2,
body.lang-ur .cart-summary-card h2,
body.lang-ur .cart-checkout-section h2,
body.lang-ur .cart-recommend-section h2 {
  font-size: 1.45rem;
}

body.lang-ur .cart-inline-action {
  font-size: 0.84rem;
  padding: 0.5rem 0.82rem;
}

body.lang-ur .cart-line-top h3,
body.lang-ur .cart-line-top h3 a {
  font-size: 1.08rem;
}

body.lang-ur .cart-hero .meta,
body.lang-ur .cart-line-copy .meta,
body.lang-ur .cart-totals-stack span,
body.lang-ur .cart-qty-box span,
body.lang-ur .cart-price-box span,
body.lang-ur .cart-summary-card .meta,
body.lang-ur .cart-checkout-section .meta,
body.lang-ur .cart-checkout-form input,
body.lang-ur .cart-checkout-form textarea,
body.lang-ur .cart-checkout-form select,
body.lang-ur .cart-coupon-row input,
body.lang-ur .cart-coupon-row button,
body.lang-ur .cart-summary-actions button {
  font-size: 0.88rem;
  line-height: 1.6;
}

body.lang-ur .cart-totals-stack strong,
body.lang-ur .cart-price-box strong,
body.lang-ur .cart-line-total strong,
body.lang-ur #cartTotal,
body.lang-ur #finalTotalLine {
  font-family: var(--font-english);
}

.checkout-grid textarea {
  min-height: 92px;
  border: 1px solid #d8cfbd;
  border-radius: 12px;
  padding: 0.78rem;
  font: inherit;
  background: #fff;
}

.checkout-grid button {
  grid-column: 1 / -1;
  justify-self: start;
}

.admin-form-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.9rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(135deg, #fffaf0, #f7f4ed);
}

.admin-form-head h2 {
  margin: 0.15rem 0 0.35rem;
}

.admin-stock-form {
  display: grid;
  gap: 0.9rem;
}

.admin-form-section {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.72);
}

.admin-form-section legend {
  padding: 0 0.45rem;
  color: var(--brand-deep);
  font-weight: 900;
  font-size: 1rem;
}

.admin-form-section .checkout-grid {
  margin-top: 0.35rem;
}

.admin-book-details-grid {
  grid-template-columns: minmax(0, 1fr) minmax(210px, 0.32fr);
  align-items: stretch;
}

.admin-book-description-field {
  grid-column: span 1;
  min-height: 132px;
  resize: vertical;
}

.admin-book-small-fields {
  display: grid;
  gap: 0.55rem;
}

.admin-book-pages-field {
  max-width: none;
  min-height: 52px;
}

.admin-book-date-field {
  margin: 0;
}

.admin-book-date-field input {
  min-height: 52px;
}

.admin-pricing-stock-grid {
  grid-template-columns: minmax(130px, 1fr) minmax(120px, 0.75fr) minmax(145px, 1fr) minmax(100px, 0.65fr) minmax(135px, 0.8fr);
  align-items: center;
}

.admin-pricing-stock-grid input {
  min-width: 0;
}

.admin-sale-check-field,
.admin-featured-check-field {
  min-height: 42px;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffaf0;
}

.cover-preview-box {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 120px;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem;
  border: 1px dashed #cfc3ac;
  border-radius: 14px;
  background: #fffaf0;
}

.cover-preview-box img {
  width: 110px;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  border: 1px solid #d8cfbd;
  border-radius: 10px;
  background: #fff;
}

.admin-date-field,
.admin-check-field {
  display: flex;
  gap: 0.45rem;
}

.admin-date-field {
  flex-direction: column;
}

.admin-check-field {
  align-items: center;
}

.admin-check-field input {
  width: auto;
}

.admin-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  position: sticky;
  bottom: 0.6rem;
  z-index: 4;
  box-shadow: 0 10px 28px rgba(40, 30, 15, 0.08);
}

.admin-form-actions .btn {
  grid-column: auto;
}

.card-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 0.7rem;
}

.card-actions-primary,
.card-actions-secondary {
  width: 100%;
  display: grid;
  gap: 0.45rem;
}

.card-actions-primary {
  grid-template-columns: 1fr;
}

.card-actions-secondary {
  grid-template-columns: 1fr 1fr;
}

.btn-icon {
  margin-inline-end: 0.35rem;
  font-size: 0.95em;
}

.card-actions-primary .buy-btn,
.card-actions-secondary .buy-btn {
  min-width: 0;
  width: 100%;
  text-align: center;
  margin-top: 0;
  overflow-wrap: anywhere;
}

button.buy-btn {
  background: transparent;
  cursor: pointer;
}

button.buy-btn.buy-btn-solid {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

button.buy-btn.buy-btn-solid:hover {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  color: #fff;
}

.card-actions-secondary .buy-btn {
  font-size: 0.82rem;
}

@media (max-width: 940px) {
  .checkout-grid { grid-template-columns: 1fr; }
  .account-page {
    gap: 0.85rem;
  }
  .account-hero,
  .account-auth-panel,
  .account-dashboard {
    border-radius: 18px;
  }
  .account-hero,
  .account-auth-panel,
  .account-dashboard {
    padding: 0.85rem;
  }
  .account-hero h1 {
    font-size: clamp(1.75rem, 8vw, 2.35rem);
  }
  .account-auth-head,
  .account-dashboard-head {
    flex-direction: column;
    padding: 0.85rem;
  }
  .account-auth-grid {
    grid-template-columns: 1fr;
  }
  .account-card {
    padding: 0.95rem;
    border-radius: 16px;
  }
  .account-submit,
  .account-dashboard-head .btn {
    width: 100%;
    justify-self: stretch;
  }
  .account-section {
    padding: 0.85rem;
    border-radius: 16px;
  }
  .admin-form-head {
    flex-direction: column;
  }
  .cover-preview-box {
    grid-template-columns: 1fr;
  }
  .cover-preview-box img {
    width: 130px;
  }
  .admin-form-actions {
    position: static;
  }
  .header-search-advanced {
    padding: 0.5rem;
  }
}

@media (max-width: 900px) {
  .admin-book-details-grid,
  .admin-pricing-stock-grid {
    grid-template-columns: 1fr 1fr;
  }

  .admin-book-description-field {
    grid-column: 1 / -1;
  }

  .admin-book-small-fields {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .admin-book-details-grid,
  .admin-pricing-stock-grid {
    grid-template-columns: 1fr;
  }

  .admin-book-small-fields {
    grid-template-columns: 1fr;
  }
}
.book-cover {
  width: 100%;
  aspect-ratio: 4 / 5;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin-bottom: 0.65rem;
  background: #f8f3e8;
}

.book-cover-lg {
  max-width: 320px;
}

/* Admin list me image ko fixed compact size dena */
#adminList .book-cover {
  width: 140px;
  height: 190px;
  aspect-ratio: auto;
  object-fit: cover;
  display: block;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem;
}

.stat-card h3 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--brand-deep);
}

.stat-card p {
  margin: 0.2rem 0 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

#authUserBox .section {
  margin-top: 1rem;
  padding-top: 0.4rem;
  border-top: 1px dashed #d8cfbd;
}

.account-page {
  display: grid;
  gap: 1.1rem;
}

.account-hero,
.account-auth-panel,
.account-dashboard {
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(circle at 95% 5%, rgba(15, 118, 110, 0.12), transparent 30%),
    linear-gradient(135deg, rgba(255, 250, 241, 0.98), rgba(255, 255, 255, 0.88));
  box-shadow: 0 18px 45px rgba(22, 33, 30, 0.08);
}

.account-hero {
  padding: 1.45rem;
}

.account-hero h1 {
  margin: 0.15rem 0 0.35rem;
  max-width: 720px;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 0.98;
}

.account-hero .meta {
  max-width: 760px;
  font-size: 1rem;
}

.account-auth-panel,
.account-dashboard {
  padding: 1rem;
}

.account-auth-head,
.account-dashboard-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid rgba(216, 207, 189, 0.82);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
}

.account-auth-head h2,
.account-dashboard-head h2 {
  margin: 0.1rem 0 0.35rem;
}

.account-secure-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.8rem;
  border: 1px solid rgba(15, 118, 110, 0.25);
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.09);
  color: var(--brand-deep);
  font-weight: 900;
  font-size: 0.82rem;
}

.account-auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 1rem;
  align-items: stretch;
}

.account-card {
  position: relative;
  border: 1px solid rgba(216, 207, 189, 0.95);
  border-radius: 20px;
  padding: 1.1rem;
  background: #fffdf8;
  box-shadow: 0 12px 30px rgba(35, 45, 40, 0.06);
}

.account-login-card {
  background: linear-gradient(180deg, #fffdf8, #f8f3e8);
}

.account-card-icon {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.2);
}

.account-card h3 {
  margin: 0.65rem 0 0.2rem;
  font-size: 1.55rem;
}

.account-form {
  display: grid;
  gap: 0.75rem;
}

.account-form label {
  display: grid;
  gap: 0.35rem;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.account-form label span {
  padding-left: 0.12rem;
}

.account-form input {
  width: 100%;
  border: 1px solid #d8cfbd;
  border-radius: 14px;
  padding: 0.88rem 0.95rem;
  background: #fff;
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.account-form input:focus {
  border-color: rgba(15, 118, 110, 0.65);
  outline: 3px solid rgba(15, 118, 110, 0.14);
}

.account-submit {
  justify-self: start;
  min-width: 170px;
  margin-top: 0.25rem;
}

.account-help-box {
  display: grid;
  gap: 0.15rem;
  margin-top: 0.25rem;
  padding: 0.8rem;
  border-radius: 14px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--brand-deep);
  font-size: 0.88rem;
}

.account-auth-message {
  min-height: 1.2rem;
  margin: 0.9rem 0 0;
  color: var(--brand-deep);
  font-weight: 800;
}

.account-dashboard-head {
  align-items: center;
}

.account-dashboard .stats-grid {
  margin: 0 0 1rem;
}

.account-dashboard .stat-card {
  border-radius: 18px;
  padding: 1rem;
  background: linear-gradient(135deg, #fff, #fffaf0);
  box-shadow: 0 10px 24px rgba(35, 45, 40, 0.055);
}

.account-section {
  margin-top: 0.9rem;
  padding: 1rem;
  border: 1px solid rgba(216, 207, 189, 0.84);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
}

.account-section h3 {
  margin-top: 0;
}

.account-section .book-grid {
  margin-top: 0.7rem;
}

.account-dashboard .card {
  box-shadow: none;
}

.admin-dashboard-shell {
  display: grid;
  gap: 1rem;
  padding: .25rem;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255,255,255,.74), rgba(248,244,235,.9));
}

.admin-dashboard-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid rgba(166,106,0,.16);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(15,118,110,.09), rgba(255,255,255,.98));
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.05);
}

.admin-dashboard-head h2 {
  margin: .1rem 0 .35rem;
}

.admin-dashboard-range {
  margin-top: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  align-items: center;
}

.orders-transfer-panel {
  display: grid;
  gap: 0.75rem;
  padding: 1rem 1.05rem;
  border-style: dashed;
}

.orders-transfer-copy {
  margin: -0.2rem 0 0;
}

.orders-transfer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.orders-file-picker {
  display: grid;
  gap: 0.2rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(166,106,0,.18);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,244,235,.92));
}

.orders-file-picker-title {
  font-weight: 800;
  color: var(--ink);
}

.orders-file-picker-help {
  color: var(--muted);
  font-size: 0.88rem;
}

.orders-import-input {
  width: 100%;
  max-width: 100%;
  border: 1px solid rgba(166,106,0,.18);
  border-radius: 14px;
  padding: 0.75rem;
  background: #fff;
}

.orders-transfer-meta {
  min-height: 1.4rem;
  margin: 0;
}

.admin-dashboard-range .btn {
  min-height: 46px;
  min-width: 96px;
}

.admin-dashboard-kpis {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.admin-kpi-card {
  text-align: left;
  border-radius: 20px;
  min-height: 150px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,244,235,.96));
  border: 1px solid rgba(166,106,0,.18);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}

.admin-kpi-card h3 {
  margin: .35rem 0;
  font-size: 1.9rem;
}

.admin-kpi-card p {
  margin: 0;
  color: var(--muted);
}

.admin-kpi-card.admin-kpi-loading {
  pointer-events: none;
  opacity: 0.72;
}

.admin-kpi-card.admin-kpi-loading h3 {
  color: var(--muted, #61706f);
}

.admin-kpi-label {
  display: inline-flex;
  font-size: .77rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #0f766e;
}

.admin-dashboard-main {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, .9fr);
  gap: 1rem;
  align-items: start;
}

.admin-dashboard-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.admin-dashboard-side {
  display: grid;
  gap: 1rem;
}

.admin-dashboard-alerts {
  width: 100%;
}

.admin-dashboard-panel {
  border: 1px solid rgba(166,106,0,.16);
  border-radius: 20px;
  padding: 1rem 1.05rem;
  background: rgba(255,255,255,.96);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.04);
}

.admin-dashboard-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  margin-bottom: .75rem;
}

.admin-dashboard-panel-head h3 {
  margin: 0;
  font-size: 1.1rem;
}

.admin-mini-chart {
  display: flex;
  align-items: flex-end;
  gap: .55rem;
  min-height: 170px;
  overflow-x: auto;
  padding-top: .35rem;
}

.admin-mini-chart-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  min-width: 42px;
}

.admin-mini-chart-column {
  display: flex;
  align-items: flex-end;
  min-height: 128px;
}

.admin-dashboard-health-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
  margin-bottom: .85rem;
}

.admin-health-pill {
  padding: .75rem .85rem;
  border-radius: 16px;
  background: rgba(15,118,110,.07);
  border: 1px solid rgba(15,118,110,.12);
}

.admin-health-pill strong,
.admin-analytics-card strong {
  display: block;
  font-size: 1.2rem;
  color: var(--heading);
}

.admin-health-pill span {
  font-size: .9rem;
  color: var(--muted);
}

.admin-alert-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.admin-dashboard-alerts .admin-dashboard-panel-head {
  margin-bottom: 1rem;
}

.admin-dashboard-alerts .admin-alert-columns > div {
  padding: 0.2rem;
  border-radius: 16px;
  background: rgba(248,244,235,.42);
}

.admin-alert-columns h4 {
  margin: 0 0 .5rem;
}

.admin-alert-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  margin-bottom: .55rem;
}

.admin-alert-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .45rem;
}

.admin-alert-list li {
  margin: 0;
}

.admin-alert-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .6rem .75rem;
  border-radius: 14px;
  background: rgba(248,244,235,.92);
  border: 1px solid rgba(166,106,0,.12);
  font-size: .92rem;
  text-align: left;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.admin-alert-item:hover {
  transform: translateY(-1px);
  border-color: rgba(15,118,110,.28);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.05);
}

.admin-alert-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

.admin-alert-meta {
  white-space: nowrap;
  color: var(--muted);
  font-weight: 700;
}

.admin-dashboard-analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: .8rem;
}

.admin-traffic-snapshot,
.admin-traffic-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: .8rem;
}

.admin-traffic-detail {
  display: grid;
  gap: .9rem;
  max-width: 100%;
  overflow: hidden;
}

.admin-traffic-kpi {
  border: 1px solid rgba(166,106,0,.14);
  border-radius: 18px;
  padding: .95rem 1rem;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,244,235,.92));
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.04);
}

.admin-traffic-kpi strong {
  display: block;
  margin: .25rem 0 .1rem;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1;
  color: #0f4f4a;
}

.admin-traffic-chart {
  border: 1px solid rgba(166,106,0,.14);
  border-radius: 22px;
  padding: 0;
  background: rgba(255,255,255,.96);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.04);
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.admin-traffic-chart-notes,
.admin-search-chart-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  flex-wrap: wrap;
}

.admin-search-chart-tabs {
  align-items: stretch;
  justify-content: flex-start;
  border-bottom: 1px solid #e6e0d4;
  background: #fff;
}

.admin-search-chart-tile {
  min-width: 150px;
  padding: .82rem 1rem;
  border-right: 1px solid #e6e0d4;
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  background: #fff;
  color: #667085;
  text-align: left;
  cursor: pointer;
}

.admin-search-chart-tile.active {
  background: var(--metric-color);
  color: #fff;
}

.admin-search-chart-tile:hover {
  background: color-mix(in srgb, var(--metric-color) 10%, #fff);
}

.admin-search-chart-tabs small,
.admin-search-chart-tabs strong {
  display: block;
}

.admin-search-chart-tabs small {
  font-size: .78rem;
  margin-bottom: .35rem;
}

.admin-search-chart-tabs strong {
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1;
}

.admin-search-chart-tabs button {
  margin: .8rem 1rem .8rem auto;
  align-self: start;
  border: 1px solid #9aa0a6;
  border-radius: 8px;
  background: #fff;
  padding: .42rem .8rem;
  color: #202124;
  font-weight: 700;
}

.admin-traffic-line-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.admin-traffic-line-chart {
  display: block;
  min-width: 760px;
  width: 100%;
  height: auto;
  padding: .65rem .75rem .1rem;
}

.admin-traffic-line-chart .grid {
  stroke: #edf0f2;
  stroke-width: 1;
}

.admin-traffic-line-chart text {
  fill: #697386;
  font-size: 11px;
}

.admin-traffic-line-chart .axis-label {
  fill: #4b5563;
  font-weight: 700;
}

.admin-traffic-line-chart .axis-value {
  fill: #6b7280;
}

.traffic-line {
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.traffic-line {
  stroke: var(--metric-color);
  fill: none;
  opacity: 0;
  transition: opacity .15s ease, stroke-width .15s ease;
}

.traffic-line.is-on {
  opacity: .95;
}

.metric-dot {
  stroke: var(--metric-color);
  fill: var(--metric-color);
}

.metric-dot {
  opacity: 0;
  transition: opacity .15s ease;
}

.metric-dot.is-on {
  opacity: .38;
}

.admin-traffic-line-chart:hover .metric-dot.is-on {
  opacity: .8;
}

.traffic-hit {
  fill: transparent;
  stroke: transparent;
  cursor: help;
  pointer-events: all;
}

.admin-traffic-chart-notes {
  border-top: 1px solid rgba(166,106,0,.12);
  padding: .75rem 1rem;
  color: var(--muted);
  font-size: .86rem;
}

.admin-traffic-chart-notes strong {
  color: #0f4f4a;
}

.admin-traffic-intel {
  border: 1px solid rgba(15,118,110,.13);
  border-radius: 20px;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(239,250,247,.9));
}

.admin-traffic-intel h3 {
  margin: .15rem 0 .8rem;
}

.admin-traffic-intel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: .7rem;
}

.admin-traffic-intel-grid article {
  border: 1px solid rgba(15,118,110,.12);
  border-radius: 14px;
  background: rgba(255,255,255,.78);
  padding: .75rem;
}

.admin-traffic-intel-grid strong,
.admin-traffic-intel-grid small {
  display: block;
}

.admin-traffic-intel-grid small {
  margin-top: .3rem;
  color: var(--muted);
  line-height: 1.45;
}

.admin-traffic-grid .admin-analytics-card {
  min-height: 230px;
}

#trafficPanel {
  max-width: 100%;
  overflow: hidden;
}

#trafficPanel .admin-form-head {
  max-width: 100%;
}

.orders-dash-chart {
  min-height: 100%;
  padding: 1rem 1.05rem;
  border-radius: 22px;
  border: 1px solid rgba(166,106,0,.14);
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,244,235,.94));
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.04);
}

.orders-dash-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
  gap: .65rem;
  align-items: end;
  min-height: 180px;
  padding-top: .8rem;
}

.orders-dash-bar-col {
  display: grid;
  justify-items: center;
  gap: .35rem;
}

.orders-dash-bar {
  width: 100%;
  max-width: 32px;
  border-radius: 999px 999px 10px 10px;
  background: linear-gradient(180deg, #0f766e, #0b4f4a);
  box-shadow: inset 0 -6px 12px rgba(255,255,255,.12);
}

.orders-dash-bar-col strong {
  font-size: .9rem;
  color: var(--ink);
}

.orders-dash-bar-col span {
  font-size: .72rem;
  color: var(--muted);
  text-align: center;
}

.orders-dash-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem;
}

.orders-dash-status {
  border: 1px solid rgba(15,118,110,.14);
  border-radius: 16px;
  padding: .9rem;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(245,248,247,.95));
}

.orders-dash-status strong {
  display: block;
  font-size: 1.5rem;
  color: #0f766e;
}

.orders-dash-status span {
  color: var(--muted);
  font-size: .9rem;
}


.admin-analytics-card {
  padding: .9rem;
  border-radius: 16px;
  background: rgba(248,244,235,.92);
  border: 1px solid rgba(166,106,0,.12);
  display: flex;
  flex-direction: column;
  gap: .55rem;
  min-height: 190px;
}

.admin-analytics-card--wide {
  grid-column: span 2;
}

.admin-analytics-card small {
  display: block;
  margin-top: .45rem;
  line-height: 1.45;
}

.admin-analytics-stats {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.admin-analytics-pill {
  display: inline-flex;
  align-items: center;
  padding: .28rem .6rem;
  border-radius: 999px;
  background: rgba(15,118,110,.08);
  border: 1px solid rgba(15,118,110,.14);
  color: var(--ink);
  font-size: .84rem;
  font-weight: 600;
}

.admin-analytics-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .45rem;
}

.admin-analytics-list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .65rem;
  padding: .5rem .6rem;
  border-radius: 12px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(166,106,0,.1);
}

.admin-analytics-list li span {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  color: var(--muted);
  font-size: .88rem;
}

.admin-analytics-list li small {
  display: block;
  margin-top: .18rem;
  color: #7a6f5d;
  font-size: .74rem;
  line-height: 1.35;
}

.admin-analytics-list li strong {
  flex: 0 0 auto;
  font-size: .9rem;
  color: #0f766e;
}

@media (max-width: 980px) {
  .admin-dashboard-main,
  .admin-dashboard-charts,
  .admin-dashboard-analytics-grid,
  .admin-traffic-snapshot,
  .admin-traffic-kpis,
  .admin-alert-columns {
    grid-template-columns: 1fr;
  }

  .admin-analytics-card--wide {
    grid-column: span 1;
  }

  .admin-dashboard-head {
    flex-direction: column;
  }

  .admin-dashboard-range {
    justify-content: flex-start;
  }
}

@media (max-width: 940px) {
  .account-page {
    gap: 0.85rem;
  }

  .account-hero,
  .account-auth-panel,
  .account-dashboard {
    padding: 0.85rem;
    border-radius: 18px;
  }

  .account-hero h1 {
    font-size: clamp(1.75rem, 8vw, 2.35rem);
  }

  .account-auth-head,
  .account-dashboard-head {
    flex-direction: column;
    padding: 0.85rem;
  }

  .account-secure-badge,
  .account-submit,
  .account-dashboard-head .btn {
    width: 100%;
  }

  .account-auth-grid {
    grid-template-columns: 1fr;
  }

  .account-card,
  .account-section {
    padding: 0.95rem;
    border-radius: 16px;
  }
}

.alerts-box {
  margin-top: 0.7rem;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 0.65rem;
}

.barcode-wrap {
  width: 170px;
  max-width: 100%;
}

#adminList .barcode-wrap svg {
  width: 170px;
  height: 54px;
  display: block;
}

#adminList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 0.8rem;
}

#adminList .admin-book-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.9rem;
  align-items: start;
  margin-bottom: 0 !important;
}

#adminList .admin-book-main {
  min-width: 0;
}

#adminList .admin-actions {
  grid-column: 1 / -1;
  margin-top: 0.2rem;
  align-items: center;
}

#adminList .print-qty-input {
  width: 90px;
  padding: 0.48rem 0.5rem;
}

.category-order-item.dragging {
  opacity: 0.55;
}

.category-order-item.drag-over {
  outline: 2px dashed var(--brand);
  outline-offset: 2px;
  background: #f8fefc;
}

#bookSetPicker {
  max-height: 340px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid #eadbc0;
  border-radius: 14px;
  padding: 0.6rem 0.9rem;
  background: #fffdf8;
}

.book-set-picker-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
  padding: 0.85rem 0;
  border-bottom: 1px solid #f1e7d5;
  cursor: pointer;
}

.book-set-picker-row:last-child {
  border-bottom: 0;
}

.book-set-picker-check {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 0.2rem;
}

.book-set-picker-check input {
  appearance: auto;
  -webkit-appearance: checkbox;
  width: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;
  height: 20px !important;
  min-height: 20px !important;
  max-height: 20px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 4px;
  flex: 0 0 20px;
  accent-color: var(--brand);
  cursor: pointer;
  box-shadow: none !important;
  transform: none !important;
}

.book-set-picker-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
}

.book-set-picker-copy strong {
  display: block;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--ink);
  word-break: break-word;
}

.book-set-picker-copy .meta {
  margin: 0;
  line-height: 1.5;
  word-break: break-word;
}

@media (max-width: 640px) {
  .book-set-picker-row {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 0.65rem;
    padding: 0.75rem 0;
  }

  .book-set-picker-copy strong {
    font-size: 0.96rem;
  }
}

.settings-tab-btn.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.is-hidden {
  display: none !important;
}

@media (max-width: 700px) {
  #adminList {
    grid-template-columns: 1fr;
  }

  #adminList .admin-book-card {
    grid-template-columns: 1fr;
  }
}

.mobile-bottom-nav {
  display: none;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-direction: column;
  margin-inline-start: auto;
  cursor: pointer;
}

.nav-toggle span {
  width: 18px;
  height: 2px;
  background: var(--ink);
  display: block;
}

@media (max-width: 820px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    padding-bottom: 86px;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    border-top: 1px solid #e7dcc8;
    background: rgba(255, 251, 244, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 -8px 22px rgba(15, 23, 42, 0.08);
  }

  .mobile-bottom-nav a {
    text-decoration: none;
    text-align: center;
    padding: 0.7rem 0.14rem 0.76rem;
    min-height: 64px;
    font-family: var(--font-english);
    font-weight: 800;
    font-size: 0.72rem;
    line-height: 1.05;
    color: #27403d;
    border-inline-start: 1px solid #ece3d2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.08rem;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-bottom-nav a:first-child {
    border-inline-start: 0;
  }

  .mobile-bottom-nav a::before {
    display: none;
  }

  .mobile-bottom-nav .nav-cart-count {
    position: absolute;
    top: 6px;
    right: 18px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #b42318;
    color: #fff;
    display: grid;
    place-items: center;
    margin-inline-start: 0;
    font-size: 0.66rem;
    line-height: 1;
    padding: 0 4px;
    border: 1px solid rgba(255,255,255,0.92);
  }

  .mobile-bottom-nav,
  .floating-cart,
  .wa-float,
  .back-to-top,
  .top-strip,
  .nav-wrap,
  .hero,
  .hero-copy,
  .hero-card,
  .section,
  .container {
    max-width: 100%;
  }

  body[data-admin-surface="true"] {
    padding-bottom: 0;
  }

body[data-admin-surface="true"] .floating-cart,
body[data-admin-surface="true"] .desktop-pinned-cart,
body[data-admin-surface="true"] .wa-float,
body[data-admin-surface="true"] .back-to-top,
body[data-admin-surface="true"] .mobile-bottom-nav,
body[data-admin-surface="true"] .user-session-badge,
body[data-admin-surface="true"] a[href$="account.html"],
body[data-admin-surface="true"] a[href="account.html"] {
  display: none !important;
}
}

@media (max-width: 940px) {
  .book-detail-actions {
    grid-template-columns: 1fr;
  }

  .book-primary-actions {
    grid-template-columns: 1fr;
  }

  .book-secondary-actions .btn {
    flex: 1 1 150px;
    text-align: center;
  }

  .book-tab-list {
    justify-content: flex-start;
    gap: 1rem;
  }

  .book-tab-panel {
    padding: 1.15rem;
  }

  .book-detail-table {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: inline-flex;
    margin-inline-start: 0;
    flex: 0 0 44px;
  }

  .nav-wrap.nav-has-drawer {
    position: relative;
  }

  .nav-wrap .main-nav,
  .nav-wrap.nav-has-drawer .main-nav {
    display: none;
    width: 100%;
    max-height: 72vh;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.6rem;
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.14);
  }

  .nav-wrap.nav-has-drawer .main-nav a {
    width: 100%;
    text-align: left;
    border: 0;
    border-radius: 8px;
    padding: 0.5rem 0.45rem;
    background: transparent;
  }

  .nav-wrap.nav-has-drawer .nav-submenu summary {
    width: 100%;
    text-align: left;
    border: 0;
    border-radius: 8px;
    padding: 0.5rem 0.45rem;
    background: transparent;
    font-size: 0.96rem;
  }

  .nav-wrap.nav-has-drawer .nav-submenu-list {
    position: static;
    border: 0;
    box-shadow: none;
    background: transparent;
    padding: 0.2rem 0 0.2rem 0.5rem;
    min-width: 0;
  }

  .nav-wrap.is-open .main-nav,
  .nav-wrap.nav-has-drawer.is-open .main-nav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
  }
}
.old-price {
  text-decoration: line-through;
  color: #8b8b8b;
  font-weight: 600;
  margin-inline-end: 0.35rem;
}

.discount-price {
  color: #b42318;
  font-weight: 800;
  letter-spacing: 0;
}

.book-detail-root {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  min-height: 980px;
}

.book-page-shell {
  display: grid;
  gap: 1rem;
  min-height: 980px;
}

.book-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.book-breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

.book-breadcrumbs a:hover {
  color: var(--brand);
}

.book-breadcrumbs span:last-child {
  color: var(--ink);
  font-weight: 800;
}

.book-product-layout,
.book-loading-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1.08fr) minmax(340px, 1fr);
  gap: 1rem;
  align-items: start;
  padding: 1rem;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.06);
  min-height: 690px;
}

.book-gallery-panel,
.book-info-panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.book-gallery-panel {
  padding: 0.25rem 1rem 0.25rem 0.25rem;
  border-inline-end: 1px solid #eadfcb;
}

.book-main-frame {
  position: relative;
  min-height: 560px;
  display: grid;
  place-items: center;
  padding: 0.75rem;
  border-radius: 16px;
  background: linear-gradient(180deg, #fcf8ef, #f6eddc);
  overflow: hidden;
}

.book-main-cover {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  border: 0;
  background: transparent;
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.12));
}

.book-sale-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
}

.book-info-panel {
  padding: 0.35rem 0.35rem 0.35rem 0.85rem;
}

.book-info-panel h1 {
  margin: 0.2rem 0 0.35rem;
  font-size: clamp(2.05rem, 3.2vw, 3.3rem);
  line-height: 1.03;
}

.book-title-mixed,
.book-title-single {
  display: grid;
  gap: 0.28rem;
}

.book-title-urdu {
  display: block;
  direction: rtl;
  text-align: right;
  font-family: var(--font-arabic);
  font-size: clamp(1.55rem, 2.25vw, 2.35rem);
  font-weight: 700;
  line-height: 1.42;
  letter-spacing: 0;
}

.book-title-en {
  display: block;
  font-family: var(--font-english);
  font-weight: 800;
  line-height: 1.08;
  font-size: clamp(1.75rem, 2.45vw, 2.7rem);
}

.arabic-text-inline {
  display: inline;
  font-family: var(--font-salawat) !important;
  font-weight: inherit;
  letter-spacing: 0;
  unicode-bidi: isolate;
}

.book-breadcrumbs,
.book-subtitle,
.book-author-line,
.book-summary-line,
.book-rating-line,
.book-tab-list,
.book-tab-panel,
.book-detail-table,
.book-detail-actions {
  font-family: var(--font-english), var(--font-arabic);
}

.book-subtitle,
.book-author-line,
.book-summary-text {
  color: var(--muted);
  margin: 0.35rem 0;
}

.book-author-line a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 800;
}

.book-rating-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin: 1rem 0;
}

.book-price-block {
  margin-top: 0.7rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.book-summary-line {
  margin: 0.5rem 0 0;
  line-height: 1.55;
}

.book-price-block .price {
  margin: 0 0 0.35rem;
  font-size: clamp(1.7rem, 2.4vw, 2.2rem);
}

.book-info-panel .book-detail-actions {
  max-width: none;
  grid-template-columns: 130px minmax(0, 1fr);
  background: transparent;
  border-radius: 0;
  border: 0;
  padding: 1rem 0 0;
  gap: 0.75rem;
}

.book-tabs {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  min-height: 190px;
}

.book-tabs .book-tab-list {
  padding: 0 1rem;
  justify-content: flex-start;
}

.book-tabs .book-tab-panel {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: #fffdf8;
}

.search-panel:has(#relatedBooksGrid) {
  background: #fffdf8;
  border-radius: 18px;
}

.book-more-section {
  margin-top: 1.3rem;
  padding: 1.1rem 1.1rem 1.2rem;
  background: linear-gradient(180deg, #fffdf8 0%, #fbf6eb 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.book-more-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.book-more-head h2 {
  margin: 0;
}

.book-more-link {
  color: var(--brand);
  text-decoration: none;
  font-weight: 800;
  white-space: nowrap;
}

.book-more-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.book-more-item {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  color: inherit;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.book-more-item:hover {
  transform: translateY(-2px);
  border-color: #d8c8ab;
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.06);
}

.book-more-item img {
  width: 116px;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  background: #f7f1e5;
}

.book-more-copy {
  display: grid;
  gap: 0.24rem;
  min-width: 0;
  padding-top: 0.1rem;
}

.book-more-copy strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
}

.book-more-copy span,
.book-more-copy small,
.book-more-copy em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.88rem;
}

.book-more-copy small {
  display: block;
  line-height: 1.4;
}

.book-more-copy em {
  color: var(--brand);
  font-weight: 800;
  font-size: 0.95rem;
  margin-top: 0.2rem;
}

.sale-badge {
  display: inline-block;
  background: #b42318;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.16rem 0.45rem;
  border-radius: 999px;
  margin-bottom: 0.45rem;
}

.book-cover-wrap .sale-badge {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  z-index: 2;
  margin: 0;
}

.discount-badge {
  display: inline-block;
  background: #0f766e;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 0.16rem 0.45rem;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.16);
}

.book-cover-wrap .discount-badge {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 2;
}

.cover-stock-badge {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  z-index: 2;
  padding: 0.16rem 0.45rem;
  border: 1px solid rgba(170, 35, 35, 0.35);
  border-radius: 999px;
  background: #fff0f0;
  color: #9f2929;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.2;
}

.collection-page .book-grid {
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
}

.collection-page .book-grid .card {
  min-height: 620px;
}

.collection-page .book-grid .card .book-cover {
  height: 292px;
}

.collection-card-actions {
  padding-top: 0.5rem;
}

.collection-card-actions .card-actions-primary {
  grid-template-columns: 1fr;
}

.collection-card-actions .buy-btn {
  min-height: 40px;
  padding: 0.48rem 0.7rem;
}

#collectionCustomizer .set-customizer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 1.25rem;
  align-items: center;
}

#collectionCustomizer .set-customizer-copy h3 {
  margin: 0.1rem 0 0.45rem;
}

.set-checkout-actions {
  display: grid;
  gap: 0.65rem;
}

.set-checkout-btn {
  width: 100%;
  min-height: 58px;
  padding: 0.6rem 0.85rem;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 0.15rem;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.set-checkout-btn span {
  font-weight: 800;
}

.set-checkout-btn small {
  font-size: 0.78rem;
  opacity: 0.88;
}

.set-checkout-btn:hover,
.set-checkout-btn:focus-visible {
  transform: translateY(-1px);
}

.set-checkout-cart {
  color: #fff;
  background: #0f766e;
  border-color: #0f766e;
}

.set-checkout-cart:hover,
.set-checkout-cart:focus-visible {
  background: #0b5d57;
  border-color: #0b5d57;
}

.set-checkout-buy {
  color: #5b3500;
  background: #fff8e7;
  border-color: #c98b2c;
}

.set-checkout-buy:hover,
.set-checkout-buy:focus-visible {
  background: #fff0c9;
  border-color: #a96b09;
}

.set-price-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.set-price-summary span {
  display: grid;
  gap: 0.08rem;
  min-width: 116px;
  padding: 0.45rem 0.55rem;
  border: 1px solid #eadbc2;
  border-radius: 6px;
  background: #fffdf8;
}

.set-price-summary small {
  color: #6b7280;
  font-size: 0.7rem;
  font-weight: 700;
}

.set-price-summary del {
  color: #7b8790;
  font-weight: 700;
}

.set-price-summary b {
  color: #9a6700;
  font-size: 0.9rem;
}

.set-price-summary strong {
  color: #b42318;
  font-size: 1rem;
}

.set-price-summary em {
  color: #0f766e;
  font-size: 0.9rem;
  font-style: normal;
  font-weight: 800;
}

.collection-layout-toggle {
  margin: -0.1rem 0 0.85rem;
}

@media (max-width: 640px) {
  #collectionCustomizer .set-customizer-layout {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .set-checkout-actions {
    grid-template-columns: 1fr;
  }

  .set-checkout-btn {
    min-height: 56px;
    text-align: center;
    align-items: center;
  }
}

.category-page #categoryPageGrid {
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
}

.category-page #categoryPageGrid .card {
  min-height: 620px;
}

.category-page #categoryPageGrid .book-cover {
  height: 292px;
}

.category-card-actions {
  padding-top: 0.5rem;
}

.category-card-actions .card-actions-primary {
  grid-template-columns: 1fr;
}

.category-card-actions .buy-btn {
  min-height: 40px;
  padding: 0.48rem 0.7rem;
}

@media (max-width: 520px) {
  .category-page #categoryPageGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.55rem;
  }

  .category-page #categoryPageGrid .card {
    min-height: 0;
    padding: 0.62rem;
  }

  .category-page #categoryPageGrid .book-cover {
    height: 178px;
    object-fit: contain;
  }

  .category-page #categoryPageGrid .book-card-title {
    min-height: 4rem !important;
  }

  .category-page #categoryPageGrid .book-card-title-ur {
    min-height: 1.25rem;
    max-height: 1.25rem;
    font-size: 0.78em;
    line-height: 1.25;
  }

  .category-page #categoryPageGrid .book-card-title-en {
    min-height: 2.35rem;
    max-height: 2.35rem;
    font-size: 0.72em;
    line-height: 1.18;
  }

  .category-page #categoryPageGrid .meta {
    min-height: 1.15rem;
    max-height: 1.15rem;
    font-size: 0.72rem;
    line-height: 1.15;
  }

  .category-page #categoryPageGrid .book-card-author-meta {
    min-height: 1.2em;
    max-height: 1.2em;
    margin-top: 0.1rem;
    margin-bottom: 0.05rem;
    line-height: 1.2;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .category-page #categoryPageGrid .price-row {
    min-height: 1.75rem;
    margin-top: 0.35rem;
    gap: 0.28rem;
  }

  .category-page #categoryPageGrid .stock {
    font-size: 0.68rem;
    padding: 0.12rem 0.42rem;
  }

  .category-card-actions {
    gap: 0.3rem;
    padding-top: 0.38rem;
  }

  .category-card-actions .buy-btn {
    min-height: 34px;
    padding: 0.38rem 0.25rem;
    font-size: 0.68rem;
  }
}

@media (max-width: 1180px) {
  .book-product-layout {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }
}

@media (max-width: 940px) {
  .cart-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .cart-hero-chip {
    min-width: 0;
    text-align: left;
  }

  .cart-layout {
    grid-template-columns: 1fr;
  }

  .cart-line-item {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 0.8rem;
  }

  .cart-line-cover img {
    width: 96px;
    height: 120px;
  }

  .cart-line-bottom {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .cart-sheet-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .book-main-frame {
    min-height: 420px;
  }

  .book-detail-root,
  .book-page-shell {
    min-height: 1180px;
  }

  .book-product-layout,
  .book-loading-layout {
    min-height: 780px;
  }

  .book-gallery-panel,
  .book-info-panel {
    border-radius: 0;
  }

  .book-gallery-panel {
    padding: 0 0 0.5rem;
    border-inline-end: 0;
    border-bottom: 1px solid #eadfcb;
  }

  .book-info-panel .book-detail-actions {
    grid-template-columns: 1fr;
  }

  .book-primary-actions {
    grid-template-columns: 1fr;
  }

  .book-primary-actions .btn {
    min-height: 48px;
    border-radius: 14px;
  }

  .book-secondary-actions {
    gap: 0.45rem;
  }

  .book-secondary-actions .btn {
    flex: 1 1 140px;
    text-align: center;
  }

  .book-screenshot-brand {
    width: 100%;
    justify-content: center;
    text-align: left;
  }

  .book-more-list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .cart-hero,
  .cart-sheet,
  .cart-summary-card,
  .cart-checkout-section,
  .cart-recommend-section {
    padding: 0.9rem;
    border-radius: 16px;
  }

  .cart-summary-head {
    display: grid;
    gap: 0.2rem;
  }

  .cart-line-item {
    grid-template-columns: 1fr;
  }

  .cart-line-cover img {
    width: 100%;
    max-width: 132px;
    height: 158px;
  }

  .cart-line-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .cart-coupon-row {
    grid-template-columns: 1fr;
  }

  .cart-totals-stack div {
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 0.55rem;
  }

  .cart-totals-stack span {
    font-size: 0.9rem;
  }

  .cart-totals-stack strong {
    font-size: 0.92rem;
  }

  .cart-total-final strong {
    font-size: 1rem;
  }

  .online-payment-box {
    padding: 0.75rem;
    border-radius: 12px;
  }

  .online-payment-head {
    align-items: flex-start;
  }

  .online-payment-head h3 {
    font-size: 1rem;
    line-height: 1.25;
  }

  .online-payment-account {
    padding: 0.65rem;
  }

  .online-payment-account-grid div {
    grid-template-columns: 1fr;
    gap: 0.12rem;
  }

  .book-product-layout,
  .book-loading-layout {
    padding: 0.8rem;
    border-radius: 18px;
  }

  .book-breadcrumbs {
    font-size: 0.78rem;
  }

  .book-main-frame {
    min-height: 350px;
    padding: 0.55rem;
  }

  .book-detail-root,
  .book-page-shell {
    min-height: 1080px;
  }

  .book-product-layout,
  .book-loading-layout {
    min-height: 760px;
  }

  .book-tabs {
    min-height: 180px;
  }

  .book-info-panel {
    padding: 0.1rem 0;
  }

  .book-info-panel h1 {
    font-size: clamp(1.75rem, 8vw, 2.25rem);
  }

  .book-title-mixed,
  .book-title-single {
    gap: 0.18rem;
  }

  .book-title-urdu {
    font-size: clamp(1.32rem, 7vw, 1.86rem);
    line-height: 1.58;
    overflow-wrap: anywhere;
  }

  .book-title-en {
    font-size: clamp(1.55rem, 7.8vw, 2.08rem);
    line-height: 1.12;
    overflow-wrap: anywhere;
  }

  .book-subtitle,
  .book-author-line,
  .book-summary-line {
    font-size: 0.95rem;
  }

  .book-detail-actions {
    margin-top: 0.85rem;
  }

  .book-qty-field input {
    min-height: 48px;
  }

  .book-tabs .book-tab-list {
    gap: 0.9rem;
    padding-inline: 0.75rem;
  }

  .book-tabs .book-tab-panel {
    padding: 1rem;
  }

  .book-more-section {
    padding: 0.95rem;
    border-radius: 16px;
  }

  .book-more-head {
    align-items: flex-start;
  }

  .book-more-list {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .book-more-item {
    grid-template-columns: 78px minmax(0, 1fr);
    padding: 0.7rem;
  }

  .book-more-item img {
    width: 78px;
    height: 98px;
  }

  .book-more-copy strong {
    font-size: 0.94rem;
  }
}

.order-tracker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0.75rem 0;
}

.order-tracker span {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px dashed var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 0.42rem 0.55rem;
  font-size: 0.85rem;
  font-weight: 800;
}

.order-tracker i {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #efe8d9;
  color: var(--ink);
  font-style: normal;
  font-size: 0.78rem;
}

.order-tracker span.is-done {
  border-color: rgba(15, 118, 110, 0.35);
  background: rgba(15, 118, 110, 0.08);
  color: var(--brand-deep);
}

.order-tracker span.is-done i {
  background: var(--brand);
  color: #fff;
}

.order-tracker.is-cancelled {
  grid-template-columns: 1fr;
}

.order-tracker.is-cancelled span {
  border-color: rgba(180, 35, 24, 0.32);
  background: rgba(180, 35, 24, 0.08);
  color: #b42318;
}

.order-tracking-admin {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 0.55rem;
  align-items: end;
  margin: 0.8rem 0;
}

.order-tracking-admin label {
  display: grid;
  gap: 0.28rem;
  font-weight: 800;
}

.order-tracking-admin label span {
  color: var(--ink);
  font-size: 0.85rem;
}

.admin-order-card {
  display: grid;
  gap: 0.8rem;
}

.admin-order-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid rgba(166,106,0,.16);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,244,235,.9));
  padding: .9rem 1rem;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--ink);
}

.admin-order-toggle span {
  display: grid;
  gap: 0.15rem;
}

.admin-order-toggle-state {
  color: var(--brand);
  font-size: 0.88rem;
  white-space: nowrap;
}

.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1rem;
}

.admin-layout > *,
.admin-panel,
.admin-form-section {
  min-width: 0;
}

.admin-sidebar {
  position: sticky;
  top: 0.7rem;
  align-self: start;
  max-height: calc(100vh - 1.4rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.admin-menu-btn {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  margin-top: 0.45rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}

.admin-menu-btn.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.admin-panel.is-hidden {
  display: none;
}

#dataToolsPanel {
  overflow: hidden;
}

#dataToolsPanel .admin-form-head,
#dataToolsPanel .admin-form-section,
#dataToolsPanel .meta {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#dataToolsPanel input[type="file"] {
  max-width: 100%;
  width: 100%;
}

#dataToolsPanel .hero-cta {
  align-items: stretch;
}

#dataToolsPanel .btn {
  white-space: normal;
  text-align: center;
  overflow-wrap: anywhere;
}

.scanner-box {
  margin-top: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem;
  background: #fff;
}

.scanner-box #barcodeScannerReader,
.scanner-box #billScannerReader {
  width: min(360px, 100%);
}

.admin-login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 18%, rgba(15, 118, 110, 0.12), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(161, 98, 7, 0.1), transparent 24%),
    linear-gradient(135deg, #f7f4ed 0%, #fffdf8 48%, #efe8d9 100%);
}

.admin-login-shell {
  min-height: calc(100vh - 48px);
  display: grid;
  place-items: center;
  padding: clamp(2rem, 6vw, 5rem) 1rem;
}

.admin-login-card {
  width: min(100%, 640px);
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid rgba(223, 215, 200, 0.95);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(29, 42, 42, 0.14);
  padding: clamp(1.2rem, 4vw, 2rem);
  position: relative;
  overflow: hidden;
}

.admin-login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--brand-deep), var(--brand), var(--accent));
}

.admin-login-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.2rem;
}

.admin-login-mark {
  width: 52px;
  height: 52px;
  display: inline-grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--brand), var(--brand-deep));
  color: #fff;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.24);
}

.admin-login-brand strong {
  display: block;
  font-family: var(--font-english);
  font-size: 1.35rem;
  line-height: 1.1;
}

.admin-login-brand span span,
.admin-login-brand div > span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-login-card h1 {
  margin: 0;
  font-size: clamp(2.35rem, 5vw, 3.6rem);
  line-height: 0.95;
}

.admin-login-copy {
  margin: 0.85rem 0 1.35rem;
  color: var(--muted);
  max-width: 36rem;
}

.admin-login-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.admin-login-field {
  display: grid;
  gap: 0.35rem;
}

.admin-login-field span {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}

.admin-login-field input {
  width: 100%;
  min-height: 54px;
  background: #fff;
  border-radius: 14px;
}

.admin-login-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.admin-login-actions .btn {
  min-height: 46px;
  padding-inline: 1.35rem;
  box-shadow: 0 10px 20px rgba(15, 118, 110, 0.18);
}

.admin-login-back {
  font-weight: 800;
  text-decoration: none;
}

.admin-login-back:hover {
  text-decoration: underline;
}

.admin-login-meta {
  min-height: 1.5rem;
  margin: 0.95rem 0 0;
  color: var(--muted);
}

@media (max-width: 980px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
  }
}

@media (max-width: 700px) {
  .order-tracker {
    grid-template-columns: 1fr;
  }

  .order-tracking-admin {
    grid-template-columns: 1fr;
  }

  .admin-login-page .top-strip-inner {
    align-items: flex-start;
  }

  .admin-login-shell {
    min-height: calc(100vh - 72px);
    place-items: start center;
    padding-top: 1.4rem;
  }

  .admin-login-form {
    grid-template-columns: 1fr;
  }

  .admin-login-card h1 {
    font-size: 2.55rem;
  }
}

@media (max-width: 560px) {
  body[data-admin-surface="true"],
  body[data-admin-surface="true"] .page-shell,
  body[data-admin-surface="true"] .admin-layout,
  body[data-admin-surface="true"] .admin-content,
  body[data-admin-surface="true"] .admin-dashboard-shell,
  body[data-admin-surface="true"] .admin-dashboard-head,
  body[data-admin-surface="true"] .admin-dashboard-actions,
  body[data-admin-surface="true"] .admin-dashboard-panel,
  body[data-admin-surface="true"] .search-panel.admin-panel,
  body[data-admin-surface="true"] .stats-grid.admin-dashboard-kpis,
  body[data-admin-surface="true"] .stat-card.admin-kpi-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  body[data-admin-surface="true"] .admin-content,
  body[data-admin-surface="true"] .admin-dashboard-shell,
  body[data-admin-surface="true"] .admin-panel,
  body[data-admin-surface="true"] .search-panel.admin-panel {
    overflow-x: hidden;
  }

  body[data-admin-surface="true"] .top-strip {
    display: none;
  }

  body[data-admin-surface="true"] .nav-wrap {
    padding: 0.65rem 0;
  }

  body[data-admin-surface="true"] .brand-copy small {
    display: none;
  }

  .admin-layout {
    gap: 0.65rem;
  }

  body[data-admin-surface="true"] .admin-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0.8rem;
  }

  body[data-admin-surface="true"] .admin-sidebar h2 {
    font-size: 1.35rem;
    margin-bottom: 0.25rem;
  }

  body[data-admin-surface="true"] .admin-menu-btn {
    margin-top: 0.35rem;
    padding: 0.72rem 0.78rem;
    border-radius: 12px;
    font-size: 0.96rem;
  }

  .admin-panel.search-panel {
    padding: 0.7rem;
    border-radius: 14px;
    margin-inline: 0;
  }

  .admin-form-head,
  .admin-form-section {
    padding: 0.75rem;
    border-radius: 14px;
  }

  body[data-admin-surface="true"] .admin-dashboard-head {
    gap: 0.8rem;
  }

  body[data-admin-surface="true"] .admin-dashboard-range {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 0.6rem;
  }

  body[data-admin-surface="true"] .admin-dashboard-range .btn {
    width: 100%;
    min-width: 0;
  }

  body[data-admin-surface="true"] .admin-dashboard-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    align-items: stretch;
  }

  body[data-admin-surface="true"] .admin-dashboard-actions .btn {
    width: 100%;
    min-width: 0;
    padding-inline: 0.7rem;
    text-align: center;
    white-space: normal;
    line-height: 1.2;
    justify-content: center;
  }

  body[data-admin-surface="true"] .stats-grid.admin-dashboard-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
  }

  body[data-admin-surface="true"] .stat-card.admin-kpi-card {
    min-height: 138px;
    padding: 0.85rem 0.78rem;
  }

  body[data-admin-surface="true"] .admin-dashboard-head h2 {
    font-size: 1.9rem;
    line-height: 1.08;
    overflow-wrap: anywhere;
  }

  body[data-admin-surface="true"] .admin-dashboard-head .meta {
    overflow-wrap: anywhere;
  }

  body[data-admin-surface="true"] .admin-dashboard-main,
  body[data-admin-surface="true"] .admin-dashboard-charts,
  body[data-admin-surface="true"] .admin-dashboard-side,
  body[data-admin-surface="true"] .admin-alert-columns,
  body[data-admin-surface="true"] .admin-dashboard-analytics-grid {
    grid-template-columns: 1fr;
  }

  body[data-admin-surface="true"] .admin-health-pill,
  body[data-admin-surface="true"] .admin-analytics-card,
  body[data-admin-surface="true"] .admin-dashboard-panel {
    padding: 0.85rem;
    border-radius: 16px;
  }

  body[data-admin-surface="true"] .admin-mini-chart {
    min-height: 150px;
  }

  .admin-form-head h2,
  #dataToolsPanel h2 {
    font-size: 1.45rem;
    line-height: 1.1;
  }

  #dataToolsPanel h3 {
    font-size: 1.18rem;
    line-height: 1.15;
  }

  #dataToolsPanel .hero-cta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  #dataToolsPanel .btn,
  #dataToolsPanel input[type="file"] {
    width: 100%;
    min-width: 0;
  }

  #dataToolsPanel input[type="file"] {
    font-size: 0.86rem;
    padding: 0.62rem;
  }

  .admin-inventory-search-box {
    padding: 1rem;
    border: 1px solid #e7dcc7;
    border-radius: 18px;
    background: linear-gradient(180deg, #fffefb 0%, #fbf6eb 100%);
    margin-bottom: 0.85rem;
  }

  .admin-inventory-search-box select,
  .admin-inventory-search-box input {
    min-height: 46px;
  }

  .inventory-quick-filters {
    flex-wrap: wrap;
  }

  .inventory-quick-filters .btn.active {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
  }

  .inventory-manager-head {
    display: grid;
    gap: 0.85rem;
    margin-bottom: 0.9rem;
  }

  .inventory-manager-head h3 {
    margin: 0.2rem 0 0;
  }

  .inventory-manager-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.7rem;
  }

  .inventory-kpi {
    padding: 0.8rem;
    border: 1px solid #e7dcc7;
    border-radius: 14px;
    background: #fff;
    display: grid;
    gap: 0.2rem;
  }

  .inventory-kpi span {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
  }

  .inventory-kpi strong {
    font-size: 1.25rem;
    color: var(--ink);
  }

  .inventory-manager-table-wrap {
    overflow: auto;
    border: 1px solid #e7dcc7;
    border-radius: 16px;
    background: #fff;
  }

  .inventory-manager-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
  }

  .inventory-manager-table th,
  .inventory-manager-table td {
    padding: 0.85rem;
    border-bottom: 1px solid #efe6d6;
    text-align: left;
    vertical-align: top;
  }

  .inventory-manager-table th {
    background: #fbf6eb;
    font-size: 0.84rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }

  .inventory-book-cell {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 0.75rem;
    align-items: start;
    min-width: 240px;
  }

  .inventory-book-cell img {
    width: 54px;
    height: 72px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #e4d6be;
    background: #f7f1e5;
  }

  .inventory-book-cell strong,
  .inventory-book-cell span {
    display: block;
  }

  .inventory-book-cell span {
    color: var(--muted);
    font-size: 0.82rem;
    margin-top: 0.16rem;
  }

  .inventory-stock-box {
    display: grid;
    gap: 0.32rem;
  }

  .inventory-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
  }

  .inventory-status-in {
    background: #e7f7ef;
    color: #0d7a43;
  }

  .inventory-status-low {
    background: #fff4de;
    color: #b46a00;
  }

  .inventory-status-out {
    background: #fde9e8;
    color: #c43c2f;
  }

  .inventory-stock-actions,
  .inventory-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
  }

.inventory-stock-actions input,
.inventory-row-actions input {
  width: 76px;
  min-height: 40px;
}
}

.admin-inventory-search-box {
  padding: 1.15rem;
  border: 1px solid #e7dcc7;
  border-radius: 22px;
  background: linear-gradient(180deg, #fffefc 0%, #f8f2e7 100%);
  box-shadow: 0 18px 40px rgba(37, 41, 39, 0.06);
  margin-bottom: 1rem;
}

.inventory-search-main {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto auto;
  gap: 0.7rem;
  align-items: center;
}

.inventory-search-main .btn {
  min-height: 48px;
  white-space: nowrap;
}

#inventoryAdvancedFilters[hidden] {
  display: none !important;
}

.admin-inventory-search-box .checkout-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) repeat(3, minmax(180px, 1fr));
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.admin-inventory-search-box select,
.admin-inventory-search-box input {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
}

.inventory-quick-filters,
#inventoryPager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.inventory-quick-filters .btn.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: 0 10px 18px rgba(15, 118, 110, 0.18);
}

.inventory-manager-head {
  display: grid;
  gap: 1rem;
  margin: 1.1rem 0 1rem;
  padding: 1.1rem;
  border: 1px solid #ebe0cc;
  border-radius: 20px;
  background: linear-gradient(135deg, #fffefb 0%, #f7f2e8 100%);
}

.inventory-manager-head h3 {
  margin: 0.15rem 0 0;
  font-size: clamp(1.35rem, 2vw, 1.7rem);
}

.inventory-manager-head .meta {
  max-width: 56rem;
}

.inventory-manager-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.2rem 0;
}

.inventory-manager-toolbar .btn {
  min-height: 40px;
  border-radius: 999px;
  padding-inline: 0.95rem;
}

.inventory-manager-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 0.75rem;
}

.inventory-kpi {
  padding: 0.9rem 0.95rem;
  border: 1px solid #e8dcc6;
  border-radius: 16px;
  background: #fff;
  display: grid;
  gap: 0.2rem;
  box-shadow: 0 8px 20px rgba(37, 41, 39, 0.04);
}

.inventory-kpi span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.inventory-kpi strong {
  font-size: 1.25rem;
  color: var(--ink);
}

.inventory-manager-table-wrap {
  overflow: auto;
  border: 1px solid #e7dcc7;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(37, 41, 39, 0.06);
}

.inventory-manager-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1240px;
}

.inventory-manager-table th,
.inventory-manager-table td {
  padding: 0.9rem 0.85rem;
  border-bottom: 1px solid #efe6d6;
  text-align: left;
  vertical-align: top;
  background: #fff;
}

.inventory-manager-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fbf6eb;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #5f5138;
}

.inventory-manager-table tbody tr:hover td {
  background: #fffcf5;
}

.inventory-row-archived td {
  background: #f7f4ef;
}

.inventory-book-cell {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 0.8rem;
  align-items: start;
  min-width: 270px;
}

.inventory-book-cell img {
  width: 58px;
  height: 78px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #e4d6be;
  background: #f7f1e5;
}

.inventory-book-cell strong,
.inventory-book-cell span {
  display: block;
}

.inventory-book-cell strong {
  line-height: 1.2;
}

.inventory-book-cell span,
.inventory-manager-table .meta {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.inventory-stock-box {
  display: grid;
  gap: 0.35rem;
}

.inventory-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 0.24rem 0.62rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
}

.inventory-status-in {
  background: #e7f7ef;
  color: #0d7a43;
}

.inventory-status-low {
  background: #fff4de;
  color: #b46a00;
}

.inventory-status-out {
  background: #fde9e8;
  color: #c43c2f;
}

.inventory-status-active {
  background: #e9f4ff;
  color: #0c5ea8;
}

.inventory-status-archived {
  background: #ece7f8;
  color: #6f42c1;
}

.inventory-stock-actions,
.inventory-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.inventory-stock-actions input,
.inventory-row-actions input {
  width: 76px;
  min-height: 40px;
}

.inventory-report-grid,
.inventory-activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}

.inventory-report-card,
.inventory-activity-card {
  padding: 1rem;
  border: 1px solid #e7dcc7;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(37, 41, 39, 0.04);
}

.inventory-report-card h4,
.inventory-activity-card h4 {
  margin: 0 0 0.8rem;
}

.inventory-report-card p,
.inventory-activity-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid #f1e8da;
}

.inventory-report-card p:last-child,
.inventory-activity-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.inventory-activity-item {
  display: grid;
}

.inventory-activity-grid-collapsed {
  align-items: start;
}

.inventory-collapse-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--ink);
  margin-bottom: 0.1rem;
}

.inventory-collapse-btn-main {
  align-items: start;
  margin-bottom: 0;
}

.inventory-collapse-btn-main span {
  display: grid;
  gap: 0.12rem;
}

.inventory-collapse-title {
  display: block;
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  color: var(--ink);
  line-height: 1.1;
}

.inventory-collapse-btn strong {
  color: var(--brand);
  font-size: 0.85rem;
}

@media (max-width: 1100px) {
  .inventory-search-main {
    grid-template-columns: 1fr 1fr;
  }

  .admin-inventory-search-box .checkout-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .inventory-search-main {
    grid-template-columns: 1fr;
  }

  .admin-inventory-search-box .checkout-grid {
    grid-template-columns: 1fr;
  }

  .inventory-manager-head {
    padding: 0.9rem;
  }

  .inventory-manager-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inventory-manager-toolbar .btn,
  .inventory-stock-actions .btn,
  .inventory-row-actions .btn {
    width: 100%;
  }
}

.inventory-manager-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.inventory-manager-tabs .btn {
  min-height: 40px;
  border-radius: 999px;
  padding-inline: 1rem;
}

#inventoryPanel #adminList {
  display: block;
  grid-template-columns: none;
}

#inventoryPanel #adminList > * {
  width: 100%;
}

.inventory-content-block {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #e7dcc7;
  border-radius: 20px;
  background: linear-gradient(180deg, #fffefb 0%, #fcf8ef 100%);
}

.inventory-section-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.9rem;
}

.inventory-section-head h4 {
  margin: 0.15rem 0 0;
  font-size: 1.2rem;
}

.inventory-book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 0.8rem;
}

.inventory-book-card {
  border: 1px solid #e7dcc7;
  border-radius: 18px;
  background: #fff;
  padding: 0.85rem;
  display: grid;
  gap: 0.7rem;
  box-shadow: 0 10px 22px rgba(37, 41, 39, 0.045);
}

.inventory-book-card-archived {
  background: #faf7f1;
  border-color: #ddd2be;
}

.inventory-book-card-head,
.inventory-book-controls,
.inventory-book-badges,
.inventory-book-meta,
.inventory-book-branches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  align-items: center;
}

.inventory-book-card-main {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 0.75rem;
  align-items: start;
}

.inventory-book-card-main img {
  width: 68px;
  height: 92px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #e4d6be;
  background: #f7f1e5;
}

.inventory-book-details h4 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.15;
}

.inventory-book-details p {
  margin: 0.12rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.inventory-book-meta span,
.inventory-book-branches span {
  padding: 0.28rem 0.52rem;
  border-radius: 999px;
  background: #f6f0e4;
  color: #63543a;
  font-size: 0.72rem;
  font-weight: 700;
}

.inventory-book-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.inventory-book-stat-wide {
  grid-column: span 2;
}

.inventory-book-stats div,
.inventory-book-extra div {
  border: 1px solid #eee2ce;
  border-radius: 12px;
  background: #fcfaf6;
  padding: 0.58rem 0.65rem;
  min-height: 0;
}

.inventory-book-stats span,
.inventory-book-extra span,
.inventory-select-box span {
  display: block;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.inventory-book-stats strong,
.inventory-book-extra strong {
  display: block;
  margin-top: 0.16rem;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.2;
}

.inventory-book-extra {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.inventory-book-branches {
  padding-top: 0;
}

.inventory-select-box {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.inventory-select-box input {
  width: 18px;
  height: 18px;
}

.inventory-book-controls {
  justify-content: space-between;
  align-items: start;
  border-top: 1px solid #efe6d6;
  padding-top: 0.7rem;
  gap: 0.55rem;
}

.inventory-book-controls .inventory-stock-actions,
.inventory-book-controls .inventory-row-actions {
  flex: 1 1 240px;
}

.inventory-stock-actions input,
.inventory-row-actions input {
  width: 72px;
  min-height: 38px;
}

.inventory-stock-actions .btn,
.inventory-row-actions .btn {
  min-height: 38px;
  padding-inline: 0.82rem;
}

.inventory-icon-btn {
  min-width: 38px;
  width: 38px;
  padding-inline: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
}

.inventory-book-card .print-qty-input {
  width: 58px;
}

.branch-stock-toolbar h3 {
  margin-top: 0;
}

.branch-stock-summary {
  margin-top: 0.9rem;
}

.branch-stock-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.65rem;
}

.branch-stock-branch-totals,
.branch-stock-quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.branch-stock-branch-totals span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid #d9cbb5;
  border-radius: 999px;
  background: #fffaf1;
  padding: 0.35rem 0.65rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.branch-stock-table td,
.branch-stock-table th {
  vertical-align: top;
}

.branch-stock-table input[type="number"] {
  min-width: 88px;
}

.branch-edit-grid {
  align-items: start;
}

.branch-edit-field {
  display: grid;
  gap: 0.35rem;
}

.branch-edit-field span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.branch-edit-field textarea {
  min-height: 92px;
}

@media (max-width: 860px) {
  .inventory-section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .inventory-book-card-main {
    grid-template-columns: 1fr;
  }

  .inventory-book-card-main img {
    width: 64px;
    height: 86px;
  }

  .inventory-book-extra {
    grid-template-columns: 1fr;
  }

  .inventory-book-controls {
    grid-template-columns: 1fr;
    display: grid;
  }

  .inventory-book-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inventory-book-stat-wide {
    grid-column: span 2;
  }
}

@media (max-width: 420px) {
  body[data-admin-surface="true"] .admin-dashboard-actions,
  body[data-admin-surface="true"] .stats-grid.admin-dashboard-kpis {
    grid-template-columns: 1fr;
  }
}

.categories-page .categories-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 360px);
  gap: 1rem;
  align-items: center;
}

.categories-page .categories-search-box {
  display: flex;
  justify-content: flex-end;
}

.categories-page .categories-search-box input {
  width: 100%;
  min-height: 54px;
}

.categories-featured-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.categories-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.category-featured-card,
.category-list-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.category-featured-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  text-align: left;
  min-height: 100%;
  padding: 1.15rem 1.1rem 1rem;
  color: inherit;
  text-decoration: none;
}

.category-featured-icon {
  display: none;
}

.category-featured-card h3 {
  margin: 0;
  font-size: clamp(1.08rem, 1.6vw, 1.35rem);
  line-height: 1.2;
}

.category-count-pill {
  margin: 0;
  padding: 0.36rem 0.72rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-weight: 700;
  background: rgba(255,255,255,0.55);
  font-size: 0.9rem;
}

.category-featured-cta {
  margin-top: auto;
  width: calc(100% + 2.2rem);
  margin-left: -1.1rem;
  margin-right: -1.1rem;
  padding: 0.88rem 1.1rem;
  border-top: 1px solid rgba(15,118,110,0.12);
  font-weight: 800;
}

.category-list-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto auto;
  gap: 0.8rem;
  align-items: center;
  padding: 1rem 1rem 0.95rem;
  color: inherit;
  text-decoration: none;
}

.category-list-icon {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  font-weight: 800;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(15,118,110,0.12);
}

.category-list-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.category-list-copy strong {
  font-size: 1.05rem;
}

.category-list-copy small,
.category-list-count {
  color: var(--muted);
}

.category-list-arrow {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
}

.tone-green { background: linear-gradient(180deg, rgba(225,245,236,0.9), rgba(255,255,255,0.98)); color: #1c7c54; }
.tone-blue { background: linear-gradient(180deg, rgba(232,242,255,0.9), rgba(255,255,255,0.98)); color: #1f5ea8; }
.tone-gold { background: linear-gradient(180deg, rgba(255,245,224,0.92), rgba(255,255,255,0.98)); color: #9a6500; }
.tone-purple { background: linear-gradient(180deg, rgba(242,236,255,0.9), rgba(255,255,255,0.98)); color: #6a3eb8; }
.tone-emerald { background: linear-gradient(180deg, rgba(231,249,241,0.9), rgba(255,255,255,0.98)); color: #117a58; }
.tone-orange { background: linear-gradient(180deg, rgba(255,239,228,0.92), rgba(255,255,255,0.98)); color: #b05a18; }

.categories-page .categories-featured-grid.is-loading-shell,
.categories-page .categories-list.is-loading-shell {
  min-height: 280px;
}

@media (max-width: 980px) {
  .categories-page .categories-hero {
    grid-template-columns: 1fr;
  }
  .categories-featured-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .categories-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .categories-featured-grid {
    grid-template-columns: 1fr;
  }

  .mobile-bottom-nav a {
    font-size: 0.68rem;
  }
  .category-list-card {
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }
  .category-list-count {
    display: none;
  }
}


.inventory-action-btn {
  min-width: 92px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-inline: 0.9rem;
  font-size: 0.92rem;
  font-weight: 700;
}

.inventory-action-danger {
  color: #9f2d1f;
  border-color: rgba(159, 45, 31, 0.2);
  background: rgba(159, 45, 31, 0.04);
}

.inventory-action-danger:hover {
  background: rgba(159, 45, 31, 0.08);
}

@media (max-width: 820px) {
  .mobile-bottom-nav a::before {
    content: "" !important;
    display: none !important;
  }

  .mobile-bottom-nav a {
    font-family: var(--font-english) !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
  }
}

.home-page #reviews {
  min-height: 0;
  margin-top: 1rem;
}

.home-page #authors,
.home-page #blog,
.home-page #reviews {
  min-height: 0;
}

.home-page .hero-card {
  min-height: 0;
  padding: 0.85rem;
}

.home-page .hero-ad-slider {
  min-height: 0;
  gap: 0.35rem;
}

.home-page .hero-ad-dots {
  margin-top: 0.25rem;
}

.home-page .hero {
  align-items: start;
}

.home-book-slider.review-slider .category-slide {
  grid-template-columns: repeat(3, minmax(230px, 1fr));
  align-items: start;
}

.home-book-slider.review-slider .card {
  min-height: 0;
  height: auto;
  align-self: start;
}

.home-book-slider.review-slider .card h3,
.home-book-slider.review-slider .card .meta {
  min-height: 0;
}

.home-book-slider.review-slider .card .meta {
  max-height: none;
  -webkit-line-clamp: unset;
}

.home-book-slider.review-slider .buy-btn {
  margin-top: 0.8rem;
}

@media (min-width: 941px) {
  .home-page .nav-wrap {
    min-height: 266px;
  }

  .home-page .header-actions {
    min-height: 76px;
  }

  .home-page .user-session-badge {
    width: 168px;
    min-height: 46px;
    margin-left: auto;
  }

  .home-page .hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
    align-items: stretch;
  }

  .home-page .hero-copy,
  .home-page .hero-card {
    min-height: 352px;
  }

  .home-page .hero-card {
    display: flex;
    padding: 0.85rem;
  }

  .home-page .hero-ad-slider {
    width: 100%;
    min-height: 320px;
  }

  .home-page .hero-ad-track-wrap {
    width: 100%;
    height: 282px;
    min-height: 282px;
    aspect-ratio: auto;
  }

  .home-page .hero-ad-slide,
  .home-page .hero-ad-slide a,
  .home-page .hero-ad-slide img {
    height: 100%;
  }
}

.home-book-slider.content-fit-slider .category-slide {
  align-items: start;
}

.home-book-slider.content-fit-slider .card {
  height: auto;
  min-height: 0;
  align-self: start;
}

.home-book-slider.content-fit-slider .card h3 {
  min-height: 0;
  line-height: 1.18;
  max-height: 2.36em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-book-slider.content-fit-slider .card .meta {
  min-height: 0;
  line-height: 1.45;
  max-height: 1.45em;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-book-slider.content-fit-slider .buy-btn {
  width: 100%;
  margin-top: 0.75rem;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: #d8c8ab;
  background: #fffaf2;
  color: var(--brand-deep);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: none;
}

.home-book-slider.content-fit-slider .buy-btn:hover {
  border-color: var(--brand);
  background: #eef8f6;
  color: var(--brand-deep);
}

.home-page #authorsGrid .category-slide,
.home-page #latestArticlesGrid .category-slide,
.home-page #latestReviewsGrid .category-slide {
  align-items: start;
}

.home-page #authorsGrid .card,
.home-page #latestArticlesGrid .card,
.home-page #latestReviewsGrid .card {
  height: auto;
  min-height: 0;
  align-self: start;
}

.home-page #authorsGrid .card h3,
.home-page #latestArticlesGrid .card h3,
.home-page #latestReviewsGrid .card h3 {
  min-height: 0;
  line-height: 1.18;
  max-height: 2.36em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-page #authorsGrid .card .meta,
.home-page #latestArticlesGrid .card .meta,
.home-page #latestReviewsGrid .card .meta {
  min-height: 0;
  line-height: 1.45;
  max-height: 1.45em;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 940px) {
  .home-page #reviews {
    min-height: 0;
  }

  .home-page .hero-card {
    min-height: 0;
  }

  .home-page .hero-ad-slider {
    min-height: 0;
  }

  .home-book-slider.review-slider .category-slide {
    display: flex;
    gap: 0.5rem;
  }

  .home-book-slider.review-slider .category-slide > * {
    flex: 0 0 calc(50% - 0.25rem);
    min-width: 0;
  }

  .home-book-slider.content-fit-slider .card {
    min-height: 0;
    height: auto;
  }

  .home-book-slider.content-fit-slider .card h3 {
    line-height: 1.22;
    max-height: 2.44em;
  }

  .home-book-slider.content-fit-slider .buy-btn {
    min-height: 34px;
    padding: 0.42rem 0.5rem;
    font-size: 0.72rem;
  }
}

body[data-orders-page="manager"] {
  background:
    radial-gradient(circle at 12% 6%, rgba(15, 118, 110, 0.1), transparent 28rem),
    radial-gradient(circle at 92% 18%, rgba(166, 106, 0, 0.09), transparent 24rem),
    var(--bg);
}

body[data-orders-page="manager"] #mainContent {
  max-width: 1180px;
}

body[data-orders-page="manager"] .admin-dashboard-shell {
  padding: 0;
  overflow: hidden;
  border-radius: 30px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
}

body[data-orders-page="manager"] .admin-dashboard-head {
  margin: 0;
  padding: 2rem 2rem 1.7rem;
  border: 0;
  border-bottom: 1px solid rgba(166, 106, 0, 0.13);
  border-radius: 0;
  background:
    linear-gradient(135deg, rgba(230, 246, 244, 0.95), rgba(255, 253, 248, 0.92) 58%, rgba(248, 244, 235, 0.92)),
    radial-gradient(circle at 88% 20%, rgba(15, 118, 110, 0.14), transparent 13rem);
}

body[data-orders-page="manager"] .admin-dashboard-head h2 {
  font-size: clamp(1.85rem, 3vw, 2.65rem);
}

body[data-orders-page="manager"] #ordersQuickActions {
  padding: 1.05rem 1.35rem;
  margin: 0;
  border-bottom: 1px solid rgba(166, 106, 0, 0.1);
  background: rgba(255, 255, 255, 0.58);
}

body[data-orders-page="manager"] #ordersQuickActions .btn {
  min-height: 48px;
  padding-inline: 1.2rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

body[data-orders-page="manager"] #ordersTransferMeta:empty {
  display: none;
}

body[data-orders-page="manager"] #ordersTransferMeta,
body[data-orders-page="manager"] #ordersManagerModeMeta,
body[data-orders-page="manager"] #ordersBooksSummary,
body[data-orders-page="manager"] #ordersDeliveryAging,
body[data-orders-page="manager"] #ordersManagerSection {
  margin-left: 1.35rem !important;
  margin-right: 1.35rem !important;
}

body[data-orders-page="manager"] #ordersManagerModeBar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 1.35rem 1.35rem 0.8rem !important;
  padding: 0.55rem;
  border: 1px solid rgba(166, 106, 0, 0.15);
  border-radius: 22px;
  background: rgba(248, 244, 235, 0.74);
}

body[data-orders-page="manager"] #ordersManagerModeBar .btn {
  width: 100%;
  border-radius: 16px;
  min-height: 46px;
  box-shadow: none;
}

body[data-orders-page="manager"] #ordersManagerModeBar .btn-primary {
  background: linear-gradient(135deg, var(--brand), #0c675f);
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.18);
}

body[data-orders-page="manager"] .orders-delivered-range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin: 0 1.35rem 0.8rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 16px;
  background: rgba(230, 246, 244, 0.52);
}

body[data-orders-page="manager"] .orders-delivered-range[hidden] {
  display: none;
}

body[data-orders-page="manager"] .orders-delivered-range .meta {
  margin-right: 0.2rem;
  color: #28534e;
  font-weight: 700;
}

body[data-orders-page="manager"] .orders-delivered-range .btn {
  min-height: 38px;
  padding: 0.45rem 0.85rem;
  border-radius: 12px;
  box-shadow: none;
}

body[data-orders-page="manager"] #ordersManagerModeMeta {
  display: inline-flex;
  width: auto;
  padding: 0.55rem 0.8rem;
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 999px;
  background: rgba(230, 246, 244, 0.7);
  color: #28534e;
  font-weight: 700;
}

body[data-orders-page="manager"] .admin-dashboard-panel {
  border-radius: 24px;
  border-color: rgba(166, 106, 0, 0.14);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.045);
}

body[data-orders-page="manager"] .admin-dashboard-panel-head {
  padding-bottom: 0.7rem;
  border-bottom: 1px solid rgba(166, 106, 0, 0.1);
}

body[data-orders-page="manager"] .admin-dashboard-panel-head h3 {
  font-size: 1.28rem;
}

body[data-orders-page="manager"] .admin-alert-columns {
  grid-template-columns: minmax(0, 1.05fr) minmax(330px, 0.95fr);
  align-items: start;
}

body[data-orders-page="manager"] .admin-alert-item {
  min-height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 253, 248, 0.98), rgba(248, 244, 235, 0.9));
}

body[data-orders-page="manager"] .admin-dashboard-health-grid {
  gap: 0.7rem;
}

body[data-orders-page="manager"] .admin-health-pill {
  min-height: 82px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(230, 246, 244, 0.9), rgba(255, 255, 255, 0.82));
}

body[data-orders-page="manager"] .admin-health-pill strong {
  line-height: 1.15;
}

body[data-orders-page="manager"] #ordersManagerSection {
  margin-bottom: 1.35rem !important;
}

body[data-orders-page="manager"] #ordersManagerSection > .admin-dashboard-panel-head {
  margin: -1rem -1.05rem 1rem;
  padding: 1rem 1.05rem;
  border-radius: 22px 22px 0 0;
  background: rgba(248, 244, 235, 0.55);
}

body[data-orders-page="manager"] #ordersManagerBody > .hero-cta:first-child {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) repeat(4, auto);
  gap: 0.6rem;
  align-items: center;
}

body[data-orders-page="manager"] #ordersManagerSearch {
  min-height: 48px;
  border-radius: 16px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.03);
}

body[data-orders-page="manager"] .admin-order-card {
  border-radius: 20px;
  min-height: 0;
  background: rgba(255, 255, 255, 0.92);
}

body[data-orders-page="manager"] .admin-order-toggle {
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 253, 248, 1), rgba(230, 246, 244, 0.72));
}

@media (max-width: 820px) {
  body[data-orders-page="manager"] .admin-dashboard-head,
  body[data-orders-page="manager"] #ordersQuickActions {
    padding-inline: 1rem;
  }

  body[data-orders-page="manager"] #ordersTransferMeta,
  body[data-orders-page="manager"] #ordersManagerModeMeta,
  body[data-orders-page="manager"] #ordersBooksSummary,
  body[data-orders-page="manager"] #ordersDeliveryAging,
  body[data-orders-page="manager"] #ordersManagerSection {
    margin-left: 1rem !important;
    margin-right: 1rem !important;
  }

  body[data-orders-page="manager"] #ordersManagerModeBar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-inline: 1rem !important;
  }

  body[data-orders-page="manager"] .orders-delivered-range {
    margin-inline: 1rem;
  }

  body[data-orders-page="manager"] .admin-alert-columns,
  body[data-orders-page="manager"] #ordersManagerBody > .hero-cta:first-child {
    grid-template-columns: 1fr;
  }
}

body[data-orders-page="dashboard"] {
  background:
    radial-gradient(circle at 16% 7%, rgba(15, 118, 110, 0.1), transparent 28rem),
    radial-gradient(circle at 90% 16%, rgba(166, 106, 0, 0.08), transparent 24rem),
    var(--bg);
}

body[data-orders-page="dashboard"] .admin-order-card {
  gap: 0.7rem;
  padding: 0.8rem;
  border-radius: 12px;
}

body[data-orders-page="dashboard"] .admin-order-toggle {
  padding: 0.8rem 0.9rem;
  border-radius: 10px;
}

.ordersdash-order-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.ordersdash-order-summary > div {
  display: grid;
  gap: 0.16rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid #e7dcc7;
  border-radius: 8px;
  background: #fffdf8;
}

.ordersdash-order-summary span,
.ordersdash-edit-panel label > span,
.ordersdash-action-group > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.ordersdash-order-summary strong {
  color: var(--ink);
  font-size: 0.88rem;
}

.ordersdash-order-summary small {
  color: var(--muted);
  font-size: 0.76rem;
}

.ordersdash-order-summary .ordersdash-summary-wide {
  grid-column: span 4;
}

.ordersdash-address-actions,
.ordersdash-action-buttons,
.ordersdash-edit-save {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.ordersdash-address-actions .btn,
.ordersdash-action-buttons .btn,
.ordersdash-edit-save .btn {
  min-height: 36px;
  padding: 0.42rem 0.7rem;
  font-size: 0.8rem;
}

.ordersdash-payment-received {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.42rem 0.7rem;
  border: 1px solid #b9e2d8;
  border-radius: 8px;
  background: #edf9f5;
  color: #087166;
  font-size: 0.8rem;
  font-weight: 800;
}

.ordersdash-payment-verification {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(170px, 1fr) auto;
  gap: 0.45rem;
  align-items: end;
  width: 100%;
  padding: 0.55rem;
  border: 1px solid #dce9e4;
  border-radius: 8px;
  background: #f7fcfa;
}

.ordersdash-payment-verification label {
  display: grid;
  gap: 0.22rem;
  min-width: 0;
}

.ordersdash-payment-verification label span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.ordersdash-payment-verification input {
  min-height: 36px;
  padding: 0.4rem 0.55rem;
  border-radius: 7px;
}

.ordersdash-edit-panel,
.ordersdash-review-panel {
  margin: 0.25rem 0;
  padding: 0.85rem;
  border: 1px solid #e7dcc7;
  border-radius: 10px;
  background: #fffdf8;
}

.ordersdash-section-head,
.ordersdash-review-panel h4,
.ordersdash-review-panel p {
  margin: 0;
}

.ordersdash-section-head {
  margin-bottom: 0.7rem;
}

.ordersdash-section-head h4,
.ordersdash-review-panel h4 {
  font-size: 0.95rem;
}

.ordersdash-section-head p,
.ordersdash-review-panel p {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.ordersdash-edit-items {
  display: grid;
  gap: 0.45rem;
}

.ordersdash-edit-line {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 82px 118px auto;
  gap: 0.5rem;
  align-items: end;
  padding: 0.6rem;
  border: 1px solid #efe6d6;
  border-radius: 8px;
  background: #fff;
}

.ordersdash-edit-book,
.ordersdash-edit-line label,
.ordersdash-edit-tools label,
.ordersdash-adjustment-grid label {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.ordersdash-edit-book strong {
  font-size: 0.84rem;
}

.ordersdash-edit-book small {
  color: var(--muted);
  font-size: 0.75rem;
}

.ordersdash-edit-panel input,
.ordersdash-edit-panel select {
  width: 100%;
  min-height: 38px;
  padding: 0.42rem 0.55rem;
  border-radius: 7px;
}

.ordersdash-edit-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto 150px;
  gap: 0.5rem;
  align-items: end;
  margin-top: 0.6rem;
}

.ordersdash-adjustment-grid {
  display: grid;
  grid-template-columns: 140px minmax(180px, 1fr) minmax(180px, 1fr);
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.ordersdash-edit-save {
  margin-top: 0.65rem;
}

.ordersdash-notification-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.ordersdash-action-group {
  display: grid;
  gap: 0.38rem;
  padding-top: 0.65rem;
  border-top: 1px solid #eee4d1;
}

.ordersdash-review-panel {
  display: grid;
  gap: 0.5rem;
}

.ordersdash-notification-summary strong {
  overflow-wrap: anywhere;
}

.ordersdash-action-group {
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 0.7rem;
  align-items: center;
  padding: 0.7rem 0;
}

.ordersdash-action-group > span {
  color: var(--ink);
  font-size: 0.8rem;
}

.ordersdash-status-actions .ordersdash-action-buttons,
.ordersdash-communication-actions .ordersdash-action-buttons {
  display: grid;
  gap: 0.45rem;
}

.ordersdash-status-actions .ordersdash-action-buttons {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.ordersdash-communication-actions .ordersdash-action-buttons {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.ordersdash-action-group .ordersdash-action-buttons .btn {
  width: 100%;
  justify-content: center;
}

.ordersdash-modal-backdrop {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: start center;
  overflow-y: auto;
  padding: 1.25rem;
  background: rgba(18, 33, 38, 0.42);
}

.ordersdash-modal {
  width: min(1120px, 100%);
  margin: auto;
  padding: 0.9rem;
  border: 1px solid #dce7e2;
  border-radius: 12px;
  background: #fffefa;
  box-shadow: 0 18px 48px rgba(18, 33, 38, 0.24);
}

.ordersdash-modal-header,
.ordersdash-modal-status,
.ordersdash-modal-footer {
  display: flex;
  gap: 0.7rem;
  align-items: center;
}

.ordersdash-modal-header {
  justify-content: space-between;
  padding: 0.15rem 0.2rem 0.8rem;
}

.ordersdash-modal-header p,
.ordersdash-modal-header h3 {
  margin: 0;
}

.ordersdash-modal-header p {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.ordersdash-modal-header h3 {
  color: var(--ink);
  font-size: 1.15rem;
}

.ordersdash-modal-close {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 1px solid #d8e1dd;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
}

.ordersdash-modal-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  border: 1px solid #d9e8e2;
  border-radius: 9px;
  background: #f2faf6;
}

.ordersdash-modal-status > div {
  display: grid;
  gap: 0.18rem;
}

.ordersdash-modal-status span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.ordersdash-modal-status strong {
  color: var(--ink);
  font-size: 0.84rem;
}

.ordersdash-modal .ordersdash-order-summary {
  margin-bottom: 0.65rem;
}

.ordersdash-modal .ordersdash-edit-panel {
  margin-top: 0.7rem;
}

.ordersdash-modal-footer {
  justify-content: flex-end;
  padding-top: 0.8rem;
  margin-top: 0.8rem;
  border-top: 1px solid #e8dfcf;
  position: sticky;
  bottom: -0.9rem;
  z-index: 2;
  padding-bottom: 0.9rem;
  background: #fffefa;
}

.ordersdash-modal-footer-actions {
  display: flex;
  gap: 0.45rem;
  margin-left: auto;
}

.ordersdash-modal-footer .btn {
  min-width: 112px;
  min-height: 40px;
}

.ordersdash-delete-order {
  margin-right: auto;
  color: #a5251c;
  border-color: #edc6c1;
}

@media (max-width: 820px) {
  .ordersdash-order-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ordersdash-order-summary .ordersdash-summary-wide {
    grid-column: span 2;
  }

  .ordersdash-edit-line,
  .ordersdash-edit-tools,
  .ordersdash-adjustment-grid {
    grid-template-columns: 1fr;
  }

  .ordersdash-modal-backdrop {
    padding: 0.5rem;
  }

  .ordersdash-modal {
    padding: 0.65rem;
  }

  .ordersdash-modal-status {
    grid-template-columns: 1fr 1fr;
  }

  .ordersdash-modal-status .btn {
    grid-column: span 2;
  }

  .ordersdash-action-group {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .ordersdash-status-actions .ordersdash-action-buttons,
  .ordersdash-communication-actions .ordersdash-action-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ordersdash-payment-verification {
    grid-template-columns: 1fr;
  }

  .ordersdash-modal-footer,
  .ordersdash-modal-footer-actions {
    width: 100%;
  }

  .ordersdash-modal-footer {
    flex-wrap: wrap;
  }

  .ordersdash-modal-footer .btn {
    flex: 1 1 130px;
  }
}

/* Home performance stability: reserve accurate space for lazy-rendered sections. */
.home-page #categories {
  contain-intrinsic-size: 1px 190px;
}

.home-page #category-showcase {
  contain-intrinsic-size: 1px 650px;
}

.home-page #all-books {
  contain-intrinsic-size: 1px 980px;
}

.home-page #featured,
.home-page #sales-books {
  contain-intrinsic-size: 1px 780px;
}

.home-page #authors,
.home-page #blog,
.home-page #reviews {
  contain-intrinsic-size: 1px 430px;
}

.home-page #categoryChips {
  min-height: 116px;
}

.home-page #categorySliders {
  min-height: 590px;
}

.home-page #bookGrid {
  min-height: 780px;
}

.home-page #featuredGrid,
.home-page #salesGrid {
  min-height: 630px;
}

.home-page #authorsGrid,
.home-page #latestArticlesGrid,
.home-page #latestReviewsGrid {
  min-height: 390px;
}

.home-page .book-cover-wrap {
  aspect-ratio: 4 / 5;
  background: #f7f1e5;
  border-radius: 12px;
  overflow: hidden;
}

.home-page .book-cover-wrap .book-cover,
.home-page .book-grid .card .book-cover,
.home-page .category-slide .card .book-cover,
.home-page .home-book-slider .card .book-cover {
  width: 100%;
  aspect-ratio: 4 / 5;
  height: auto;
  min-height: 0;
  object-fit: contain;
}

.home-page .price-row {
  min-height: 34px;
}

.home-page .card-actions {
  min-height: 96px;
  margin-top: auto;
}

@media (min-width: 941px) {
  .home-page .book-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .home-page .book-grid .card,
  .home-page .category-slide .card,
  .home-page .home-book-slider .card {
    min-height: 620px;
  }
}

@media (max-width: 940px) {
  .home-page #categories {
    min-height: 230px;
    contain-intrinsic-size: 1px 230px;
  }

  .home-page #category-showcase {
    min-height: 560px;
    contain-intrinsic-size: 1px 560px;
  }

  .home-page #all-books {
    min-height: 920px;
    contain-intrinsic-size: 1px 920px;
  }

  .home-page #featured,
  .home-page #sales-books {
    min-height: 560px;
    contain-intrinsic-size: 1px 560px;
  }

  .home-page #authors,
  .home-page #blog,
  .home-page #reviews {
    min-height: 360px;
    contain-intrinsic-size: 1px 360px;
  }

  .home-page .hero-card,
  .home-page .hero-ad-slider {
    min-height: 320px;
  }

  .home-page #heroAdSlider.is-loading-shell {
    min-height: 320px;
  }
}

body[data-orders-page="dashboard"] #mainContent {
  max-width: 1180px;
}

body[data-orders-page="dashboard"] .admin-dashboard-shell {
  padding: 0;
  gap: 0;
  overflow: hidden;
  border-radius: 30px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
}

body[data-orders-page="dashboard"] .admin-dashboard-head {
  margin: 0;
  padding: 1.8rem 2rem;
  border: 0;
  border-bottom: 1px solid rgba(166, 106, 0, 0.13);
  border-radius: 0;
  background:
    linear-gradient(135deg, rgba(230, 246, 244, 0.98), rgba(255, 253, 248, 0.92) 58%, rgba(248, 244, 235, 0.92)),
    radial-gradient(circle at 86% 20%, rgba(15, 118, 110, 0.13), transparent 13rem);
}

body[data-orders-page="dashboard"] .admin-dashboard-head h2 {
  font-size: clamp(1.85rem, 3vw, 2.55rem);
}

body[data-orders-page="dashboard"] .admin-dashboard-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(96px, 1fr));
  gap: 0.6rem;
  min-width: 310px;
  padding: 0.5rem;
  border: 1px solid rgba(166, 106, 0, 0.15);
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.74);
}

body[data-orders-page="dashboard"] .admin-dashboard-range .btn {
  width: 100%;
  border-radius: 16px;
  box-shadow: none;
}

body[data-orders-page="dashboard"] .admin-dashboard-range .btn-primary {
  background: linear-gradient(135deg, #8a5a00, #6d4600);
  box-shadow: 0 10px 22px rgba(166, 106, 0, 0.18);
}

body[data-orders-page="dashboard"] #ordersQuickActions {
  padding: 1.05rem 1.35rem;
  border-bottom: 1px solid rgba(166, 106, 0, 0.1);
  background: rgba(255, 255, 255, 0.58);
}

body[data-orders-page="dashboard"] #ordersQuickActions .btn {
  min-height: 48px;
  padding-inline: 1.2rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

body[data-orders-page="dashboard"] .orders-transfer-panel,
body[data-orders-page="dashboard"] #ordersKpis,
body[data-orders-page="dashboard"] .admin-dashboard-main,
body[data-orders-page="dashboard"] #ordersInsights,
body[data-orders-page="dashboard"] #ordersRecentSection,
body[data-orders-page="dashboard"] #ordersManagerSection {
  margin-left: 1.35rem;
  margin-right: 1.35rem;
}

body[data-orders-page="dashboard"] .orders-transfer-panel {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.75fr);
  gap: 0.9rem 1.2rem;
  align-items: start;
  border-style: solid;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 244, 235, 0.82)),
    radial-gradient(circle at 100% 0%, rgba(15, 118, 110, 0.1), transparent 12rem);
}

body[data-orders-page="dashboard"] .orders-transfer-panel .admin-dashboard-panel-head,
body[data-orders-page="dashboard"] .orders-transfer-copy,
body[data-orders-page="dashboard"] .orders-transfer-actions {
  grid-column: 1;
}

body[data-orders-page="dashboard"] .orders-file-picker,
body[data-orders-page="dashboard"] .orders-import-input,
body[data-orders-page="dashboard"] .orders-transfer-meta {
  grid-column: 2;
}

body[data-orders-page="dashboard"] .orders-file-picker {
  min-height: 82px;
  align-content: center;
}

body[data-orders-page="dashboard"] .orders-import-input {
  min-height: 46px;
}

body[data-orders-page="dashboard"] .orders-transfer-meta:empty {
  display: none;
}

body[data-orders-page="dashboard"] #ordersKpis {
  margin-top: 1.2rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

body[data-orders-page="dashboard"] .admin-kpi-card {
  min-height: 132px;
  padding: 1rem;
  border-radius: 22px;
  position: relative;
  overflow: hidden;
}

body[data-orders-page="dashboard"] .admin-kpi-card::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -34px;
  width: 92px;
  height: 92px;
  border-radius: 999px;
  background: rgba(166, 106, 0, 0.08);
}

body[data-orders-page="dashboard"] .admin-kpi-card h3 {
  font-size: clamp(1.8rem, 2.5vw, 2.25rem);
  line-height: 1;
  color: #6d4600;
}

body[data-orders-page="dashboard"] .admin-kpi-card .admin-kpi-label {
  color: #8a5a00;
}

body[data-orders-page="dashboard"] .admin-dashboard-main {
  margin-top: 1rem;
}

body[data-orders-page="dashboard"] .admin-dashboard-panel,
body[data-orders-page="dashboard"] .orders-dash-chart {
  border-radius: 24px;
  border-color: rgba(166, 106, 0, 0.14);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.045);
}

body[data-orders-page="dashboard"] .orders-dash-bars {
  min-height: 150px;
}

body[data-orders-page="dashboard"] .orders-dash-status {
  background: linear-gradient(135deg, rgba(248, 244, 235, 0.94), rgba(255, 255, 255, 0.86));
  border-color: rgba(166, 106, 0, 0.14);
}

body[data-orders-page="dashboard"] .orders-dash-status strong {
  color: #6d4600;
}

body[data-orders-page="dashboard"] #ordersInsights,
body[data-orders-page="dashboard"] #ordersRecentSection,
body[data-orders-page="dashboard"] #ordersManagerSection {
  margin-top: 1rem !important;
}

body[data-orders-page="dashboard"] #ordersManagerSection {
  margin-bottom: 1.35rem;
}

@media (max-width: 940px) {
  body[data-orders-page="dashboard"] .admin-dashboard-head {
    display: grid;
    padding: 1.35rem 1rem;
  }

  body[data-orders-page="dashboard"] .admin-dashboard-range {
    min-width: 0;
    width: 100%;
  }

  body[data-orders-page="dashboard"] #ordersQuickActions,
  body[data-orders-page="dashboard"] .orders-transfer-panel,
  body[data-orders-page="dashboard"] #ordersKpis,
  body[data-orders-page="dashboard"] .admin-dashboard-main,
  body[data-orders-page="dashboard"] #ordersInsights,
  body[data-orders-page="dashboard"] #ordersRecentSection,
  body[data-orders-page="dashboard"] #ordersManagerSection {
    margin-left: 1rem;
    margin-right: 1rem;
  }

  body[data-orders-page="dashboard"] .orders-transfer-panel {
    grid-template-columns: 1fr;
  }

  body[data-orders-page="dashboard"] .orders-file-picker,
  body[data-orders-page="dashboard"] .orders-import-input,
  body[data-orders-page="dashboard"] .orders-transfer-meta {
    grid-column: 1;
  }

  body[data-orders-page="dashboard"] #ordersKpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .container,
  main,
  section,
  .section,
  .search-panel,
  .book-grid,
  .book-grid .card,
  .home-book-slider,
  .category-slider-track-wrap {
    max-width: 100%;
    min-width: 0;
  }

  .container {
    width: 100%;
    padding-inline: 0.75rem;
  }

  .home-page #all-books {
    min-height: 0;
  }

  .home-page #all-books .section-head h2 {
    font-size: clamp(1.65rem, 9vw, 2.05rem);
    overflow-wrap: anywhere;
  }

  body.mobile-books-1 #bookGrid.book-grid,
  body:not(.mobile-books-2) .book-grid {
    grid-template-columns: 1fr !important;
  }

  body.mobile-books-2 #bookGrid.book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.mobile-books-1 #bookGrid.book-grid .card,
  body.mobile-books-2 #bookGrid.book-grid .card,
  .book-grid .card {
    width: 100%;
    min-height: 0;
  }

  body.mobile-books-1 #bookGrid.book-grid .card .book-cover,
  body.mobile-books-2 #bookGrid.book-grid .card .book-cover,
  .book-grid .card .book-cover {
    width: 100%;
    max-width: 100%;
  }

  /* Let a single-column card size its cover frame from the actual cover image. */
  body.mobile-books-1.home-page #bookGrid.book-grid .book-cover-wrap {
    aspect-ratio: auto;
  }

  body.mobile-books-1.home-page #bookGrid.book-grid .book-cover-wrap .book-cover {
    display: block;
    height: auto !important;
    aspect-ratio: auto;
    margin-bottom: 0;
  }

  .card-actions-primary,
  .card-actions-secondary {
    grid-template-columns: 1fr;
  }
}

.author-page #authorBooksGrid .book-card-title-ur {
  font-size: 0.86em;
}

.author-page #authorBooksGrid .book-card-title-en {
  font-family: var(--font-english);
  font-size: 0.76em;
}

.author-page #authorBooksGrid .buy-btn {
  width: 100%;
  text-align: center;
}

.author-page #authorBooksGrid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
}

#authorsPageGrid {
  align-items: stretch;
}

#authorsPageGrid .author-directory-card {
  min-height: 0;
  height: 100%;
  padding: 0.9rem;
}

#authorsPageGrid .author-directory-card .book-cover {
  height: 300px;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  background: #f7f1e5;
}

#authorsPageGrid .author-directory-title {
  min-height: 3.1rem;
  max-height: 3.1rem;
  margin-top: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#authorsPageGrid .author-directory-bio {
  min-height: 2.85rem;
  max-height: 2.85rem;
  -webkit-line-clamp: 2;
}

#authorsPageGrid .author-directory-card .buy-btn {
  margin-top: auto;
}

.author-page #authorBooksGrid .card {
  min-height: 0;
  height: auto;
  padding: 0.9rem;
}

.author-page #authorBooksGrid .book-cover {
  height: 300px;
  object-fit: contain;
}

.author-page #authorBooksGrid .book-card-title {
  min-height: 4.35rem !important;
  margin-top: 0.35rem;
}

.author-page #authorBooksGrid .meta {
  min-height: 1.3rem;
  max-height: 1.3rem;
}

.author-page #authorBooksGrid .buy-btn {
  margin-top: 0.55rem;
  min-height: 42px;
}

.author-profile-card {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  align-items: center;
  justify-items: start;
  text-align: left;
  gap: 1.2rem;
}

.author-profile-image {
  width: 170px;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.author-profile-copy {
  width: 100%;
}

.author-profile-title {
  display: grid;
  gap: 0.15rem;
  margin: 0 0 0.35rem;
}

.author-profile-title-en,
.author-profile-title-ur {
  display: block;
}

.author-profile-title-en {
  font-family: var(--font-english);
  font-size: clamp(1.85rem, 3vw, 2.85rem);
  line-height: 1.05;
  font-weight: 800;
}

.author-profile-title-ur {
  direction: rtl;
  text-align: right;
  font-family: var(--font-arabic);
  font-size: clamp(1.55rem, 2.45vw, 2.25rem);
  line-height: 1.3;
  font-weight: 700;
}

body .main-nav,
body .nav-submenu summary,
body .nav-submenu-list a {
  font-family: var(--font-english) !important;
}

body .main-nav > a,
body .nav-submenu summary {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: var(--ink);
  font-size: 0.94rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
  text-decoration: none;
}

body .main-nav > a[aria-current="page"],
body .main-nav > a.active {
  color: var(--brand-deep);
}

body .main-nav .nav-cart-count {
  min-width: 20px;
  height: 20px;
  font-family: var(--font-english) !important;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  line-height: 1 !important;
}

body[data-admin-surface="true"],
body[data-admin-surface="true"] *,
.admin-login-page,
.admin-login-page *,
body[data-orders-page],
body[data-orders-page] *,
.pos-page,
.pos-page * {
  font-family: var(--font-english), var(--font-arabic) !important;
}

body[data-admin-surface="true"] h1,
body[data-admin-surface="true"] h2,
body[data-admin-surface="true"] h3,
body[data-admin-surface="true"] h4,
body[data-admin-surface="true"] .brand strong,
body[data-admin-surface="true"] .admin-menu-btn,
body[data-admin-surface="true"] .btn,
body[data-admin-surface="true"] button,
body[data-admin-surface="true"] input,
body[data-admin-surface="true"] select,
body[data-admin-surface="true"] textarea,
.admin-login-page h1,
.admin-login-page .admin-login-brand strong,
.admin-login-page .btn,
.admin-login-page button,
.admin-login-page input,
body[data-orders-page] h1,
body[data-orders-page] h2,
body[data-orders-page] h3,
body[data-orders-page] h4,
body[data-orders-page] .btn,
body[data-orders-page] button,
body[data-orders-page] input,
body[data-orders-page] select,
body[data-orders-page] textarea {
  font-family: var(--font-english), var(--font-arabic) !important;
  letter-spacing: 0 !important;
}

@media (max-width: 940px) {
  body .main-nav > a,
  body .nav-submenu summary {
    min-height: 34px;
    font-size: 0.86rem !important;
    line-height: 1.15 !important;
  }

  .author-profile-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 0.85rem;
  }

  .author-profile-image {
    width: min(220px, 62vw);
  }

  .author-profile-title-en {
    font-size: clamp(1.75rem, 8.5vw, 2.35rem);
  }

  .author-profile-title-ur {
    text-align: center;
    font-size: clamp(1.35rem, 7vw, 1.95rem);
  }

  .author-page .author-mobile-layout-toggle {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.45rem 0 0.75rem;
    flex-wrap: wrap;
  }

  .author-page .author-mobile-layout-toggle.is-hidden {
    display: none;
  }

  .author-page.mobile-author-books-1 #authorBooksGrid.book-grid {
    grid-template-columns: 1fr !important;
  }

  .author-page.mobile-author-books-2 #authorBooksGrid.book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.55rem;
  }

  .author-page #authorBooksGrid .card {
    min-height: 0;
  }

  .author-page.mobile-author-books-1 #authorBooksGrid .book-cover {
    height: 315px;
    object-fit: contain;
  }

  .author-page.mobile-author-books-2 #authorBooksGrid .card {
    padding: 0.62rem;
  }

  .author-page.mobile-author-books-2 #authorBooksGrid .book-cover {
    height: 178px;
    object-fit: contain;
  }

  .author-page.mobile-author-books-2 #authorBooksGrid .book-card-title {
    min-height: 4rem !important;
    gap: 0.1rem;
  }

  .author-page.mobile-author-books-2 #authorBooksGrid .book-card-title-ur {
    min-height: 1.25rem;
    max-height: 1.25rem;
    font-size: 0.78em;
    line-height: 1.25;
  }

  .author-page.mobile-author-books-2 #authorBooksGrid .book-card-title-en {
    min-height: 2.35rem;
    max-height: 2.35rem;
    font-size: 0.72em;
    line-height: 1.18;
  }

  .author-page.mobile-author-books-2 #authorBooksGrid .meta {
    min-height: 1.15rem;
    max-height: 1.15rem;
    font-size: 0.72rem;
    line-height: 1.15;
  }

  .author-page.mobile-author-books-2 #authorBooksGrid .buy-btn {
    min-height: 34px;
    padding: 0.4rem 0.35rem;
    font-size: 0.72rem;
  }
}

/* Final English font lock: keep first paint and post-load UI on Calibri. */
body,
button,
input,
select,
textarea,
.main-nav,
.main-nav a,
.nav-submenu summary,
.nav-submenu-list a,
.mobile-bottom-nav,
.mobile-bottom-nav a,
.hero-copy,
.hero-copy h1,
.hero-copy p,
.hero-ad-title,
.section-head h2,
.category-slider-head h3,
.home-category-copy strong,
.book-card-title-en,
.book-title-en,
.price-row,
.btn,
.buy-btn,
.chip,
.meta,
.eyebrow {
  font-family: Calibri, "Segoe UI", Arial, sans-serif !important;
  letter-spacing: 0 !important;
}

.book-card-title-ur,
.book-title-urdu {
  font-family: var(--font-arabic);
}

/* Unified menu typography across every public and admin page. */
body .main-nav,
body .main-nav > a,
body .nav-submenu summary,
body .nav-submenu-list a,
body[data-admin-surface="true"] .main-nav,
body[data-admin-surface="true"] .main-nav > a,
.admin-login-page .main-nav,
.admin-login-page .main-nav > a {
  font-family: Calibri, "Segoe UI", Arial, sans-serif !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
}

body .main-nav > a,
body .nav-submenu summary {
  min-height: 24px !important;
}

body .nav-submenu-list a {
  font-size: 0.96rem !important;
  font-weight: 700 !important;
}

.home-page #resultCount {
  display: none !important;
}

@media (min-width: 941px) {
  /* Desktop header uses icon-only account and cart actions. */
  .nav-wrap > .user-session-badge > .user-avatar,
  .nav-wrap > .user-session-badge > .user-session-copy,
  .nav-wrap > .user-session-badge > .user-session-logout {
    display: none !important;
  }

  .nav-wrap {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center !important;
    column-gap: 1rem;
    row-gap: 0.8rem;
  }

  .nav-wrap .brand {
    grid-column: 1 / -1;
  }

  .nav-wrap .main-nav {
    grid-column: 1;
    width: auto !important;
  }

  .nav-wrap .user-session-badge {
    grid-column: 2;
    grid-row: 2;
    width: auto !important;
    min-width: 0;
    margin-top: 0 !important;
    justify-self: end;
    padding: 0.24rem;
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  }

  .nav-wrap .user-avatar {
    display: none;
  }

  .nav-wrap .user-session-copy,
  .nav-wrap .user-session-logout {
    display: none !important;
  }

  .nav-wrap .header-profile-icon,
  .nav-wrap .header-cart-icon {
    position: relative;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid #d8cfbd;
    border-radius: 50%;
    background: #fffdf8;
    color: var(--ink);
    text-decoration: none;
    font-size: 1.2rem;
    line-height: 1;
  }

  .nav-wrap .header-profile-icon:hover,
  .nav-wrap .header-cart-icon:hover {
    border-color: var(--brand);
    color: var(--brand);
  }

  .nav-wrap .header-cart-icon .nav-cart-count {
    position: absolute;
    top: -6px;
    right: -7px;
    min-width: 19px;
    height: 19px;
    margin: 0;
    padding: 0 0.2rem;
    font-size: 0.68rem;
  }

  .nav-wrap .header-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 940px) {
  body .main-nav,
  body .main-nav > a,
  body .nav-submenu summary,
  body .nav-submenu-list a {
    font-size: 0.9rem !important;
    font-weight: 700 !important;
  }
}

@media (max-width: 820px) {
  body .mobile-bottom-nav a {
    font-family: Calibri, "Segoe UI", Arial, sans-serif !important;
    font-size: 0.68rem !important;
    font-weight: 700 !important;
    line-height: 1.15 !important;
    letter-spacing: 0 !important;
  }
}

.admin-toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 99999;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100vw - 28px));
  pointer-events: none;
}

.admin-toast {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: start;
  padding: 13px 14px;
  border-radius: 16px;
  background: #fffaf0;
  border: 1px solid #d8cfbd;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.16);
  color: var(--ink, #122322);
  pointer-events: auto;
  animation: adminToastIn 0.2s ease-out;
}

.admin-toast strong {
  font-size: 0.84rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-toast span {
  grid-column: 1;
  font-size: 0.96rem;
  line-height: 1.45;
}

.admin-toast button {
  grid-row: 1 / span 2;
  grid-column: 2;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.65);
  cursor: pointer;
}

.admin-toast-success {
  border-color: rgba(17, 135, 119, 0.35);
  box-shadow: 0 16px 42px rgba(17, 135, 119, 0.18);
}

.admin-toast-error {
  border-color: rgba(194, 28, 28, 0.35);
  box-shadow: 0 16px 42px rgba(194, 28, 28, 0.16);
}

.admin-toast-warning {
  border-color: rgba(177, 107, 0, 0.38);
}

.admin-toast.is-leaving {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.admin-notifications-list {
  display: grid;
  gap: 0.75rem;
}

.admin-notification-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: start;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid #d8cfbd;
  background: rgba(255, 252, 246, 0.92);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.admin-notification-card strong {
  display: inline-flex;
  margin-bottom: 0.25rem;
  color: var(--teal, #0f766e);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-notification-card p {
  margin: 0;
  line-height: 1.45;
}

.admin-notification-card time {
  color: var(--muted, #61706f);
  font-size: 0.82rem;
  white-space: nowrap;
}

.admin-notification-error {
  border-color: rgba(194, 28, 28, 0.35);
}

.admin-notification-error strong {
  color: #b42318;
}

.admin-notification-warning {
  border-color: rgba(177, 107, 0, 0.38);
}

.admin-notification-warning strong {
  color: #a15c00;
}

body[data-admin-surface="true"] .user-session-badge,
body[data-admin-surface="true"] .main-nav a[href$="account.html"],
body[data-admin-surface="true"] .main-nav a[href="account.html"] {
  display: none !important;
}

.admin-notification-widget {
  position: relative;
  margin-left: auto;
  z-index: 20;
}

.admin-notification-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 48px;
  padding: 0.42rem 0.7rem 0.42rem 0.5rem;
  border: 1px solid #d8cfbd;
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.92);
  color: var(--ink, #1f2d2b);
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
}

.admin-notification-toggle:hover {
  border-color: rgba(17, 135, 119, 0.42);
  box-shadow: 0 14px 34px rgba(17, 135, 119, 0.12);
}

.admin-notification-toggle > span:not(.admin-notification-icon) {
  display: grid;
  gap: 0.05rem;
  text-align: left;
}

.admin-notification-toggle strong {
  font-size: 0.88rem;
  line-height: 1.1;
}

.admin-notification-toggle small {
  color: var(--muted, #61706f);
  font-size: 0.72rem;
  line-height: 1.1;
}

.admin-notification-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #0f766e;
  color: #fff;
  font-weight: 800;
}

.admin-notification-toggle em {
  min-width: 22px;
  height: 22px;
  padding: 0 0.35rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #b42318;
  color: #fff;
  font-style: normal;
  font-size: 0.72rem;
  line-height: 1;
}

.admin-notification-popup {
  position: absolute;
  right: 0;
  top: calc(100% + 0.55rem);
  width: min(360px, calc(100vw - 2rem));
  padding: 0.9rem;
  border: 1px solid #d8cfbd;
  border-radius: 20px;
  background: rgba(255, 252, 246, 0.98);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
}

body[data-orders-page] .nav-wrap,
body[data-admin-surface="true"] .nav-wrap {
  align-items: center;
}

body[data-orders-page] .main-nav,
body[data-admin-surface="true"] .main-nav {
  width: auto;
  flex: 1 1 auto;
}

.admin-page-notification-widget {
  flex: 0 0 auto;
}

@media (max-width: 700px) {
  .admin-page-notification-widget {
    width: 100%;
    margin-left: 0;
  }

  .admin-page-notification-widget .admin-notification-toggle {
    width: 100%;
    justify-content: flex-start;
  }

  .admin-page-notification-widget .admin-notification-popup {
    right: auto;
    left: 0;
  }
}

.admin-notification-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.65rem;
}

.admin-notification-popup-head a {
  color: var(--teal, #0f766e);
  font-weight: 800;
  text-decoration: underline;
}

.admin-header-notifications-list {
  display: grid;
  gap: 0.55rem;
  max-height: 330px;
  overflow: auto;
}

.admin-header-notification {
  position: relative;
  display: grid;
  gap: 0.18rem;
  padding: 0.72rem 0.78rem;
  border: 1px solid rgba(216, 207, 189, 0.85);
  border-radius: 14px;
  background: #fffdf8;
}

.admin-header-notification strong {
  color: var(--teal, #0f766e);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.admin-header-notification p {
  margin: 0;
  color: var(--ink, #1f2d2b);
  line-height: 1.35;
}

.admin-header-notification time {
  color: var(--muted, #61706f);
  font-size: 0.75rem;
}

.admin-header-notification-error {
  border-color: rgba(194, 28, 28, 0.34);
}

.admin-header-notification-error strong {
  color: #b42318;
}

.admin-header-notification-warning {
  border-color: rgba(177, 107, 0, 0.36);
}

.admin-header-notification-warning strong {
  color: #a15c00;
}

@keyframes adminToastIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Final home CLS guard: keep late mobile/per-page overrides from collapsing placeholders. */
.home-page #heroAdSlider,
.home-page #heroAdSlider.is-loading-shell {
  min-height: 320px !important;
}

.home-page .hero-card {
  min-height: 352px !important;
}

.home-page .hero-ad-track-wrap {
  height: 282px !important;
  min-height: 282px !important;
}

.home-page .hero-ad-slide,
.home-page .hero-ad-slide a,
.home-page .hero-ad-slide img {
  min-height: 282px;
}

.home-page .hero-ad-slide img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.home-page .user-session-badge {
  min-width: 178px;
  min-height: 44px;
}

.desktop-pinned-cart {
  display: none;
}

@media (min-width: 941px) {
  .desktop-pinned-cart {
    position: fixed;
    right: 18px;
    bottom: 24px;
    z-index: 1450;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 46px;
    padding: 0.48rem 0.7rem;
    border: 2px solid #fff;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
    font-size: 0.86rem;
    font-weight: 800;
    text-decoration: none;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease;
  }

  .desktop-pinned-cart.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .desktop-pinned-cart:hover {
    background: var(--brand-deep);
  }

  .desktop-pinned-cart em {
    display: inline-grid;
    min-width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 50%;
    background: #b91c1c;
    color: #fff;
    font-size: 0.7rem;
    font-style: normal;
  }

  .home-page .nav-wrap .user-session-badge {
    width: 98px !important;
    min-width: 98px;
    gap: 0.35rem;
  }
}

body[data-admin-surface="true"] .desktop-pinned-cart,
body[data-orders-page] .desktop-pinned-cart {
  display: none !important;
}

.home-page .user-session-logout[hidden] {
  display: none !important;
}

.home-page #categories {
  content-visibility: visible;
}

.home-page #categoryChips {
  min-height: 116px;
}

.home-page #categorySliders {
  min-height: 590px;
}

.home-page #bookGrid {
  min-height: 780px;
}

.home-page #featuredGrid,
.home-page #salesGrid {
  min-height: 630px;
}

.home-page #authorsGrid,
.home-page #latestArticlesGrid,
.home-page #latestReviewsGrid {
  min-height: 390px;
}

.home-page .book-cover-wrap,
.home-page .book-cover {
  aspect-ratio: 4 / 5;
}

.home-page .card-actions {
  min-height: 96px;
}

.book-set-home-offer {
  display: grid;
  gap: 0.16rem;
  margin: 0.45rem 0;
  color: #0f766e;
  font-size: 0.86rem;
}

.book-set-home-offer span,
.book-set-home-offer small {
  color: #9a6700;
}

.book-set-home-offer del {
  color: #7b8790;
}

.book-set-home-offer em {
  color: #0f766e;
  font-style: normal;
}

.book-set-home-offer strong {
  color: #b42318;
  font-size: 1rem;
}

.book-sets-hero {
  margin-top: 1.25rem;
}

.book-set-directory-card {
  min-height: 0;
}

.book-set-directory-card .book-cover {
  aspect-ratio: 4 / 5;
  object-fit: contain;
}

.book-set-directory-offer {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  margin: 0.5rem 0;
  color: #9a6700;
  font-size: 0.86rem;
}

.book-set-directory-offer strong {
  color: #b42318;
  font-size: 1rem;
}

.book-set-directory-description {
  min-height: 0 !important;
  max-height: none !important;
  margin-bottom: 0.85rem;
}

.collection-meta-availability,
.collection-meta-description {
  display: block;
}

.collection-meta-description {
  margin-top: 0.38rem;
  text-align: right;
  unicode-bidi: plaintext;
}

/* Keep the home hero, advertiser and stock labels inside real mobile browser widths. */
@media (max-width: 820px) {
  body.home-page {
    overflow-x: clip;
  }

  .home-page .hero,
  .home-page .hero-copy,
  .home-page .hero-card,
  .home-page .hero-ad-slider,
  .home-page .hero-ad-track-wrap,
  .home-page .hero-ad-slide,
  .home-page .hero-ad-slide a,
  .home-page .hero-ad-slide img {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .home-page .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-page .hero-copy,
  .home-page .hero-card {
    box-sizing: border-box;
  }

  .home-page .hero-copy h1,
  .home-page .hero-copy p {
    overflow-wrap: anywhere;
  }

  .home-page .hero-ad-track-wrap {
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 4 / 3;
  }

  .home-page .hero-ad-slide,
  .home-page .hero-ad-slide a,
  .home-page .hero-ad-slide img {
    min-height: 0;
    height: 100%;
  }

  /* Every advertisement must occupy one complete slider page on mobile. */
  .home-page .hero-ad-track {
    width: 100%;
  }

  .home-page .hero-ad-slide {
    flex: 0 0 100%;
    min-width: 100%;
    max-width: 100%;
  }

  .home-page .book-grid .card .price-row,
  .home-page .category-slide .card .price-row,
  .home-page .home-book-slider .card .price-row,
  .home-page .mini-book .price-row {
    flex-wrap: wrap;
    align-items: flex-start;
    min-width: 0;
  }

  .home-page .book-grid .card .stock,
  .home-page .category-slide .card .stock,
  .home-page .home-book-slider .card .stock,
  .home-page .mini-book .stock {
    flex: 0 0 auto;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .book-grid .card .price-row,
  .category-slide .card .price-row,
  .home-book-slider .card .price-row,
  .mini-book .price-row {
    flex-wrap: wrap;
    align-items: flex-start;
    min-width: 0;
  }

  .book-grid .card .stock,
  .category-slide .card .stock,
  .home-book-slider .card .stock,
  .mini-book .stock {
    flex: 0 0 auto;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 940px) {
  .books-page-card-actions {
    margin-top: 0.45rem !important;
  }

  body.books-mobile-1 #booksPageGrid.book-grid .card,
  body.books-mobile-2 #booksPageGrid.book-grid .card {
    min-height: 0;
    height: auto;
  }

  body.books-mobile-1 #booksPageGrid.book-grid {
    grid-template-columns: 1fr !important;
  }

  body.books-mobile-2 #booksPageGrid.book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .home-page #categorySliders {
    min-height: 560px;
  }

  .home-page #bookGrid {
    min-height: 920px;
  }

  .home-page #featuredGrid,
  .home-page #salesGrid {
    min-height: 560px;
  }

  .home-page #authorsGrid,
  .home-page #latestArticlesGrid,
  .home-page #latestReviewsGrid {
    min-height: 360px;
  }
}

@media (max-width: 560px) {
  body.books-mobile-2 #booksPageGrid.book-grid .card {
    padding: 0.62rem;
  }

  body.books-mobile-2 #booksPageGrid.book-grid .book-cover {
    height: 178px;
    object-fit: contain;
  }

  body.books-mobile-2 #booksPageGrid.book-grid .book-card-title {
    min-height: 4rem !important;
  }

  body.books-mobile-2 #booksPageGrid.book-grid .book-card-title-ur {
    min-height: 1.25rem;
    max-height: 1.25rem;
    font-size: 0.78em;
    line-height: 1.25;
  }

  body.books-mobile-2 #booksPageGrid.book-grid .book-card-title-en {
    min-height: 2.35rem;
    max-height: 2.35rem;
    font-size: 0.72em;
    line-height: 1.18;
  }

  .site-footer {
    min-height: 0;
    margin-top: 1.25rem;
  }

  .site-footer .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.95rem 0.75rem;
    padding: 1.35rem 1.15rem 1.5rem;
  }

  .site-footer .footer-brand {
    grid-column: 1 / -1;
  }

  .site-footer .footer-brand > p {
    max-width: 38ch;
    font-size: 0.88rem;
  }

  .site-footer .footer-link-group {
    gap: 0.48rem;
  }

  .site-footer .footer-link-group h3 {
    font-size: 0.92rem;
  }

  .site-footer .footer-link-group a,
  .site-footer .footer-contact-links a {
    font-size: 0.82rem;
  }

  .site-footer .footer-copyright {
    margin-top: 0.15rem;
    padding-top: 0.7rem;
  }
}

/* Collection pages keep compact cards and allow the customer to choose the mobile grid. */
.collection-page #collectionPageGrid.book-grid .card {
  min-height: 0;
  height: auto;
}

.collection-page #collectionPageGrid.book-grid .book-cover {
  height: 260px;
}

@media (max-width: 640px) {
  .collection-layout-toggle {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  .collection-layout-toggle > span {
    flex-basis: 100%;
  }

  body.collection-page.collection-mobile-1 #collectionPageGrid.book-grid {
    grid-template-columns: 1fr !important;
  }

  body.collection-page.collection-mobile-2 #collectionPageGrid.book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.55rem;
  }

  body.collection-page.collection-mobile-1 #collectionPageGrid.book-grid .book-cover {
    height: min(300px, 72vw);
  }

  body.collection-page.collection-mobile-2 #collectionPageGrid.book-grid .card {
    padding: 0.62rem;
  }

  body.collection-page.collection-mobile-2 #collectionPageGrid.book-grid .book-cover {
    height: 178px;
  }

  .set-price-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
  }

  .set-price-summary span {
    min-width: 0;
    padding: 0.42rem;
  }

.set-price-summary strong,
.set-price-summary b,
.set-price-summary del,
.set-price-summary em {
    font-size: 0.75rem;
    overflow-wrap: anywhere;
  }

  .collection-page #collectionPageGrid .price-row {
    min-height: 0;
    margin-top: 0.45rem;
    gap: 0.35rem;
  }

  .collection-page #collectionPageGrid .old-price,
  .collection-page #collectionPageGrid .discount-price,
  .collection-page #collectionPageGrid .price {
    font-size: 0.9rem;
  }

  .collection-page #collectionPageGrid .collection-card-actions {
    padding-top: 0.5rem;
  }

  .collection-page #collectionPageGrid .collection-card-actions .buy-btn {
    min-height: 38px;
    padding: 0.42rem 0.5rem;
    font-size: 0.78rem;
  }
}

/* Compact cart layout for narrow screens: product details above, purchase values in one grid row. */
@media (max-width: 640px) {
  .cart-page .cart-line-item {
    grid-template-columns: 92px minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 0.7rem;
    padding: 0.7rem;
  }

  .cart-page .cart-line-cover {
    grid-column: 1;
    grid-row: 1;
  }

  .cart-page .cart-line-cover img {
    width: 92px;
    height: 116px;
    max-width: 100%;
    border-radius: 8px;
  }

  .cart-page .cart-line-copy {
    display: contents;
  }

  .cart-page .cart-line-top {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.45rem;
    align-items: start;
  }

  .cart-page .cart-line-top h3 {
    margin-bottom: 0.25rem;
    font-size: 0.86rem;
    line-height: 1.25;
  }

  .cart-page .cart-line-top .meta {
    margin: 0.22rem 0 0;
    font-size: 0.66rem;
    line-height: 1.32;
  }

  .cart-page .cart-remove-btn {
    min-height: 30px;
    padding: 0.32rem 0.5rem;
    font-size: 0.68rem;
  }

  .cart-page .cart-line-bottom {
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 0.42rem;
    align-items: stretch;
  }

  .cart-page .cart-qty-box,
  .cart-page .cart-price-box {
    min-width: 0;
    min-height: 66px;
    padding: 0.42rem;
    border: 1px solid #eadfcf;
    border-radius: 6px;
    background: #fffdf8;
  }

  .cart-page .cart-qty-box span,
  .cart-page .cart-price-box > span {
    font-size: 0.62rem;
    line-height: 1.15;
  }

  .cart-page .cart-qty-box input {
    width: 34px;
    min-height: 30px;
    margin: 0;
    padding: 0.2rem;
    font-size: 0.82rem;
  }

  .cart-page .cart-qty-stepper {
    grid-template-columns: 26px 34px 26px;
    gap: 0.25rem;
    margin-top: 0.3rem;
  }

  .cart-page .cart-qty-adjust {
    width: 26px;
    min-height: 26px;
    padding: 0;
    font-size: 0.9rem;
  }

  .cart-page .cart-price-box strong,
  .cart-page .cart-item-original-price {
    font-size: 0.76rem;
    overflow-wrap: anywhere;
  }

  .cart-page .cart-price-box .meta {
    display: none !important;
  }
}
