/*
Theme Name: Zay Babies
Description: Baby clothing shop theme with a spinning product ring, colour swatches, a magnifying lens and a height chart. Works with WooCommerce.
Version: 1.0.0
Requires PHP: 7.4
Text Domain: babystore
*/

:root {
  --bg: #f4ede1;
  --card: #ebe2d2;
  --ink: #1f1b16;
  --muted: #857b6c;
  --line: #d9cebb;
  --word: #e4d9c6;
  --accent: #b5562f;
  --radius: 18px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Archivo", "Arial Black", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 .5em; font-weight: 600; }
h2 { font-size: clamp(28px, 4vw, 48px); }
h3 { font-size: 18px; }
p { margin: 0 0 1em; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.bs-eyebrow, .bs-label, .bs-hero__kicker, .bs-hero__side, .bs-hero__hint, .bs-header__note {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0;
}
.bs-muted { color: var(--muted); font-size: 14px; }
.bs-center { text-align: center; margin-top: 40px; }

.bs-btn {
  display: inline-block; padding: 14px 26px; border-radius: 999px; background: var(--ink); color: var(--bg);
  text-decoration: none; font-weight: 600; font-size: 14px; border: 1px solid var(--ink); transition: transform .2s, background .2s;
}
.bs-btn:hover { transform: translateY(-2px); background: #000; }
.bs-btn--ghost { background: transparent; color: var(--ink); }
.bs-btn--ghost:hover { background: var(--ink); color: var(--bg); }

/* Header */
.bs-header {
  position: sticky; top: 0; z-index: 50; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 16px clamp(16px, 4vw, 48px); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
}
.bs-logo { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -.01em; text-decoration: none; text-transform: uppercase; }
.bs-header__note { text-align: center; }
.bs-nav { display: flex; gap: clamp(12px, 2vw, 28px); justify-content: flex-end; font-size: 14px; font-weight: 500; }
.bs-nav a { text-decoration: none; }
.bs-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.bs-bag-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--ink); color: var(--bg); font-size: 11px; }

/* Product visual (photo or drawn garment) */
.bs-visual { display: block; width: 100%; aspect-ratio: 5 / 6; position: relative; }
.bs-visual svg, .bs-visual img { width: 100%; height: 100%; object-fit: contain; }
.bs-visual svg * { transition: fill .35s, stroke .35s; }
.bs-thumb { background: var(--card); border-radius: var(--radius); padding: 10%; }

.bs-swatches { display: flex; gap: 8px; margin-top: 10px; }
.bs-swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); background: var(--sw); padding: 0; transition: transform .2s, box-shadow .2s; }
.bs-swatch:hover { transform: scale(1.15); }
.bs-swatch.is-on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--ink); }

/* Hero with the spinning ring */
.bs-hero { position: relative; min-height: calc(100svh - 60px); padding: 12px clamp(16px, 4vw, 48px) 28px; display: flex; flex-direction: column; overflow: clip; }
.bs-hero__side { position: absolute; right: clamp(16px, 4vw, 48px); top: 12px; text-align: right; }
.bs-stage { flex: 1; min-height: 420px; position: relative; perspective: 1500px; perspective-origin: 50% 42%; touch-action: pan-y; cursor: grab; user-select: none; }
.bs-stage.is-drag { cursor: grabbing; }
.bs-scene { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(-5deg); }
.bs-word {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); white-space: nowrap; pointer-events: none;
  font-family: var(--display); font-weight: 800; text-transform: uppercase; color: var(--word);
  font-size: clamp(110px, 27vw, 430px); line-height: .8; letter-spacing: -.04em;
}
.bs-ring { --r: clamp(170px, 31vw, 430px); --iw: clamp(130px, 17vw, 240px); position: absolute; left: 50%; top: 52%; width: 0; height: 0; transform-style: preserve-3d; transform: rotateY(var(--rot, 0deg)); }
.bs-ring__item {
  position: absolute; width: var(--iw); left: calc(var(--iw) / -2); top: calc(var(--iw) * -.6); padding: 0; border: 0; background: none;
  transform: rotateY(var(--a, 0deg)) translateZ(var(--r)) rotateY(calc(-1 * (var(--a, 0deg) + var(--rot, 0deg))));
  transition: opacity .3s; will-change: transform, opacity; cursor: pointer;
}
.bs-ring__item::after { content: ""; position: absolute; left: 12%; right: 12%; bottom: -14px; height: 22px; background: radial-gradient(closest-side, rgba(60,40,20,.22), transparent); filter: blur(3px); }
.bs-ring__item .bs-visual { transition: transform .4s; filter: drop-shadow(0 14px 14px rgba(60,40,20,.12)); }
.bs-ring__item.is-front .bs-visual { transform: translateY(-6px); }
.bs-ring__item.is-front:hover .bs-visual { transform: translateY(-12px) scale(1.03); }

.bs-hero__foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 16px; }
.bs-hero__info { display: flex; gap: 14px; align-items: flex-end; font-size: 13px; line-height: 1.35; }
.bs-hero__num { font-size: 44px; font-weight: 400; line-height: .9; letter-spacing: -.04em; }
.bs-hero__meta { color: var(--muted); }
.bs-hero__controls { display: flex; align-items: center; gap: 14px; }
.bs-arrow { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: transparent; transition: background .2s; }
.bs-arrow:hover { background: var(--card); }
.bs-dots { display: flex; gap: 6px; }
.bs-dots button { width: 6px; height: 6px; border-radius: 3px; border: 0; padding: 0; background: var(--line); transition: width .3s, background .3s; }
.bs-dots button.is-on { width: 22px; background: var(--ink); }
.bs-hero__hint { text-align: right; }

/* Quick-look panel */
.bs-panel {
  position: absolute; z-index: 20; left: 50%; top: 50%; width: min(880px, calc(100% - 32px)); transform: translate(-50%, -46%) scale(.97);
  display: grid; grid-template-columns: 1fr 1fr; background: #f9f4ea; border-radius: 26px; box-shadow: 0 40px 90px rgba(60,40,20,.25);
  opacity: 0; visibility: hidden; transition: opacity .3s, transform .3s, visibility .3s;
}
.bs-panel.is-open { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.bs-panel__visual { position: relative; background: var(--card); border-radius: 26px 0 0 26px; padding: 9%; cursor: zoom-in; overflow: hidden; }
.bs-panel__body { padding: clamp(20px, 3vw, 40px); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.bs-panel__name { font-size: clamp(24px, 3vw, 34px); margin: 0; }
.bs-panel__price { font-size: 18px; font-weight: 600; margin: 0; }
.bs-panel__text { color: var(--muted); font-size: 14px; margin: 0 0 6px; }
.bs-panel__sizes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.bs-panel__sizes span { border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; font-size: 12px; }
.bs-panel__close { position: absolute; right: 14px; top: 10px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; font-size: 24px; line-height: 1; }
.bs-panel .bs-swatch { width: 24px; height: 24px; }
.bs-panel .bs-swatches { margin: 0 0 8px; }

/* Magnifying lens */
[data-lens] { position: relative; }
.bs-lens { position: absolute; z-index: 5; width: 170px; height: 170px; border-radius: 50%; overflow: hidden; pointer-events: none; background: var(--card); border: 3px solid #fffaf2; box-shadow: 0 16px 40px rgba(60,40,20,.3); }
.bs-lens .bs-visual { position: absolute; left: 0; top: 0; transform-origin: 0 0; aspect-ratio: auto; }

/* Promise strip */
.bs-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 40px; padding: 18px 16px; border-block: 1px solid var(--line); font-size: 13px; font-weight: 500; }
.bs-strip span::before { content: "✓ "; color: var(--accent); }

/* Sections */
.bs-fabric, .bs-shop, .bs-size, .bs-promise, .bs-wrap { padding: clamp(56px, 9vw, 120px) clamp(16px, 4vw, 48px); max-width: 1320px; margin: 0 auto; }
.bs-section-head { max-width: 640px; margin-bottom: 40px; }
.bs-section-head p:last-child { color: var(--muted); margin: 0; }
.bs-eyebrow { margin-bottom: 12px; }

.bs-fabric { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(24px, 6vw, 90px); align-items: center; }
.bs-fabric__visual { background: var(--card); border-radius: 28px; padding: 12%; cursor: zoom-in; overflow: hidden; }
.bs-points { list-style: none; padding: 0; margin: 24px 0; display: grid; gap: 14px; }
.bs-points li { padding-left: 18px; border-left: 2px solid var(--line); font-size: 15px; color: var(--muted); }
.bs-points strong { color: var(--ink); }
.bs-fabric .bs-swatch { width: 26px; height: 26px; }

.bs-grid, .woocommerce ul.products { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(14px, 2.4vw, 32px); }
.bs-card__visual { display: block; background: var(--card); border-radius: var(--radius); padding: 12%; transition: transform .35s; }
.bs-card:hover .bs-card__visual { transform: translateY(-6px); }
.bs-card__row { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-top: 14px; }
.bs-card h3 { margin: 0; font-size: 16px; }
.bs-card h3 a { text-decoration: none; }
.bs-card__price { font-size: 14px; font-weight: 600; white-space: nowrap; }
.bs-card__cat { font-size: 12px; color: var(--muted); margin: 2px 0 0; }

/* Height chart */
.bs-size__tool { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(24px, 5vw, 70px); align-items: end; }
.bs-chart { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; height: 340px; align-items: end; padding: 20px; background: var(--card); border-radius: 28px;
  background-image: repeating-linear-gradient(to top, transparent 0 33px, rgba(0,0,0,.06) 33px 34px); }
.bs-chart__col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 6px; }
.bs-chart__bar { width: 100%; border-radius: 12px 12px 4px 4px; background: #d8ccb6; transition: background .3s, transform .3s; transform-origin: bottom; }
.bs-chart__cm { font-size: 11px; color: var(--muted); opacity: 0; transition: opacity .3s; white-space: nowrap; }
.bs-chart__label { font-size: 12px; font-weight: 600; }
.bs-chart__col.is-on .bs-chart__bar { background: var(--accent); transform: scaleY(1.03); }
.bs-chart__col.is-on .bs-chart__cm { opacity: 1; }
.bs-size__control label { font-size: 18px; font-weight: 600; display: block; margin-bottom: 14px; }
.bs-size__control input[type=range] { width: 100%; accent-color: var(--ink); }
.bs-size__result { font-size: clamp(22px, 3vw, 32px); margin: 22px 0 8px; letter-spacing: -.02em; }
.bs-size__result span { font-size: 14px; color: var(--muted); letter-spacing: 0; }

.bs-promise { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding-top: 0; }
.bs-promise article { background: var(--card); border-radius: var(--radius); padding: 28px; }
.bs-promise p { margin: 0; color: var(--muted); font-size: 15px; }

/* Footer */
.bs-footer { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 32px; padding: 56px clamp(16px, 4vw, 48px) 28px; background: var(--ink); color: #e9e1d2; font-size: 14px; }
.bs-footer h3 { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #9c9282; font-weight: 500; margin-bottom: 14px; }
.bs-footer a { display: block; text-decoration: none; margin-bottom: 8px; }
.bs-footer a:hover { text-decoration: underline; }
.bs-footer p { color: #b8ae9d; }
.bs-footer .bs-logo { font-size: 32px; color: #f4ede1; }
.bs-footer__legal { grid-column: 1 / -1; border-top: 1px solid #3a342c; padding-top: 20px; margin: 0; font-size: 12px; }

/* Pages and WooCommerce */
.bs-wrap { padding-top: clamp(32px, 5vw, 64px); }
.bs-page { max-width: 820px; }
.bs-page h1, .bs-woo h1 { font-size: clamp(30px, 5vw, 52px); margin-bottom: .6em; }
.bs-page h2 { font-size: 24px; margin-top: 1.8em; }
.bs-page h3 { margin-top: 1.4em; }
.bs-page table { width: 100%; border-collapse: collapse; margin: 1em 0 1.5em; font-size: 14px; }
.bs-page th, .bs-page td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.bs-page th { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 500; }

.woocommerce ul.products::before, .woocommerce ul.products::after { display: none; }
.woocommerce ul.products li.product { width: auto; margin: 0; float: none; }
.woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 16px; font-weight: 600; padding: 14px 0 2px; }
.woocommerce ul.products li.product .price { color: var(--ink); font-weight: 600; font-size: 14px; }
.woocommerce ul.products li.product .button { display: none; }
.woocommerce div.product { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 70px); align-items: start; }
.woocommerce div.product div.images, .woocommerce div.product div.summary { width: auto; float: none; margin: 0; }
.woocommerce div.product .woocommerce-tabs, .woocommerce div.product .related, .woocommerce div.product .up-sells { grid-column: 1 / -1; }
.bs-single-visual { background: var(--card); border-radius: 28px; padding: 12%; cursor: zoom-in; overflow: hidden; }
.woocommerce div.product .product_title { font-size: clamp(30px, 4vw, 46px); }
.woocommerce div.product p.price { color: var(--ink); font-size: 22px; font-weight: 600; }
.bs-fabric-note { font-size: 13px; color: var(--muted); }
.bs-size-link { font-size: 14px; }
.woocommerce div.product form.cart .variations select { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: #f9f4ea; font: inherit; min-width: 180px; }
.woocommerce div.product form.cart .variations th { text-align: left; padding-right: 16px; font-size: 13px; }
.woocommerce div.product form.cart .bs-swatches { margin: 0 0 6px; }
.woocommerce div.product form.cart .bs-swatch { width: 28px; height: 28px; }
.woocommerce div.product form.cart .qty { padding: 12px 8px; border-radius: 10px; border: 1px solid var(--line); background: #f9f4ea; }
.woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button, .woocommerce button.button.alt, .woocommerce a.button.alt, .wc-block-components-button:not(.is-link) {
  background: var(--ink); color: var(--bg); border-radius: 999px; padding: 14px 26px; font-weight: 600; font-family: var(--font);
}
.woocommerce button.button.alt:hover, .woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce a.button.alt:hover { background: #000; color: var(--bg); }
.woocommerce button.button.alt.disabled, .woocommerce button.button.alt.disabled:hover { background: var(--muted); }
.woocommerce span.onsale { background: var(--accent); }
.woocommerce .woocommerce-breadcrumb { color: var(--muted); font-size: 13px; }
.woocommerce-message, .woocommerce-info { border-top-color: var(--accent); background: #f9f4ea; }
.woocommerce-message::before, .woocommerce-info::before { color: var(--accent); }

/* Scroll reveal */
.bs-reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s, transform .7s; }
.bs-reveal.is-in { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .bs-header { grid-template-columns: auto 1fr; }
  .bs-header__note, .bs-hero__side, .bs-hero__hint { display: none; }
  .bs-hero__foot { grid-template-columns: 1fr auto; }
  .bs-grid, .woocommerce ul.products { grid-template-columns: repeat(2, 1fr); }
  .bs-fabric, .bs-size__tool, .woocommerce div.product { grid-template-columns: 1fr; }
  .bs-promise { grid-template-columns: 1fr; }
  .bs-footer { grid-template-columns: 1fr 1fr; }
  .bs-panel { grid-template-columns: 1fr; max-height: calc(100svh - 90px); overflow: auto; position: fixed; }
  .bs-panel__visual { border-radius: 26px 26px 0 0; padding: 6% 22%; }
  .bs-chart { height: 260px; padding: 12px; gap: 6px; }
  .bs-stage { min-height: 360px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bs-reveal { opacity: 1; transform: none; transition: none; }
}

/* Small refinements */
.bs-sr { position: absolute !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.bs-fabric__visual { max-width: 520px; width: 100%; justify-self: center; }
@media (max-width: 900px) {
  .bs-hero { min-height: 0; }
  .bs-stage { flex: none; height: 50svh; min-height: 340px; }
  .bs-word { font-size: min(26vw, calc(138vw / var(--chars, 5))); }
  .bs-hero__foot { grid-template-columns: 1fr; gap: 16px; }
  .bs-hero__controls { justify-content: center; }
  .bs-header { padding-block: 12px; }
  .bs-nav { gap: 12px; font-size: 13px; }
}
.bs-nav a { white-space: nowrap; }
@media (max-width: 1100px) { .bs-header__note { display: none; } .bs-header { grid-template-columns: auto 1fr; } }

/* Slider controls always sit above the products, and only the garment itself is clickable. */
.bs-hero__foot { position: relative; z-index: 6; }
.bs-ring { --iw: clamp(120px, min(17vw, 27svh), 240px); }
.bs-ring__item { pointer-events: none; }
.bs-ring__item.is-hit .bs-visual { pointer-events: auto; }

/* The giant brand word shrinks to fit longer names. */
.bs-word { font-size: clamp(60px, min(27vw, calc(138vw / var(--chars, 5))), 430px); }
@media (max-width: 900px) { .bs-word { font-size: min(26vw, calc(138vw / var(--chars, 5))); } }
.bs-logo { white-space: nowrap; }
@media (max-width: 480px) { .bs-header .bs-logo { font-size: 16px; } .bs-nav { gap: 10px; font-size: 12px; } }

/* Search additions: main heading, category links, FAQ */
h1.bs-hero__side { font-weight: 400; line-height: 1.6; }
.bs-cats { max-width: 1320px; margin: 0 auto; padding: clamp(36px, 6vw, 72px) clamp(16px, 4vw, 48px) 0; text-align: center; }
.bs-cats h2 { font-size: clamp(20px, 2.6vw, 28px); margin-bottom: 20px; }
.bs-cats__list { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.bs-cats__list a { border: 1px solid var(--line); border-radius: 999px; padding: 10px 18px; text-decoration: none; font-size: 14px; font-weight: 500; background: #f9f4ea; transition: background .2s, color .2s; }
.bs-cats__list a:hover { background: var(--ink); color: var(--bg); }
.bs-faq { max-width: 900px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px) clamp(56px, 9vw, 120px); }
.bs-faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.bs-faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.bs-faq summary::-webkit-details-marker { display: none; }
.bs-faq summary::after { content: "+"; font-size: 24px; line-height: 1; color: var(--muted); }
.bs-faq details[open] summary::after { content: "−"; }
.bs-faq summary h3 { margin: 0; font-size: 17px; }
.bs-faq details p { margin: 12px 0 0; color: var(--muted); max-width: 720px; }
.bs-archive-intro, .woocommerce .term-description { color: var(--muted); max-width: 720px; margin-bottom: 28px; }

/* Logo image */
.bs-logo img { height: 80px; width: auto; display: block; }
.bs-header { padding-block: 8px; }
.bs-footer__logo { width: 150px; height: 150px; border-radius: 24px; margin-bottom: 14px; }
@media (max-width: 900px) { .bs-logo img { height: 54px; } }
@media (max-width: 480px) { .bs-logo img { height: 48px; } }

/* Contact links and WhatsApp button */
.bs-footer a.bs-inline { display: inline; text-decoration: underline; }
.bs-wa { position: fixed; right: 18px; bottom: 18px; z-index: 60; background: #25d366; color: #fff; font-weight: 700; font-size: 14px; text-decoration: none; padding: 12px 18px; border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.bs-wa:hover { background: #1ebe5b; }

/* Social links in the footer */
.bs-follow-title { margin-top: 22px; }
.bs-social { list-style: none; padding: 0; margin: 0; display: flex; gap: 10px; flex-wrap: wrap; }
.bs-social a { display: grid; place-items: center; width: 40px; height: 40px; margin: 0; border-radius: 50%; background: #2e2822; color: #f4ede1; transition: background .2s, transform .2s; }
.bs-social a:hover { background: var(--accent); transform: translateY(-2px); }
.bs-social svg { width: 20px; height: 20px; }

/* About and Contact pages */
.bs-lead { font-size: 19px; line-height: 1.6; color: var(--ink); }
.bs-contact-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 28px 0; }
.bs-contact-card { background: var(--card); border-radius: var(--radius); padding: 24px; }
.bs-contact-card h2 { margin-top: 0; }
.bs-contact-card p { margin: 0 0 10px; }
.bs-page .bs-btn { text-decoration: none; }
@media (max-width: 700px) { .bs-contact-cards { grid-template-columns: 1fr; } }
