﻿: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);
}

* { 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: "Manrope", "Segoe UI", sans-serif;
  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: "Cormorant Garamond", serif;
}

.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;
}

.main-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.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-weight: 600;
}

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

.nav-submenu summary::after {
  content: " ▾";
  font-size: 0.8em;
  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-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;
}

.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: 0;
}

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

.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;
  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: "Cormorant Garamond", Georgia, serif;
  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);
}

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

h1, h2, h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  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: "Cormorant Garamond", Georgia, serif;
  font-weight: 700;
  line-height: 1.1;
}
.section-head .btn,
.section-head .category-view-all {
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
}
body.lang-ur .section-head h2 {
  font-family: "Noto Naskh Arabic", "Noto Sans Arabic", Tahoma, "Segoe UI", sans-serif;
  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;
}

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

.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;
}

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.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.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.36rem;
  margin-top: 0.2rem;
}

.meta {
  margin: 0.25rem 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.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);
}

.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);
}

.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-size: 0.9rem;
  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;
}

.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-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;
}

.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: repeat(3, 1fr);
  gap: 1rem;
  padding: 1.4rem 0;
}

.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: 300px;
  }
  .hero-ad-slider {
    min-height: 0;
  }
  .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;
  }
  .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.96rem;
    white-space: nowrap;
    border: 1px solid #ddd3c1;
    border-radius: 999px;
    padding: 0.36rem 0.72rem;
    background: #fff;
  }
  .nav-submenu summary {
    font-size: 0.96rem;
    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 .book-grid {
    grid-template-columns: 1fr;
  }
  body.mobile-books-2 .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;
  }
}

@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; }
  .wa-float {
    right: 12px;
    bottom: 84px;
    min-width: 62px;
    height: 48px;
    padding: 0 0.75rem;
    font-size: 0;
  }
  .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: 30px;
    height: 30px;
    font-size: 0.72rem;
  }
  .floating-cart {
    right: 12px;
    bottom: 140px;
    min-width: 64px;
    height: 50px;
    padding: 0 0.65rem;
  }
  .back-to-top {
    right: 12px;
    bottom: 196px;
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
  }
}

@media (max-width: 520px) {
  .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;
  }
  .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;
  }
  .mini-book .meta,
  .home-book-slider .card .meta,
  body.mobile-books-2 .book-grid .card .meta {
    font-size: 0.8rem;
    line-height: 1.35;
  }
  .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;
    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.78rem;
    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;
  }
}
.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: 1.2rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(135deg, #fffdf8 0%, #f5ecd9 100%);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
}

.cart-hero h1 {
  margin: 0.2rem 0 0.35rem;
  font-size: clamp(1.75rem, 3vw, 2.7rem);
}

.cart-hero-chip {
  min-width: 190px;
  display: grid;
  gap: 0.2rem;
  padding: 0.95rem 1rem;
  border: 1px solid #dccdaf;
  border-radius: 16px;
  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-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: 1.15rem;
}

.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.65rem;
}

.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-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-remove-btn {
  white-space: nowrap;
}

.cart-line-bottom {
  display: grid;
  grid-template-columns: 110px 1fr 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 {
  min-height: 46px;
  border: 1px solid #d8cfbd;
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  font: inherit;
  background: #fff;
}

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

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

.cart-coupon-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 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-summary-actions {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 0.35rem;
}

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

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

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

.cart-totals-stack div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  color: var(--muted);
  padding: 0.55rem 0;
  border-bottom: 1px solid #eee4d1;
}

.cart-totals-stack strong {
  color: var(--ink);
}

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

.cart-trust-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 1rem;
}

.cart-trust-list p {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid #eadfc9;
  border-radius: 14px;
  background: #fffaf2;
}

.cart-trust-list strong,
.cart-trust-list span {
  display: block;
}

.cart-trust-list span {
  color: var(--muted);
  font-size: 0.84rem;
  text-align: right;
}

.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-trust-list span,
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: "Manrope", "Segoe UI", sans-serif;
}

.checkout-grid textarea {
  grid-column: 1 / -1;
  min-height: 92px;
  border: 1px solid #d8cfbd;
  border-radius: 10px;
  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;
}

.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;
  }
}
.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;
}

@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;
}

.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) {
  body {
    padding-bottom: 82px;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 0;
    border-top: 1px solid var(--line);
    background: rgba(255, 253, 248, 0.98);
    backdrop-filter: blur(4px);
  }

  .mobile-bottom-nav a {
    text-decoration: none;
    text-align: center;
    padding: 0.86rem 0.2rem;
    min-height: 54px;
    font-weight: 700;
    font-size: 0.86rem;
    color: var(--ink);
    border-inline-start: 1px solid #ece3d2;
  }

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

  .mobile-bottom-nav .nav-cart-count {
    display: inline-block;
    margin-inline-start: 0.15rem;
    font-size: 0.78rem;
    color: #b42318;
  }
}

@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.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.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;
}

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

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

.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 {
  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);
}

.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-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;
}

.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;
}

@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-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-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-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-trust-list p {
    flex-direction: column;
    align-items: flex-start;
  }

  .cart-trust-list span {
    text-align: left;
  }

  .book-product-layout {
    padding: 0.8rem;
    border-radius: 18px;
  }

  .book-breadcrumbs {
    font-size: 0.78rem;
  }

  .book-main-frame {
    min-height: 350px;
    padding: 0.55rem;
  }

  .book-info-panel {
    padding: 0.1rem 0;
  }

  .book-info-panel h1 {
    font-size: clamp(1.75rem, 8vw, 2.25rem);
  }

  .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-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;
}

.admin-menu-btn {
  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;
}

.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: Georgia, "Times New Roman", serif;
  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) {
  .admin-layout {
    gap: 0.65rem;
  }

  .admin-panel.search-panel {
    padding: 0.7rem;
    border-radius: 14px;
  }

  .admin-form-head,
  .admin-form-section {
    padding: 0.75rem;
    border-radius: 14px;
  }

  .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;
  }
}
