/* Card alignment — consistent internal spacing and row-wise baselines (loads after section CSS) */

:root {
  --card-body-gap: 0.25rem;
}

/* —— Book cards (all .bestsellers carousels) —— */
.book-card__body {
  gap: var(--card-body-gap);
  width: 100%;
  text-align: left;
  box-sizing: border-box;
  align-items: stretch;
}

.book-card__title {
  min-height: calc(2 * 1.35em);
}

.book-card__author {
  min-height: 1.35em;
}

.book-card__price {
  padding-top: 0.45rem;
}

/* Collection cards: structure in collections.css (uses --card-body-gap from this file) */

/* —— Quick category icons —— */
.quick-icons__grid {
  align-items: stretch;
}

.quick-icon {
  height: 100%;
  justify-content: flex-start;
  gap: 0.65rem;
  box-sizing: border-box;
}

.quick-icon__label {
  min-height: calc(2 * 1.3em);
  line-height: 1.3;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 11.5rem;
}

/* —— Poster carousel tiles —— */
.poster-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
}

.poster-card__inner {
  flex: 1 1 auto;
  min-height: 0;
}

/* —— Product page: related titles —— */
.related-grid {
  align-items: stretch;
}

.related-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
}

.related-card img {
  flex-shrink: 0;
}

.related-card__title {
  min-height: calc(2 * 1.35em);
  flex: 1 1 auto;
}

.related-card__price {
  margin-top: auto;
  margin-bottom: 0;
  padding-top: 0.4rem;
}

/* ── Book-request modal ─────────────────────────────────────────── */

@keyframes brm-in {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

.book-request-modal-open {
  overflow: hidden;
}

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

.book-request-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.book-request-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 26, 0.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.book-request-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 34rem);
  border-radius: 14px;
  background: #fff;
  color: #111827;
  box-shadow:
    0 2px 0 rgba(255,255,255,0.9) inset,
    0 32px 80px rgba(10, 14, 26, 0.28),
    0 8px 24px rgba(10, 14, 26, 0.14);
  animation: brm-in 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Brand accent strip at the top */
.book-request-modal__dialog::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, #c41e3a 0%, #e8334a 100%);
  border-radius: 14px 14px 0 0;
}

.book-request-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: inline-grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid #e5e7eb;
  border-radius: 50%;
  background: #f9fafb;
  color: #6b7280;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.book-request-modal__close:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.book-request-modal__head {
  padding: 1.5rem 1.5rem 0.75rem;
  border-bottom: 1px solid #f3f4f6;
}

.book-request-modal__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin-bottom: 0.45rem;
  color: #b90a1e;
  font: 700 0.72rem/1 "DM Sans", system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.13em;
}

.book-request-modal__eyebrow::before {
  content: "\f02d"; /* fa-book */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.8em;
}

.book-request-modal__title {
  margin: 0;
  padding-right: 2.75rem;
  color: #111827;
  font: 700 clamp(1.25rem, 3vw, 1.65rem)/1.2 "Playfair Display", serif;
}

.book-request-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding: 1.25rem 1.5rem 1.5rem;
}

.book-request-form__field {
  display: grid;
  gap: 0.4rem;
}

.book-request-form__field--full,
.book-request-form__status,
.book-request-form__actions {
  grid-column: 1 / -1;
}

.book-request-form label {
  color: #374151;
  font: 700 0.8rem/1.2 "DM Sans", system-ui, sans-serif;
  letter-spacing: 0.01em;
}

.book-request-form input,
.book-request-form textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  color: #111827;
  background: #faf9f7;
  font: 400 0.9375rem/1.4 "DM Sans", system-ui, sans-serif;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.book-request-form input::placeholder,
.book-request-form textarea::placeholder {
  color: #9ca3af;
}

.book-request-form input:hover,
.book-request-form textarea:hover {
  border-color: #b5b2ab;
  background: #fff;
}

.book-request-form input:focus,
.book-request-form textarea:focus {
  outline: none;
  border-color: #c41e3a;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.14);
}

.book-request-form textarea {
  resize: vertical;
}

/* Phone field context override — match auth-form sizing */
.book-request-form__field .phone-field {
  width: 100%;
  min-height: 46px;
}

.book-request-form__field .phone-field .phone-prefix__btn {
  min-height: 44px;
  border-radius: 10px 0 0 10px;
  border-right-color: #d1d5db;
  background: #f3f4f6;
}

.book-request-form__field .phone-field .phone-prefix__btn:hover {
  background: #e9eaec;
}

.book-request-form__field .phone-field input[type="tel"] {
  min-height: 44px;
  padding: 0.7rem 0.9rem;
  border-radius: 0 10px 10px 0;
  border-color: #d1d5db;
  background: #faf9f7;
  font-size: 0.9375rem;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.book-request-form__status {
  display: flex;
  align-items: center;
  gap: 0.45em;
  min-height: 1.4rem;
  margin: 0;
  color: #15803d;
  font: 600 0.86rem/1.3 "DM Sans", system-ui, sans-serif;
}

.book-request-form__status:not(:empty)::before {
  content: "\f00c"; /* fa-check */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.8em;
  flex-shrink: 0;
}

.book-request-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  padding-top: 0.25rem;
}

.book-request-form__cancel,
.book-request-form__submit {
  border-radius: 9px;
  padding: 0.72rem 1.2rem;
  font: 700 0.85rem/1 "DM Sans", system-ui, sans-serif;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s, box-shadow 0.18s;
}

.book-request-form__cancel {
  border: 1px solid #d1d5db;
  background: transparent;
  color: #4b5563;
}

.book-request-form__cancel:hover {
  border-color: #9ca3af;
  background: #f3f4f6;
  color: #111827;
}

.book-request-form__submit {
  border: 0;
  background: linear-gradient(135deg, #c41e3a 0%, #a8152e 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(196, 30, 58, 0.28);
}

.book-request-form__submit:hover {
  background: linear-gradient(135deg, #d42040 0%, #b91c35 100%);
  box-shadow: 0 4px 14px rgba(196, 30, 58, 0.36);
}

/* Dark mode */
[data-theme="dark"] .book-request-modal__backdrop {
  background: rgba(4, 8, 18, 0.72);
}

[data-theme="dark"] .book-request-modal__dialog {
  background: #1a1f2e;
  color: #e7e9ee;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.55),
    0 8px 24px rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(231, 233, 238, 0.1);
}

[data-theme="dark"] .book-request-modal__dialog::before {
  background: linear-gradient(90deg, #c41e3a 0%, #e8334a 100%);
}

[data-theme="dark"] .book-request-modal__head {
  border-bottom-color: rgba(231, 233, 238, 0.1);
}

[data-theme="dark"] .book-request-modal__title {
  color: #f2f4f7;
}

[data-theme="dark"] .book-request-modal__close {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(231, 233, 238, 0.18);
  color: rgba(231, 233, 238, 0.7);
}

[data-theme="dark"] .book-request-modal__close:hover {
  background: rgba(196, 30, 58, 0.15);
  border-color: rgba(196, 30, 58, 0.45);
  color: #ff7a8c;
}

[data-theme="dark"] .book-request-form label {
  color: rgba(231, 233, 238, 0.88);
}

[data-theme="dark"] .book-request-form input,
[data-theme="dark"] .book-request-form textarea {
  border-color: rgba(231, 233, 238, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: #e7e9ee;
}

[data-theme="dark"] .book-request-form input::placeholder,
[data-theme="dark"] .book-request-form textarea::placeholder {
  color: rgba(231, 233, 238, 0.4);
}

[data-theme="dark"] .book-request-form input:hover,
[data-theme="dark"] .book-request-form textarea:hover {
  border-color: rgba(231, 233, 238, 0.28);
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .book-request-form input:focus,
[data-theme="dark"] .book-request-form textarea:focus {
  border-color: #c41e3a;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.22);
}

[data-theme="dark"] .book-request-form__field .phone-field .phone-prefix__btn {
  background: rgba(255, 255, 255, 0.06);
  border-right-color: rgba(231, 233, 238, 0.18);
  color: rgba(231, 233, 238, 0.75);
}

[data-theme="dark"] .book-request-form__field .phone-field .phone-prefix__btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .book-request-form__field .phone-field input[type="tel"] {
  border-color: rgba(231, 233, 238, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: #e7e9ee;
}

[data-theme="dark"] .book-request-form__cancel {
  border-color: rgba(231, 233, 238, 0.2);
  background: transparent;
  color: rgba(231, 233, 238, 0.8);
}

[data-theme="dark"] .book-request-form__cancel:hover {
  border-color: rgba(231, 233, 238, 0.32);
  background: rgba(255, 255, 255, 0.07);
  color: #e7e9ee;
}

[data-theme="dark"] .book-request-form__status {
  color: #4ade80;
}

@media (max-width: 540px) {
  .book-request-form {
    grid-template-columns: 1fr;
  }

  .book-request-form__actions {
    flex-direction: column-reverse;
  }

  .book-request-form__cancel,
  .book-request-form__submit {
    width: 100%;
    text-align: center;
  }
}

/* ── Feature badges on book cards ─────────────────────────── */
.book-card__features {
  display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .45rem;
  position: relative; z-index: 2; /* above the whole-card link overlay */
}
.book-card__feature {
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; position: relative; z-index: 2;
}
.book-card__feature img {
  width: 1.5rem; height: 1.5rem; border-radius: 50%; object-fit: cover;
  border: 1px solid #ece4d0; background: #fff; transition: border-color .15s;
}
.book-card__feature:hover img { border-color: #c9a227; }
.book-card__feature i { font-size: 1.05rem; color: #6b5d3e; }
/* Image-only: the feature name stays as the link title for accessibility, but is visually hidden */
.book-card__feature span { display: none; }

/* ── Clickable author link ────────────────────────────────── */
/* Sit above the absolute .book-card__link overlay so the name is clickable. */
.book-card__author .author-link,
a.author-link {
  position: relative; z-index: 2;
  color: inherit; text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
.book-card__author .author-link:hover,
a.author-link:hover { color: #c41e3a; border-bottom-color: currentColor; }
/* Keep the rest of the author line (non-link text) passing clicks to the card */
.book-card__author { position: relative; z-index: 2; pointer-events: none; }
.book-card__author .author-link { pointer-events: auto; }
