/* Visual layer only: catalog, public product details and shared navigation.
   Purchase, authentication, entitlements and reader behavior stay in their existing modules. */
:root {
  --catalog-gold: #e8bf72;
  --catalog-ink: #111b2d;
  --catalog-muted: #b8c5d7;
}
.header .nav { gap:24px; padding:15px 0; }
.header .brand-name { max-width:310px; white-space:normal; font-size:16px; line-height:1.35; letter-spacing:0; }
.header .links { gap:6px; }
.header .links a, .header .links .ghost {
  display:inline-flex; align-items:center; justify-content:center;
  min-height:44px; padding:10px 16px; font-size:14px; font-weight:600;
  background:transparent; border-color:transparent; border-radius:12px;
}
.header .links a[aria-current="page"] { color:var(--catalog-gold); background:rgba(232,191,114,.08); }
.header .links a[href="/login"] { border-color:rgba(232,191,114,.4); color:var(--catalog-gold); }
.header .links a:hover, .header .links .ghost:hover { background:rgba(255,255,255,.06); }
.header a:focus-visible, .header button:focus-visible,
.store-page a:focus-visible, .product-detail-hero a:focus-visible,
.product-info-grid a:focus-visible, .footer a:focus-visible {
  outline:2px solid var(--catalog-gold); outline-offset:4px;
}
.footer { background:rgba(3,9,20,.35); }
.footer-copy { max-width:780px; font-size:14px; color:var(--catalog-muted); }
.footer-links { gap:8px 24px; }
.footer-links a { padding:6px 0; font-size:13px; color:var(--catalog-muted); }

/* Catalog heading and collection */
.store-page { padding:58px 0 0; }
.store-heading { max-width:720px; margin-bottom:44px; }
.catalog-kicker, .product-section-kicker {
  display:block; color:var(--catalog-gold); font-size:11px; font-weight:700;
  letter-spacing:.16em; text-transform:uppercase;
}
.store-heading h1 {
  margin:16px 0 16px; max-width:640px; font-size:clamp(34px,4.5vw,52px);
  font-weight:700; line-height:1.12; letter-spacing:-1.6px; text-wrap:balance;
}
.store-heading p { max-width:620px; margin:0; color:var(--catalog-muted); font-size:17px; line-height:1.7; }
.catalog-heading { display:flex; align-items:baseline; justify-content:space-between; gap:14px; padding-top:22px; border-top:1px solid var(--line); }
.catalog-heading h2 { margin:0; font-size:19px; font-weight:600; letter-spacing:-.3px; }
.catalog-heading > span { font-size:13px; color:var(--catalog-muted); white-space:nowrap; }
.store-page .store-grid { gap:24px; margin:22px 0 0; grid-template-columns:repeat(3,minmax(0,1fr)); }
.store-page .ebook {
  border-radius:20px; background:linear-gradient(135deg,#1d2a3c,#121d2f);
  border-color:rgba(184,197,215,.18); box-shadow:0 12px 30px rgba(0,0,0,.14);
}
.store-page .store-grid .ebook .cover {
  height:220px!important; min-height:220px!important; max-height:220px!important;
  flex:0 0 220px!important; aspect-ratio:auto!important;
  background:#0b1120;
}
.store-page .store-grid .ebook .cover img { object-fit:contain; display:block; }
.store-page .ebook .ebook-body { padding:26px; gap:14px; min-width:0; }
.store-page .ebook h3 { font-size:23px; font-weight:650; line-height:1.25; letter-spacing:-.45px; overflow-wrap:anywhere; }
.store-page .ebook p { color:var(--catalog-muted); line-height:1.7; font-size:15px; }
.store-page .ebook .price { color:var(--catalog-gold); font-size:23px; letter-spacing:-.4px; margin-top:8px; }
.store-page .ebook .actions { padding-top:6px; gap:12px; }
.store-page .primary, .store-page .ghost, .product-detail-hero .actions a, .product-info-grid .primary {
  display:inline-flex; justify-content:center; align-items:center; min-height:46px;
  border-radius:12px; padding:12px 20px; font-size:14px; line-height:1.3; font-weight:650;
}
.store-page .primary, .product-detail-hero .primary, .product-info-grid .primary { background:var(--catalog-gold); color:#152031; }
.store-page .primary:hover, .product-detail-hero .primary:hover, .product-info-grid .primary:hover { filter:brightness(1.07); }
.store-page .ghost:hover, .product-detail-hero .ghost:hover { background:rgba(255,255,255,.08); }
.store-page .store-grid-single { grid-template-columns:minmax(0,1fr); }
.store-page .store-grid-single .ebook { display:grid; grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr); }
.store-page .store-grid-single .ebook .cover {
  height:100%!important; min-height:300px!important; max-height:none!important;
  border-right:1px solid var(--line);
}
.store-page .store-grid-single .ebook .ebook-body { padding:34px 40px; justify-content:center; gap:16px; }
.store-page .store-grid-single .ebook h3 { font-size:clamp(25px,3vw,34px); }
.store-page .store-grid-single .ebook p { max-width:490px; font-size:16px; }
.store-page .store-grid-single .ebook .actions { margin-top:0; }
.catalog-help { display:flex; align-items:center; justify-content:space-between; gap:28px; margin-top:38px; padding:28px 0 6px; border-top:1px solid var(--line); }
.catalog-help h2 { font-size:17px; font-weight:600; margin:0 0 8px; }
.catalog-help p { max-width:650px; margin:0; color:var(--catalog-muted); font-size:14px; line-height:1.65; }
.catalog-text-link { color:var(--catalog-gold); white-space:nowrap; font-size:14px; padding:12px 0; }
.catalog-text-link:hover { text-decoration:underline; text-underline-offset:4px; }
.catalog-empty { margin-top:24px; }
.catalog-empty p { color:var(--catalog-muted); }

/* Product presentation, deliberately excluding the purchased reader layout. */
.hero.product-detail-hero {
  grid-template-columns:minmax(0,1fr) minmax(240px,310px); gap:64px;
  padding:54px 0 44px; align-items:center;
}
.product-detail-hero > div:first-child { min-width:0; }
.product-detail-hero h1 { font-size:clamp(34px,4.5vw,52px); line-height:1.1; font-weight:700; letter-spacing:-1.5px; margin:0 0 20px; }
.product-detail-hero p { font-size:17px; line-height:1.75; color:var(--catalog-muted); max-width:620px; }
.product-detail-hero .badge { font-size:12px; padding:7px 12px; color:var(--catalog-gold); border-color:rgba(232,191,114,.24); background:rgba(232,191,114,.05); }
.product-detail-hero .hero-card {
  width:100%; max-width:310px; min-height:0; padding:12px; justify-self:end;
  border-radius:20px; background:linear-gradient(135deg,rgba(232,191,114,.10),rgba(255,255,255,.025));
  border:1px solid rgba(232,191,114,.22); box-shadow:0 24px 60px rgba(0,0,0,.28);
}
.product-detail-hero .hero-card .cover { width:100%; height:auto; aspect-ratio:2/3; border-radius:12px; overflow:hidden; background:#0b1120; }
.product-detail-hero .hero-card .cover img { display:block; height:100%; width:100%; object-fit:contain; }
.product-detail-hero .product-meta { gap:18px; grid-template-columns:.7fr .7fr 1.6fr; margin:24px 0; padding:20px 0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.product-detail-hero .product-meta > div { padding:0; background:none; border:0; border-radius:0; }
.product-detail-hero .product-meta span { color:var(--catalog-muted); font-size:12px; margin-bottom:6px; }
.product-detail-hero .product-meta strong { font-size:14px; font-weight:600; line-height:1.5; }
.product-price { display:flex; flex-direction:column; gap:4px; margin:22px 0; }
.product-price > span { font-size:12px; color:var(--catalog-muted); }
.product-price strong { color:var(--catalog-gold); font-size:32px; line-height:1.2; letter-spacing:-.6px; }
.product-detail-hero .actions { margin-top:0; gap:12px; scroll-margin-top:160px; }
.product-info-grid { gap:24px; margin-bottom:24px; }
.product-info-grid .panel { padding:28px; border-radius:18px; background:rgba(255,255,255,.025); box-shadow:none; }
.product-info-panel h2 { font-size:26px; font-weight:650; line-height:1.25; letter-spacing:-.5px; margin:12px 0 20px; }
.product-highlights { color:var(--catalog-muted); line-height:1.7; }
.product-access-panel h3 { font-size:22px; font-weight:650; line-height:1.3; margin:12px 0; }
.product-access-panel p { color:var(--catalog-muted); font-size:14px; line-height:1.7; }

@media (max-width:1000px) {
  .header .nav { gap:14px; }
  .header .brand-name { max-width:260px; }
  .header .links a, .header .links .ghost { padding:10px 12px; }
  .store-page .store-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .store-page .store-grid-single { grid-template-columns:minmax(0,1fr); }
  .store-page .store-grid-single .ebook .ebook-body { padding:28px; }
  .hero.product-detail-hero { gap:32px; grid-template-columns:minmax(0,1fr) 260px; }
}
@media (max-width:860px) {
  .header .nav { flex-direction:row; align-items:center; flex-wrap:wrap; gap:10px; }
  .header .links { margin-left:auto; }
}
@media (max-width:700px) {
  .store-page { padding-top:34px; }
  .store-heading { margin-bottom:30px; }
  .store-heading h1 { letter-spacing:-1px; }
  .store-heading p { font-size:16px; }
  .store-page .store-grid { grid-template-columns:minmax(0,1fr); }
  .store-page .store-grid-single .ebook { grid-template-columns:minmax(0,1fr); }
  .store-page .store-grid .ebook .cover,
  .store-page .store-grid-single .ebook .cover {
    height:250px!important; min-height:250px!important; max-height:250px!important;
    flex:0 0 250px!important; border-right:0; border-bottom:1px solid var(--line);
  }
  .store-page .ebook .ebook-body, .store-page .store-grid-single .ebook .ebook-body { padding:24px; }
  .store-page .store-grid-single .ebook h3 { font-size:27px; }
  .catalog-help { flex-direction:column; align-items:flex-start; gap:8px; margin-top:30px; }
  .hero.product-detail-hero { grid-template-columns:minmax(0,1fr); padding-top:28px; gap:28px; }
  .product-detail-hero .hero-card { order:-1; justify-self:center; max-width:210px; padding:8px; border-radius:16px; }
  .product-detail-hero h1 { font-size:36px; letter-spacing:-1px; }
  .product-detail-hero p { font-size:16px; }
  .product-info-grid { grid-template-columns:minmax(0,1fr); }
}
@media (max-width:520px) {
  .header .nav { flex-direction:column; align-items:stretch; padding:12px 0 8px; }
  .header .logo { gap:10px; }
  .header .brand-logo { width:36px; height:36px; flex-basis:36px; }
  .header .brand-name { font-size:14px; max-width:240px; }
  .header .links { margin-left:0; gap:4px; width:100%; justify-content:space-between; }
  .header .links a, .header .links .ghost { padding:9px 10px; font-size:13px; min-height:44px; }
  .catalog-heading { align-items:flex-start; flex-direction:column; gap:8px; }
  .store-page .ebook .actions { display:grid; grid-template-columns:1fr 1fr; }
  .product-detail-hero .product-meta { grid-template-columns:1fr 1fr; gap:18px; }
  .product-detail-hero .product-meta > div:last-child { grid-column:1/-1; }
  .product-detail-hero .actions { display:grid; grid-template-columns:1fr; }
  .product-info-grid .panel { padding:24px; }
  .footer { margin-top:36px; }
}
@media (prefers-reduced-motion:reduce) {
  .store-page .ebook { transition:none; }
}
