/* ============================================================
   Wooden Toys R Us — design tokens from the brand mockup
   ============================================================ */
:root {
  --cream: #FBF4E6;        /* page background */
  --cream-card: #F6ECD9;   /* hero / card panels */
  --cream-deep: #F0E2C8;   /* borders, footer band */
  --ink: #5F4630;          /* primary brown text */
  --ink-soft: #8A6F55;     /* secondary text */
  --wood: #C98A4B;         /* logo block, accents */
  --green: #6D8B4F;        /* CTAs */
  --green-deep: #5C7742;
  --green-band: #8CA36B;   /* newsletter band */
  --red-badge: #D95B43;

  --tile-sage: #DDE5C9;
  --tile-yellow: #F7E3AC;
  --tile-coral: #F5C9B4;
  --tile-blue: #CFE0EE;
  --tile-amber: #F3D48E;
  --tile-green: #D9E4C2;

  --radius: 16px;
  --radius-lg: 22px;
  --font-display: "Baloo 2", "Nunito", sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
  --shadow: 0 2px 10px rgba(95, 70, 48, .08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; }

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { display: block; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

:focus-visible { outline: 3px solid var(--wood); outline-offset: 2px; border-radius: 4px; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 999px; font-weight: 700; transition: background .18s, transform .18s;
}
.btn-primary {
  background: var(--green); color: #fff;
  padding: 12px 26px; font-family: var(--font-display); font-size: 1.05rem;
}
.btn-primary:hover { background: var(--green-deep); transform: translateY(-1px); }
.btn-cart {
  background: var(--green); color: #fff; justify-content: center;
  width: 100%; padding: 9px 12px; font-size: .9rem;
}
.btn-cart:hover { background: var(--green-deep); }
.btn-subscribe { background: var(--ink); color: #fff; padding: 11px 24px; }
.btn-subscribe:hover { background: #4a3624; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 6px; border-radius: 10px; color: var(--ink);
  transition: background .15s;
}
.icon-btn:hover { background: var(--cream-deep); }

.text-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 800; color: var(--green-deep);
}
.text-link:hover { text-decoration: underline; }

/* ============ Header ============ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--cream);
  border-bottom: 1px solid var(--cream-deep);
}
.header-inner {
  display: flex; align-items: center; gap: 22px;
  padding-top: 12px; padding-bottom: 12px;
}
.nav-toggle { display: none; }

.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo-text {
  font-family: var(--font-display); font-weight: 800;
  font-size: 1.02rem; line-height: 1.1; letter-spacing: .01em;
}

.primary-nav { display: flex; gap: 26px; font-weight: 700; font-size: .95rem; }
.primary-nav a { padding: 6px 2px; border-radius: 6px; }
.primary-nav a:hover { color: var(--green-deep); }

.search {
  display: flex; align-items: center; margin-left: auto;
  background: #fff; border: 1px solid var(--cream-deep);
  border-radius: 999px; padding: 3px 6px 3px 16px; min-width: 200px;
}
.search input {
  border: 0; background: none; outline: none; width: 100%;
  font: inherit; color: var(--ink);
}
.search input::placeholder { color: var(--ink-soft); }

.header-actions { display: flex; align-items: center; gap: 6px; }
.cart-btn { position: relative; }
.cart-badge {
  position: absolute; top: -2px; right: -4px;
  background: var(--red-badge); color: #fff;
  font-size: .68rem; font-weight: 800; line-height: 1;
  padding: 3px 6px; border-radius: 999px;
}

/* ============ Hero ============ */
.hero {
  display: grid; grid-template-columns: 5fr 6fr; align-items: center; gap: 30px;
  background: var(--cream-card);
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius-lg);
  padding: 44px 48px;
  margin-top: 26px;
  position: relative; overflow: hidden;
}
.hero-copy { position: relative; z-index: 1; }
.hero-copy h1 {
  font-size: clamp(2.2rem, 4.5vw, 3.4rem); font-weight: 800; margin-bottom: 16px;
}
.hero-copy p { max-width: 34ch; color: var(--ink-soft); font-size: 1.05rem; margin-bottom: 24px; }
.hero-leaf { position: absolute; left: -14px; bottom: -46px; width: 74px; opacity: .8; }

.hero-art svg { width: 100%; height: auto; border-radius: var(--radius); }
.hero-dots { display: flex; justify-content: center; gap: 7px; margin-top: 12px; }
.hero-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--cream-deep); }
.hero-dots .active { background: var(--wood); }

/* ============ Category tiles ============ */
.cat-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px;
  margin-top: 22px;
}
.cat-tile {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 20px 8px 16px; border-radius: var(--radius);
  font-weight: 800; font-size: .88rem; text-align: center;
  transition: transform .18s, box-shadow .18s;
}
.cat-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.tile-sage   { background: var(--tile-sage); }
.tile-yellow { background: var(--tile-yellow); }
.tile-coral  { background: var(--tile-coral); }
.tile-blue   { background: var(--tile-blue); }
.tile-amber  { background: var(--tile-amber); }
.tile-green  { background: var(--tile-green); }

/* ============ Sections ============ */
.section { margin-top: 46px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 18px;
}
.section-head h2 {
  display: flex; align-items: center; gap: 9px;
  font-size: 1.5rem; font-weight: 800;
}
.head-icon { flex: none; }
.view-all {
  display: inline-flex; align-items: center; gap: 2px;
  font-weight: 800; font-size: .92rem; color: var(--ink-soft);
}
.view-all:hover { color: var(--green-deep); }

/* ============ Product cards ============ */
.product-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px;
}
.product-card {
  position: relative; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--cream-deep);
  border-radius: var(--radius); padding: 12px;
  transition: transform .18s, box-shadow .18s;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.wish {
  position: absolute; top: 10px; right: 10px; z-index: 1;
  color: var(--ink-soft); background: #fff; border-radius: 50%;
}
.wish:hover { color: var(--red-badge); background: #fff; }
.wish.active { color: var(--red-badge); }
.wish.active svg { fill: currentColor; }

.product-art {
  background: var(--cream-card); border-radius: 12px; margin-bottom: 10px;
}
.product-art svg { width: 100%; height: auto; }

.product-card h3 { font-size: .95rem; font-family: var(--font-body); font-weight: 800; }

.rating { display: flex; align-items: center; gap: 6px; margin: 4px 0 2px; }
.stars {
  --star: #E8A33D;
  position: relative; display: inline-block;
  width: 74px; height: 14px;
  background:
    linear-gradient(90deg, var(--star) var(--fill, 100%), #E3D5BC var(--fill, 100%));
  -webkit-mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 3.4l2.5 5.4 5.9.7-4.4 4 1.2 5.8L12 16.4l-5.2 2.9 1.2-5.8-4.4-4 5.9-.7z"/></svg>') 0 0/14.8px 14px repeat-x;
  mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 3.4l2.5 5.4 5.9.7-4.4 4 1.2 5.8L12 16.4l-5.2 2.9 1.2-5.8-4.4-4 5.9-.7z"/></svg>') 0 0/14.8px 14px repeat-x;
}
.count { font-size: .78rem; color: var(--ink-soft); font-weight: 700; }

.price { font-family: var(--font-display); font-weight: 800; font-size: 1.12rem; margin: 2px 0 10px; }
.product-card .btn-cart { margin-top: auto; }

/* ============ Trust strip ============ */
.trust-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  background: var(--cream-card); border: 1px solid var(--cream-deep);
  border-radius: var(--radius); padding: 20px 24px; margin-top: 34px;
}
.trust-strip li { display: flex; gap: 12px; align-items: flex-start; }
.trust-strip svg { color: var(--green-deep); flex: none; margin-top: 2px; }
.trust-strip strong { display: block; font-size: .92rem; }
.trust-strip span { font-size: .8rem; color: var(--ink-soft); }

/* ============ Shop by age ============ */
.age-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.age-card {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 18px; border-radius: var(--radius);
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
  transition: transform .18s, box-shadow .18s;
}
.age-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.age-arrow {
  margin-left: auto; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255, 255, 255, .65); color: var(--ink);
}

/* ============ Makers band ============ */
.makers {
  position: relative; display: grid; grid-template-columns: 2fr 3fr;
  gap: 34px; align-items: center;
  background: var(--cream-card); border: 1px solid var(--cream-deep);
  border-radius: var(--radius-lg); padding: 34px 40px; margin-top: 46px;
  overflow: hidden;
}
.makers-art svg { width: 100%; height: auto; border-radius: var(--radius); }
.makers-copy h2 { font-size: 1.7rem; font-weight: 800; margin-bottom: 10px; }
.makers-copy p { color: var(--ink-soft); max-width: 52ch; margin-bottom: 14px; }
.makers-leaf { position: absolute; right: 26px; bottom: -18px; width: 52px; opacity: .8; }

/* ============ Newsletter ============ */
.newsletter {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  background: var(--green-band); color: #fff;
  border-radius: var(--radius-lg); padding: 30px 40px; margin: 46px 0;
}
.newsletter h2 { font-size: 1.5rem; font-weight: 800; }
.newsletter p { opacity: .95; }
.newsletter-form { display: flex; gap: 10px; flex: 0 1 440px; }
.newsletter-form input {
  flex: 1; border: 0; border-radius: 999px; padding: 11px 20px;
  font: inherit; color: var(--ink); background: #fff; outline-offset: 2px;
}

/* ============ Footer ============ */
.site-footer {
  background: var(--cream-card);
  border-top: 1px solid var(--cream-deep);
  padding: 40px 0 22px;
}
.footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr 1.3fr; gap: 26px;
}
.footer-brand .tagline { margin-top: 14px; font-size: .88rem; color: var(--ink-soft); font-style: italic; }
.site-footer h3 { font-size: .98rem; font-weight: 800; margin-bottom: 10px; }
.site-footer li { margin-bottom: 7px; font-size: .9rem; color: var(--ink-soft); }
.site-footer li a:hover { color: var(--green-deep); }

.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-top: 1px solid var(--cream-deep); margin-top: 30px; padding-top: 16px;
  font-size: .8rem; color: var(--ink-soft);
}
.pay-icons { display: flex; gap: 8px; }
.pay {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 46px; height: 26px; padding: 0 8px;
  background: #fff; border: 1px solid var(--cream-deep); border-radius: 6px;
  font-size: .62rem; font-weight: 800; letter-spacing: .02em;
}
.pay-visa { color: #1A1F71; font-style: italic; }
.pay-mc { gap: 0; }
.pay-mc i { width: 13px; height: 13px; border-radius: 50%; display: inline-block; }
.pay-mc i:first-child { background: #EB001B; }
.pay-mc i:last-child { background: #F79E1B; margin-left: -5px; opacity: .9; }
.pay-pp { color: #003087; }
.pay-ap { color: #111; }
.pay-after { background: #B2FCE4; border-color: #B2FCE4; color: #111; }

/* ============ Sub-page header band ============ */
.page-head {
  background: var(--cream-card); border: 1px solid var(--cream-deep);
  border-radius: var(--radius-lg); padding: 30px 40px; margin-top: 26px;
}
.page-head h1 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); font-weight: 800; margin-bottom: 6px; }
.page-head p { color: var(--ink-soft); max-width: 60ch; }

/* ============ Shop filters ============ */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 20px;
}
.chip {
  padding: 8px 18px; border-radius: 999px; font-weight: 800; font-size: .88rem;
  background: #fff; border: 1px solid var(--cream-deep); color: var(--ink-soft);
  transition: background .15s, color .15s;
}
.chip:hover { border-color: var(--green); color: var(--green-deep); }
.chip.active { background: var(--green); border-color: var(--green); color: #fff; }
.shop-grid { grid-template-columns: repeat(4, 1fr); }
.shop-count { color: var(--ink-soft); font-size: .88rem; margin-bottom: 14px; }

/* ============ About page ============ */
.story { display: grid; grid-template-columns: 3fr 2fr; gap: 36px; align-items: center; margin-top: 40px; }
.story h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: 12px; }
.story p { color: var(--ink-soft); margin-bottom: 12px; }
.story-art svg { width: 100%; height: auto; border-radius: var(--radius); }
.values-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 20px; }
.value-card {
  background: #fff; border: 1px solid var(--cream-deep); border-radius: var(--radius);
  padding: 22px 18px; text-align: center;
}
.value-card svg { margin: 0 auto 10px; color: var(--green-deep); }
.value-card strong { display: block; font-family: var(--font-display); font-size: 1rem; margin-bottom: 4px; }
.value-card span { font-size: .85rem; color: var(--ink-soft); }
.cta-band {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  background: var(--cream-card); border: 1px solid var(--cream-deep);
  border-radius: var(--radius-lg); padding: 28px 36px; margin: 46px 0;
}
.cta-band h2 { font-size: 1.4rem; font-weight: 800; }

/* ============ Contact page ============ */
.contact-layout { display: grid; grid-template-columns: 2fr 3fr; gap: 24px; margin: 30px 0 46px; align-items: start; }
.contact-cards { display: grid; gap: 14px; }
.contact-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: #fff; border: 1px solid var(--cream-deep); border-radius: var(--radius); padding: 18px;
}
.contact-card svg { color: var(--green-deep); flex: none; margin-top: 2px; }
.contact-card strong { display: block; font-family: var(--font-display); }
.contact-card span, .contact-card a { font-size: .9rem; color: var(--ink-soft); }
.contact-card a:hover { color: var(--green-deep); }
.contact-form {
  background: var(--cream-card); border: 1px solid var(--cream-deep);
  border-radius: var(--radius-lg); padding: 28px;
}
.contact-form h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 800; font-size: .85rem; }
.field input, .field textarea {
  border: 1px solid var(--cream-deep); border-radius: 12px; padding: 11px 14px;
  font: inherit; color: var(--ink); background: #fff; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--green); border-color: var(--green); }
.form-success {
  display: none; background: var(--tile-green); color: var(--green-deep);
  border-radius: 12px; padding: 14px 18px; font-weight: 800; margin-top: 14px;
}
.form-success.show { display: block; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 980px) {
  .primary-nav { display: none; gap: 4px; }
  .primary-nav.open {
    display: flex; flex-direction: column;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--cream); border-bottom: 1px solid var(--cream-deep);
    padding: 12px 20px 18px;
  }
  .primary-nav.open a { padding: 10px 6px; border-radius: 8px; }
  .nav-toggle { display: inline-flex; }
  .header-inner { position: relative; gap: 12px; }
  .search { min-width: 0; flex: 1; }

  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .shop-grid { grid-template-columns: repeat(3, 1fr); }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .story { grid-template-columns: 1fr; }
  .values-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-layout { grid-template-columns: 1fr; }
  .trust-strip { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .age-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; padding: 30px 26px; }
  .hero-leaf { display: none; }
  .makers { grid-template-columns: 1fr; padding: 26px; }
}

@media (max-width: 560px) {
  .search { display: none; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .shop-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .age-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .age-card { flex-direction: column; text-align: center; gap: 8px; padding: 16px 10px; }
  .age-card .age-arrow { margin: 0; }
  .trust-strip { grid-template-columns: repeat(2, 1fr); padding: 16px; }
  .trust-strip span { display: none; }
  .newsletter { flex-direction: column; text-align: center; padding: 26px 20px; }
  .newsletter-form { width: 100%; flex: none; flex-direction: column; }
  .newsletter-form input { flex: none; }
  .footer-bottom { flex-direction: column; }
}

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