/* ==========================================================================
   A Blessed Phamily — design tokens
   Palette: cream base, honey accent, sage, dusty rose, deep ink, soft navy
   Type: Fraunces (display, warm rounded serif) + Nunito Sans (body)
   Signature: the "shelf" — a hand-drawn ledge divider that recurs everywhere,
   evoking the family bookshelf/toy shelf at the heart of the shop.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,500&family=Nunito+Sans:ital,wght@0,400;0,600;0,700;0,800;1,400&display=swap');

:root {
  --cream: #FBF6EC;
  --cream-deep: #F3EADA;
  --ink: #2E2A26;
  --ink-soft: #6B6459;
  --honey: #E8A33D;
  --honey-deep: #C97F1E;
  --sage: #7C9473;
  --sage-deep: #5F7857;
  --rose: #D98A93;
  --rose-deep: #C06672;
  --navy: #33506A;
  --white: #FFFFFF;

  --font-display: 'Fraunces', serif;
  --font-body: 'Nunito Sans', sans-serif;

  --radius: 14px;
  --shadow-soft: 0 6px 20px rgba(46, 42, 38, 0.08);
  --shadow-lift: 0 12px 32px rgba(46, 42, 38, 0.14);
  --max-width: 1160px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.55;
}

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

a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0 0 0.4em;
  color: var(--ink);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.4rem, 4.5vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; color: var(--ink-soft); }

.eyebrow {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage-deep);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

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

button { font-family: inherit; cursor: pointer; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  border: none;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary { background: var(--honey); color: var(--ink); box-shadow: var(--shadow-soft); }
.btn-primary:hover { background: var(--honey-deep); color: var(--white); transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.btn-secondary { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.btn-secondary:hover { background: var(--ink); color: var(--cream); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(251, 246, 236, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--cream-deep);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}
.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo img { height: 48px; width: 48px; border-radius: 50%; display: block; }
.logo .logo-text { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: var(--ink); white-space: nowrap; }
.logo .dot { color: var(--rose); }
.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav a {
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover, .main-nav a.active { border-bottom-color: var(--honey); }
.cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cart-badge {
  background: var(--rose);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.nav-toggle { display: none; }

.lang-switch { display: flex; align-items: center; gap: 4px; background: var(--cream-deep); border-radius: 999px; padding: 3px; }
.lang-btn { background: none; border: none; padding: 5px 10px; border-radius: 999px; font-size: 0.82rem; font-weight: 800; letter-spacing: 0.02em; cursor: pointer; display: flex; align-items: center; gap: 6px; color: var(--ink-soft); }
.lang-btn.active { background: var(--white); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.lang-btn .flag-icon { width: 18px; height: 13px; border-radius: 2px; display: block; box-shadow: 0 0 0 1px rgba(0,0,0,0.08); flex-shrink: 0; }

/* ---------- shelf divider signature ---------- */
.shelf-divider {
  display: block;
  width: 100%;
  height: 34px;
  margin: 0;
}
.shelf-divider path { fill: var(--cream-deep); }
.shelf-divider.flip { transform: scaleY(-1); }
.section-navy + .shelf-divider path,
.shelf-divider.on-navy path { fill: var(--navy); }

/* ---------- hero ---------- */
.hero {
  padding: 64px 0 40px;
  position: relative;
  overflow: hidden;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
}
.hero-copy .eyebrow { margin-bottom: 14px; display: inline-block; }
.hero-copy p.lead { font-size: 1.15rem; max-width: 46ch; }
.hero-actions { display: flex; gap: 14px; margin-top: 26px; flex-wrap: wrap; }
.hero-art { position: relative; }

/* ---------- animated shelf illustration ----------
   A short looping video of the shelf filling up with books and toys.
   For visitors with "reduce motion" enabled, we show the completed,
   static shelf image instead of autoplaying video. */
.shelf-video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}
.shelf-static-fallback { display: none; width: 100%; height: auto; }

@media (prefers-reduced-motion: reduce) {
  .shelf-video { display: none; }
  .shelf-static-fallback { display: block; }
}

/* ---------- value strip ---------- */
.value-strip {
  background: var(--cream-deep);
  padding: 30px 0;
}
.value-strip .container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.value-item { display: flex; align-items: flex-start; gap: 12px; }
.value-item .icon { font-size: 1.5rem; line-height: 1; }
.value-item h4 { margin: 0 0 2px; font-size: 0.95rem; font-family: var(--font-body); font-weight: 800; }
.value-item p { margin: 0; font-size: 0.85rem; }

/* ---------- section ---------- */
.section { padding: 64px 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 20px;
  flex-wrap: wrap;
}
.section-navy { background: var(--navy); color: var(--cream); }
.section-navy p, .section-navy h2 { color: var(--cream); }

/* ---------- tabs ---------- */
.tabs { display: inline-flex; background: var(--white); border-radius: 999px; padding: 4px; box-shadow: var(--shadow-soft); }
.tab {
  background: transparent;
  border: none;
  padding: 9px 22px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.tab.active { background: var(--sage); color: var(--white); }

/* ---------- product grid ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 24px;
}
.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.product-thumb {
  aspect-ratio: 4/3.2;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.product-thumb svg { width: 62%; height: 62%; }
.product-thumb-photo { padding: 14px; }
.product-thumb-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(46, 42, 38, 0.12);
}
.out-of-stock .product-thumb { filter: grayscale(0.6) opacity(0.55); }
.out-of-stock .product-info h3, .out-of-stock .price { opacity: 0.55; }
.stock-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(46,42,38,0.35); color: white; font-weight: 800; font-size: 0.85rem;
  text-transform: uppercase; letter-spacing: 0.04em; text-align: center; padding: 0 10px;
}
.product-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255,255,255,0.85);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 9px;
  border-radius: 999px;
}
.sale-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--rose-deep);
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.price-sale, .price-sale-large { display: inline-flex; align-items: baseline; gap: 8px; }
.price-original { text-decoration: line-through; color: var(--ink-soft); font-weight: 600; font-size: 0.85em; }
.price-current { color: var(--rose-deep); font-weight: 800; }
.price-sale-large .price-original { font-size: 1rem; }
.price-sale-large .price-current { font-size: 1.5rem; }
.product-info { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-info h3 { font-size: 1.02rem; margin: 0; }
.product-meta { font-size: 0.82rem; color: var(--ink-soft); margin: 0; }
.product-bottom { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.age-badge { font-size: 0.72rem; font-weight: 700; color: var(--sage-deep); background: #EEF2EC; padding: 3px 8px; border-radius: 999px; }

/* ---------- testimonial ---------- */
.testimonial {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
.testimonial p.quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--cream);
  line-height: 1.5;
}
.testimonial .who { color: var(--honey); font-weight: 800; font-size: 0.9rem; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: var(--cream-deep); padding: 48px 0 28px; }
.site-footer .container { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.site-footer h4 { color: var(--cream); font-family: var(--font-body); font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; }
.site-footer .logo img { height: 56px; width: 56px; }
.site-footer .logo .logo-text { color: var(--cream); font-size: 1.3rem; }
.site-footer a { text-decoration: none; color: var(--cream-deep); opacity: 0.85; }
.site-footer a:hover { opacity: 1; text-decoration: underline; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-bottom {
  max-width: var(--max-width);
  margin: 32px auto 0;
  padding: 20px 24px 0;
  border-top: 1px solid rgba(251,246,236,0.15);
  font-size: 0.8rem;
  opacity: 0.7;
}
.newsletter-form { display: flex; gap: 8px; margin-top: 10px; }
.newsletter-form input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 999px;
  border: none;
  font-family: inherit;
}

.social-links { display: flex; gap: 10px; margin-top: 16px; }
.social-links a {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(251,246,236,0.12);
  transition: background 0.15s ease, transform 0.15s ease;
}
.social-links a:hover { background: var(--honey); transform: translateY(-2px); }
.social-links svg { width: 18px; height: 18px; fill: var(--cream); }
.social-links a:hover svg { fill: var(--ink); }

/* ---------- cart drawer ---------- */
.cart-drawer-overlay {
  position: fixed; inset: 0; background: rgba(46,42,38,0.4);
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease; z-index: 60;
}
.cart-drawer-overlay.open { opacity: 1; pointer-events: auto; }
.cart-drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(400px, 92vw);
  background: var(--cream); z-index: 61; box-shadow: -12px 0 32px rgba(0,0,0,0.15);
  transform: translateX(100%); transition: transform 0.3s ease;
  display: flex; flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }
.cart-drawer-head { padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--cream-deep); }
.cart-drawer-head h3 { margin: 0; }
.cart-drawer-close { background: none; border: none; font-size: 1.4rem; line-height: 1; color: var(--ink); }
.cart-drawer-items { flex: 1; overflow-y: auto; padding: 14px 22px; }
.cart-drawer-footer { padding: 18px 22px 24px; border-top: 1px solid var(--cream-deep); }
.cart-line { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--cream-deep); }
.cart-line-thumb { width: 56px; height: 56px; border-radius: 10px; background: var(--white); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cart-line-thumb svg { width: 65%; height: 65%; }
.cart-line-info { flex: 1; }
.cart-line-info h4 { margin: 0 0 4px; font-size: 0.92rem; font-family: var(--font-body); font-weight: 800; }
.qty-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.qty-btn { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--ink-soft); background: var(--white); font-weight: 800; }
.remove-link { background: none; border: none; color: var(--rose-deep); font-size: 0.78rem; font-weight: 700; padding: 0; margin-top: 6px; text-decoration: underline; }
.cart-subtotal-row { display: flex; justify-content: space-between; font-weight: 800; font-size: 1.05rem; margin-bottom: 14px; }
.cart-empty { text-align: center; padding: 40px 10px; }

/* ---------- page header (shop/cart/checkout) ---------- */
.page-hero { padding: 44px 0 24px; }
.page-hero p { max-width: 60ch; }

/* ---------- shop layout ---------- */
.shop-controls { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 30px; }
.search-input {
  padding: 10px 16px; border-radius: 999px; border: 1px solid var(--cream-deep);
  background: var(--white); min-width: 220px; font-family: inherit;
}

/* ---------- cart page ---------- */
.cart-page-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 36px; align-items: start; }
.summary-card { background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-soft); }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 0.95rem; color: var(--ink-soft); }
.summary-row.total { color: var(--ink); font-weight: 800; font-size: 1.15rem; border-top: 1px solid var(--cream-deep); padding-top: 12px; margin-top: 12px; }

/* ---------- checkout form ---------- */
.checkout-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 36px; align-items: start; }
.form-card { background: var(--white); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-soft); }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-weight: 700; font-size: 0.85rem; margin-bottom: 6px; }
.form-row input, .form-row select {
  width: 100%; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--cream-deep);
  font-family: inherit; font-size: 0.95rem; background: var(--cream);
}
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checkout-note {
  background: #EEF2EC; border: 1px solid var(--sage); border-radius: 10px; padding: 12px 14px;
  font-size: 0.83rem; color: var(--sage-deep); margin-top: 18px;
}

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--cream); padding: 12px 22px; border-radius: 999px;
  font-weight: 700; font-size: 0.9rem; opacity: 0; pointer-events: none; transition: all 0.25s ease; z-index: 80;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- empty state ---------- */
.empty-state { text-align: center; padding: 70px 20px; }
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 340px; margin: 0 auto; }
  .value-strip .container { grid-template-columns: repeat(2, 1fr); }
  .site-footer .container { grid-template-columns: 1fr 1fr; }
  .cart-page-grid, .checkout-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .main-nav { position: fixed; top: 68px; left: 0; right: 0; background: var(--cream); flex-direction: column; padding: 18px 24px; gap: 16px; border-bottom: 1px solid var(--cream-deep); transform: translateY(-130%); transition: transform 0.25s ease; }
  .main-nav.open { transform: translateY(0); }
  .nav-toggle { display: inline-flex; background: none; border: none; font-size: 1.4rem; }
  .value-strip .container { grid-template-columns: 1fr; }
  .site-footer .container { grid-template-columns: 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .logo .logo-text { font-size: 1rem; }
}

/* ---------- contact form ---------- */
.contact-form .form-row textarea {
  width: 100%; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--cream-deep);
  font-family: inherit; font-size: 0.95rem; background: var(--cream); resize: vertical; min-height: 120px;
}
.form-status { font-size: 0.88rem; margin-top: 12px; padding: 10px 14px; border-radius: 8px; display: none; }
.form-status.success { display: block; background: #EAF3E7; color: #3f6b37; }
.form-status.error { display: block; background: #FBEAEA; color: #a13a3a; }
