/* ============================================================
   Chen Math Worksheets — storefront styles
   Teal/emerald + warm amber "resource shop" theme.
   Mobile-first, no frameworks.
   ============================================================ */

:root {
  --teal: #0f766e;
  --teal-dark: #115e59;
  --teal-deep: #0b3d39;
  --emerald: #059669;
  --amber: #f59e0b;
  --amber-dark: #d97706;
  --amber-soft: #fef3c7;
  --cream: #fffdf8;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e9e2d3;
  --teal-soft: #e6f4f2;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(11, 61, 57, 0.08);
  --shadow-lg: 0 18px 50px rgba(11, 61, 57, 0.14);
  --font-display: "Nunito", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", 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;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  color: var(--teal-deep);
  margin: 0 0 0.6em;
}

h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 800; }
h3 { font-size: 1.25rem; font-weight: 800; }

p { margin: 0 0 1em; }

a { color: var(--teal); }

section { scroll-margin-top: 84px; }

.wrap {
  width: min(1140px, 92%);
  margin: 0 auto;
}

.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 999px;
  padding: 0.35em 1em;
  margin-bottom: 1rem;
}

.section-lede {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 640px;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  margin-right: auto;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--teal), var(--emerald));
  color: #fff;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.35rem;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.05rem;
  color: var(--teal-deep);
  line-height: 1.15;
}
.brand-name small {
  display: block;
  font-weight: 700;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
}
.nav-links a:hover { color: var(--teal); }

.cart-btn {
  position: relative;
  border: 2px solid var(--teal);
  background: #fff;
  color: var(--teal-dark);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: background 0.2s, color 0.2s;
}
.cart-btn:hover { background: var(--teal); color: #fff; }

.cart-count {
  background: var(--amber);
  color: #fff;
  font-size: 0.75rem;
  min-width: 1.4em;
  height: 1.4em;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  padding: 0 0.3em;
}

.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--line);
  border-radius: 10px;
  font-size: 1.2rem;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  color: var(--teal-deep);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 800;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.85rem 1.7rem;
  font-size: 1rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--teal), var(--emerald));
  color: #fff;
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.35);
}
.btn-primary:hover { box-shadow: 0 12px 26px rgba(15, 118, 110, 0.45); }

.btn-amber {
  background: var(--amber);
  color: #fff;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.35);
}
.btn-amber:hover { background: var(--amber-dark); }

.btn-outline {
  background: #fff;
  border-color: var(--teal);
  color: var(--teal-dark);
}
.btn-outline:hover { background: var(--teal-soft); }

.btn-block { width: 100%; text-align: center; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3rem, 8vw, 6rem) 0;
  background:
    radial-gradient(600px 320px at 85% 10%, rgba(245, 158, 11, 0.14), transparent 60%),
    radial-gradient(700px 380px at 10% 90%, rgba(15, 118, 110, 0.12), transparent 60%),
    var(--cream);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 3rem;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 900;
  margin-bottom: 0.5em;
}
.hero h1 .accent { color: var(--teal); }

.hero p.lede {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 34rem;
}

.hero-ctas { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-top: 1.6rem; }

.hero-proof {
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
  margin-top: 1.8rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.hero-proof span { display: inline-flex; align-items: center; gap: 0.4rem; }
.hero-proof strong { color: var(--teal-dark); }

.hero-art {
  position: relative;
}
.hero-art img {
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  transform: rotate(1.5deg);
}
.hero-badge {
  position: absolute;
  left: -14px;
  bottom: 26px;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 0.8rem 1.1rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--teal-deep);
  transform: rotate(-2deg);
}
.hero-badge small { display: block; font-weight: 700; color: var(--muted); font-size: 0.75rem; }

/* ---------- Trust strip ---------- */
.trust-strip {
  background: var(--teal-deep);
  color: #e6f4f2;
  padding: 1.1rem 0;
}
.trust-strip ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
}
.trust-strip li::before { content: "✓ "; color: var(--amber); font-weight: 900; }

/* ---------- Product grid ---------- */
.shop-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.card-badge {
  position: absolute;
  top: -12px;
  right: 16px;
  background: var(--amber);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.3em 0.9em;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.4);
}

.card-level {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--emerald);
  margin-bottom: 0.4rem;
}

.card h3 { margin-bottom: 0.4rem; }

.card p.blurb { color: var(--muted); font-size: 0.95rem; }

.inside-list {
  list-style: none;
  margin: 0 0 1.1rem;
  padding: 0;
  font-size: 0.9rem;
}
.inside-list li {
  padding: 0.28rem 0 0.28rem 1.6rem;
  position: relative;
  color: var(--ink);
}
.inside-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--emerald);
  font-weight: 900;
}

.card-format {
  font-size: 0.82rem;
  color: var(--muted);
  border-top: 1px dashed var(--line);
  padding-top: 0.8rem;
  margin-bottom: 1rem;
}

.card-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.card-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.price {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.5rem;
  color: var(--teal-deep);
}
.price small { font-size: 0.75rem; font-weight: 700; color: var(--muted); }

.add-btn {
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.92rem;
  padding: 0.7rem 1.3rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}
.add-btn:hover { background: var(--teal-dark); }
.add-btn:active { transform: scale(0.96); }

/* ---------- PayPal buttons ---------- */
.paypal-btn {
  display: inline-block;
  background: #FFC439;
  color: #1a1a2e;
  border: none;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.92rem;
  padding: 0.7rem 1.3rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}
.paypal-btn:hover { background: #e6ae2e; }
.paypal-btn:active { transform: scale(0.96); }
.paypal-btn.disabled,
span.paypal-btn.disabled {
  background: var(--line, #e5e7eb);
  color: var(--muted, #6b7280);
  cursor: not-allowed;
  pointer-events: none;
}
.cart-pay {
  margin-top: 0.6rem;
  width: 100%;
  font-size: 0.85rem;
  padding: 0.6rem 1rem;
}
.card-foot .paypal-btn { font-size: 0.85rem; padding: 0.7rem 1rem; }

/* ---------- Samples ---------- */
.samples { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.samples-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 3rem;
  align-items: center;
}
.samples-grid img { border-radius: 20px; box-shadow: var(--shadow-lg); }

.sample-cards { display: grid; gap: 1.2rem; margin-top: 1.6rem; }

.sample-card {
  display: flex;
  gap: 1.1rem;
  align-items: center;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
}
.sample-icon {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--teal-soft);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
}
.sample-card h4 { margin: 0 0 0.2rem; font-size: 1.05rem; }
.sample-card p { margin: 0; font-size: 0.88rem; color: var(--muted); }
.sample-dl {
  margin-left: auto;
  flex-shrink: 0;
}

/* ---------- Why ---------- */
.why-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.why-grid img { border-radius: 20px; box-shadow: var(--shadow-lg); }

.why-list { list-style: none; margin: 1.6rem 0 0; padding: 0; display: grid; gap: 1.3rem; }
.why-list li { display: flex; gap: 1rem; }
.why-num {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amber), var(--amber-dark));
  color: #fff;
  font-family: var(--font-display);
  font-weight: 900;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}
.why-list h4 { margin: 0 0 0.25rem; }
.why-list p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- About ---------- */
.about { background: var(--teal-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.about-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: clamp(1.6rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 2rem;
  align-items: start;
}
.about-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--emerald));
  color: #fff;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2.6rem;
  display: grid;
  place-items: center;
}
.about-card p { color: var(--muted); }
.about-card p strong { color: var(--ink); }

/* ---------- FAQ ---------- */
.faq-list { max-width: 760px; display: grid; gap: 0.9rem; }

details.faq {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.1rem 1.3rem;
  box-shadow: var(--shadow);
}
details.faq summary {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--teal-deep);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: "+";
  font-size: 1.4rem;
  color: var(--amber-dark);
  font-weight: 900;
  flex-shrink: 0;
}
details.faq[open] summary::after { content: "–"; }
details.faq p { margin: 0.8rem 0 0; color: var(--muted); font-size: 0.96rem; }

/* ---------- Final CTA ---------- */
.final-cta {
  background: linear-gradient(135deg, var(--teal-deep), var(--teal-dark));
  color: #fff;
  border-radius: 24px;
  padding: clamp(2rem, 5vw, 3.5rem);
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.final-cta h2 { color: #fff; }
.final-cta p { color: #cde8e4; max-width: 560px; margin: 0 auto 1.6rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--teal-deep);
  color: #b9d9d4;
  padding: 3rem 0 1.5rem;
  font-size: 0.92rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 0.8rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.site-footer a { color: #b9d9d4; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 1.2rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: #8fb8b2;
}

/* ---------- Cart drawer ---------- */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 61, 57, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 90;
}
.cart-overlay.open { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(420px, 94vw);
  background: var(--cream);
  z-index: 100;
  transform: translateX(105%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -20px 0 60px rgba(11, 61, 57, 0.25);
}
.cart-drawer.open { transform: translateX(0); }

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.4rem;
  border-bottom: 1px solid var(--line);
}
.cart-head h3 { margin: 0; }
.cart-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }
.cart-empty .big { font-size: 2.4rem; display: block; margin-bottom: 0.6rem; }

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem 0.8rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem;
}
.cart-item h4 { margin: 0; font-size: 0.98rem; }
.cart-item .unit { font-size: 0.82rem; color: var(--muted); }
.qty-ctrl { display: flex; align-items: center; gap: 0.6rem; grid-column: 1; }
.qty-ctrl button {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: #fff;
  font-weight: 900;
  color: var(--teal-dark);
  cursor: pointer;
  line-height: 1;
}
.qty-ctrl button:hover { border-color: var(--teal); }
.qty-num { font-weight: 800; min-width: 1.4em; text-align: center; }
.item-total { font-family: var(--font-display); font-weight: 800; color: var(--teal-deep); align-self: center; }
.item-remove {
  background: none; border: none; color: var(--muted);
  font-size: 0.8rem; cursor: pointer; text-decoration: underline;
  grid-column: 2; justify-self: end;
}
.item-remove:hover { color: #b91c1c; }

.cart-foot {
  border-top: 1px solid var(--line);
  padding: 1.2rem 1.4rem 1.4rem;
  background: #fff;
}
.cart-subtotal {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--teal-deep);
  margin-bottom: 1rem;
}
.cart-note { font-size: 0.8rem; color: var(--muted); text-align: center; margin-top: 0.8rem; }

/* ---------- Checkout modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 61, 57, 0.55);
  z-index: 110;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
}
.modal-overlay.open { display: flex; }

.modal {
  background: #fff;
  border-radius: 20px;
  max-width: 460px;
  width: 100%;
  padding: 2.2rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.modal .modal-icon { font-size: 2.6rem; display: block; margin-bottom: 0.8rem; }
.modal h3 { margin-bottom: 0.5rem; }
.modal p { color: var(--muted); font-size: 0.96rem; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 80px);
  background: var(--teal-deep);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  z-index: 120;
  transition: transform 0.3s ease;
  max-width: 92vw;
  text-align: center;
}
.toast.show { transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid, .samples-grid, .why-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero-art { max-width: 520px; }
  .about-card { grid-template-columns: 1fr; text-align: left; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 0.5rem 4%;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.8rem 0.2rem; border-bottom: 1px solid var(--line); }
  .nav-links li:last-child a { border-bottom: none; }
  .site-header .wrap { position: relative; }
  .footer-grid { grid-template-columns: 1fr; }
  .sample-card { flex-wrap: wrap; }
  .sample-dl { margin-left: 0; width: 100%; }
  .sample-dl .btn { width: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
