/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--scroll-offset); /* anchor jumps (#about, #respond…) land below the sticky header */
}
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Sticky footer: short pages push the footer to the bottom of the viewport. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
::selection {
  background: var(--color-selection);
  color: var(--ink);
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-heading);
  color: var(--color-heading);
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-snug);
  margin: 0;
  text-wrap: balance; /* no single-word last lines in headings */
  overflow-wrap: break-word; /* a long product name or unbroken word never overflows a narrow card */
  hyphens: auto;
  font-synthesis: none; /* Fredoka has no italic: never fake-slant or fake-bold it */
}
p {
  margin: 0;
  text-wrap: pretty;
}
a {
  color: inherit;
  text-decoration: none;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: var(--border-w) solid var(--color-brand-text);
  outline-offset: var(--space-0-5);
}
img {
  max-width: 100%;
  display: block;
}
input[type='submit'].btn {
  font-family: inherit;
  cursor: pointer;
}
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}
ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.container {
  width: 100%; /* body is a flex column, so containers must not shrink to their content */
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.is-hidden {
  display: none !important;
}

/* Icons */
.icon {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}
.icon-sm {
  width: 14px;
  height: 14px;
}
.icon-xs {
  width: 12px;
  height: 12px;
}
.star-filled {
  color: var(--cream-400);
  fill: var(--cream-400);
}
.star-empty {
  color: var(--gray-200);
  fill: var(--gray-200);
}

/* Buttons — "sticker" style: ink outline + hard offset shadow that the button presses into. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border: var(--border-strong);
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-weight: var(--fw-ui);
  font-size: var(--text-md);
  line-height: var(--lh-snug);
  box-shadow: var(--shadow-pop-sm);
  transition: transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
  font-synthesis: none;
}
.btn:hover {
  transform: var(--lift);
  box-shadow: var(--shadow-pop);
}
.btn:active {
  transform: var(--press);
  box-shadow: none;
}
.btn .icon {
  transition: transform var(--dur-base) var(--ease-spring);
}
.btn:hover .icon {
  transform: translateX(3px);
}
.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}
.btn-primary:hover {
  background: var(--btn-primary-bg-hover);
}
.btn-secondary {
  background: var(--color-surface);
  color: var(--color-heading);
}
.btn-secondary:hover {
  background: var(--cream-200);
}
.btn-dark {
  background: var(--btn-dark-bg);
  color: var(--btn-dark-text);
}
.btn-block {
  width: 100%;
}

/* Section helpers */
.section {
  padding: var(--section-pad) 0;
}
.section-head {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-12);
}
.section-head-center {
  text-align: center;
  align-items: center;
  gap: 0;
}
.section-head-center /* Hand-drawn squiggle under every section title. */
.section-title::after {
  content: '';
  display: block;
  width: 132px;
  height: 14px;
  margin-top: var(--space-3);
  background: var(--squiggle) repeat-x left center / 33px 12px;
}
.section-head-center .section-title::after {
  margin-inline: auto;
}
/* A floating doodle beside each section heading; the doodle cycles by section for variety. */
.section-head::after {
  content: none;
}
.section-head-center::after {
  content: '';
  position: absolute;
  top: -28px;
  right: 6%;
  width: 46px;
  height: 46px;
  background: var(--section-doodle, var(--doodle-star)) center / contain no-repeat;
  pointer-events: none;
  rotate: 12deg;
}
.section:nth-of-type(3n + 1) {
  --section-doodle: var(--doodle-heart);
}
.section:nth-of-type(3n + 2) {
  --section-doodle: var(--doodle-sparkle);
}
.section:nth-of-type(4n + 3) {
  --section-doodle: var(--doodle-swirl);
}
@media (max-width: 767px) {
  .section-head::after {
    width: 34px;
    height: 34px;
    top: -10px;
    right: 0;
  }
  .section-head-center::after {
    left: auto;
    right: 4%;
  }
}
.section-lead {
  margin-top: var(--space-3);
}
/* Eyebrow = a little sticker chip above each section title. */
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1-5) var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--fw-ui);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--color-heading);
  background: var(--color-surface);
  border: var(--border-strong);
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-4);
}
.eyebrow-mint {
  background: var(--mint-100);
}
.eyebrow-accent {
  background: var(--accent-100);
}
.eyebrow-sky {
  background: var(--sky-100);
}
.section-title {
  font-size: var(--text-5xl);
  font-weight: var(--fw-display);
  color: var(--color-heading);
  line-height: var(--lh-tight);
}
.section-lead {
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  max-width: 400px;
}
.section-cta {
  text-align: center;
  margin-top: var(--space-12);
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  display: inline-block;
  border: 1.5px solid var(--ink);
}
.dot-primary {
  background: var(--color-brand);
}
.dot-accent {
  background: var(--accent-400);
}
.dot-mint {
  background: var(--mint-400);
}
.dot-sky {
  background: var(--sky-400);
}
.text-mint {
  color: var(--mint-600);
}
.products-empty {
  color: var(--color-text-subtle);
  text-align: center;
  padding: var(--space-10) 0;
}

@media (min-width: 768px) {
  .section-head {
    flex-direction: row;
    align-items: flex-end;
  }
  .section-lead {
    text-align: left;
  }
  /* Centred heads stay stacked: eyebrow, title, lead. */
  .section-head-center {
    flex-direction: column;
    align-items: center;
  }
  .section-head-center .section-lead {
    text-align: center;
    max-width: 540px;
  }
}

/* ===== Shared patterns (merged from per-section partials) ===== */
/* Cover images */
.floating-card-thumb img,
.promo-image img,
.testimonial-avatar img,
.cart-item-thumb img,
.single-post-thumb img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

/* Card hover lift */
.category-card:hover,
.news-card:hover,
.woocommerce ul.products li.product:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-pop);
  transform: var(--lift) rotate(0deg);
}

/* Zooming card images */
.category-card-image img,
.news-card-media img {
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
  width: 100%;
}

/* Icon + text rows */
.about-point,
.cart-drawer-title,
.single-post-author {
  align-items: center;
  display: flex;
  gap: var(--space-3);
}

/* Space-between rows */
.topbar-inner,
.cart-drawer-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

/* Two-column card grid */
.categories-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(2, 1fr);
}

/* Summary panels */
.cart_totals,
.woocommerce-checkout-review-order,
.woocommerce-checkout #order_review {
  background: var(--pattern-dots), var(--cream-50);
  border: var(--border-strong);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
}

/* Visually hidden but available to screen readers (used by WP core markup too). */
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Respect the OS "reduce motion" setting: no floating, marquee or smooth-scroll animation. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Skip link: visually hidden until it receives keyboard focus. */
.skip-link:focus {
  clip: auto;
  width: auto;
  height: auto;
  margin: 0;
  padding: var(--space-3) var(--space-5);
  top: 8px;
  left: 8px;
  z-index: var(--z-skip);
  background: var(--color-surface);
  color: var(--gray-900);
  font-weight: var(--fw-semibold);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}
/* The <main id="content"> skip target takes focus programmatically; no ring needed on it. */
main:focus {
  outline: none;
}

/* iOS Safari zooms the page when a form control under 16px gets focus — keep controls at 16px on phones. */
@media (max-width: 767px) {
  input:not([type='checkbox']):not([type='radio']):not([type='range']),
  select,
  textarea,
  .select2-container .select2-selection--single .select2-selection__rendered {
    font-size: var(--text-base) !important; /* beats the per-form 14px rules in the WooCommerce partials; iOS focus-zoom workaround */
  }
}

/* ===== Scroll reveal =====
   app.js adds .reveal only to elements that start below the fold (so nothing visible ever blinks),
   then .is-revealed as they scroll in. Without JS, or with reduced motion, nothing is hidden. */
.reveal {
  /* Individual translate/scale properties (not `transform`) so the reveal composes with each card's own
     tilt/rotate transform instead of wiping it out. */
  opacity: 0;
  translate: 0 28px;
  scale: 0.98;
  /* !important only for the few hundred ms the reveal runs: each card's own transition rule loads later and would
     otherwise make it pop in. app.js removes the reveal classes afterwards, restoring the card's hover transitions. */
  transition: opacity var(--dur-reveal) var(--ease-out), translate var(--dur-reveal) var(--ease-out),
    scale var(--dur-reveal) var(--ease-out) !important;
  transition-delay: var(--reveal-delay, 0ms) !important;
}
.reveal.is-revealed {
  opacity: 1;
  translate: none;
  scale: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    translate: none;
    scale: none;
  }
}

/* Gentle "wiggle" used on hover by playful icons (category emoji, feature icons). */
@keyframes juno-wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-10deg) scale(1.08); }
  75% { transform: rotate(8deg) scale(1.08); }
}
@keyframes juno-float {
  0%, 100% { transform: translateY(0) rotate(var(--float-rot, 0deg)); }
  50% { transform: translateY(-10px) rotate(var(--float-rot, 0deg)); }
}
