/* =========================================================================
   Diet eBooks - stylesheet
   Palette: botanical green + cream paper + honey accent (natural / health)
   Type: Fraunces (display) + Inter (body)
   ====================================================================== */

:root {
  --green-900: #14432c;
  --green-700: #1f5c3a;
  --green-500: #4c956c;
  --green-300: #86b89a;
  --sage:      #cfe1d0;
  --sage-50:   #eef4ee;
  --cream:     #f7f6f0;
  --paper:     #ffffff;
  --honey:     #e9a53f;
  --honey-dark:#c9871f;
  --ink:       #1d2b22;
  --muted:     #5b6b60;
  --line:      #e2e5dd;

  --radius:    14px;
  --radius-sm: 9px;
  --shadow:    0 10px 30px -18px rgba(20, 67, 44, 0.45);
  --shadow-sm: 0 4px 14px -8px rgba(20, 67, 44, 0.4);
  --wrap:      1140px;

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-wrap: break-word;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  font-weight: 600;
  color: var(--green-900);
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2rem, 5vw, 3.1rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1rem; }

a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--green-900); color: #fff; padding: 10px 16px; z-index: 200;
}
.skip-link:focus { left: 8px; top: 8px; }

:focus-visible { outline: 3px solid var(--honey); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem;
  padding: 0.8em 1.5em; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--honey); color: #3a2a05; text-decoration: none;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--honey-dark); color: #fff; text-decoration: none; transform: translateY(-1px); }
.btn-green { background: var(--green-700); color: #fff; }
.btn-green:hover { background: var(--green-900); color: #fff; }
.btn-ghost { background: transparent; color: var(--green-700); box-shadow: inset 0 0 0 2px var(--green-500); }
.btn-ghost:hover { background: var(--green-700); color: #fff; }
.btn-small { padding: 0.55em 1.1em; font-size: 0.9rem; }
.btn-block { display: flex; width: 100%; justify-content: center; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247, 246, 240, 0.92);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 68px; }

/* Small horizontal logo */
.brand { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px;
  background: var(--green-700); color: #fff; border-radius: 9px; font-size: 0.95rem;
}
.brand-text {
  font-family: var(--font-display); font-weight: 700; font-size: 1.3rem;
  color: var(--green-900); letter-spacing: -0.01em; line-height: 1;
}
.brand-accent { color: var(--green-500); }
.brand:hover { text-decoration: none; }

.primary-nav { margin-left: auto; display: flex; align-items: center; gap: 0.35rem; }
.primary-nav a {
  color: var(--ink); font-weight: 500; padding: 0.5rem 0.85rem; border-radius: 8px;
  font-size: 0.98rem;
}
.primary-nav a:hover { background: var(--sage-50); color: var(--green-900); text-decoration: none; }

.nav-cart { position: relative; display: inline-flex; align-items: center; gap: 0.45rem; }
.cart-count {
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--honey); color: #3a2a05; font-size: 0.72rem; font-weight: 700;
  display: inline-grid; place-items: center;
}
.cart-count.is-empty { background: var(--sage); color: var(--muted); }

.nav-toggle {
  margin-left: auto; display: none; background: none; border: 0; font-size: 1.4rem;
  color: var(--green-900); cursor: pointer; padding: 6px 8px;
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1200px 400px at 80% -10%, rgba(76,149,108,.22), transparent 60%),
    linear-gradient(180deg, var(--sage-50), var(--cream));
  border-bottom: 1px solid var(--line);
  padding: 4.5rem 0 4rem;
}
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 3rem; align-items: center; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: #fff; border: 1px solid var(--line); color: var(--green-700);
  padding: 0.4rem 0.9rem; border-radius: 999px; font-weight: 600; font-size: 0.82rem;
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 1.2rem;
}
.hero h1 { margin-bottom: 0.6rem; }
.hero .lead { font-size: 1.18rem; color: var(--muted); max-width: 40ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.6rem; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 1.4rem; margin-top: 2rem; color: var(--muted); font-size: 0.92rem; }
.hero-trust span { display: inline-flex; align-items: center; gap: 0.45rem; }
.hero-trust i { color: var(--green-500); }

.hero-visual {
  background: #fff; border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow); padding: 2rem; text-align: center;
}
.hero-visual .big-leaf { font-size: 3.4rem; color: var(--green-500); margin-bottom: 0.6rem; }
.hero-visual .stat { font-family: var(--font-display); font-size: 2.6rem; color: var(--green-900); font-weight: 700; }
.hero-covers { display: flex; justify-content: center; align-items: stretch;
  gap: 0.8rem; margin-bottom: 1.1rem; }
.hero-cover { flex: 1 1 0; min-width: 0; max-width: 150px; aspect-ratio: 2 / 3;
  border-radius: 10px; overflow: hidden; box-shadow: var(--shadow);
  transition: transform .14s ease; }
.hero-cover:hover { transform: translateY(-4px); }
.hero-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Sections ---------- */
.section { padding: 3.5rem 0; }
.section-tint { background: var(--sage-50); }
.section-head { text-align: center; max-width: 60ch; margin: 0 auto 2.4rem; }
.section-head p { color: var(--muted); }
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.09em; font-size: 0.78rem;
  font-weight: 700; color: var(--green-500); margin-bottom: 0.5rem;
}

/* ---------- Feature row ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.feature {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem; box-shadow: var(--shadow-sm);
}
.feature-ico {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--sage-50); color: var(--green-700); font-size: 1.15rem; margin-bottom: 0.9rem;
}
.feature h3 { margin-bottom: 0.3rem; }
.feature p { color: var(--muted); margin: 0; font-size: 0.96rem; }

/* ---------- Product grid ---------- */
.book-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.6rem;
}
.book-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-sm);
  transition: transform .14s ease, box-shadow .14s ease;
}
.book-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.book-cover { aspect-ratio: 2 / 3; background: var(--sage-50); position: relative; overflow: hidden; }
.book-cover img { width: 100%; height: 100%; object-fit: contain; display: block; }
.book-cover .cover-fallback {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--green-300); font-size: 2.4rem;
}
.book-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; flex: 1; }
.book-title { font-family: var(--font-display); font-size: 1.08rem; font-weight: 600; margin: 0 0 0.15rem; }
.book-title a { color: var(--green-900); }
.book-author { color: var(--muted); font-size: 0.86rem; margin: 0 0 0.9rem; }
.book-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.book-price { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: var(--green-700); }

/* ---------- Pagination ---------- */
.pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 0.4rem; margin-top: 2.6rem; }
.pager a, .pager span { display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; height: 42px; padding: 0 0.7rem; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--green-900); font-weight: 600;
  text-decoration: none; transition: background .12s ease, border-color .12s ease; }
.pager a:hover { background: var(--sage-50); border-color: var(--green-300); }
.pager .is-current { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.pager .is-disabled { opacity: 0.4; pointer-events: none; }
.pager .pager-gap { border: none; background: none; min-width: 20px; }

/* ---------- Product detail ---------- */
.product { display: grid; grid-template-columns: 340px 1fr; gap: 2.6rem; align-items: start; }
.product-cover {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); position: sticky; top: 90px;
}
.product-cover img { width: 100%; }
.product-cover .cover-fallback { aspect-ratio: 3/4; display: grid; place-items: center; color: var(--green-300); font-size: 3rem; }
.product-meta { color: var(--muted); font-size: 0.95rem; margin-bottom: 1rem; }
.product-meta span { margin-right: 1.2rem; display: inline-flex; align-items: center; gap: 0.4rem; }
.product-price-row { display: flex; align-items: center; gap: 1.2rem; margin: 1.4rem 0; flex-wrap: wrap; }
.product-price { font-family: var(--font-display); font-weight: 700; font-size: 2rem; color: var(--green-700); }
.product-preface { line-height: 1.75; }
.product-preface h2 { margin-top: 1.6rem; }
.breadcrumb { font-size: 0.86rem; color: var(--muted); margin-bottom: 1rem; }
.breadcrumb a { color: var(--muted); }
.breadcrumb i { font-size: 0.7rem; margin: 0 0.4rem; }

/* ---------- Cart ---------- */
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 2rem; align-items: start; }
.cart-list { list-style: none; margin: 0; padding: 0; }
.cart-row {
  display: grid; grid-template-columns: 60px 1fr auto auto; gap: 1rem; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 0.9rem 1rem; margin-bottom: 0.9rem;
}
.cart-row .thumb { width: 60px; height: 80px; border-radius: 6px; overflow: hidden; background: var(--sage-50); }
.cart-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-row .c-title { font-weight: 600; color: var(--green-900); }
.cart-row .c-author { color: var(--muted); font-size: 0.85rem; }
.cart-row .c-price { font-weight: 700; color: var(--green-700); font-family: var(--font-display); }
.cart-remove { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1rem; }
.cart-remove:hover { color: #b23b3b; }

.summary {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem; box-shadow: var(--shadow-sm); position: sticky; top: 90px;
}
.summary h2 { font-size: 1.25rem; }
.summary-row { display: flex; justify-content: space-between; padding: 0.4rem 0; color: var(--muted); }
.summary-total { display: flex; justify-content: space-between; font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; color: var(--green-900); border-top: 1px solid var(--line); margin-top: 0.6rem; padding-top: 0.8rem; }
.summary .btn { margin-top: 1rem; }
.summary .safe-note { font-size: 0.82rem; color: var(--muted); text-align: center; margin: 0.9rem 0 0; }

/* ---------- Forms ---------- */
.form-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.8rem; box-shadow: var(--shadow-sm); max-width: 620px;
}
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.35rem; color: var(--green-900); }
.field input, .field textarea {
  width: 100%; padding: 0.75rem 0.9rem; border: 1px solid var(--line); border-radius: 10px;
  font-family: var(--font-body); font-size: 1rem; background: var(--cream); color: var(--ink);
}
.field input:focus, .field textarea:focus { border-color: var(--green-500); background: #fff; outline: none; box-shadow: 0 0 0 3px rgba(76,149,108,.18); }
.field textarea { min-height: 140px; resize: vertical; }
.field .hint { font-size: 0.83rem; color: var(--muted); margin-top: 0.3rem; }
.field-help { font-size: 0.83rem; color: var(--muted); margin: 0.4rem 0 0; }

/* Contact spam-check challenge */
.captcha {
  display: inline-flex; gap: 0.4rem; margin-bottom: 0.6rem; padding: 0.5rem 0.7rem;
  background: var(--sage-50); border: 1px dashed var(--green-300); border-radius: 10px;
  user-select: none;
}
.captcha-digit {
  font-family: var(--font-display); font-weight: 700; font-size: 1.4rem;
  color: var(--green-900); letter-spacing: 0.06em; min-width: 1.1ch; text-align: center;
}
.captcha-digit:nth-child(2n) { transform: translateY(-2px) rotate(-4deg); }
.captcha-digit:nth-child(2n+1) { transform: translateY(1px) rotate(3deg); }

.notice { padding: 0.9rem 1.1rem; border-radius: 10px; margin-bottom: 1.2rem; font-size: 0.95rem; }
.notice-ok { background: #e7f3ea; color: #1f5c3a; border: 1px solid #bfe0c8; }
.notice-err { background: #fbeaea; color: #a12727; border: 1px solid #f0c9c9; }
.notice i { margin-right: 0.4rem; }

/* ---------- Static / policy pages ---------- */
.prose { max-width: 760px; }
.prose h2 { margin-top: 2rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.4rem; }
.page-hero { background: var(--sage-50); border-bottom: 1px solid var(--line); padding: 2.6rem 0; }
.page-hero p { color: var(--muted); margin: 0; max-width: 60ch; }

/* ---------- Secure download area ---------- */
.secure-wrap { max-width: 560px; margin: 0 auto; }
.download-list { list-style: none; margin: 1.4rem 0 0; padding: 0; }
.download-row {
  display: flex; align-items: center; gap: 1rem; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 1rem 1.1rem; margin-bottom: 0.9rem;
}
.download-row .d-title { font-weight: 600; color: var(--green-900); flex: 1; }
.download-formats { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--green-900); color: #d8e6dd; margin-top: 4rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 2rem; padding: 3rem 20px 2.4rem; }
.footer-col p { color: #b6ccbe; font-size: 0.95rem; }
.brand--footer .brand-text { color: #fff; }
.brand--footer .brand-accent { color: var(--green-300); }
.brand--footer .brand-mark { background: var(--green-500); }
.footer-parent a { color: var(--honey); font-weight: 600; }
.footer-heading { color: #fff; font-size: 1rem; font-family: var(--font-body); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.9rem; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 0.5rem; }
.footer-links a { color: #cfe1d0; }
.footer-links a:hover { color: #fff; }
.footer-contact i { color: var(--green-300); width: 18px; }
.footer-bar { border-top: 1px solid rgba(255,255,255,.12); }
.footer-bar-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem; padding: 1.1rem 20px; font-size: 0.86rem; color: #a9c2b3; }
.footer-bar p { margin: 0; }
.footer-pay i { color: #fff; margin-right: 0.3rem; }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state i { font-size: 2.6rem; color: var(--green-300); margin-bottom: 0.8rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero-visual { max-width: 360px; margin-inline: auto; }
  .features { grid-template-columns: 1fr; }
  .product { grid-template-columns: 1fr; }
  .product-cover { position: static; max-width: 300px; margin-inline: auto; }
  .cart-layout { grid-template-columns: 1fr; }
  .summary { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1.2rem; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .section { padding: 2.6rem 0; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin-left: auto; }
  .primary-nav {
    position: absolute; top: 68px; left: 0; right: 0; background: var(--cream);
    border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch;
    gap: 0; padding: 0.5rem; display: none; z-index: 120;
    box-shadow: var(--shadow);
  }
  .primary-nav.is-open { display: flex; }
  .primary-nav a { padding: 0.9rem 1rem; border-radius: 8px; }
  .primary-nav a:hover { background: var(--sage-50); text-decoration: none; }
  .nav-cart { justify-content: space-between; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  .store-filter { flex-direction: column; align-items: stretch; }
  .store-filter .btn { justify-content: center; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.6rem; }
  .form-card { padding: 1.3rem; }
  .product-meta span { margin-right: 0.9rem; }
}
@media (max-width: 480px) {
  .wrap { padding: 0 16px; }
  .book-grid { grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }
  .book-body { padding: 0.8rem 0.85rem 1rem; }
  .book-title { font-size: 0.98rem; }
  .book-price { font-size: 1.1rem; }
  .book-foot { flex-wrap: wrap; gap: 0.5rem; }
  .book-foot .btn-small { width: 100%; justify-content: center; }
  .hero-covers { gap: 0.7rem; }
  .btn { padding: 0.75em 1.2em; }
  .pager a, .pager span { min-width: 38px; height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
