/* ===== Home page (index.html only) =====
   Loaded after style.css. Wiping hero with a timed progress dot, three
   10-product sections, and the size helper with its flying bee. Page
   backgrounds stay in the site palette: cream, beige bands, brown footer. */
:root {
  --hb-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
body.home { overflow-x: clip; }

/* ===== Hero: the next slide wipes in over the last =====
   A wipe, not a crossfade: fading two photos together mixes their colours
   (red jacket + blue jacket turned the hero purple mid-change). The
   outgoing slide stays visible underneath until the wipe has finished. */
.hero { isolation: isolate; }
.hero-slider { display: grid; }
.hero-slide {
  display: flex;
  grid-area: 1 / 1;
  visibility: hidden;
  transition: visibility 0s linear 0.9s;
}
.hero-slide.active { visibility: visible; z-index: 2; transition: none; }
.hero-slide.is-entering { animation: hbWipe 0.9s cubic-bezier(0.65, 0, 0.35, 1) both; }
@keyframes hbWipe { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }
.hero-controls { z-index: 4; }

/* Text arrives line by line, then the highlight gets a honey marker stroke */
.hero-slide.active .hero-text { animation: none; }
.hero-slide.active .hero-eyebrow { animation: hbRise 0.7s var(--hb-ease) 0.15s both; }
.hero-slide.active .hero-text h1 { animation: hbRise 0.8s var(--hb-ease) 0.28s both; }
.hero-slide.active .hero-sub { animation: hbRise 0.8s var(--hb-ease) 0.42s both; }
.hero-slide.active .hero-cta { animation: hbRise 0.8s var(--hb-ease) 0.56s both; }
@keyframes hbRise { from { opacity: 0; transform: translateY(26px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.hero-text h1 .highlight {
  background: linear-gradient(rgba(255, 200, 69, 0.3), rgba(255, 200, 69, 0.3)) no-repeat 0 90% / 0% 0.3em;
}
.hero-slide.active .hero-text h1 .highlight { animation: hbMarker 0.8s var(--hb-ease) 1s forwards; }
@keyframes hbMarker { to { background-size: 100% 0.3em; } }

/* Active dot fills up over the 15 s autoplay; while hovered (autoplay paused)
   it stays full and restarts with the timer on mouse leave */
.hero-dot { position: relative; overflow: hidden; }
.hero-dot.active { width: 46px; background: rgba(255, 255, 255, 0.35); }
.hero-dot.active::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--color-accent);
  transform-origin: left center;
  animation: hbDot 15s linear both; /* same as the autoplay delay in script.js */
}
.hero-slider:hover .hero-dot.active::after { animation: none; }
@keyframes hbDot { from { transform: scaleX(0); } to { transform: scaleX(1); } }


/* ===== Section heads =====
   Same look as "Shop by category" (style.css .categories-head), so every
   section on the page reads as one family. */
.hb-section { padding-block: 64px; }
.hb-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px 32px;
  margin-bottom: 28px;
}
.hb-head h2, .sizer h2 { font-size: 1.7rem; line-height: 1.15; text-wrap: balance; }
.hb-head h2 + p { margin-top: 6px; color: var(--color-text-soft); }
@media (max-width: 600px) {
  .hb-section { padding-block: 44px; }
  .hb-head h2, .sizer h2 { font-size: 1.4rem; }
}

/* ===== Product sections: Kids Winter 10, Kids Summer 4, Other Items 4 =====
   Layout: see .home-grid below (2 per row on phones). Section colours:
   the kids palette right below. */
/* Kids colour palette: each section gets a soft tint + a deeper "ink" for
   its heading, icon badge and "সব দেখুন" button. Ink colours are dark
   enough for ≥4.5:1 contrast on their tint. */
body.home {
  background: #FFFBF2;
  --kid-sky: #E4F2FC;   --kid-sky-ink: #1F6FAE;
  --kid-sun: #FFF3CC;   --kid-sun-ink: #9A5A00;
  --kid-mint: #E2F5EB;  --kid-mint-ink: #1B7049;
  --kid-peach: #FFE8E2; --kid-peach-ink: #B23E2E;
}
.kid-sky { --tint: var(--kid-sky); --ink: var(--kid-sky-ink); }
.kid-sun { --tint: var(--kid-sun); --ink: var(--kid-sun-ink); }
.kid-mint { --tint: var(--kid-mint); --ink: var(--kid-mint-ink); }
.kid-peach { --tint: var(--kid-peach); --ink: var(--kid-peach-ink); }
/* Product sections are plain white so the products stand out; the kids
   colour stays in each section's title, icon and "সব দেখুন" button. */
.kid-section { background: #FFFFFF; }
.kid-section + .kid-section { border-top: 1px solid #F1EADB; }
.kid-section .hb-head h2 { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.kid-section .hb-head h2 + p { color: #5F4C3A; }
.kid-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #FFFFFF;
  color: var(--ink);
  box-shadow: 0 6px 16px -10px rgba(61, 40, 23, 0.45);
}
.kid-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kid-section .hb-more { border-color: var(--ink); color: var(--ink); background: rgba(255, 255, 255, 0.6); }
.kid-section .hb-more:hover { background: var(--ink); color: #FFFFFF; }
.kid-section .product-card { border-color: #EFE8DA; box-shadow: 0 8px 22px -18px rgba(61, 40, 23, 0.45); }
@media (max-width: 600px) {
  .kid-icon { width: 36px; height: 36px; }
  .kid-icon svg { width: 20px; height: 20px; }
}
.hb-more-group { display: flex; flex-wrap: wrap; gap: 8px; }
.hb-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 8px 18px;
  border: 1.5px solid var(--color-text);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.hb-more svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.hb-more:hover { background: var(--color-text); color: #FFFFFF; }
.hb-more:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
/* Desktop: Kids Winter 5 per row (2 rows), Kids Summer / Other Items 4 in a row.
   Phone & small tablet (≤900px): every section 2 per row, no sideways swiping. */
.home-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
.home-grid.home-grid--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .home-grid, .home-grid.home-grid--four { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}
@media (max-width: 600px) {
  .home-grid, .home-grid.home-grid--four { gap: 12px; }
  .hb-head { align-items: flex-start; }
  .hb-more { min-height: 38px; padding: 6px 14px; font-size: 0.85rem; }
}

/* Cards pop in one after another when a section renders */
.is-in > .product-card { animation: hbCard 0.55s var(--hb-ease) backwards; animation-delay: calc(var(--i, 0) * 55ms); }
@keyframes hbCard { from { opacity: 0; transform: translateY(18px) scale(0.98); } }
.home .product-card { transition: transform 0.3s var(--hb-ease), box-shadow 0.3s ease; }
.home .product-card:hover { transform: translateY(-4px); box-shadow: 0 22px 36px -24px rgba(61, 40, 23, 0.55); }
.section-view-all .btn { gap: 10px; }

/* ===== Size helper: one split panel on a peach section =====
   Left: sky blue with white text, honey ticks and the bee. Right: white
   form — honey for the chosen option, pale sunshine for the result, coral
   + WhatsApp green for the two actions. */
.sizer { padding-block: 64px; background: var(--tint, transparent); }
.sizer-inner {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  overflow: hidden;
  border-radius: 28px;
  background: var(--color-surface);
  box-shadow: 0 30px 60px -36px rgba(178, 62, 46, 0.45);
}
.sizer-copy {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 44px;
  background: linear-gradient(160deg, #1F6FAE 0%, #185C92 100%);
  color: #FFFFFF;
}
.sizer-copy h2 { position: relative; color: #FFFFFF; }
.sizer-lead { position: relative; margin-top: 14px; max-width: 42ch; color: #FFFFFF; opacity: 0.92; font-size: 1.02rem; }
.sizer-points { position: relative; list-style: none; display: grid; gap: 14px; margin-top: 28px; }
.sizer-points li { display: flex; align-items: center; gap: 12px; font-weight: 600; color: #FFFFFF; }
.sizer-points li::before {
  content: "";
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%233D2817' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 15px no-repeat;
}
.sizer-card { padding: 36px 40px; }
.sizer-step { margin-bottom: 18px; }
.sizer-step-label { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-weight: 700; font-size: 0.95rem; }
.sizer-step-label small { font-weight: 500; color: var(--color-text-soft); }
.sizer-num {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--kid-sky-ink);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 0.8rem;
}
.sizer-ages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.sizer-kinds { display: flex; gap: 8px; }
.sizer-chip {
  min-height: 44px;
  padding: 0 12px;
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}
.sizer-kinds .sizer-chip { flex: 1; font-size: 0.98rem; }
.sizer-chip:hover { border-color: var(--color-primary); }
.sizer-chip[aria-pressed="true"] { border-color: var(--color-primary); background: var(--color-accent); transform: translateY(-1px); }
.sizer-chip:focus-visible, .sizer-input:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }
.sizer-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-bg);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-text);
}
.sizer-result {
  padding: 16px 18px;
  border-left: 4px solid var(--color-accent);
  border-radius: 12px;
  background: #FFF6DA;
}
.sizer-result.is-pop { animation: hbPop 0.45s var(--hb-ease); }
@keyframes hbPop { 0% { transform: scale(0.97); } 50% { transform: scale(1.015); } 100% { transform: none; } }
.sizer-result-kicker { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; color: var(--color-text-soft); }
.sizer-result-size { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; line-height: 1.2; color: var(--color-text); }
.sizer-result-tip { margin-top: 4px; font-size: 0.9rem; color: var(--color-text-soft); }
.sizer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.sizer-actions .btn { padding-inline: 14px; text-align: center; }
.btn-wa { background: #128C4A; color: #FFFFFF; box-shadow: 0 10px 22px -12px rgba(18, 140, 74, 0.8); }
.btn-wa:hover { background: #0E7A3F; }
.btn-wa svg { fill: currentColor; stroke: none; }

/* The bee loops across the top of the brown panel, turning round at each end */
.hb-bee { position: absolute; top: 18px; right: 28px; pointer-events: none; }
.hb-bee-x { animation: hbBeeX 12s ease-in-out infinite; }
.hb-bee-y { animation: hbBeeY 2.4s ease-in-out infinite alternate; }
.hb-bee-wings { transform-box: fill-box; transform-origin: center bottom; animation: hbWing 0.11s linear infinite alternate; }
@keyframes hbBeeX {
  0% { transform: translateX(-150px) scaleX(1); }
  48% { transform: translateX(0) scaleX(1); }
  50% { transform: translateX(0) scaleX(-1); }
  98% { transform: translateX(-150px) scaleX(-1); }
  100% { transform: translateX(-150px) scaleX(1); }
}
@keyframes hbBeeY { from { transform: translateY(-6px) rotate(-5deg); } to { transform: translateY(10px) rotate(6deg); } }
@keyframes hbWing { from { transform: scaleY(1); } to { transform: scaleY(0.5); } }

@media (max-width: 900px) {
  .sizer-inner { grid-template-columns: 1fr; }
  .sizer-copy { padding: 48px 28px 36px; }
  .sizer-card { padding: 28px; }
}
@media (max-width: 600px) {
  .sizer { padding-block: 44px; }
  .sizer-inner { border-radius: 22px; }
  .sizer-copy { padding: 44px 20px 28px; }
  .sizer-card { padding: 20px 16px; }
  .sizer-chip { min-height: 42px; }
  .sizer-actions { grid-template-columns: 1fr; }
  .hb-bee { right: 12px; top: 8px; }
  .hb-bee svg { width: 44px; height: 34px; }
  @keyframes hbBeeX {
    0% { transform: translateX(-110px) scaleX(1); }
    48% { transform: translateX(0) scaleX(1); }
    50% { transform: translateX(0) scaleX(-1); }
    98% { transform: translateX(-110px) scaleX(-1); }
    100% { transform: translateX(-110px) scaleX(1); }
  }
}

/* ===== Floating WhatsApp ===== */
.wa-float {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25D366;
  color: #FFFFFF;
  box-shadow: 0 14px 28px -10px rgba(18, 140, 74, 0.75);
  transition: transform 0.2s ease;
}
.wa-float svg { width: 30px; height: 30px; }
.wa-float::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid #25D366;
  animation: hbPulse 2.4s ease-out infinite;
}
@keyframes hbPulse { from { transform: scale(1); opacity: 0.7; } to { transform: scale(1.6); opacity: 0; } }
.wa-float:hover { transform: scale(1.06); }
.wa-float:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 3px; }
.wa-float-label {
  position: absolute;
  right: calc(100% + 12px);
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--color-text);
  color: #FFFFFF;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(6px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.wa-float:hover .wa-float-label, .wa-float:focus-visible .wa-float-label { opacity: 1; transform: none; }
@media (max-width: 600px) {
  .wa-float { width: 52px; height: 52px; right: 14px; }
  .wa-float svg { width: 27px; height: 27px; }
}

/* ===== Compact phone layout (≤600px) =====
   Each home section a notch smaller on phones: a shorter hero, the
   "সব দেখুন" button beside each section title, a tighter size helper. */
@media (max-width: 600px) {
  /* Hero on phones: small words on one side of the photo, like desktop —
     the side the slide's text is on (--left / --right), with the child
     moved to the other side so the words never cover them. */
  .hero-slide { min-height: 360px; align-items: center; } /* words in the middle of the photo's height */
  .hero-bg { object-position: var(--pos-p, var(--pos-m, 50% 50%)); }
  .hero-slide[data-key="winter-snow"] { --pos-p: 13% 40%; }
  .hero-slide[data-key="winter-cozy"] { --pos-p: 25% 35%; }
  .hero-slide[data-key="summer-beach"] { --pos-p: 34% 50%; }
  .hero-slide[data-key="summer-play"] { --pos-p: 58% 50%; }
  .hero-slide--left::after {
    background: linear-gradient(90deg, rgba(42, 27, 15, 0.86) 0%, rgba(42, 27, 15, 0.6) 42%, rgba(42, 27, 15, 0) 70%),
                linear-gradient(0deg, rgba(42, 27, 15, 0.55) 0%, rgba(42, 27, 15, 0) 30%);
  }
  .hero-slide--right::after {
    background: linear-gradient(270deg, rgba(42, 27, 15, 0.86) 0%, rgba(42, 27, 15, 0.6) 42%, rgba(42, 27, 15, 0) 70%),
                linear-gradient(0deg, rgba(42, 27, 15, 0.55) 0%, rgba(42, 27, 15, 0) 30%);
  }
  .hero-slide .hero-content { padding-block: 16px 34px; }
  .hero-text, .hero-slide--right .hero-text { max-width: 60%; margin: 0; text-align: left; }
  .hero-slide--right .hero-text { margin-left: auto; text-align: right; }
  .hero-eyebrow { font-size: 0.66rem; padding: 2px 9px; margin-bottom: 6px; }
  .hero-text h1 { font-size: 1.3rem; line-height: 1.22; margin-bottom: 10px; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45); }
  .hero-sub { display: none; } /* title + button say it; keeps the photo the star */
  /* one compact button, sized to its words */
  .hero-cta { flex-direction: row; justify-content: flex-start; align-items: center; gap: 8px; }
  .hero-slide--right .hero-cta { justify-content: flex-end; }
  .hero-btn { width: auto; min-height: 38px; padding: 0 16px; font-size: 0.84rem; gap: 6px; }
  .hero-btn--primary { padding-right: 13px; }
  .hero-btn svg { width: 15px; height: 15px; }
  .hero-btn--glass { display: none; } /* WhatsApp stays as the floating button */
  .hero-controls { bottom: 12px; }
  .hero-dot { width: 8px; height: 8px; }
  .hero-dot.active { width: 34px; }

  .categories { padding: 22px 0 26px; }
  .categories-head { margin-bottom: 12px; gap: 2px 12px; }
  .categories h2 { font-size: 1.3rem; }
  .categories-head p { font-size: 0.85rem; }
  .category-grid { gap: 10px; }
  .category-card { border-radius: 14px; }
  .category-card-body { padding: 36px 8px 10px; }
  .category-card h3 { font-size: 0.98rem; margin-bottom: 0; }
  .category-card-meta { display: none; }
  .category-card-arrow { width: 28px; height: 28px; top: 8px; right: 8px; }
  .category-card-arrow svg { width: 14px; height: 14px; }

  /* section head: title + "সব দেখুন" on one row, the line under it below */
  .hb-section { padding-block: 26px 30px; }
  .hb-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; margin-bottom: 14px; }
  .hb-head > div:first-child { display: contents; }
  .hb-head h2 { grid-column: 1; grid-row: 1; font-size: 1.22rem; }
  .kid-section .hb-head h2 { gap: 8px; }
  .hb-head h2 + p { grid-column: 1 / -1; grid-row: 2; margin-top: 0; font-size: 0.86rem; }
  .hb-head > .hb-more { grid-column: 2; grid-row: 1; }
  .hb-more-group { grid-column: 1 / -1; grid-row: 3; margin-top: 6px; }
  .hb-more { min-height: 34px; padding: 4px 12px; font-size: 0.8rem; }
  .kid-icon { width: 32px; height: 32px; }
  .kid-icon svg { width: 18px; height: 18px; }
  .home-grid, .home-grid.home-grid--four { gap: 10px; }

  .sizer { padding-block: 26px 30px; }
  .sizer-inner { border-radius: 18px; }
  .sizer-copy { padding: 26px 16px 18px; }
  .sizer h2 { font-size: 1.2rem; padding-right: 48px; }
  .sizer-lead { margin-top: 8px; font-size: 0.88rem; }
  .sizer-points { gap: 6px; margin-top: 12px; }
  .sizer-points li { font-size: 0.84rem; gap: 8px; }
  .sizer-points li::before { width: 20px; height: 20px; background-size: 11px; }
  .sizer-card { padding: 16px 14px; }
  .sizer-step { margin-bottom: 12px; }
  .sizer-step-label { margin-bottom: 8px; font-size: 0.88rem; }
  .sizer-ages { gap: 6px; }
  .sizer-chip { min-height: 38px; font-size: 0.95rem; border-radius: 10px; }
  .sizer-kinds .sizer-chip { font-size: 0.88rem; }
  .sizer-input { padding: 9px 12px; font-size: 0.9rem; }
  .sizer-result { padding: 10px 12px; }
  .sizer-result-size { font-size: 1.3rem; }
  .sizer-result-tip { font-size: 0.82rem; }
  .sizer-actions { gap: 8px; margin-top: 12px; }
  .sizer-actions .btn { min-height: 44px; padding-block: 8px; font-size: 0.9rem; }

  .wa-float { width: 48px; height: 48px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .wa-float svg { width: 25px; height: 25px; }
}

/* ===== Scroll reveal (home.js adds .js-reveal, so no-JS shows everything) ===== */
.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--hb-ease), transform 0.8s var(--hb-ease);
  transition-delay: var(--d, 0ms);
}
.js-reveal [data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .hero-slide, .hero-slide.active { transition: none; }
  .hero-slide.is-entering { animation: none; }
  .hero-slide.active .hero-eyebrow, .hero-slide.active .hero-text h1, .hero-slide.active .hero-sub, .hero-slide.active .hero-cta { animation: none; }
  .hero-slide.active .hero-text h1 .highlight { animation: none; background-size: 100% 0.3em; }
  .hero-dot.active::after { animation: none; }
  .home .product-card, .hb-more, .wa-float, .wa-float-label { transition: none; }
  .is-in > .product-card, .sizer-result.is-pop, .wa-float::before { animation: none; }
  .hb-bee { display: none; }
  .js-reveal [data-reveal] { opacity: 1; transform: none; transition: none; }
}
