/* App-level tweaks only. Prefer Bootstrap utilities in markup. */

.offcanvas-start {
  --bs-offcanvas-width: 85vw;
}

.navbar-brand-logo {
  height: 36px;
  width: auto;
  max-width: min(200px, 48vw);
  display: block;
  object-fit: contain;
}

.footer-brand-logo {
  height: 40px;
  width: auto;
  max-width: 220px;
  display: block;
  object-fit: contain;
}

.header-search {
  max-width: 520px;
}

.header-search .form-control:focus {
  box-shadow: none;
}

.header-search-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 1080;
  max-height: min(70vh, 420px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--color-border, #ddd);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.1);
  padding: 6px;
}

.header-search-suggest-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 8px 10px;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.header-search-suggest-item:hover,
.header-search-suggest-item.is-active {
  background: #f3f1ea;
}

.header-search-suggest-cover {
  width: 36px;
  height: 54px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
  background: #eee;
}

.header-search-suggest-copy {
  min-width: 0;
  flex: 1;
}

.header-search-suggest-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
}

.header-search-suggest-meta {
  display: block;
  margin-top: 2px;
  font-size: 0.8rem;
  color: var(--color-text-muted, #6c757d);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-search-suggest-empty {
  padding: 12px 10px;
  font-size: 0.9rem;
  color: var(--color-text-muted, #6c757d);
}

.header-search-submit {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  transition: width 0.2s ease, height 0.2s ease;
}

/*
  Fixed site header (sticky fails when body uses overflow-x:hidden).
  Offset page content via #main — body padding is unreliable with d-flex.
*/
body {
  overflow-x: visible;
}

#main {
  overflow-x: hidden;
  padding-top: var(--site-header-offset, 72px);
}

site-footer {
  overflow-x: hidden;
}

html[data-theme] .site-header,
.site-header {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: auto !important;
  min-height: 0;
  display: block;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  overflow: visible !important;
  border-bottom: none;
  background: #eae9df !important; /* match footer ivory */
  box-shadow: none;
  z-index: 1040;
}

.site-header .navbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  width: 100%;
  font-size: inherit;
  background: #eae9df;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  transition: padding 0.2s ease;
}

.site-header .navbar .container {
  display: flex;
  flex-wrap: inherit;
  align-items: center;
  justify-content: space-between;
}

.site-header.is-scrolled .navbar {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.site-header.is-scrolled .navbar-brand {
  font-size: 19px;
}

.site-header.is-scrolled .header-search-submit {
  width: 40px;
  height: 40px;
}

html {
  scroll-padding-top: 88px;
}

/* Site chrome uses the same typeface as the storefront. */
.navbar,
.navbar .navbar-brand,
.navbar .nav-link,
.navbar .offcanvas-title,
.header-search .form-control {
  font-family: var(--font-heading) !important;
}

.navbar .nav-link {
  font-size: 15px;
}

.navbar .navbar-brand {
  font-size: 21px;
  font-weight: 400;
  transition: font-size 0.2s ease;
}

@media (min-width: 992px) {
  .site-header .navbar {
    flex-wrap: nowrap;
  }

  .site-header .offcanvas {
    flex-grow: 1;
    width: auto !important;
  }

  /* Bootstrap sets flex-grow:0 here; grow so search + links span the bar. */
  .site-header .offcanvas-body {
    flex-grow: 1 !important;
    width: 100%;
    align-items: center;
    flex-wrap: nowrap;
  }

  .site-header .header-search {
    flex: 1 1 auto;
    width: auto;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Desktop bar uses the account dropdown; hide offcanvas title chrome. */
  .site-header .offcanvas-header {
    display: none;
  }
}

@media (max-width: 991.98px) {
  .site-header .offcanvas-body .navbar-nav .nav-link {
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
  }
}

/* Stop old home.css from hiding the whole Bootstrap navbar under 900px. */
@media (max-width: 900px) {
  .site-header .navbar {
    display: flex !important;
    position: static;
    top: auto;
    left: auto;
    right: auto;
    background: var(--color-background);
    padding: 0.5rem 0;
    border: 0;
    z-index: auto;
  }
}

/* Mobile: keep fixed header; spacing via Bootstrap utilities in markup. */
@media (max-width: 767px) {
  html[data-theme] .site-header,
  .site-header {
    position: fixed !important;
    height: auto !important;
    background: #eae9df !important; /* match footer ivory */
    box-shadow: none;
  }

  .site-header .navbar {
    background: #eae9df !important;
  }
}

/*
  Global country + Country default theme = Ivory Editorial.
  Original design shows categories as a compact 4-column index (not the arched carousel).
*/
html[data-theme="ivory"] #categories .category-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: visible;
  gap: 0;
  padding: 0;
  scroll-snap-type: none;
}

html[data-theme="ivory"] #categories .category-card {
  display: flex;
  flex: none;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  width: auto;
  min-height: 72px;
  padding: 12px;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  background: var(--color-surface, #ffffff);
  text-align: left;
  transform: none;
  color: inherit;
  text-decoration: none;
}

html[data-theme="ivory"] #categories .category-card:hover {
  background: var(--theme-soft, #f5f5f5);
  border-color: var(--color-accent, #967348);
  transform: none;
  box-shadow: none;
}

html[data-theme="ivory"] #categories .category-emblem {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border: 0;
  box-shadow: none;
  flex-shrink: 0;
}

html[data-theme="ivory"] #categories .category-emblem img,
html[data-theme="ivory"] #categories .category-emblem svg {
  width: 32px;
  height: 32px;
  display: block;
}

html[data-theme="ivory"] #categories .category-card > span:nth-child(2) {
  font-size: 16px;
  line-height: 1.45;
  max-width: none;
}

html[data-theme="ivory"] #categories .category-card i {
  display: none;
}

html[data-theme="ivory"] #categories #category-prev,
html[data-theme="ivory"] #categories #category-next {
  display: none;
}

@media (max-width: 1199px) {
  html[data-theme="ivory"] #categories .category-track {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 767px) {
  html[data-theme="ivory"] #categories .category-track {
    grid-template-columns: 1fr 1fr;
  }

  html[data-theme="ivory"] #categories .category-card {
    min-height: 70px;
    padding: 10px 4px;
    gap: 8px;
  }

  html[data-theme="ivory"] #categories .category-card > span:nth-child(2) {
    font-size: 11px;
  }
}

/* Original design footer (shared shell) */
site-footer {
  display: block;
  margin-top: auto;
}

site-footer footer {
  background: #eae9df;
  padding-top: 56px;
  color: var(--color-text, #242522);
  font-family: Arial, Helvetica, sans-serif;
}

site-footer .wrap {
  width: calc(100% - 96px);
  max-width: var(--content, 1280px);
  margin-inline: auto;
}

site-footer .footer-top {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 30px;
  padding-bottom: 40px;
}

site-footer .footer-brand .brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font: 25px Georgia, "Times New Roman", serif;
  letter-spacing: -0.7px;
  color: inherit;
  text-decoration: none;
}

site-footer .footer-brand p {
  font: 22px/1.4 Georgia, "Times New Roman", serif;
  margin: 20px 0;
  color: var(--color-text-muted, #686860);
}

site-footer .footer-brand > span {
  font-size: 12px;
  letter-spacing: 1px;
}

site-footer .social-links {
  display: flex;
  gap: 9px;
  margin-top: 18px;
  color: var(--color-primary, #263d35);
}

site-footer .social-links button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid #b9bdab;
  border-radius: 50%;
  background: none;
  padding: 0;
  color: inherit;
}

site-footer .social-links button:disabled {
  opacity: 0.7;
  cursor: default;
}

site-footer .social-links svg {
  width: 19px;
  height: 19px;
}

site-footer .footer-column h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 17px;
}

site-footer .footer-column button,
site-footer .footer-column a {
  display: block;
  text-align: left;
  color: #656b60;
  font-size: 14px;
  min-height: 38px;
  padding-block: 6px;
  line-height: 1.5;
  background: none;
  border: 0;
  text-decoration: none;
}

site-footer .footer-column button:hover,
site-footer .footer-column a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

site-footer .footer-bottom {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #d4d7c8;
  padding-block: 20px;
  font-size: 13px;
  color: #626b5e;
}

site-footer .footer-bottom a {
  color: inherit;
  text-decoration: none;
}

site-footer .footer-bottom a:hover {
  text-decoration: underline;
}

@media (max-width: 1199px) {
  site-footer .footer-top {
    gap: 20px;
    grid-template-columns: 1.3fr repeat(4, 1fr);
  }
}

@media (max-width: 900px) {
  site-footer .footer-top {
    grid-template-columns: repeat(4, 1fr);
  }

  site-footer .footer-brand {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}

@media (max-width: 767px) {
  site-footer .wrap {
    width: calc(100% - 36px);
  }

  site-footer .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  site-footer .footer-brand {
    display: block;
  }

  site-footer .footer-brand p {
    margin: 12px 0;
  }

  site-footer .footer-brand > span {
    display: none;
  }

  site-footer .footer-bottom {
    flex-wrap: wrap;
    gap: 15px;
  }

  site-footer .footer-bottom > span:nth-child(2) {
    display: none;
  }
}

@media (max-width: 359px) {
  site-footer .wrap {
    width: calc(100% - 28px);
  }
}

a.book-card {
  color: inherit;
  text-decoration: none;
}

/* Book tiles — Bootstrap col stretch + flex-fill / mt-auto pins footer */
.book-card,
a.book-card {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: 100% !important;
  height: auto !important;
  min-height: 100%;
  box-sizing: border-box;
  background: #f5f5f5 !important;
  border: 1px solid var(--color-border) !important;
  border-radius: 10px;
  padding: 12px 0 12px !important;
  overflow: hidden;
  box-shadow: none;
  transform: translateY(0);
  transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  cursor: pointer;
}

.book-card:hover,
.book-card:focus-within,
a.book-card:hover,
a.book-card:focus-within {
  background: #f5f5f5 !important;
  border: 1px solid var(--color-border) !important;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1) !important;
  transform: translateY(-4px) !important;
}

.book-card:after,
a.book-card:after {
  display: none !important;
}

.book-card .book-card-main {
  display: block;
  color: inherit;
  text-decoration: none;
}

.book-card .book-card-main h3,
.book-card .book-card-main p {
  margin-left: 12px;
  margin-right: 12px;
}

.book-card .book-card-top {
  min-height: 0;
}

.book-card .book-card-oneliner-wrap {
  margin: 0 12px;
  position: relative;
  z-index: 2;
  cursor: pointer;
}

.book-card .book-card-oneliner {
  font-size: 14px;
  line-height: 1.45;
}

.book-card .book-card-oneliner-more,
.book-card .book-card-oneliner-less {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  color: var(--color-primary, #263d35);
  font: 14px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.book-card .book-card-footer {
  width: 100%;
  position: relative;
  z-index: 2;
}

.book-card .book-bottom {
  position: relative;
  z-index: 2;
  margin-left: 12px;
  margin-right: 12px;
  flex-wrap: nowrap !important;
}

.book-card .book-bottom .price-group {
  flex: 1 1 auto;
  min-width: 0;
}

.price-group .mrp,
.book-bottom .mrp,
del.mrp {
  color: #c62828;
}

.price-incl-gst,
.find-next-price-gst {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--color-text-muted, #5c5a55);
  line-height: 1.25;
}

.book-card .book-card-footer {
  flex-shrink: 0;
}

.book-card .book-lang-pills-slot {
  position: relative;
  z-index: 3;
  min-height: 2.5rem;
  margin: 8px 12px 4px;
}

.book-card .book-lang-pills {
  margin: 0;
}

/* Horizontal shelf: Bootstrap row flex-nowrap */
.book-track {
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.book-track > .book-track-item {
  scroll-snap-align: start;
}

.book-track::-webkit-scrollbar {
  display: none;
  height: 0;
}

.category-track {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-track::-webkit-scrollbar {
  display: none;
  height: 0;
}

/* Keep Bootstrap .row on collection/search grids (override legacy display:grid) */
.collection-page .collection-grid.row {
  display: flex !important;
  flex-wrap: wrap;
  grid-template-columns: none !important;
  gap: 0 !important; /* Bootstrap g-* uses padding; CSS gap breaks % column widths */
}

.collection-page .collection-grid.row > [class*="col"] {
  flex: 0 0 auto;
  width: 33.33333333%;
  max-width: 33.33333333%;
}

@media (max-width: 767.98px) {
  .collection-page .collection-grid.row > [class*="col"] {
    width: 100%;
    max-width: 100%;
  }
}

.book-card .book-lang-pill {
  font-size: 0.75rem;
  line-height: 1.3;
  padding: 0.2rem 0.7rem;
  white-space: nowrap;
}

.book-card .book-lang-pill.btn-outline-secondary {
  background: #fff;
  color: var(--color-text, #333);
  border-color: var(--color-border, #ddd);
}

.book-card .book-lang-pill.btn-outline-secondary:hover {
  background: #f3f0e7;
  border-color: var(--color-accent, #967348);
  color: var(--color-text, #333);
}

.book-card .book-lang-pill.is-active,
.book-card .book-lang-pill.btn-dark {
  background: var(--color-primary, #263d35) !important;
  border-color: var(--color-primary, #263d35) !important;
  color: #fff !important;
}

.book-card .book-card-buy,
.book-card .book-card-read,
.book-bottom > .book-card-buy,
.book-bottom > .book-card-read {
  margin-left: auto;
  min-height: 36px;
  padding: 0.35rem 0.9rem;
  font-size: 0.9rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  pointer-events: auto;
  background: #ffd47d !important;
  border: 1px solid #C4B89A !important;
  color: #4A3B26 !important;
  cursor: pointer;
  text-decoration: none !important;
}

.book-card .book-card-buy:hover,
.book-card .book-card-read:hover,
.book-bottom > .book-card-buy:hover,
.book-bottom > .book-card-read:hover {
  background: #ffcb66 !important;
  border-color: #b9ab8a !important;
  color: #4A3B26 !important;
}

.nav-cart-link {
  min-width: 2.25rem;
  justify-content: center;
}

.nav-cart-badge {
  position: absolute;
  top: 0.15rem;
  right: 0.05rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: #d64545;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.1rem;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
}

.nav-library-badge {
  min-width: 1.15rem;
  padding: 0.2em 0.45em;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
  background: var(--color-primary, #263d35);
  color: #fff;
}

/* Hide reCAPTCHA v3 badge site-wide; disclosure text is shown on auth forms/modals. */
.grecaptcha-badge {
  visibility: hidden !important;
}

.buy-payment-notice-icon {
  width: 3.25rem;
  height: 3.25rem;
  margin: 0.25rem auto 1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(38, 61, 53, 0.1);
  color: var(--color-primary, #263d35);
  font-size: 1.45rem;
}

.buy-payment-notice-icon-success {
  background: rgba(47, 107, 79, 0.14);
  color: #2f6b4f;
  font-size: 1.7rem;
}

.buy-payment-notice-sub {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--color-text-muted, #686860);
}

.buy-recaptcha-note {
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--color-text-muted, #686860);
}

.buy-recaptcha-note a {
  color: var(--color-primary, #263d35);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Auth chrome: guest vs signed-in (updated live after buy-flow login) */
body[data-signed-in="0"] [data-nav-signed],
body[data-signed-in="0"] [data-footer-signed] {
  display: none !important;
}

body[data-signed-in="1"] [data-nav-guest],
body[data-signed-in="1"] [data-footer-guest] {
  display: none !important;
}

/* Buy checkout modals — match signup panel tone */
.buy-modal .modal-dialog {
  max-width: 28rem;
}

.buy-modal-content {
  position: relative;
  border: 1px solid #e5e5e5;
  border-radius: 18px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 60% at 0% 0%, rgba(150, 115, 72, 0.06), transparent 55%),
    linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
  box-shadow: 0 24px 48px rgba(38, 61, 53, 0.16);
}

.buy-modal-content.is-google-busy {
  pointer-events: none;
}

.buy-modal-content.is-google-busy .buy-modal-close {
  pointer-events: none;
}

.buy-modal-busy {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(2px);
}

.buy-modal-busy-card {
  width: min(100%, 16.5rem);
  text-align: center;
  padding: 1.25rem 1rem;
  border-radius: 14px;
  border: 1px solid #e5e5e5;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(38, 61, 53, 0.1);
}

.buy-modal-busy-text {
  margin-top: 0.85rem;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--color-primary, #263d35);
}

.buy-modal-busy-sub {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--color-text-muted, #686860);
}

.buy-google-host {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Google signup stays locked until Terms of Use is accepted. */
.google-signup-gate {
  position: relative;
}

/* Keep Google button fully visible (match Sign in); lock is via blocker overlay only. */
.google-signup-gate.is-locked #btn_google_auth,
.google-signup-gate.is-locked .buy-google-host {
  opacity: 1;
  filter: none;
}

.google-signup-gate-hint {
  display: none;
}

.google-signup-gate.is-locked .google-signup-gate-hint {
  display: block;
}

.google-signup-gate-blocker {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: not-allowed;
}

.google-signup-gate.is-locked .google-signup-gate-blocker {
  display: block;
}

.form-check-input.terms-attention {
  outline: 2px solid var(--color-accent, #967348);
  outline-offset: 2px;
}

.buy-modal-accent {
  height: 5px;
  background: linear-gradient(90deg, #263d35 0%, #967348 55%, #c4a06a 100%);
}

.buy-modal-header {
  align-items: flex-start;
  padding: 1.35rem 1.4rem 0;
}

.buy-modal-kicker {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent, #967348);
}

.buy-modal-title {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--color-primary, #263d35);
  margin: 0;
}

.buy-modal-book {
  margin-top: 0.55rem;
  display: inline-block;
  max-width: 100%;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(38, 61, 53, 0.08);
  color: var(--color-primary, #263d35);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
}

.buy-modal-lede {
  margin: 0 0 1rem;
  color: var(--color-text-muted, #686860);
  font-size: 0.92rem;
  line-height: 1.5;
}

.buy-modal-body {
  padding: 0.75rem 1.4rem 1.5rem;
}

.buy-modal-alert {
  padding: 0.75rem 1rem;
  margin-bottom: 0.85rem;
  border-radius: 10px;
  border: 1px solid #e2b4b0;
  background: #fbf0ee;
  color: #7a2e28;
  font-size: 0.92rem;
}

.buy-label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.35rem;
}

.buy-required {
  color: #d64545;
  font-weight: 700;
  margin-left: 0.15rem;
  line-height: 1;
}

.buy-hint {
  font-size: 0.78rem;
  color: var(--color-text-muted, #686860);
}

.buy-input-wrap {
  position: relative;
}

.buy-input.form-control {
  height: 3.15rem;
  padding: 0.65rem 1rem;
  border: 1.5px solid var(--color-border, #e3ded4);
  border-radius: 10px;
  background: #fff;
  color: var(--color-text);
  font-size: 1rem;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.buy-input-wrap .buy-input {
  padding-right: 4.25rem;
}

.buy-input.form-control::placeholder {
  color: #9a968a;
}

.buy-input.form-control:hover {
  border-color: #d2cbbd;
}

.buy-input.form-control:focus {
  border-color: var(--color-primary, #263d35);
  box-shadow: 0 0 0 3px rgba(38, 61, 53, 0.14);
  background: #fff;
}

.buy-input-readonly.form-control,
.buy-input-readonly.form-control:focus {
  background: #f1eee7;
  color: var(--color-text-muted, #686860);
  border-color: #ddd6c8;
  box-shadow: none;
  cursor: default;
}

.buy-reveal {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  min-height: 2.2rem;
  padding: 0 0.7rem;
  border-radius: 7px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-primary, #263d35);
  background: transparent;
  border: 0;
}

.buy-reveal:hover,
.buy-reveal:focus-visible {
  background: rgba(38, 61, 53, 0.08);
  outline: none;
}

.buy-modal-submit {
  min-height: 3.15rem;
  border-radius: 10px;
  font-size: 1.02rem;
  margin-top: 0.25rem;
}

.buy-modal-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.buy-divider {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--color-text-muted, #686860);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.buy-divider::before,
.buy-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #ddd6c8;
}

.buy-divider span {
  flex-shrink: 0;
}

.buy-modal-footer {
  font-size: 0.95rem;
  color: var(--color-text-muted, #686860);
  text-align: center;
}

.buy-modal-footer-link {
  color: var(--color-primary, #263d35);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.buy-modal-footer-link:hover {
  color: var(--color-accent, #967348);
}

.book-card .book-card-rating {
  margin: 6px 12px 10px;
}

.book-detail-rating {
  margin: 0 0 12px;
}

.book-card .book-card-rating .book-rating,
.book-detail-rating .book-rating {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}

.book-card .book-card-rating .bi,
.book-detail-rating .bi {
  color: #ffb03a;
  font-size: 0.92rem;
}

.book-detail-rating .bi {
  font-size: 1.05rem;
}

.book-card .book-card-rating .book-rating-value,
.book-detail-rating .book-rating-value {
  margin-left: 6px;
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 600;
}

.book-detail-rating .book-rating-value {
  font-size: 1rem;
}

/* CMS longdesc often ships a static sample review — hide it; live list is #book-reviews. */
.conversion-page .review-placeholder {
  display: none !important;
}

/* Catalogue tiles: upright cover, stacked pages fanned behind */
.book-card .cover-stage,
.book-card:nth-child(3n + 2) .cover-stage,
.book-card:nth-child(3n + 3) .cover-stage {
  background: transparent;
  overflow: visible;
  padding: 28px 40px 18px;
  height: 304px;
  perspective: none;
}

.book-card .book-stack {
  transform: none;
}

.book-card .stack-front {
  transform: none;
  box-shadow: 4px 8px 16px rgba(37, 53, 30, 0.16);
}

.book-card .stack-front:after {
  width: 5px;
  top: 1px;
  bottom: 1px;
  background: linear-gradient(90deg, #e8e2d4, #cfc7b4);
  transform: none;
  border-right: 1px solid #9a9486;
}

.book-card .stack-front:before {
  width: 8px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.18), transparent);
}

.book-card .stack-back-one {
  transform: translate(11px, -7px) rotateZ(5deg);
  filter: brightness(0.88);
}

.book-card .stack-back-two {
  transform: translate(20px, -12px) rotateZ(9deg);
  filter: brightness(0.76);
}

.book-card .cover-stage img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  box-shadow: none;
  display: block;
  margin: 0;
  background: transparent;
}

.book-sample-frame {
  width: 100%;
  height: min(80vh, 820px);
  border: 0;
  display: block;
  background: #fff;
}

/* Keep Why section tighter under the hero. */
.conversion-page #book-why.conversion-section {
  padding-block: 24px 60px;
}

/* Book page: one typeface so CMS "font-family: inherit" resolves correctly. */
.conversion-page,
.conversion-page .conversion-hero,
.conversion-page .conversion-hero .hero-message,
.conversion-page .conversion-hero .hero-message h1,
.conversion-page .conversion-hero .conversion-lead,
.conversion-page .conversion-hero .eyebrow,
.conversion-page .conversion-hero .conversion-buy,
.conversion-page .conversion-hero .reader-signals {
  font-family: var(--font-heading) !important;
}

/* Breadcrumb, pills, price, Buy button, and hero text links use Arial. */
.conversion-page .product-breadcrumb,
.conversion-page .product-breadcrumb a,
.conversion-page .product-breadcrumb span,
.conversion-page .conversion-hero .product-badges,
.conversion-page .conversion-hero .product-badges span,
.conversion-page .conversion-hero .price-group,
.conversion-page .conversion-hero .price-group *,
.conversion-page .conversion-hero .buy-primary,
.conversion-page .conversion-hero .text-link,
.conversion-page .mobile-purchase,
.conversion-page .mobile-purchase .price-group,
.conversion-page .mobile-purchase .price-group *,
.conversion-page .mobile-purchase .buy-primary {
  font-family: Arial, Helvetica, sans-serif !important;
}

.conversion-page .scene-book {
  width: auto;
  height: auto;
  max-width: 100%;
  perspective: none;
  transform: none;
  margin-top: 0;
}

.conversion-page .scene-book img {
  width: auto;
  height: 560px;
  max-width: 100%;
  background: transparent;
  display: block;
  margin: 0 auto;
}

/* Why-this-book: section title matches CMS headline size/type. */
.conversion-page #book-why .conversion-heading {
  font-size: 17px;
  align-items: start;
  margin: 24px 0 8px;
}

.conversion-page #book-why .conversion-heading h2 {
  font-family: var(--font-heading);
  font-size: 1.5em;
  line-height: 1.25;
  letter-spacing: normal;
  font-weight: 400;
  color: var(--color-text);
  margin: 0;
}

/* Keep CMS styles; only open the content to full available width. */
.conversion-page #book-why .book-detail-body {
  font-family: var(--font-heading);
  max-width: none !important;
  width: 100% !important;
  padding-bottom: 70px;
  box-sizing: border-box;
}

.conversion-page #book-why .book-detail-body,
.conversion-page #book-why .book-detail-body * {
  max-width: none !important;
  box-sizing: border-box;
}

.conversion-page #book-why .book-detail-body > * {
  width: 100% !important;
  max-width: none !important;
}

.conversion-page #book-why .book-detail-audience {
  font-family: var(--font-heading);
  margin: 28px 0 36px;
  width: 100%;
}

.conversion-page #book-why .book-preview-cta {
  cursor: pointer;
}

.conversion-page .conversion-lead {
  margin-top: -8px;
  margin-bottom: 8px;
  font-family: var(--font-heading);
}

@media (max-width: 900px) {
  .conversion-page .scene-book img {
    height: 440px;
  }
}

@media (max-width: 767px) {
  .conversion-page .scene-book img {
    height: 340px;
  }
}

/* Find my next read quiz */
.find-next-modal-content {
  border: 1px solid #e5e5e5;
  border-radius: 18px;
  background:
    radial-gradient(ellipse 90% 60% at 0% 0%, rgba(150, 115, 72, 0.06), transparent 55%),
    linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
}

.find-next-options.find-next-levels {
  grid-template-columns: 1fr;
}

.find-next-option {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--color-border, #ddd);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.find-next-option:hover,
.find-next-option:focus {
  background: #f3f0e7;
  border-color: var(--color-accent, #967348);
}

.find-next-option strong {
  font-weight: 600;
}

.find-next-option small {
  color: var(--color-text-muted, #5c5a55);
  font-size: 0.9rem;
  line-height: 1.4;
}

.find-next-results {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.find-next-result {
  text-decoration: none;
  color: inherit;
}

.find-next-cover-fallback {
  display: inline-block;
  width: 45px;
  height: 68px;
  background: #ebe6dc;
  border-radius: 3px;
  flex-shrink: 0;
}

#content-dialog .find-next-options,
#findNextReadBody .quiz-options {
  margin-top: 8px;
}

#findNextReadBody .quiz-progress,
#content-dialog .quiz-progress {
  margin-bottom: 10px;
}

/* Catalogue / shelf loading */
.catalogue-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  min-height: 10rem;
  padding: 2.5rem 1rem;
  text-align: center;
}

.catalogue-loader-inline {
  min-height: 5.5rem;
  padding: 1.25rem 1rem;
  width: 100%;
  grid-column: 1 / -1;
}

.catalogue-loader-visual {
  position: relative;
  width: 2.75rem;
  height: 2.75rem;
}

.catalogue-loader-ring {
  position: absolute;
  inset: 0;
  border: 2px solid #e7e1d4;
  border-top-color: #967348;
  border-radius: 50%;
  animation: catalogue-loader-spin 0.85s linear infinite;
}

.catalogue-loader-dot {
  position: absolute;
  inset: 0.7rem;
  border-radius: 50%;
  background: #ffd47d;
  animation: catalogue-loader-pulse 1.1s ease-in-out infinite;
}

.catalogue-loader-text {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--color-text-muted, #5c5a55);
}

@keyframes catalogue-loader-spin {
  to { transform: rotate(360deg); }
}

@keyframes catalogue-loader-pulse {
  0%, 100% { opacity: 0.45; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}

/* Preferred language picker (first visit) */
.pref-lang-modal-content {
  border: 1px solid #e5e5e5;
  border-radius: 18px;
  background:
    radial-gradient(ellipse 90% 60% at 0% 0%, rgba(150, 115, 72, 0.06), transparent 55%),
    linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
  box-shadow: 0 24px 48px rgba(38, 61, 53, 0.16);
}

.pref-lang-option {
  min-width: 6.5rem;
  border: 1px solid #d9d2c4;
  background: #fff;
  color: #4A3B26;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-weight: 600;
}

.pref-lang-option:hover,
.pref-lang-option:focus {
  background: #ffd47d;
  border-color: #C4B89A;
  color: #4A3B26;
}

.pref-lang-option.is-selected {
  background: #ffd47d;
  border-color: #C4B89A;
  color: #4A3B26;
  box-shadow: inset 0 0 0 1px #C4B89A;
}

/* Terms of Use modal — sits above buy/signup modals without leaving the flow. */
#termsOfUseModal {
  z-index: 1065;
}

#termsOfUseModal + .modal-backdrop,
.modal-backdrop.show:nth-of-type(2) {
  z-index: 1060;
}

.terms-modal-body .information-body {
  margin: 0;
}

.terms-modal-body .information-section h2 {
  font-size: 1.25rem;
}

.signup-consent .form-check-label,
.buy-consent .form-check-label {
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--color-text-muted, #5c5a55);
}

.font-14 { 
    font-size: 14px;
}