/*
 * Storefront design system — the redesign's tokens, chrome (header, footer)
 * and page layouts. Loaded on every page, after the legacy Divi CSS on the
 * pages that still use it, so class selectors here win over Divi's element
 * rules. Everything is prefixed rap- to stay clear of Divi's own classes.
 */

:root {
  --rap-paper: #f5efe4;
  --rap-surface: #fffdf8;
  --rap-white: #ffffff;
  --rap-tile: #eae0ce;
  --rap-ink: #1c1814;
  --rap-ink-2: #3d362e;
  --rap-muted: #5e554a;
  --rap-line: #e2d8c6;
  --rap-line-soft: #efe7d8;
  --rap-field: #8a7f70;
  --rap-accent: #a93b1c;
  --rap-accent-dark: #86301a;
  --rap-green: #1e5b43;
  --rap-green-soft: #dceadf;
  --rap-ochre: #e8b04a;
  --rap-danger: #a4262c;
  --rap-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --rap-sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --rap-gutter: clamp(16px, 4.5vw, 64px);
  --rap-radius: 12px;
  --rap-shadow-cover: 0 8px 18px rgba(28, 24, 20, 0.22);
}

body.rap {
  margin: 0;
  background: var(--rap-paper);
  color: var(--rap-ink);
  font-family: var(--rap-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.rap *,
.rap *::before,
.rap *::after {
  box-sizing: border-box;
}
.rap img {
  max-width: 100%;
}
/* Components set their own display, which would otherwise beat [hidden]. */
.rap [hidden] {
  display: none !important;
}
.rap button,
.rap input,
.rap select,
.rap textarea {
  font: inherit;
  color: inherit;
}
.rap :focus-visible {
  outline: 3px solid var(--rap-ochre);
  outline-offset: 2px;
}
.rap-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.rap-skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: 8px;
  background: var(--rap-ink);
  color: var(--rap-surface);
  font-weight: 600;
}
.rap-skip:focus {
  top: 12px;
}
.rap-container {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: var(--rap-gutter);
}
.rap-icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Type ---------- */
.rap-h1,
.rap-h2,
.rap-h3 {
  font-family: var(--rap-serif);
  font-weight: 600;
  color: var(--rap-ink);
  margin: 0;
  padding: 0;
  letter-spacing: -0.01em;
}
.rap-h1 {
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.02;
}
.rap-h2 {
  font-size: clamp(26px, 2.6vw, 36px);
  line-height: 1.15;
}
.rap-h3 {
  font-size: 22px;
  line-height: 1.2;
}
.rap-eyebrow {
  display: inline-block;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rap-green);
}
.rap-eyebrow--pill {
  align-self: flex-start;
  background: var(--rap-green-soft);
  padding: 6px 12px;
  border-radius: 4px;
}
.rap-muted {
  color: var(--rap-muted);
}
.rap-link {
  color: var(--rap-accent);
  font-weight: 600;
  text-underline-offset: 3px;
}
.rap-link:hover {
  color: var(--rap-accent-dark);
}
.rap-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

/* ---------- Buttons ---------- */
.rap-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    transform 0.1s ease;
}
.rap-btn:active {
  transform: translateY(1px);
}
.rap-btn--primary {
  background: var(--rap-accent);
  color: var(--rap-surface);
}
.rap-btn--primary:hover {
  background: var(--rap-accent-dark);
  color: var(--rap-surface);
}
.rap-btn--dark {
  background: var(--rap-ink);
  color: var(--rap-surface);
}
.rap-btn--dark:hover {
  background: #000;
  color: var(--rap-surface);
}
.rap-btn--outline {
  background: transparent;
  border-color: var(--rap-ink);
  color: var(--rap-ink);
}
.rap-btn--outline:hover {
  background: var(--rap-ink);
  color: var(--rap-surface);
}
.rap-btn--light {
  background: var(--rap-paper);
  color: var(--rap-ink);
}
.rap-btn--light:hover {
  background: var(--rap-white);
  color: var(--rap-ink);
}
.rap-btn--lg {
  min-height: 56px;
  padding: 0 28px;
  font-size: 17px;
}
.rap-btn--sm {
  min-height: 44px;
  padding: 0 16px;
  font-size: 15px;
}
.rap-btn--block {
  width: 100%;
}
.rap-btn:disabled,
.rap-btn[aria-disabled="true"] {
  background: var(--rap-line-soft);
  border-color: var(--rap-line);
  color: var(--rap-muted);
  cursor: not-allowed;
  transform: none;
}
.rap-textbtn {
  border: 0;
  background: none;
  padding: 10px 0;
  min-height: 44px;
  color: var(--rap-accent);
  font-weight: 600;
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.rap-textbtn:hover {
  color: var(--rap-accent-dark);
}

/* ---------- Header ---------- */
.rap-topbar {
  background: var(--rap-ink);
  color: var(--rap-paper);
  font-size: 14px;
  text-align: center;
  padding: 9px var(--rap-gutter);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 18px;
}
.rap-topbar__sep {
  opacity: 0.5;
}
.rap-promo {
  background: var(--rap-ochre);
  color: var(--rap-ink);
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  padding: 10px var(--rap-gutter);
}
.rap-promo a {
  color: var(--rap-ink);
}
.rap-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--rap-white);
  border-bottom: 1px solid var(--rap-line);
}
.rap-header__bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "logo search cart";
  align-items: center;
  gap: 16px 40px;
  min-height: 84px;
  padding-block: 12px;
}
.rap-header__menu {
  grid-area: menu;
  display: none;
}
.rap-header__logo {
  grid-area: logo;
  display: block;
  line-height: 0;
}
.rap-header__logo img {
  height: 52px;
  width: auto;
}
.rap-header__cart {
  grid-area: cart;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--rap-paper);
  color: var(--rap-ink);
  text-decoration: none;
  font-weight: 600;
}
.rap-header__cart:hover {
  background: var(--rap-tile);
  color: var(--rap-ink);
}
.rap-header__cart .rap-icon {
  width: 22px;
  height: 22px;
}
.rap-badge {
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 12px;
  background: var(--rap-accent);
  color: var(--rap-surface);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.rap-badge[data-empty] {
  background: var(--rap-line);
  color: var(--rap-ink-2);
}

.rap-search {
  grid-area: search;
  position: relative;
  max-width: 640px;
  width: 100%;
}
.rap-search__field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 5px 0 20px;
  border: 1px solid var(--rap-field);
  border-radius: 999px;
  background: var(--rap-white);
}
.rap-search__field:focus-within {
  border-color: var(--rap-ink);
  box-shadow: 0 0 0 3px rgba(232, 176, 74, 0.45);
}
.rap-search__input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 16px;
  padding: 0;
  height: 100%;
}
.rap-search__input::-webkit-search-cancel-button {
  cursor: pointer;
}
.rap-search__submit {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: var(--rap-ink);
  color: var(--rap-surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.rap-search__submit .rap-icon {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}
.rap-search__results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 60;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--rap-white);
  border: 1px solid var(--rap-line);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(28, 24, 20, 0.16);
  max-height: min(70vh, 480px);
  overflow-y: auto;
}
.rap-search__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--rap-ink);
  text-decoration: none;
}
.rap-search__item:hover,
.rap-search__item[aria-selected="true"] {
  background: var(--rap-paper);
  color: var(--rap-ink);
}
.rap-search__item img {
  width: 36px;
  height: 50px;
  object-fit: cover;
  border-radius: 2px;
  flex: 0 0 auto;
}
.rap-search__item strong {
  display: block;
  font-size: 15px;
  line-height: 1.3;
}
.rap-search__item span span {
  display: block;
  font-size: 13px;
  color: var(--rap-muted);
}
.rap-search__all {
  display: block;
  padding: 12px 10px 8px;
  font-weight: 600;
  font-size: 15px;
}
.rap-search__empty {
  padding: 14px 10px;
  color: var(--rap-muted);
  font-size: 15px;
}

.rap-nav {
  border-top: 1px solid var(--rap-line-soft);
}
.rap-nav__inner {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
}
.rap-nav__list {
  display: flex;
  align-items: center;
  gap: 4px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rap-nav__list--secondary {
  margin-left: auto;
}
.rap-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--rap-ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
}
.rap-nav__list--secondary .rap-nav__link {
  color: var(--rap-muted);
}
.rap-nav__link:hover {
  color: var(--rap-accent);
}
.rap-nav__link[aria-current="page"] {
  color: var(--rap-ink);
  border-bottom-color: var(--rap-accent);
}
.rap-nav__link--sale {
  color: var(--rap-accent);
  font-weight: 600;
}

@media (max-width: 899px) {
  /* On phones the two-row header would eat too much of the screen if it
     stuck; book pages get their own sticky buy bar instead. */
  .rap-header {
    position: static;
  }
  .rap-header__bar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "menu logo cart"
      "search search search";
    gap: 10px 8px;
    min-height: 0;
    padding-block: 8px 12px;
  }
  .rap-header__menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 8px;
    background: none;
    cursor: pointer;
  }
  .rap-header__menu .rap-icon {
    width: 24px;
    height: 24px;
    stroke-width: 2;
  }
  .rap-header__logo img {
    height: 38px;
  }
  .rap-header__cart {
    padding: 0 12px;
    background: none;
  }
  .rap-header__cart-label {
    display: none;
  }
  .rap-search {
    max-width: none;
  }
  .rap-nav {
    display: none;
    border-top: 1px solid var(--rap-line);
    max-height: calc(100vh - 140px);
    overflow-y: auto;
  }
  .rap-nav[data-open] {
    display: block;
  }
  .rap-nav__inner {
    flex-direction: column;
    align-items: stretch;
    padding-block: 8px 16px;
  }
  .rap-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .rap-nav__list--secondary {
    margin-left: 0;
    border-top: 1px solid var(--rap-line-soft);
    padding-top: 8px;
    margin-top: 8px;
  }
  .rap-nav__link {
    width: 100%;
    min-height: 48px;
    font-size: 17px;
    border-bottom: 0;
  }
  .rap-nav__link[aria-current="page"] {
    color: var(--rap-accent);
  }
}

/* ---------- Footer ---------- */
.rap-footer {
  background: var(--rap-ink);
  color: #d9cfbf;
  padding-block: 56px 32px;
  margin-top: 88px;
  font-size: 15px;
}
.rap-footer a {
  color: #d9cfbf;
  text-decoration: none;
}
.rap-footer a:hover {
  color: var(--rap-surface);
  text-decoration: underline;
}
.rap-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
  gap: 32px;
}
.rap-footer__brand {
  font-family: var(--rap-serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--rap-paper);
  margin: 0 0 8px;
}
.rap-footer__heading {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--rap-paper);
}
.rap-footer__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rap-footer__list a {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
}
.rap-footer__social {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}
.rap-footer__social a {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--rap-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.rap-footer__social a:hover {
  border-color: var(--rap-paper);
}
.rap-footer__bottom {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--rap-ink-2);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: 14px;
}
@media (max-width: 899px) {
  .rap-footer__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rap-footer__grid > :first-child {
    grid-column: 1 / -1;
  }
}

/* ---------- Book card + grids ---------- */
.rap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 40px 24px;
}
.rap-grid--row {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.rap-grid--5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
@media (max-width: 1199px) {
  .rap-grid--row,
  .rap-grid--5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 599px) {
  .rap-grid,
  .rap-grid--row,
  .rap-grid--5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 14px;
  }
}
.rap-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.rap-card[hidden] {
  display: none;
}
.rap-card__cover {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 5 / 7;
  padding: 16px;
  margin-bottom: 6px;
  border-radius: 6px;
  background: var(--rap-tile);
  transition: background-color 0.15s ease;
}
.rap-card__cover img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: var(--rap-shadow-cover);
  transition: transform 0.2s ease;
}
.rap-card__cover:hover img {
  transform: translateY(-4px);
}
.rap-card__cover--square {
  aspect-ratio: 1 / 1;
  padding: 0;
  overflow: hidden;
}
.rap-card__cover--square img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  box-shadow: none;
}
.rap-card__flag {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--rap-ochre);
  color: var(--rap-ink);
}
.rap-card__cat {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rap-muted);
}
.rap-card__title {
  margin: 0;
  padding: 0;
  font-family: var(--rap-serif);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.2;
}
.rap-card__title a {
  color: var(--rap-ink);
  text-decoration: none;
}
.rap-card__title a:hover {
  color: var(--rap-accent);
  text-decoration: underline;
}
.rap-card__sub {
  margin: 0;
  padding: 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--rap-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rap-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}
.rap-price {
  font-size: 17px;
  font-weight: 600;
  color: var(--rap-ink);
}
.rap-price s {
  font-weight: 400;
  font-size: 0.85em;
  color: var(--rap-muted);
  margin-right: 4px;
}
.rap-stock-note {
  font-size: 14px;
  font-weight: 500;
  color: var(--rap-muted);
}
.rap-card--out .rap-card__cover img {
  opacity: 0.55;
}
@media (max-width: 599px) {
  .rap-card__title {
    font-size: 17px;
  }
  .rap-card__foot .rap-btn {
    width: 100%;
  }
}

/* ---------- Home ---------- */
.rap-hero {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  padding-block: clamp(32px, 5vw, 72px);
}
.rap-hero__copy {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.rap-hero__sub {
  margin: 0;
  font-family: var(--rap-serif);
  font-size: clamp(19px, 1.8vw, 24px);
  line-height: 1.3;
  color: var(--rap-ink-2);
}
.rap-hero__by {
  margin: 0;
  color: var(--rap-muted);
}
.rap-hero__by strong {
  color: var(--rap-ink);
}
.rap-hero__blurb {
  margin: 0;
  font-size: 18px;
  line-height: 1.6;
  color: var(--rap-ink-2);
  max-width: 560px;
}
.rap-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding-top: 6px;
}
.rap-hero__art {
  position: relative;
  min-height: 520px;
  border-radius: 14px;
  background: var(--rap-green);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 40px 120px;
}
.rap-hero__art > a {
  line-height: 0;
}
.rap-hero__art > a img {
  max-height: 420px;
  width: auto;
  border-radius: 3px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}
.rap-hero__also {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.rap-hero__also a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 10px 10px;
  border-radius: 10px;
  background: var(--rap-surface);
  color: var(--rap-ink);
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  max-width: 280px;
}
.rap-hero__also a:hover {
  background: var(--rap-white);
  color: var(--rap-ink);
}
.rap-hero__also img {
  width: 44px;
  height: 60px;
  object-fit: cover;
  border-radius: 2px;
}
.rap-hero__also small {
  display: block;
  font-size: 12px;
  color: var(--rap-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.rap-hero__also strong {
  display: block;
  font-family: var(--rap-serif);
  font-size: 16px;
  line-height: 1.2;
}
@media (max-width: 899px) {
  .rap-hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .rap-hero__art {
    order: -1;
    min-height: 0;
    padding: 28px 20px;
  }
  .rap-hero__art > a img {
    max-height: 300px;
  }
  .rap-hero__also {
    display: none;
  }
  .rap-hero__actions .rap-btn {
    flex: 1 1 100%;
  }
}

.rap-section {
  padding-bottom: clamp(48px, 6vw, 80px);
}
.rap-subjects {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rap-subjects a {
  height: 100%;
  min-height: 96px;
  padding: 18px 20px;
  border-radius: 10px;
  border: 1px solid var(--rap-line);
  background: var(--rap-surface);
  color: var(--rap-ink);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease;
}
.rap-subjects a:hover {
  border-color: var(--rap-ink);
  background: var(--rap-white);
  color: var(--rap-ink);
}
.rap-subjects strong {
  font-size: 16px;
  line-height: 1.25;
}
.rap-subjects span {
  font-size: 14px;
  color: var(--rap-muted);
}
@media (max-width: 1099px) {
  .rap-subjects {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 599px) {
  /* A swipeable row of chips instead of a tall grid on phones. */
  .rap-subjects {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    margin-inline: calc(var(--rap-gutter) * -1);
    padding-inline: var(--rap-gutter);
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .rap-subjects li {
    flex: 0 0 auto;
  }
  .rap-subjects a {
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    border-color: var(--rap-field);
    flex-direction: row;
    align-items: center;
    white-space: nowrap;
  }
  .rap-subjects strong {
    font-size: 15px;
    font-weight: 500;
  }
}

.rap-collection {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(32px, 4vw, 56px);
  align-items: center;
  padding: clamp(28px, 4vw, 56px);
  border-radius: 14px;
  background: var(--rap-ink);
  color: var(--rap-paper);
}
.rap-collection .rap-eyebrow {
  color: var(--rap-ochre);
}
.rap-collection .rap-h2 {
  color: var(--rap-paper);
  font-size: clamp(32px, 3.4vw, 48px);
  line-height: 1.05;
  margin: 14px 0;
}
.rap-collection p {
  margin: 0 0 24px;
  font-size: 18px;
  line-height: 1.6;
  color: #d9cfbf;
  max-width: 480px;
}
.rap-collection__books {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rap-collection__books a {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--rap-paper);
  text-decoration: none;
}
.rap-collection__books a:hover {
  color: var(--rap-white);
  text-decoration: underline;
}
.rap-collection__books img {
  width: 100%;
  aspect-ratio: 5 / 7;
  object-fit: cover;
  border-radius: 3px;
}
.rap-collection__books strong {
  font-family: var(--rap-serif);
  font-size: 17px;
  line-height: 1.2;
}
.rap-collection__books span {
  font-size: 15px;
  color: #d9cfbf;
}
@media (max-width: 899px) {
  .rap-collection {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 599px) {
  .rap-collection__books {
    gap: 10px;
  }
  /* Covers only on phones; the titles stay for screen readers. */
  .rap-collection__books strong,
  .rap-collection__books span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

.rap-perks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rap-perks li {
  display: flex;
  gap: 16px;
  padding: 24px;
  border-radius: 10px;
  border: 1px solid var(--rap-line);
  background: var(--rap-surface);
}
.rap-perks .rap-icon {
  width: 28px;
  height: 28px;
  stroke-width: 1.6;
  color: var(--rap-accent);
}
.rap-perks strong {
  display: block;
  font-size: 17px;
  margin-bottom: 4px;
}
.rap-perks span {
  color: var(--rap-muted);
  font-size: 15px;
  line-height: 1.5;
}
@media (max-width: 899px) {
  .rap-perks {
    grid-template-columns: minmax(0, 1fr);
  }
  .rap-perks li {
    padding: 18px;
  }
}

.rap-duo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.rap-duo > div {
  padding: clamp(28px, 3vw, 40px);
  border-radius: 14px;
  background: var(--rap-tile);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}
.rap-duo > div:nth-child(2) {
  background: var(--rap-green-soft);
}
.rap-duo p {
  margin: 0;
  font-size: 17px;
  line-height: 1.6;
  color: var(--rap-ink-2);
}
.rap-btn--green {
  background: var(--rap-green);
  color: var(--rap-surface);
}
.rap-btn--green:hover {
  background: #15432f;
  color: var(--rap-surface);
}
@media (max-width: 899px) {
  .rap-duo {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Page heads / breadcrumbs ---------- */
.rap-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 28px 0 0;
  list-style: none;
  font-size: 14px;
  color: var(--rap-muted);
}
.rap-crumbs li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--rap-field);
}
.rap-crumbs a {
  color: var(--rap-muted);
}
.rap-crumbs a:hover {
  color: var(--rap-accent);
}
.rap-pagehead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 12px 0 32px;
}
.rap-pagehead p {
  margin: 0;
  color: var(--rap-muted);
}

/* ---------- Catalogue ---------- */
.rap-catalog {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
.rap-filters {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 160px;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  padding-right: 4px;
}
.rap-filters__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.rap-filters__head strong {
  font-size: 18px;
}
.rap-fieldset {
  border: 0;
  margin: 0;
  padding: 0 0 20px;
  border-bottom: 1px solid var(--rap-line);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.rap-fieldset:last-of-type {
  border-bottom: 0;
}
.rap-fieldset legend {
  font-weight: 600;
  font-size: 15px;
  padding: 0 0 10px;
}
.rap-check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  font-size: 15px;
  cursor: pointer;
}
.rap-check input {
  width: 20px;
  height: 20px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--rap-accent);
}
.rap-check span:first-of-type {
  flex: 1 1 auto;
}
.rap-check .rap-muted {
  font-size: 14px;
}
.rap-filters__search {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--rap-field);
  border-radius: 8px;
  background: var(--rap-white);
  font-size: 16px;
}
.rap-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-bottom: 28px;
}
.rap-toolbar__count {
  font-size: 15px;
  color: var(--rap-muted);
}
.rap-toolbar__count strong {
  color: var(--rap-ink);
}
.rap-toolbar__spacer {
  flex: 1 1 auto;
}
.rap-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 10px 0 14px;
  border-radius: 999px;
  border: 1px solid var(--rap-ink);
  background: var(--rap-surface);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.rap-chip:hover {
  background: var(--rap-white);
}
.rap-chip .rap-icon {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}
.rap-select {
  height: 44px;
  padding: 0 36px 0 14px;
  border: 1px solid var(--rap-field);
  border-radius: 8px;
  background: var(--rap-white);
  font-size: 15px;
}
.rap-filter-toggle {
  display: none;
}
.rap-empty {
  padding: 48px 24px;
  border: 1px dashed var(--rap-field);
  border-radius: var(--rap-radius);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.rap-empty p {
  margin: 0;
  color: var(--rap-muted);
}
@media (max-width: 899px) {
  .rap-catalog {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .rap-filter-toggle {
    display: inline-flex;
  }
  .rap-filters {
    display: none;
    position: static;
    max-height: none;
    overflow: visible;
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid var(--rap-line);
    border-radius: var(--rap-radius);
    background: var(--rap-surface);
  }
  .rap-filters[data-open] {
    display: flex;
  }
}

/* ---------- Book page ---------- */
.rap-book {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
  padding-block: 28px 64px;
}
.rap-book__media {
  position: sticky;
  top: 160px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rap-book__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 560px;
  padding: 48px;
  border-radius: 14px;
  background: var(--rap-tile);
}
.rap-book__stage img {
  max-height: 600px;
  width: auto;
  box-shadow: 0 28px 56px rgba(28, 24, 20, 0.3);
}
.rap-book__thumbs {
  display: flex;
  gap: 10px;
}
.rap-book__thumbs button {
  width: 64px;
  height: 84px;
  padding: 4px;
  border-radius: 6px;
  border: 2px solid transparent;
  background: var(--rap-tile);
  cursor: pointer;
}
.rap-book__thumbs button[aria-pressed="true"] {
  border-color: var(--rap-ink);
}
.rap-book__thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.rap-book__info {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 8px;
}
.rap-book__cat {
  align-self: flex-start;
  text-decoration: none;
}
.rap-book__cat:hover {
  text-decoration: underline;
}
.rap-book__titles {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rap-book__sub {
  margin: 0;
  font-family: var(--rap-serif);
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.3;
  color: var(--rap-ink-2);
}
.rap-book__by {
  margin: 0;
  font-size: 17px;
  color: var(--rap-muted);
}
.rap-book__by strong {
  color: var(--rap-ink);
}
.rap-book__pricing {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.rap-book__price {
  font-size: 34px;
  font-weight: 600;
}
.rap-book__price s {
  font-size: 20px;
  font-weight: 400;
  color: var(--rap-muted);
  margin-right: 8px;
}
.rap-stock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
}
.rap-stock--in {
  color: var(--rap-green);
}
.rap-stock--out {
  color: var(--rap-danger);
}
.rap-stock .rap-icon {
  width: 16px;
  height: 16px;
  stroke-width: 2.4;
}
.rap-buy {
  display: flex;
  gap: 12px;
  align-items: stretch;
}
.rap-buy .rap-btn {
  flex: 1 1 auto;
}
.rap-stepper {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--rap-field);
  border-radius: 999px;
  background: var(--rap-white);
  height: 56px;
  flex: 0 0 auto;
}
.rap-stepper button {
  width: 48px;
  height: 100%;
  border: 0;
  background: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 999px;
}
.rap-stepper button:disabled {
  color: var(--rap-line);
  cursor: not-allowed;
}
.rap-stepper input {
  width: 36px;
  border: 0;
  background: transparent;
  text-align: center;
  font-weight: 600;
  font-size: 17px;
  -moz-appearance: textfield;
  appearance: textfield;
}
.rap-stepper input::-webkit-outer-spin-button,
.rap-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.rap-stepper--sm {
  height: 44px;
}
.rap-stepper--sm button {
  width: 42px;
  font-size: 20px;
}
.rap-message {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.rap-message--error {
  color: var(--rap-danger);
}
.rap-infobox {
  border: 1px solid var(--rap-line);
  border-radius: var(--rap-radius);
  background: var(--rap-surface);
  margin: 0;
  padding: 0;
  list-style: none;
}
.rap-infobox li {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
}
.rap-infobox li + li {
  border-top: 1px solid var(--rap-line-soft);
}
.rap-infobox .rap-icon {
  width: 24px;
  height: 24px;
  stroke-width: 1.6;
  color: var(--rap-accent);
}
.rap-infobox strong {
  display: block;
}
.rap-infobox span {
  font-size: 15px;
  color: var(--rap-muted);
}
.rap-specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
  margin: 0;
  font-size: 15px;
}
.rap-specs div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rap-specs dt {
  color: var(--rap-muted);
}
.rap-specs dd {
  margin: 0;
  font-weight: 500;
}
.rap-specs--note {
  grid-column: 1 / -1;
}
.rap-prose {
  font-size: 18px;
  line-height: 1.7;
  color: var(--rap-ink-2);
  max-width: 72ch;
}
.rap-prose p {
  margin: 0 0 1em;
  padding: 0;
}
.rap-prose a {
  color: var(--rap-accent);
}
.rap-longform {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 24px clamp(32px, 5vw, 72px);
  padding-block: 56px;
  border-top: 1px solid var(--rap-line);
}
.rap-author {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.rap-author img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
}
.rap-author strong {
  font-family: var(--rap-serif);
  font-size: 20px;
}
.rap-buybar {
  display: none;
}
@media (max-width: 899px) {
  .rap-book {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 16px;
  }
  .rap-book__media {
    position: static;
  }
  .rap-book__stage {
    min-height: 0;
    padding: 28px;
    margin-inline: calc(var(--rap-gutter) * -1);
    border-radius: 0;
  }
  .rap-book__stage img {
    max-height: 360px;
  }
  .rap-longform {
    grid-template-columns: minmax(0, 1fr);
    padding-block: 40px;
  }
  .rap-prose {
    font-size: 17px;
  }
  /* Keeps "Add to cart" in reach once the main button scrolls away. */
  .rap-buybar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px var(--rap-gutter) calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--rap-surface);
    border-top: 1px solid var(--rap-line);
    box-shadow: 0 -8px 24px rgba(28, 24, 20, 0.08);
    transform: translateY(110%);
    transition: transform 0.2s ease;
  }
  .rap-buybar[data-show] {
    transform: none;
  }
  .rap-buybar div {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  .rap-buybar small {
    font-size: 13px;
    color: var(--rap-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .rap-buybar strong {
    font-size: 18px;
  }
  .rap-buybar .rap-btn {
    flex: 1 1 auto;
  }
}
@media (max-width: 599px) {
  .rap-specs {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Checkout ---------- */
.rap-checkout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 32px 48px;
  align-items: start;
}
.rap-checkout__main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}
.rap-panel {
  background: var(--rap-surface);
  border: 1px solid var(--rap-line);
  border-radius: 14px;
  padding: clamp(20px, 2.4vw, 32px);
}
.rap-panel__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.rap-panel__head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  font-family: var(--rap-sans);
}
.rap-step {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--rap-ink);
  color: var(--rap-surface);
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.rap-line {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto auto;
  gap: 8px 20px;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid var(--rap-line-soft);
}
.rap-line img {
  width: 72px;
  height: 100px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 4px 10px rgba(28, 24, 20, 0.18);
}
.rap-line__title {
  font-family: var(--rap-serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--rap-ink);
  text-decoration: none;
}
.rap-line__title:hover {
  color: var(--rap-accent);
}
.rap-line__meta {
  display: block;
  font-size: 14px;
  color: var(--rap-muted);
}
.rap-line__total {
  min-width: 96px;
  text-align: right;
  font-size: 18px;
  font-weight: 600;
}
@media (max-width: 599px) {
  .rap-line {
    grid-template-columns: 60px minmax(0, 1fr) auto;
  }
  .rap-line img {
    width: 60px;
    height: 84px;
    grid-row: span 2;
  }
  .rap-line .rap-stepper {
    grid-column: 2;
    justify-self: start;
  }
  .rap-line__total {
    grid-column: 3;
    grid-row: 1;
    min-width: 0;
    font-size: 16px;
  }
}
.rap-meter {
  margin-top: 8px;
  padding: 18px 20px;
  border-radius: 10px;
  background: var(--rap-paper);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rap-meter__text {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 15px;
}
.rap-meter__bar {
  height: 8px;
  border-radius: 4px;
  background: var(--rap-line);
  overflow: hidden;
}
.rap-meter__bar span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--rap-green);
  transition: width 0.3s ease;
}
.rap-meter__suggest {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 15px;
}
.rap-meter__suggest img {
  width: 40px;
  height: 56px;
  object-fit: cover;
  border-radius: 2px;
}
.rap-meter__suggest span {
  flex: 1 1 auto;
}
.rap-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}
.rap-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.rap-field--wide {
  grid-column: 1 / -1;
}
.rap-field[hidden] {
  display: none;
}
.rap-field label {
  font-size: 15px;
  font-weight: 500;
}
.rap-field__hint {
  font-size: 14px;
  color: var(--rap-muted);
  margin: 0;
}
.rap-input {
  height: 48px;
  width: 100%;
  padding: 0 14px;
  border: 1px solid var(--rap-field);
  border-radius: 8px;
  background: var(--rap-white);
  font-size: 16px;
}
.rap-input:focus {
  border-color: var(--rap-ink);
  outline: none;
  box-shadow: 0 0 0 3px rgba(232, 176, 74, 0.45);
}
.rap-input[type="file"] {
  height: auto;
  padding: 10px 14px;
}
.rap-input[aria-invalid="true"] {
  border-color: var(--rap-danger);
}
@media (max-width: 599px) {
  .rap-form {
    grid-template-columns: minmax(0, 1fr);
  }
}
.rap-disclosure {
  grid-column: 1 / -1;
  border-top: 1px solid var(--rap-line-soft);
  padding-top: 8px;
}
.rap-disclosure summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--rap-accent);
  font-weight: 600;
  cursor: pointer;
}
.rap-disclosure[open] summary {
  margin-bottom: 8px;
}
.rap-summary {
  position: sticky;
  top: 160px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.rap-summary h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  font-family: var(--rap-sans);
}
.rap-summary__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 16px;
}
.rap-summary__row--total {
  align-items: baseline;
  padding-top: 14px;
  border-top: 1px solid var(--rap-line);
  font-size: 22px;
  font-weight: 600;
}
.rap-summary__note {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--rap-muted);
  text-align: center;
}
.rap-ticks {
  margin: 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--rap-line);
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  color: var(--rap-ink-2);
}
.rap-ticks li {
  display: flex;
  align-items: center;
  gap: 10px;
}
.rap-ticks .rap-icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.4;
  color: var(--rap-green);
}
@media (max-width: 1023px) {
  .rap-checkout {
    grid-template-columns: minmax(0, 1fr);
  }
  .rap-summary {
    position: static;
  }
}

/* ---------- Toast ---------- */
.rap-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: calc(100vw - 32px);
  padding: 12px 12px 12px 20px;
  border-radius: 12px;
  background: var(--rap-ink);
  color: var(--rap-paper);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}
.rap-toast[data-show] {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
.rap-toast a {
  color: var(--rap-ink);
  background: var(--rap-paper);
  border-radius: 999px;
  min-height: 40px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
@media (max-width: 899px) {
  .rap-toast {
    bottom: 96px;
  }
}

/* ---------- Legacy WordPress page bodies ---------- */
.rap-legacy {
  font-family: var(--rap-sans);
  color: var(--rap-ink-2);
}
.rap-legacy #et-main-area,
.rap-legacy #main-content,
.rap-legacy .et_pb_section,
.rap-legacy .et-l {
  background-color: transparent;
}
.rap-legacy h1 {
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.1;
  padding-top: 24px;
}
.rap-legacy h1,
.rap-legacy h2,
.rap-legacy h3,
.rap-legacy h4 {
  font-family: var(--rap-serif);
  color: var(--rap-ink);
  font-weight: 600;
}
.rap-legacy a:not(.btn):not(.et_pb_button) {
  color: var(--rap-accent);
}
.rap-legacy .btn,
.rap-legacy a.et_pb_button {
  background: var(--rap-accent);
  border-color: var(--rap-accent);
  border-radius: 999px;
  padding: 12px 24px;
  font-size: 16px;
}
.rap-legacy .btn:hover,
.rap-legacy a.et_pb_button:hover {
  background: var(--rap-accent-dark);
  border-color: var(--rap-accent-dark);
}

@media (prefers-reduced-motion: reduce) {
  .rap *,
  .rap *::before,
  .rap *::after {
    transition: none !important;
    animation: none !important;
  }
}
