* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  max-width: 100%;
}

body { overflow-x: hidden; }

body {
  font-family: "Noto Serif Bengali", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, serif;
  line-height: 1.6;
  color: #222;
  background-color: #f5f4f1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ── */
.site-header {
  background-color: #fff;
  border-bottom: 1px solid #e8e5e0;
  padding: 0.55rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 900;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-logo {
  display: block;
  line-height: 0;
}

.brand-logo img {
  display: block;
  width: 120px;
  height: auto;
}

/* ── Hero WhatsApp CTA ── */
.hero-contact {
  margin-top: 0.65rem;
}

.btn-whatsapp-hero {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  background: #25D366;
  color: #fff;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-family: inherit;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, box-shadow 0.2s;
}

.btn-whatsapp-hero:hover {
  background: #20bd5a;
  box-shadow: 0 2px 8px rgba(37,211,102,0.25);
}

/* ── Hero quick filters ── */
.quick-filters {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.85rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  max-width: 100%;
}

.quick-filters::-webkit-scrollbar { display: none; }
.quick-filters[hidden] { display: none; }

.hero-pill {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border: 1px solid #d8d4cf;
  border-radius: 9999px;
  background: #fafaf7;
  color: #555;
  font-size: 0.88rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.hero-pill:hover, .hero-pill:focus {
  border-color: #b0aca6;
  background: #f0edea;
  color: #333;
}

.hero-pill.active {
  background: #1a2744;
  border-color: #1a2744;
  color: #fff;
  box-shadow: 0 1px 6px rgba(26,39,68,0.2);
}

.pill-label {
  font-weight: 500;
}

.pill-count {
  font-size: 0.72rem;
  font-weight: 600;
  color: #999;
  background: rgba(0,0,0,0.06);
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  line-height: 1;
}

.hero-pill.active .pill-count {
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.18);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.brand-main {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.75);
  margin-top: 0.15rem;
}

.brand-tagline {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.55);
  margin-top: 0.35rem;
}

/* ── Main ── */
.container {
  max-width: 1280px;
  width: 90%;
  margin: 0 auto;
  padding: 2.5rem 0;
  flex: 1;
}

/* ── Page heading ── */
.page-heading {
  margin-bottom: 2rem;
}

.page-heading h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a2744;
  margin-bottom: 0.3rem;
}

.page-heading p {
  font-size: 1rem;
  color: #666;
}

/* ── Toolbar ── */
.toolbar {
  margin-bottom: 1.5rem;
}

.toolbar-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.toolbar-row + .toolbar-row {
  margin-top: 0.75rem;
}

.toolbar-meta {
  justify-content: space-between;
}

.search-box {
  flex: 1;
  min-width: 0;
}

.search-box input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: inherit;
  color: #333;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}

.search-box input:focus {
  border-color: #1a2744;
}

.toolbar-selects {
  display: flex;
  gap: 0.5rem;
}

.toolbar-selects select {
  padding: 0.6rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: inherit;
  color: #333;
  background: #fff;
  cursor: pointer;
  outline: none;
  max-width: 220px;
}

.toolbar-selects select:focus {
  border-color: #1a2744;
}

.result-count {
  font-size: 0.88rem;
  color: #666;
}

.btn-clear {
  padding: 0.45rem 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  color: #666;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-clear:hover {
  border-color: #999;
  color: #333;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  margin-top: 2.5rem;
}

.page-btn {
  padding: 0.5rem 0.8rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  color: #444;
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
  min-width: 2.4rem;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.page-btn:hover:not(:disabled) {
  border-color: #1a2744;
  background: #f4f6f9;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.page-active {
  background: #1a2744;
  color: #fff;
  border-color: #1a2744;
}

.page-active:hover {
  background: #1a2744;
  color: #fff;
}

.page-prev,
.page-next {
  font-weight: 500;
}

/* ── Book grid ── */
.book-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

@media (min-width: 1500px) {
  .book-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 1024px) {
  .book-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .book-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

/* ── Book card ── */
.book-card {
  background: #fff;
  border: 1px solid #e4e0db;
  border-radius: 5px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s ease;
}

.book-card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

.card-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  background: #f0edeb;
  overflow: hidden;
}

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

.card-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
}

/* Binding badge on cover */
.binding-badge {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  background: rgba(26,39,68,0.85);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 2px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Stock badge on cover */
.stock-badge {
  position: absolute;
  bottom: 0.4rem;
  left: 0;
  right: 0;
  text-align: center;
  background: rgba(192,57,43,0.88);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.25rem 0;
}

.stock-badge.backorder { background: rgba(230,126,34,0.88); }

/* Card action area */
.card-actions {
  padding: 0 0.75rem 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.card-actions .qty-btn {
  width: 1.45rem;
  height: 1.45rem;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #f9f9f9;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #444;
  font-family: inherit;
  line-height: 1;
  transition: border-color 0.15s;
  flex-shrink: 0;
}

.card-actions .qty-btn:hover:not(:disabled) { border-color: #1a2744; }
.card-actions .qty-btn:disabled { opacity: 0.4; cursor: default; }

.card-actions .qty-val {
  font-size: 0.82rem;
  font-weight: 600;
  min-width: 1.5rem;
  text-align: center;
  flex-shrink: 0;
}

.btn-card-cart {
  flex: 1;
  min-width: 0;
  padding: 0.38rem 0.5rem;
  background: #1a2744;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.78rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-card-cart:hover:not(:disabled) { background: #253b5e; }
.btn-card-cart:disabled { background: #bbb; cursor: default; }
.btn-card-cart.in-cart {
    background: #2d6a4f;
}
.btn-card-cart.in-cart:hover:not(:disabled) {
    background: #1b4332;
}
.btn-card-cart.in-cart:disabled {
    background: #2d6a4f;
    cursor: default;
    opacity: 0.85;
}

/* Modal quantity */
.modal-qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.modal-qty .qty-btn {
  width: 1.8rem;
  height: 1.8rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #f9f9f9;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #444;
  font-family: inherit;
  line-height: 1;
}

.modal-qty .qty-btn:hover:not(:disabled) { border-color: #1a2744; }
.modal-qty .qty-btn:disabled { opacity: 0.4; cursor: default; }
.modal-qty .qty-val { font-size: 1rem; font-weight: 600; min-width: 2rem; text-align: center; }
.modal-qty-label { font-size: 0.85rem; color: #777; }

.modal-profit-note {
  font-size: 0.75rem;
  color: #999;
  margin-top: 0.35rem;
}


.card-body {
  padding: 0.7rem 0.75rem 0.55rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  color: #1a2744;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 1.35em;
}

.card-author {
  font-size: 0.8rem;
  color: #555;
  line-height: 1.35;
}

.card-publisher {
  font-size: 0.75rem;
  color: #888;
}

.card-meta {
  font-size: 0.75rem;
  color: #999;
  line-height: 1.4;
}

/* ── Pricing panel ── */
.card-price {
  margin-top: auto;
  padding-top: 0.25rem;
}

.pricing-panel {
  width: 100%;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid #e4e0db;
}

.pricing-row {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.38rem 0.55rem;
  position: relative;
}

.pricing-reg { background: #fff; }

.pricing-partner {
  background: #E9F6EC;
  border-top: 1px solid #d4e8d8;
  border-bottom: 1px solid #d4e8d8;
}

.pricing-profit { background: #FFF6E5; }

/* Icon circles */
.pr-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.pr-icon-navy { background: #1D2A44; }
.pr-icon-green { background: #1E7A33; }
.pr-icon-gold { background: #B97A00; }

.pr-icon svg { width: 14px; height: 14px; }

/* Text block */
.pr-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.pr-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #1D2A44;
  line-height: 1.25;
}

.pr-label-green { color: #1E7A33; }
.pr-label-gold { color: #B97A00; }

.pr-explanation {
  font-size: 0.6rem;
  color: #888;
  line-height: 1.25;
}

/* Price block for partner row */
.pr-price-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}

/* Divider before partner price */
.pr-divider {
  width: 1px;
  height: 32px;
  background: #c4decb;
  flex-shrink: 0;
  align-self: center;
}

/* Price values */
.pr-price {
  font-size: 0.78rem;
  font-weight: 600;
  color: #555;
  white-space: nowrap;
  flex-shrink: 0;
  text-align: right;
}

.pr-price-lg { font-size: 0.95rem; font-weight: 700; }
.pr-price-gold { color: #B97A00; font-size: 0.85rem; font-weight: 700; }

/* Discount text in partner row */
.pricing-partner .discount-badge {
  display: block;
  font-size: 0.6rem;
  color: #1E7A33;
  font-weight: 600;
  margin-top: 0.05rem;
  background: none;
  padding: 0;
  border-radius: 0;
  position: static;
}

@media (max-width: 640px) {
  .pricing-row { padding: 0.35rem 0.45rem; gap: 0.35rem; }
  .pr-icon { width: 26px; height: 26px; }
  .pr-icon svg { width: 13px; height: 13px; }
  .pr-label { font-size: 0.68rem; }
  .pr-explanation { font-size: 0.58rem; }
  .pr-price { font-size: 0.72rem; }
  .pr-price-lg { font-size: 0.85rem; }
  .pr-price-gold { font-size: 0.78rem; }
  .pricing-partner .discount-badge { font-size: 0.52rem; }
}

/* ── Loading skeleton ── */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

@media (min-width: 1500px) {
  .skeleton-grid { grid-template-columns: repeat(5, 1fr); }
}

@media (max-width: 1024px) {
  .skeleton-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
  .skeleton-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
}

.skeleton-card {
  background: #fff;
  border: 1px solid #e8e5e0;
  border-radius: 4px;
  overflow: hidden;
}

.skeleton-cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  background: #e8e5e0;
  animation: pulse 1.4s ease-in-out infinite;
}

.skeleton-body {
  padding: 0.9rem 0.85rem 0.85rem;
}

.skeleton-line {
  height: 0.85rem;
  background: #e8e5e0;
  border-radius: 3px;
  margin-bottom: 0.55rem;
  animation: pulse 1.4s ease-in-out infinite;
}

.skeleton-line:last-child { margin-bottom: 0; }
.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Error / Empty ── */
.state-message {
  text-align: center;
  padding: 3rem 1rem;
  color: #666;
}

.state-message h2 {
  font-size: 1.2rem;
  color: #444;
  margin-bottom: 0.5rem;
}

.state-message p {
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.btn-retry {
  display: inline-block;
  padding: 0.55rem 1.5rem;
  background: #1a2744;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.btn-retry:hover {
  background: #253b5e;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-dialog {
  background: #fff;
  border-radius: 6px;
  max-width: 820px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 2.25rem 2.25rem 2rem;
  box-shadow: 0 4px 32px rgba(0,0,0,0.15);
}

.modal-close {
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: #888;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.modal-close:hover {
  color: #333;
  background: #f0f0f0;
}

.modal-body {
  display: flex;
  gap: 2.25rem;
}

.modal-cover {
  flex-shrink: 0;
  width: 240px;
}

.modal-cover img {
  width: 100%;
  border-radius: 4px;
  display: block;
}

.modal-cover .card-cover-placeholder {
  aspect-ratio: 2 / 3;
  border-radius: 4px;
}

.modal-info {
  flex: 1;
  min-width: 0;
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1a2744;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.modal-author {
  font-size: 0.95rem;
  color: #444;
  margin-bottom: 0.15rem;
}

.modal-publisher {
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 0.65rem;
}

.modal-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  font-size: 0.82rem;
  color: #888;
  margin-bottom: 0.5rem;
}

.modal-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.modal-cat {
  font-size: 0.75rem;
  background: #f0f0f0;
  color: #555;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
}

.modal-price {
  margin-top: 0.25rem;
  margin-bottom: 1rem;
}

.modal-description {
  font-size: 0.9rem;
  line-height: 1.7;
  color: #444;
  border-top: 1px solid #eee;
  padding-top: 1rem;
  margin-top: 0.25rem;
}

.modal-description p {
  margin-bottom: 0.6rem;
}

.modal-description p:last-child {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .modal-dialog {
    max-width: none;
    max-height: 92vh;
    border-radius: 8px 8px 0 0;
    padding: 1.5rem 1.25rem 1.25rem;
  }

  .modal-body {
    flex-direction: column;
    gap: 1rem;
  }

  .modal-cover {
    width: 160px;
    margin: 0 auto;
  }

  .modal-title {
    font-size: 1.15rem;
  }
}

/* ── Cart indicator ── */
.cart-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  color: #333;
  padding: 0.45rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  transition: background 0.15s;
}

.cart-indicator:hover {
  background: #ebebeb;
}

.cart-icon {
  font-size: 1.1rem;
}

.cart-label {
  font-weight: 500;
}

.cart-count {
  background: #e74c3c;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 1.35rem;
  height: 1.35rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.25rem;
}

/* ── Add to cart button ── */
.btn-add-cart {
  display: inline-block;
  width: 100%;
  padding: 0.65rem 1rem;
  background: #1a2744;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.92rem;
  font-family: inherit;
  cursor: pointer;
  margin-top: 0.75rem;
  transition: background 0.15s;
}

.btn-add-cart:hover {
  background: #253b5e;
}

.btn-add-cart:disabled {
  background: #5a8a5a;
  cursor: default;
}

.modal-outofstock {
  font-size: 0.88rem;
  color: #c0392b;
  margin-top: 0.75rem;
  font-weight: 500;
}

/* ── Cart modal ── */
.cart-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1001;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.cart-modal-overlay[hidden] {
  display: none;
}

.cart-modal {
  background: #fff;
  width: 420px;
  max-width: 100%;
  height: 100vh;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  box-shadow: -2px 0 24px rgba(0,0,0,0.12);
}

.cart-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #888;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
}

.cart-modal-close:hover {
  color: #333;
  background: #f0f0f0;
}

.cart-heading {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1a2744;
  margin-bottom: 1.25rem;
  padding-right: 2rem;
}

/* ── Cart items ── */
.cart-items {
  flex: 1;
}

.cart-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid #eee;
  position: relative;
}

.cart-item-img {
  width: 52px;
  height: 78px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cart-item-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1a2744;
  line-height: 1.3;
}

.cart-item-author {
  font-size: 0.75rem;
  color: #777;
}

.cart-item-price {
  font-size: 0.82rem;
  color: #888;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.15rem;
}

.qty-btn {
  width: 1.6rem;
  height: 1.6rem;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #f9f9f9;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #444;
  font-family: inherit;
  line-height: 1;
  transition: border-color 0.15s;
}

.qty-btn:hover {
  border-color: #1a2744;
}

.qty-val {
  font-size: 0.88rem;
  font-weight: 600;
  min-width: 1.5rem;
  text-align: center;
}

.cart-item-sub {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1a2744;
  margin-top: 0.2rem;
}

.cart-item-remove {
  position: absolute;
  top: 0.75rem;
  right: 0;
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #bbb;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem 0.3rem;
}

.cart-item-remove:hover {
  color: #c0392b;
}

/* ── Cart empty ── */
.cart-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #888;
  gap: 0.5rem;
}

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

.cart-empty p {
  font-size: 1rem;
}

.cart-empty-hint {
  font-size: 0.85rem !important;
  color: #aaa;
}

/* ── Cart footer ── */
.cart-footer {
  border-top: 1px solid #ddd;
  padding-top: 1rem;
  margin-top: 0.5rem;
}

.cart-summary {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.88rem;
  color: #555;
}

.cart-total {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a2744;
  margin-top: 0.3rem;
  padding-top: 0.4rem;
  border-top: 1px solid #eee;
}

.cart-delivery {
  font-size: 0.8rem;
  color: #2a7d2a;
  margin-top: 0.5rem;
  padding: 0.35rem 0;
  border-top: 1px solid #e8f0ea;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: #1a2744;
  color: #fff;
  padding: 0.65rem 1.5rem;
  border-radius: 4px;
  font-size: 0.88rem;
  font-family: inherit;
  z-index: 2000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
  animation: toast-in 0.25s ease;
}

.toast[hidden] {
  display: none;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(0.5rem); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@media (max-width: 640px) {
  .cart-modal {
    width: 100%;
    height: 92vh;
    margin-top: auto;
    border-radius: 8px 8px 0 0;
  }

  .cart-modal-overlay {
    align-items: flex-end;
  }
}

/* ── Order modal ── */
.order-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1002;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.order-modal-overlay[hidden] {
  display: none;
}

.order-modal {
  background: #fff;
  border-radius: 6px;
  max-width: 540px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  padding: 2rem 2rem 1.75rem;
  box-shadow: 0 4px 32px rgba(0,0,0,0.15);
}

.order-modal-close {
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #888;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
}

.order-modal-close:hover {
  color: #333;
  background: #f0f0f0;
}

.order-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a2744;
  margin-bottom: 0.3rem;
}

.order-subtitle {
  font-size: 0.9rem;
  color: #777;
  margin-bottom: 1.25rem;
}

/* ── Form ── */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #444;
  margin-bottom: 0.35rem;
}

.form-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: inherit;
  color: #333;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus {
  border-color: #1a2744;
}

.form-input.error {
  border-color: #c0392b;
}

.form-textarea {
  resize: vertical;
  min-height: 3rem;
}

.form-error {
  display: block;
  font-size: 0.78rem;
  color: #c0392b;
  margin-top: 0.3rem;
}

.form-error[hidden] {
  display: none;
}

/* ── Buttons ── */
.btn-proceed {
  display: block;
  width: 100%;
  padding: 0.7rem 1rem;
  background: #1a2744;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.75rem;
  transition: background 0.15s;
}

.btn-proceed:hover {
  background: #253b5e;
}

.btn-review {
  margin-top: 0.25rem;
}

.btn-secondary {
  padding: 0.6rem 1.25rem;
  background: #f0f0f0;
  color: #555;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-secondary:hover {
  background: #e4e4e4;
}

/* ── Review ── */
.review-block {
  margin-bottom: 1.25rem;
}

.review-section-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.review-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.review-info-row {
  display: flex;
  gap: 0.5rem;
  font-size: 0.88rem;
}

.review-info-label {
  color: #888;
  min-width: 5.5rem;
  flex-shrink: 0;
}

.review-info-value {
  color: #333;
}

.review-books {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.review-book-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.88rem;
}

.review-book-title {
  color: #333;
  flex: 1;
}

.review-book-qty {
  color: #888;
  white-space: nowrap;
}

.review-book-sub {
  color: #1a2744;
  font-weight: 600;
  white-space: nowrap;
}

.review-totals {
  margin: 1rem 0;
  padding: 0.75rem 0;
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
  font-size: 0.9rem;
  color: #555;
}

.review-totals-row {
  display: flex;
  justify-content: space-between;
  padding: 0.15rem 0;
}

.review-total {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a2744;
}

.review-discount {
  font-size: 0.8rem;
  color: #2a7d2a;
  margin: 0.5rem 0 1rem;
  font-weight: 500;
}

.review-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.review-actions .btn-proceed {
  flex: 1;
}

@media (max-width: 640px) {
  .order-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .order-modal {
    max-width: none;
    max-height: 92vh;
    border-radius: 8px 8px 0 0;
    padding: 1.5rem 1.25rem 1.25rem;
  }

  .review-actions {
    flex-direction: column;
  }
}

/* ── Footer ── */
.site-footer {
  background-color: #1a2744;
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: 0.82rem;
  line-height: 1.8;
}

.footer-content { max-width: 600px; margin: 0 auto; }

.footer-name { font-size: 1rem; font-weight: 700; color: #fff; margin-bottom: 0.5rem; }
.footer-address { font-size: 0.82rem; color: rgba(255,255,255,0.6); margin-bottom: 0.3rem; }
.footer-phone { font-size: 0.85rem; color: rgba(255,255,255,0.7); margin-bottom: 0.3rem; }
.footer-trade { font-size: 0.75rem; color: rgba(255,255,255,0.45); margin-bottom: 0.5rem; }
.footer-copy { font-size: 0.78rem; color: rgba(255,255,255,0.5); margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid rgba(255,255,255,0.1); }
.footer-love { font-size: 0.75rem; color: rgba(255,255,255,0.45); margin-top: 0.3rem; }

/* ── Lazy-load sentinel ── */
.catalog-sentinel {
  text-align: center;
  padding: 1.5rem 0;
  font-size: 0.85rem;
  color: #888;
}

.catalog-sentinel[hidden] { display: none; }

.sentinel-loader { color: #888; }
.sentinel-end { color: #aaa; font-size: 0.8rem; }

.sentinel-loader[hidden] { display: none; }
.sentinel-end[hidden] { display: none; }

/* ── Responsive adjustments ── */
@media (max-width: 640px) {
  .site-header {
    padding: 0.45rem 1rem;
  }

  .brand-logo img {
    width: 100px;
  }

  .container {
    width: 94%;
    padding: 1.5rem 0;
  }

  .page-heading h1 {
    font-size: 1.4rem;
  }

  .page-heading p {
    font-size: 0.9rem;
  }

  .card-title {
    font-size: 0.88rem;
  }

  .card-body {
    padding: 0.6rem 0.65rem 0.5rem;
  }

  .toolbar-selects {
    flex-wrap: wrap;
    width: 100%;
  }

  .toolbar-selects select {
    flex: 1;
    min-width: 130px;
    max-width: none;
  }

  .result-count {
    font-size: 0.82rem;
  }
}

@media (max-width: 360px) {
  .book-grid {
    gap: 0.65rem;
  }

  .card-title {
    font-size: 0.8rem;
  }
}