/* Homepage-only visual refresh. The original catalog, cart and checkout styles remain untouched. */
:root {
  --storefront-paper: #faf7f0;
  --storefront-ink: #29211d;
  --storefront-muted: #786f65;
  --storefront-line: #dfd2bd;
  --storefront-wine: #84232f;
  --storefront-sans: "Manrope", Arial, sans-serif;
}

.site-header {
  height: 72px;
  gap: clamp(12px, 1.8vw, 28px);
  padding-inline: clamp(20px, 4.2vw, 76px);
  font-family: var(--storefront-sans);
}

.site-header .main-nav {
  gap: clamp(14px, 1.65vw, 26px);
  margin-left: auto;
}

.site-header .main-nav a {
  height: 72px;
  font-family: var(--storefront-sans);
  font-size: 12px;
}

.storefront-header-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  margin: 0;
}

.storefront-header-search input {
  width: 0;
  min-width: 0;
  height: 36px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  outline: 0;
  opacity: 0;
  color: var(--storefront-ink);
  background: transparent;
  font: 500 12px var(--storefront-sans);
  transition: width .22s ease, opacity .16s ease, padding .22s ease;
}

.storefront-header-search input:focus,
.storefront-header-search:focus-within input {
  width: clamp(130px, 13vw, 190px);
  padding: 0 7px;
  border-bottom-color: var(--storefront-line);
  opacity: 1;
}

.storefront-header-search input::placeholder { color: var(--storefront-muted); }
.storefront-header-search .search-btn { flex: 0 0 auto; white-space: nowrap; }

.storefront-showcase {
  position: relative;
  padding: 18px clamp(12px, 2.1vw, 34px) 24px;
  border-bottom: 1px solid rgba(125, 93, 53, .15);
  background: #e8ddca url("hero-library.png") center 48% / cover no-repeat;
  font-family: var(--storefront-sans);
}

.storefront-inner {
  width: min(100%, 2380px);
  margin: 0 auto;
  padding: 24px clamp(24px, 4.2vw, 84px) 21px;
  background: rgba(250, 247, 240, .965);
}

.storefront-intro {
  min-height: 172px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 230px);
  align-items: center;
  gap: clamp(28px, 4vw, 65px);
}

.storefront-eyebrow {
  margin: 0 0 8px;
  color: var(--storefront-wine);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .19em;
  line-height: 1.5;
  text-transform: uppercase;
}

.storefront-intro h1 {
  max-width: 1400px;
  color: #201914;
  font: 600 clamp(48px, 5.1vw, 84px)/.92 "Cormorant Garamond", Georgia, serif;
  letter-spacing: -.045em;
}

.storefront-subtitle {
  max-width: 1020px;
  margin: 11px 0 0;
  color: #6e655e;
  font: 400 clamp(14px, 1.25vw, 18px)/1.52 var(--storefront-sans);
}

.storefront-promises {
  display: grid;
  gap: 13px;
  padding-right: 2px;
}

.storefront-promises > div {
  display: flex;
  align-items: center;
  gap: 13px;
  color: #514840;
  font-size: 11px;
  line-height: 1.35;
}

.storefront-promises i {
  width: 24px;
  flex: 0 0 24px;
  color: #61564a;
  font-size: 22px;
  text-align: center;
}

.storefront-section-label {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 14px 0 7px;
  color: var(--storefront-wine);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.storefront-section-label > span:last-child {
  color: #938575;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .03em;
  white-space: nowrap;
}

.storefront-label-rule { height: 1px; flex: 1; background: #ded1bc; }

.storefront-products {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: clamp(16px, 2vw, 32px);
}

.storefront-card {
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 12px 17px 16px;
  border: 1px solid #e5d6bf;
  border-radius: 16px;
  background: rgba(255, 253, 248, .93);
  box-shadow: 0 9px 26px rgba(58, 39, 20, .075);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.storefront-card:hover {
  transform: translateY(-3px);
  border-color: #cdb88f;
  box-shadow: 0 15px 34px rgba(58, 39, 20, .13);
}

.storefront-cover-button {
  position: relative;
  width: 100%;
  flex: 0 0 360px;
  height: 360px;
  min-height: 360px;
  display: grid;
  place-items: center;
  padding: 11px 8px 6px;
  border: 0;
  background: transparent;
}

.storefront-pick {
  position: absolute;
  z-index: 1;
  top: 5px;
  left: -3px;
  padding: 6px 10px;
  border-radius: 3px;
  color: #fff;
  background: var(--storefront-wine);
  box-shadow: 0 3px 10px rgba(56, 21, 22, .18);
  font: 800 8px var(--storefront-sans);
  letter-spacing: .12em;
}

.storefront-cover-stage {
  position: relative;
  width: 100%;
  height: 310px;
  min-width: 0;
  display: grid;
  place-items: center;
}

.storefront-cover-art {
  display: block;
  height: 100%;
  max-width: min(100%, 220px);
  max-height: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 3px;
  object-fit: cover;
  filter: drop-shadow(0 12px 11px rgba(43, 30, 20, .27));
  transition: transform .28s ease, filter .28s ease;
}

.storefront-cover-button:hover .storefront-cover-art,
.storefront-cover-button:focus-visible .storefront-cover-art {
  transform: translateY(-4px) rotate(-.35deg);
  filter: drop-shadow(0 16px 13px rgba(43, 30, 20, .3));
}

.storefront-cover-disclosure {
  position: absolute;
  top: 10px;
  right: 9px;
  padding: 4px 6px;
  border: 1px solid rgba(111, 83, 46, .26);
  border-radius: 2px;
  color: #6e5430;
  background: rgba(250, 244, 228, .93);
  font: 800 6px var(--storefront-sans);
  letter-spacing: .07em;
  pointer-events: none;
}

.storefront-card-copy { display: flex; flex: 1; flex-direction: column; padding: 1px 7px 0; }
.storefront-topic { margin: 2px 0 5px; color: var(--storefront-wine); font: 800 9px/1.4 var(--storefront-sans); letter-spacing: .1em; text-transform: uppercase; }

.storefront-title-button {
  min-height: 48px;
  padding: 0;
  border: 0;
  color: #28201b;
  background: transparent;
  font: 600 clamp(21px, 1.8vw, 28px)/1.03 "Cormorant Garamond", Georgia, serif;
  text-align: left;
}

.storefront-title-button:hover { color: var(--storefront-wine); }
.storefront-author { margin: 6px 0 7px; color: #776d63; font-size: 11px; line-height: 1.4; }

.storefront-details-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  color: var(--storefront-wine);
  background: transparent;
  font: 800 10px var(--storefront-sans);
}

.storefront-details-link:hover { color: #ad5b43; }

.storefront-specs {
  min-height: 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 15px;
  padding: 7px 0 9px;
  border-top: 1px solid #e6dbc9;
  color: #766c61;
}

.storefront-specs span { display: inline-flex; align-items: center; gap: 5px; font-size: 9px; white-space: nowrap; }
.storefront-specs i { color: var(--storefront-wine); font-size: 14px; }

.storefront-buy-row {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 5px;
}

.storefront-price { color: var(--storefront-wine); font: 700 29px/.95 "Cormorant Garamond", Georgia, serif; white-space: nowrap; }

.storefront-buy-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 17px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: var(--storefront-wine);
  font: 800 11px var(--storefront-sans);
  white-space: nowrap;
  transition: background .18s ease, transform .18s ease;
}

.storefront-buy-button:hover { transform: translateY(-1px); background: #6d1d28; }
.storefront-buy-button.is-in-cart { color: #346746; background: #e8f0e7; }
.storefront-buy-button.is-in-cart:hover { transform: none; background: #dcebdc; }

.storefront-catalog-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 19px auto 0;
  text-align: center;
}

.storefront-catalog-cta a {
  min-width: min(100%, 370px);
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 24px;
  border-radius: 25px;
  color: #fff;
  background: var(--storefront-wine);
  font: 800 13px var(--storefront-sans);
  transition: background .18s ease, transform .18s ease;
}

.storefront-catalog-cta a:hover { transform: translateY(-1px); background: #6d1d28; }
.storefront-catalog-cta > span { color: #968979; font: 700 9px var(--storefront-sans); letter-spacing: .12em; text-transform: uppercase; }

.storefront-products-empty { grid-column: 1 / -1; padding: 48px 16px; color: var(--storefront-muted); text-align: center; }

/* The 30-item paid showcase follows the same editorial system, while keeping
   the archive's genuine title-page scans clearly identified as originals. */
.catalog-section {
  width: min(100%, 1740px);
  max-width: none;
  margin: 54px auto 76px;
  padding-inline: clamp(18px, 4vw, 72px);
}

.section-heading-catalog h2 {
  font: 600 clamp(34px, 3vw, 50px)/1 "Cormorant Garamond", Georgia, serif;
}

.book-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 2vw, 30px);
}

.book-card {
  min-width: 0;
  border-radius: 14px;
  border-color: #e5d6bf;
  box-shadow: 0 8px 22px rgba(58, 39, 20, .065);
}

.card-cover-link {
  height: 360px;
  padding: 16px 22px;
  background: #efe7d8;
  display: grid;
  place-items: center;
}

.card-cover-link img {
  width: auto;
  max-width: min(100%, 250px);
  height: 100%;
  object-fit: contain;
  object-position: center;
  filter: sepia(.06) contrast(.98);
}

.catalog-scan-label {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 5px 7px;
  border: 1px solid rgba(111, 83, 46, .25);
  border-radius: 2px;
  color: #6e5430;
  background: rgba(250, 244, 228, .95);
  font: 800 7px/1 var(--storefront-sans);
  letter-spacing: .08em;
  pointer-events: none;
}

.card-body { padding: 19px 20px 21px; }
.card-genre-tag { font: 800 9px/1.4 var(--storefront-sans); letter-spacing: .1em; }
.card-title { min-height: 54px; font: 600 clamp(23px, 2vw, 30px)/1.04 "Cormorant Garamond", Georgia, serif; }
.card-author { color: #776d63; font-size: 12px; }
.card-meta { font-size: 10px; }
.card-footer { padding-top: 13px; }
.card-price { color: var(--storefront-wine); font-size: 27px; }
.card-add-btn { min-height: 42px; padding: 0 16px; border-radius: 8px; font: 800 10px var(--storefront-sans); }

.dialog-preview-viewer { display: flex; flex-direction: column; align-items: center; }
.dialog-preview-viewer .dialog-book-cover {
  height: min(66vh, 560px);
  object-fit: contain;
  background: #efe7d8;
  box-shadow: 0 10px 28px rgba(43, 30, 20, .16);
}
.dialog-preview-caption { margin: 9px 0 0; color: var(--storefront-muted); font: 600 10px var(--storefront-sans); text-align: center; }
.dialog-preview-thumbnails { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 9px; }
.dialog-preview-thumb { width: 46px; height: 58px; padding: 2px; border: 1px solid var(--storefront-line); border-radius: 3px; background: #fffdf9; cursor: pointer; }
.dialog-preview-thumb.is-active { border: 2px solid var(--storefront-wine); }
.dialog-preview-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.dialog-preview-thumb:focus-visible { outline: 2px solid var(--storefront-wine); outline-offset: 2px; }

/* Keep the five-scan maps collection gallery at a deliberate, bounded height. */
.bundle-card-featured > .bundle-preview-strip.bundle-preview-gallery {
  height: 460px;
  min-height: 460px;
  align-self: stretch;
}

@media (max-width: 900px) {
  .bundle-card-featured > .bundle-preview-strip.bundle-preview-gallery {
    height: 320px;
    min-height: 320px;
  }
}

@media (max-width: 1100px) {
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-cover-link { height: 320px; }
}

@media (min-width: 769px) and (max-height: 780px) {
  .site-header,
  .site-header .main-nav a { height: 60px; }
  .storefront-showcase { padding-top: 8px; padding-bottom: 12px; }
  .storefront-inner { padding-top: 11px; padding-bottom: 12px; }
  .storefront-intro { min-height: 112px; gap: 25px; }
  .storefront-intro h1 { font-size: clamp(43px, 4.4vw, 58px); }
  .storefront-subtitle { margin-top: 6px; font-size: clamp(12px, 1.05vw, 14px); line-height: 1.4; }
  .storefront-promises { gap: 8px; }
  .storefront-promises > div { gap: 10px; font-size: 10px; }
  .storefront-promises i { font-size: 19px; }
  .storefront-section-label { margin-top: 7px; margin-bottom: 4px; }
  .storefront-products { gap: 15px; }
  .storefront-card { padding: 8px 11px 10px; }
  .storefront-cover-button { flex-basis: 176px; height: 176px; min-height: 176px; padding-block: 6px 2px; }
  .storefront-cover-stage { height: 158px; }
  .storefront-cover-art { max-width: 106px; }
  .storefront-card-copy { padding-inline: 5px; }
  .storefront-topic { margin-bottom: 3px; font-size: 8px; }
  .storefront-title-button { min-height: 40px; font-size: clamp(20px, 1.8vw, 23px); }
  .storefront-author { margin: 3px 0 5px; font-size: 10px; }
  .storefront-details-link { margin-bottom: 5px; font-size: 9px; }
  .storefront-specs { min-height: 25px; gap: 5px 11px; padding: 4px 0 6px; }
  .storefront-specs span { font-size: 8px; }
  .storefront-buy-row { min-height: 38px; padding-top: 3px; }
  .storefront-price { font-size: 25px; }
  .storefront-buy-button { min-height: 34px; padding-inline: 12px; font-size: 10px; }
  .storefront-catalog-cta { gap: 5px; margin-top: 9px; }
  .storefront-catalog-cta a { min-height: 38px; }
  .storefront-catalog-cta > span { font-size: 8px; }
}

@media (min-width: 1400px) {
  .site-header { height: 72px; }
  .site-header .main-nav { gap: clamp(15px, 1.4vw, 25px); margin-left: auto; }
  .site-header .main-nav a { height: 72px; font-size: 12px; }
  .storefront-intro { min-height: 182px; }
  .storefront-card { padding: 13px 18px 18px; }
  .storefront-cover-button { flex-basis: 400px; height: 400px; min-height: 400px; }
  .storefront-cover-stage { height: 360px; }
}

@media (max-width: 1100px) {
  .storefront-intro { grid-template-columns: minmax(0, 1fr) 190px; gap: 25px; }
  .storefront-products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .storefront-card:last-child { grid-column: 1 / -1; }
  .storefront-card:last-child .storefront-cover-button { flex-basis: 270px; height: 270px; min-height: 270px; }
  .storefront-card:last-child .storefront-cover-stage { height: 250px; }
}

@media (max-width: 768px) {
  #book-dialog {
    box-sizing: border-box;
    width: calc(100% - 24px);
    max-width: calc(100vw - 24px);
    overflow-x: hidden;
  }
  #book-dialog-content,
  .book-dialog-body,
  .book-dialog-body > div {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
  .book-dialog-body { padding: 18px; }
  .dialog-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dialog-book-actions { align-items: stretch; flex-wrap: wrap; gap: 8px; }
  .dialog-price-tag { flex: 1 0 100%; }
  .dialog-book-actions .btn-primary-large,
  .dialog-book-actions .btn-secondary-large {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    justify-content: center;
    padding-inline: 12px;
    white-space: normal;
  }
  .site-header { height: 62px; padding: 0 12px; gap: 6px; }
  .site-header .brand { flex: 0 1 auto; min-width: max-content; gap: 6px; }
  .site-header .brand strong { font-size: 17px; white-space: nowrap; }
  .site-header .brand small { font-size: 7px; white-space: nowrap; }
  .site-header .main-nav { top: 62px; }
  .storefront-header-search input:focus,
  .storefront-header-search:focus-within input {
    position: fixed;
    z-index: 60;
    top: 70px;
    right: 12px;
    width: min(68vw, 280px);
    padding: 8px 10px;
    border: 1px solid var(--storefront-line);
    border-radius: 7px;
    background: #fffdf9;
    box-shadow: 0 8px 24px rgba(35, 31, 26, .12);
  }
  .storefront-showcase { padding: 12px 9px 17px; }
  .storefront-inner { padding: 19px 17px 17px; }
  .storefront-intro { min-height: 0; grid-template-columns: 1fr; gap: 16px; }
  .storefront-intro h1 { max-width: 680px; font-size: clamp(42px, 9vw, 66px); }
  .storefront-subtitle { margin-top: 8px; font-size: 14px; }
  .storefront-promises { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 5px 0 2px; }
  .storefront-promises > div { align-items: flex-start; gap: 7px; font-size: 9px; }
  .storefront-promises i { width: 18px; flex-basis: 18px; font-size: 17px; }
  .storefront-section-label { margin-top: 16px; }
  .storefront-products { grid-template-columns: 1fr; gap: 12px; }
  .storefront-card,
  .storefront-card:last-child { grid-column: auto; display: grid; grid-template-columns: minmax(125px, 35%) minmax(0, 1fr); gap: 5px 12px; padding: 12px; }
  .storefront-cover-button { grid-row: 1; grid-column: 1; flex: none; min-height: 0; height: 226px; padding: 8px 3px; }
  .storefront-cover-stage,
  .storefront-card:last-child .storefront-cover-stage { height: 100%; max-height: 210px; }
  .storefront-cover-art { max-width: 100%; }
  .storefront-card-copy { grid-row: 1; grid-column: 2; padding: 3px 0 0; }
  .storefront-title-button { min-height: 0; font-size: clamp(20px, 5.5vw, 26px); }
  .storefront-author { margin: 5px 0; font-size: 10px; }
  .storefront-details-link { margin-bottom: 6px; font-size: 9px; }
  .storefront-specs { gap: 5px 9px; padding: 5px 0 6px; }
  .storefront-specs span { font-size: 8px; }
  .storefront-buy-row { min-height: 40px; gap: 5px; }
  .storefront-price { font-size: 25px; }
  .storefront-buy-button { min-height: 36px; gap: 5px; padding: 0 9px; font-size: 9px; }
  .storefront-pick { top: 4px; left: -5px; padding: 5px 6px; font-size: 6px; }
  .storefront-cover-disclosure { top: 5px; right: -4px; font-size: 5px; }
  .storefront-catalog-cta { margin-top: 14px; }
  .storefront-catalog-cta a { min-width: min(100%, 340px); }
  .storefront-catalog-cta > span { max-width: 310px; font-size: 8px; line-height: 1.5; }
  .catalog-section { margin: 40px auto 55px; padding-inline: 16px; }
  .book-grid { grid-template-columns: 1fr; gap: 13px; }
  .book-card { display: grid; grid-template-columns: minmax(110px, 34%) minmax(0, 1fr); align-items: stretch; }
  .card-cover-link { height: 220px; padding: 8px; }
  .card-cover-link img { max-width: 100%; }
  .catalog-scan-label { top: 7px; right: 6px; padding: 4px; font-size: 5px; }
  .card-body { padding: 12px 11px; }
  .card-title { min-height: 0; font-size: clamp(19px, 5vw, 25px); }
  .card-author { margin-bottom: 6px; font-size: 9px; }
  .card-meta { margin-bottom: 8px; font-size: 9px; }
  .card-footer { align-items: flex-end; gap: 5px; padding-top: 8px; }
  .card-price { font-size: 23px; }
  .card-add-btn { min-height: 34px; padding-inline: 8px; font-size: 8px; }
  .dialog-preview-viewer .dialog-book-cover { height: min(42vh, 380px); }
}

@media (max-width: 420px) {
  .site-header .brand { gap: 5px; }
  .site-header .brand i { font-size: 20px; }
  .site-header .brand strong { font-size: 16px; }
  .storefront-inner { padding-inline: 12px; }
  .storefront-card,
  .storefront-card:last-child { grid-template-columns: minmax(105px, 33%) minmax(0, 1fr); gap: 5px 9px; padding: 10px; }
  .storefront-cover-button { height: 195px; }
  .storefront-card:last-child .storefront-cover-stage,
  .storefront-cover-stage { max-height: 180px; }
  .storefront-topic { font-size: 8px; }
  .storefront-title-button { font-size: 20px; }
  .storefront-specs { gap: 4px 7px; }
  .storefront-specs span { font-size: 7px; }
  .storefront-buy-button { padding-inline: 7px; font-size: 8px; }
}

@media (max-width: 360px) {
  .site-header { padding-inline: 8px; gap: 2px; }
  .site-header .brand { flex: 1 1 0; min-width: 0; gap: 4px; }
  .site-header .brand i { flex: 0 0 auto; font-size: 17px; }
  .site-header .brand strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; }
  .site-header .brand small { display: none; }
  .site-header .menu-toggle { padding: 6px; }
  .site-header .currency-selector { min-width: 62px; padding: 4px 5px; }
  .site-header .currency-selector select { width: 48px; font-size: 11px; }
  .site-header .cart-button { min-width: 38px; padding: 6px 7px; }
  .site-header .cart-badge { min-width: 16px; padding-inline: 4px; }
  .section-heading-catalog { align-items: flex-start; flex-direction: column; gap: 10px; }
  .catalog-actions { align-self: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  .storefront-card,
  .storefront-cover-art,
  .storefront-buy-button,
  .storefront-catalog-cta a,
  .storefront-header-search input { transition: none; }
}

@media (min-width: 1400px) and (max-height: 780px) {
  .site-header,
  .site-header .main-nav a { height: 60px; }
  .storefront-intro { min-height: 112px; }
  .storefront-card { padding: 8px 11px 10px; }
  .storefront-cover-button { flex-basis: 176px; height: 176px; min-height: 176px; }
  .storefront-cover-stage { height: 158px; }
  .storefront-cover-art { max-width: 106px; }
}
