/* Additions on top of the original Tailwind build (styles.css). */

/* Fill-parent image (replaces Next.js inline "fill" styles) */
.fmm-fill { position: absolute; inset: 0; width: 100%; height: 100%; color: transparent; }

/* Homepage hero dish: photo cropped to the plate, slowly rotating (same 90s spin as the original illustration).
   The photo's plate is centred at (629, 610) with a ~520px radius in a 1254px square; the offsets below
   place that circle exactly in this square so it spins without wobbling. */
.fmm-hero-dish-wrap { width: 100%; }
.fmm-hero-dish {
  position: relative; width: 100%; aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  animation: bowl-spin 90s linear infinite; transform-origin: 50% 50%;
}
.fmm-hero-dish img {
  position: absolute; max-width: none; height: auto;
  width: 120.58%; left: -10.48%; top: -8.65%;
}

/* Product hero: a whole-bowl photo on a black square, shown as the top part of the bowl
   (the 3:2 frame cuts off the bottom) with the black corners masked away. */
.fmm-bowl-half {
  position: absolute; top: 0; left: 0; width: 100%; height: auto; max-width: none;
  clip-path: ellipse(49.4% 49.4% at 50% 50%);
}

/* Prices with a discount: struck-through original, sale price, "% off" tag */
.fmm-price-wrap { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .5rem; }
.fmm-price { font-family: var(--font-display); font-weight: 800; }
.fmm-price--lg { font-size: 2.25rem; line-height: 1; }
.fmm-price--card { font-size: 1.5rem; line-height: 1.1; }
.fmm-mrp { font-weight: 600; opacity: .7; text-decoration: line-through; text-decoration-thickness: 2px; }
.fmm-price-wrap .fmm-mrp { font-size: 1rem; }
.fmm-price-wrap:has(.fmm-price--lg) .fmm-mrp { font-size: 1.25rem; }
.fmm-off {
  align-self: center; border-radius: 999px; padding: .15rem .55rem;
  background: var(--color-leaf); color: var(--color-forest-ink);
  font-size: .75rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap;
}
.fmm-savings { color: #2c8a56; }
.fmm-save {
  align-self: center; border-radius: 999px; padding: .15rem .55rem;
  background: var(--color-forest); color: var(--color-turmeric);
  font-size: .75rem; font-weight: 800; white-space: nowrap;
}

/* 3-pack combo: full-width card under the three flavour cards, warm cream-to-turmeric like its photo */
.fmm-combo-li { grid-column: 1 / -1; }
.fmm-combo-card {
  position: relative; isolation: isolate; overflow: hidden; height: 100%;
  display: grid; grid-template-columns: 1fr; border-radius: var(--radius-card);
  background: linear-gradient(135deg, #FBF3E1 0%, #F6E7C4 50%, #F2C14E 100%);
  color: var(--color-forest);
}
.fmm-combo-img { display: block; overflow: hidden; }
.fmm-combo-img img {
  display: block; width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 47%;
  transition: transform .7s cubic-bezier(0,0,.2,1);
}
.fmm-combo-card:hover .fmm-combo-img img { transform: scale(1.03); }
.fmm-combo-body { display: flex; flex-direction: column; justify-content: center; padding: 1.75rem 1.5rem 2rem; }
.fmm-combo-eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #9a5a10; }
.fmm-combo-title { margin-top: .5rem; font-size: clamp(2rem, 4vw, 3rem); line-height: 1; }
.fmm-combo-text { margin-top: .75rem; max-width: 32rem; font-size: 1.05rem; color: rgb(16 37 28 / .8); }
.fmm-combo-buy { margin-top: 1.25rem; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; }
@media (min-width: 48rem) {
  /* The pouches fill a ~1.31:1 area of the photo, so a 5:4 frame shows all three in full. */
  .fmm-combo-card { grid-template-columns: 1fr 1fr; align-items: center; }
  .fmm-combo-img { align-self: stretch; }
  .fmm-combo-img img { aspect-ratio: 5 / 4; height: 100%; min-height: 100%; object-position: 50% 46%; }
  .fmm-combo-body { padding: 2.5rem 2.5rem 2.5rem 2rem; }
}
/* Combo product page: photo inside the hero */
.fmm-combo-hero {
  display: block; width: 100%; max-width: 30rem; margin: 0 auto; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 47%;
  border-radius: var(--radius-card); box-shadow: 0 24px 50px rgb(16 37 28 / .2);
}

/* Homepage pouch cards: round "fibre per pack" sticker, top-right */
.fmm-fibre-patch {
  position: absolute; top: .9rem; right: .9rem; z-index: 10;
  display: grid; place-items: center; width: 4.75rem; height: 4.75rem; border-radius: 50%;
  color: #2A1A06; text-align: center; line-height: 1;
  font-family: var(--font-display); font-weight: 800;
  box-shadow: 0 6px 14px rgb(0 0 0 / .22);
  transform: rotate(8deg);
}
.fmm-fibre-patch::before { /* stitched-patch ring */
  content: ""; position: absolute; inset: 4px; border-radius: 50%;
  border: 1.5px dashed rgb(42 26 6 / .35);
}
.fmm-fibre-patch-num { display: block; font-size: 1.3rem; }
.fmm-fibre-patch-label { display: block; margin-top: .2rem; font-size: .55rem; letter-spacing: .05em; text-transform: uppercase; }
.group:hover .fmm-fibre-patch { transform: rotate(0deg) scale(1.05); transition: transform .3s; }

/* ---------------------------------------------------------------------------
   Brock the broccoli (js/brock.js)
   Brock is a transparent cut-out. Moods are made with body movement plus small
   cartoon overlays (eyelids, frown, blush, hearts, tear, sparkle, "hmph" mark).
   Overlay positions are percentages of the image, measured on brock.webp.
   --------------------------------------------------------------------------- */
.brock {
  position: fixed; right: 1rem; bottom: .75rem; z-index: 55;
  display: flex; align-items: flex-end; gap: .35rem;
  max-width: calc(100vw - 2rem);
  pointer-events: none; /* only the bubble and Brock himself take clicks */
}
.brock--left { right: auto; left: 1rem; flex-direction: row-reverse; }
.brock.brock--top { bottom: auto; align-items: flex-start; } /* top corner, just below the header (top set in JS) */
.brock--top .brock-bubble { margin-bottom: 0; margin-top: 1.5rem; }
.brock--top .brock-bubble::after { bottom: auto; top: 18px; }
.brock > * { pointer-events: auto; }

/* --- the figure --- */
.brock-fig { position: relative; flex-shrink: 0; width: 72px; padding-bottom: 4px; }
.brock-shadow {
  position: absolute; left: 14%; right: 10%; bottom: 0; height: 9px; border-radius: 50%;
  background: radial-gradient(closest-side, rgb(16 37 28 / .32), transparent);
}
.brock-body { position: relative; transform-origin: 50% 100%; }
.brock-inner { position: relative; transform-origin: 50% 100%; }
.brock-img { display: block; width: 100%; height: auto; filter: drop-shadow(0 3px 4px rgb(16 37 28 / .25)); }
.brock-inner > span { position: absolute; pointer-events: none; }

/* eyelids: closed = scaleY(1), open = scaleY(0) */
.brock-lid {
  transform: scaleY(0); transform-origin: 50% 0;
  border-bottom: 1.5px solid #3a3a1f;
  border-radius: 45% 45% 50% 50% / 30% 30% 70% 70%;
}
.brock-lid--l { left: 33%; top: 47.3%; width: 11.1%; height: 9%;
  background: radial-gradient(ellipse at 50% 35%, #a6b05c, #95a14d); }
.brock-lid--r { left: 62.1%; top: 47.7%; width: 9.6%; height: 8.8%;
  background: radial-gradient(ellipse at 50% 35%, #bec86f, #abb65f); }

/* mouth cover + new mouth shape (sad / impatient) */
.brock-mouth {
  left: 46%; top: 52.1%; width: 14%; height: 7.6%; opacity: 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, #adb660 62%, rgb(173 182 96 / 0) 100%);
}
.brock-mouth::after {
  content: ""; position: absolute; left: 25%; right: 25%; top: 40%; height: 45%;
  border-top: 2px solid #3a2a1c; border-radius: 50% 50% 0 0;
}
.brock-blush {
  width: 15%; height: 7.5%; opacity: 0; border-radius: 50%;
  background: radial-gradient(closest-side, rgb(255 92 110 / .75), rgb(255 92 110 / 0));
}
.brock-blush--l { left: 29.2%; top: 55.1%; width: 13%; }
.brock-blush--r { left: 63%; top: 55.1%; width: 11%; }

/* effects (all hidden until a mood shows them) */
.brock-fx { opacity: 0; color: var(--color-chilli); }
.brock-fx svg { display: block; width: 100%; height: 100%; }
.brock-heart { width: 15px; height: 15px; }
.brock-heart--1 { left: 4%;  top: 6%;  color: #ff5c6e; }
.brock-heart--2 { left: 44%; top: -4%; color: var(--color-chilli); width: 12px; height: 12px; }
.brock-heart--3 { left: 82%; top: 8%;  color: #ff5c6e; width: 13px; height: 13px; }
.brock-heart--4 { left: 92%; top: 30%; color: var(--color-turmeric); width: 10px; height: 10px; }
.brock-tear { left: 36.5%; top: 55.3%; width: 6px; height: 9px; }
.brock-sparkle { left: 73%; top: 42%; width: 13px; height: 13px; color: var(--color-turmeric); }
.brock-anger { left: 84%; top: -6%; width: 20px; height: 20px; filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 1px #fff); }
.brock-waves { left: 93%; top: 62%; width: 11px; height: 18px; color: var(--color-forest); }

/* --- always: gentle breathing while visible --- */
.brock.is-in .brock-inner { animation: brock-breathe 2.6s ease-in-out .8s infinite; }

/* --- hello: waves (rocks side to side, motion lines by the arm) and blinks --- */
.brock.is-in[data-mood=wave] .brock-body { animation: brock-rock .75s ease-in-out .7s 4; }
.brock.is-in[data-mood=wave] .brock-waves { animation: brock-waves .375s ease-in-out .7s 8 alternate; }
.brock.is-in[data-mood=wave] .brock-lid,
.brock.is-in[data-mood=cheer] .brock-lid { animation: brock-blink 4.6s ease-in-out .6s 1; }

/* --- cart / paid: happy jumps, blushing cheeks, floating hearts --- */
.brock.is-in[data-mood=cheer] .brock-body { animation: brock-jump .6s cubic-bezier(.3,.7,.4,1) .65s 3; }
.brock.is-in[data-mood=cheer] .brock-blush { animation: brock-blush 3.4s ease-in-out .6s 1 both; }
.brock.is-in[data-mood=cheer] .brock-heart { animation: brock-float 1.7s ease-out both; }
.brock.is-in[data-mood=cheer] .brock-heart--1 { animation-delay: .8s; }
.brock.is-in[data-mood=cheer] .brock-heart--2 { animation-delay: 1.05s; }
.brock.is-in[data-mood=cheer] .brock-heart--3 { animation-delay: 1.3s; }
.brock.is-in[data-mood=cheer] .brock-heart--4 { animation-delay: 1.55s; }

/* --- empty cart: droops, sad half-closed eyes, little frown, a tear --- */
.brock.is-in[data-mood=sad] .brock-body { animation: brock-droop 1s ease-out .6s both; }
.brock.is-in[data-mood=sad] .brock-img { filter: drop-shadow(0 3px 4px rgb(16 37 28 / .25)) saturate(.8); }
.brock[data-mood=sad] .brock-lid { transform: scaleY(.5); border-radius: 50% 50% 40% 40% / 20% 20% 80% 80%; }
.brock[data-mood=sad] .brock-mouth { opacity: 1; }
.brock.is-in[data-mood=sad] .brock-tear { animation: brock-tear 1.6s ease-in 1.2s 2; }

/* --- fibre: tilts, winks, sparkle by the eye --- */
.brock.is-in[data-mood=wink] .brock-body { animation: brock-tilt .9s ease-out .6s both; }
.brock.is-in[data-mood=wink] .brock-lid--r { animation: brock-wink 2.4s ease-in-out .9s 2; }
.brock.is-in[data-mood=wink] .brock-sparkle { animation: brock-twinkle 1.2s ease-in-out 1s 3; }
.brock.is-in[data-mood=wink] .brock-blush--r { animation: brock-blush 2.4s ease-in-out 1s 2; }

/* --- impatient (cart left waiting): foot-tap bounce, unimpressed eyes, flat mouth, "hmph" mark --- */
.brock.is-in[data-mood=impatient] .brock-body { animation: brock-tap .34s ease-in-out .7s 9; }
.brock[data-mood=impatient] .brock-lid { transform: scaleY(.42); border-radius: 30% 30% 0 0; }
.brock[data-mood=impatient] .brock-mouth { opacity: 1; }
.brock[data-mood=impatient] .brock-mouth::after { border-radius: 0; top: 48%; left: 30%; right: 30%; }
.brock.is-in[data-mood=impatient] .brock-anger { animation: brock-pulse .45s ease-in-out .8s 8 alternate both; }

@keyframes brock-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.015, 1.03); } }
@keyframes brock-rock { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-9deg); } 75% { transform: rotate(9deg); } }
@keyframes brock-waves { from { opacity: .2; transform: translateX(0) rotate(-6deg); } to { opacity: 1; transform: translateX(3px) rotate(8deg); } }
@keyframes brock-blink { 0%, 26%, 34%, 78%, 86%, 100% { transform: scaleY(0); } 30%, 82% { transform: scaleY(1); } }
@keyframes brock-jump {
  0%   { transform: translateY(0) scale(1, 1); }
  15%  { transform: translateY(0) scale(1.08, .9); }
  45%  { transform: translateY(-24%) scale(.94, 1.07); }
  75%  { transform: translateY(0) scale(1.06, .93); }
  100% { transform: translateY(0) scale(1, 1); }
}
@keyframes brock-blush { 0%, 100% { opacity: 0; } 20%, 75% { opacity: 1; } }
@keyframes brock-float {
  0%   { opacity: 0; transform: translateY(6px) scale(.3); }
  20%  { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-38px) scale(.9) rotate(12deg); }
}
@keyframes brock-droop { to { transform: rotate(-5deg) translateY(2%) scale(1, .96); } }
@keyframes brock-tear {
  0%   { opacity: 0; transform: translateY(0) scale(.6); }
  15%  { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(26px) scale(1); }
}
@keyframes brock-tilt { 0% { transform: rotate(0); } 60% { transform: rotate(7deg); } 100% { transform: rotate(5deg); } }
@keyframes brock-wink { 0%, 20%, 62%, 100% { transform: scaleY(0); } 28%, 52% { transform: scaleY(1); } }
@keyframes brock-twinkle { 0%, 100% { opacity: 0; transform: scale(.2) rotate(0); } 50% { opacity: 1; transform: scale(1) rotate(45deg); } }
@keyframes brock-tap {
  0%, 100% { transform: translateY(0) rotate(0); }
  30% { transform: translateY(-5%) rotate(-2deg); }
  60% { transform: translateY(0) rotate(2deg); }
}
@keyframes brock-pulse { from { opacity: .55; transform: scale(.8); } to { opacity: 1; transform: scale(1.12); } }

/* --- speech bubble --- */
.brock-bubble {
  position: relative; width: 15rem; max-width: calc(100vw - 2rem - 72px - .35rem);
  margin-bottom: 3.2rem;
  padding: .85rem 2.1rem .75rem 1rem;
  border-radius: 20px;
  background: var(--color-rice); color: var(--color-forest);
  border: 1.5px solid rgb(29 59 46 / .15);
  box-shadow: 0 12px 28px rgb(16 37 28 / .18);
}
.brock-bubble::after { /* tail pointing at Brock */
  content: ""; position: absolute; bottom: 16px; right: -9px; width: 16px; height: 16px;
  background: var(--color-rice); transform: rotate(45deg);
  border-right: 1.5px solid rgb(29 59 46 / .15); border-top: 1.5px solid rgb(29 59 46 / .15);
}
.brock--left .brock-bubble::after { right: auto; left: -9px; transform: rotate(-135deg); }
.brock-text { font-weight: 600; font-size: .95rem; line-height: 1.35; }
.brock-close {
  position: absolute; top: .35rem; right: .35rem;
  display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 999px;
  font-size: 1.2rem; line-height: 1; color: var(--color-forest); cursor: pointer;
}
.brock-close:hover { background: rgb(29 59 46 / .08); }
.brock-hide {
  margin-top: .4rem; font-size: .75rem; font-weight: 600; color: var(--color-muted);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.brock-hide:hover { color: var(--color-forest); }
.brock button:focus-visible { outline: 2px solid var(--color-leaf); outline-offset: 2px; }
.brock-toggle { color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.brock-toggle:hover { color: var(--color-rice); }

/* --- entrance / exit --- */
.brock.is-in .brock-fig { animation: brock-hop .7s cubic-bezier(.3,1.4,.5,1) both; }
.brock.is-in .brock-bubble { animation: brock-bubble-in .35s .25s ease-out both; }
.brock.is-leaving { animation: brock-out-right .45s ease-in both; }
.brock--left.is-leaving { animation-name: brock-out-left; }
@keyframes brock-hop {
  0%   { transform: translateY(130%) rotate(0); }
  55%  { transform: translateY(-14%) rotate(-6deg); }
  75%  { transform: translateY(0) rotate(5deg); }
  90%  { transform: rotate(-2deg); }
  100% { transform: none; }
}
@keyframes brock-bubble-in { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes brock-out-right { to { opacity: 0; transform: translateX(120%); } }
@keyframes brock-out-left  { to { opacity: 0; transform: translateX(-120%); } }

@media (max-width: 639px) {
  .brock { bottom: .5rem; }
  .brock--left { left: .75rem; }
  .brock:not(.brock--left) { right: .75rem; }
  .brock-fig { width: 64px; }
  .brock-bubble { margin-bottom: 2.8rem; max-width: calc(100vw - 1.5rem - 64px - .35rem); }
  .brock-text { font-size: .9rem; }
}

/* Reduced motion: no hops, jumps or slides; just a fade. Expressions (eyes, mouth) still show. */
@media (prefers-reduced-motion: reduce) {
  .brock.is-in .brock-fig, .brock.is-in .brock-bubble { animation: brock-fade .2s both !important; animation-iteration-count: 1 !important; }
  .brock.is-in .brock-body, .brock.is-in .brock-inner, .brock.is-in .brock-lid,
  .brock.is-in .brock-fx, .brock.is-in .brock-blush { animation: none !important; }
  .brock.is-leaving, .brock--left.is-leaving { animation: brock-fade-out .2s both !important; animation-iteration-count: 1 !important; }
}
@keyframes brock-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes brock-fade-out { to { opacity: 0; } }

/* Hide number spinners in quantity steppers */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* Mobile menu */
.fmm-mobile-menu { border-top: 1px solid rgb(29 59 46 / .1); background: var(--color-rice); }
.fmm-mobile-menu ul { max-width: 80rem; margin: 0 auto; padding: .5rem 1.25rem 1rem; display: grid; gap: .25rem; }
.fmm-mobile-menu a { display: block; padding: .75rem 1rem; border-radius: 14px; font-weight: 600; color: var(--color-forest); }
.fmm-mobile-menu a:hover, .fmm-mobile-menu a[aria-current=page] { background: rgb(29 59 46 / .08); }
@media (min-width: 64rem) { .fmm-mobile-menu { display: none !important; } }

/* Footer: current flavour */
footer a[aria-current=page] { color: var(--color-rice); text-decoration: underline; }

/* Toast */
.fmm-toast {
  position: fixed; left: 50%; bottom: 1.25rem; z-index: 60;
  transform: translate(-50%, 1rem); opacity: 0; pointer-events: none;
  display: block; width: max-content; max-width: calc(100vw - 2rem); text-align: center;
  padding: .85rem 1.25rem; border-radius: 999px;
  background: var(--color-forest-ink); color: var(--color-rice);
  font-weight: 500; box-shadow: 0 12px 30px rgb(0 0 0 / .25);
  transition: opacity .2s, transform .2s;
}
.fmm-toast.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.fmm-toast-action { margin-left: .75rem; font-weight: 700; color: var(--color-leaf); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Checkout field errors */
.fmm-error { margin-top: .4rem; font-size: .875rem; font-weight: 600; color: var(--color-sichuan); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
