/*
 * Cuddle Family — interactive enhancement layer.
 * Pure progressive enhancement on top of the builder export: no markup is
 * changed, and every motion rule is disabled under prefers-reduced-motion.
 * Uses the individual `translate` / `scale` properties so it never overrides
 * transforms set by the builder or the yeeo SDK scripts.
 */
:root {
  --cf-blue: #6ec6ea;
  --cf-green: #5dbb63;
  --cf-pink: #f49ac1;
  --cf-yellow: #f6d74a;
  --cf-orange: #f7a541;
  --cf-ink: #1d1e20;
  --cf-ease: cubic-bezier(.22, 1, .36, 1);
  --cf-focus: 0 0 0 3px #fff, 0 0 0 6px var(--cf-blue);
}

/* ── Scroll progress bar ── */
.cf-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 4px;
  z-index: 99989;
  pointer-events: none;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--cf-blue), var(--cf-green), var(--cf-yellow), var(--cf-orange), var(--cf-pink));
  border-radius: 0 4px 4px 0;
}

/* ── Header navigation ── */
.block-header-item__item,
.block-header-logo,
.block-header-cart__button {
  transition: color .25s ease, opacity .25s ease, scale .35s var(--cf-ease);
}
.block-header-item__item:hover { opacity: .7; }
.block-header-logo:hover { scale: 1.06; }
.block-header-cart__button:hover { scale: 1.12; }

/* ── Buttons ── */
.grid-button,
.form__button,
.block-product__button,
.product-list-item__button {
  transition: translate .3s var(--cf-ease), box-shadow .3s var(--cf-ease), background-color .25s ease, color .25s ease, filter .25s ease;
}
.grid-button:hover,
.form__button:hover {
  translate: 0 -2px;
  box-shadow: 0 10px 22px -10px rgba(29, 30, 32, .45);
}
.grid-button:active,
.form__button:active {
  translate: 0 1px;
  box-shadow: 0 2px 6px -2px rgba(29, 30, 32, .35);
  filter: brightness(.96);
}

/* ── Keyboard focus ── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: none !important;
  box-shadow: var(--cf-focus) !important;
  border-radius: 8px;
}

/* ── Form fields ── */
.input__component {
  transition: border-color .25s ease, box-shadow .25s ease, background-color .25s ease;
}
.input__component:hover { border-color: var(--cf-blue) !important; }
.input__component:focus {
  border-color: var(--cf-blue) !important;
  box-shadow: 0 0 0 4px rgba(110, 198, 234, .25) !important;
  outline: none !important;
}

/* ── Linked images (flower category tiles, product cards) ── */
.image--link {
  transition: scale .45s var(--cf-ease), rotate .45s var(--cf-ease), filter .45s ease;
}
.image--link:hover {
  scale: 1.05;
  rotate: -2deg;
  filter: drop-shadow(0 14px 18px rgba(29, 30, 32, .18));
}
.image--link:active { scale: .98; }

/* ── Product list cards ── */
.product-list-item {
  transition: translate .4s var(--cf-ease), box-shadow .4s var(--cf-ease);
  border-radius: 12px;
}
.product-list-item:hover {
  translate: 0 -6px;
  box-shadow: 0 18px 36px -18px rgba(29, 30, 32, .35);
}
.product-list-item__image-wrapper { overflow: hidden; }
.product-list-item__image { transition: scale .6s var(--cf-ease); }
.product-list-item:hover .product-list-item__image { scale: 1.06; }

/* ── Zoomable gallery images ── */
.grid-gallery .image--zoom {
  overflow: hidden;
  transition: translate .35s var(--cf-ease), box-shadow .35s var(--cf-ease);
}
.grid-gallery .image--zoom img { transition: scale .5s var(--cf-ease); }
.grid-gallery .image--zoom:hover { translate: 0 -4px; }
.grid-gallery .image--zoom:hover img { scale: 1.06; }

/* ── Product gallery arrows ── */
.wb-product-gallery-nav,
.wb-product-gallery-thumb {
  transition: scale .25s var(--cf-ease), box-shadow .25s ease, opacity .25s ease;
}
.wb-product-gallery-nav:hover { scale: 1.1; box-shadow: 0 6px 16px rgba(0, 0, 0, .18); }
.wb-product-gallery-thumb:hover { scale: 1.05; }

/* ── Social icons ── */
.social-icons__link { transition: scale .3s var(--cf-ease), color .25s ease; }
.social-icons__link:hover { scale: 1.2; color: var(--cf-blue); }

/* ── Readability for text placed on photo backgrounds ── */
.block:has(> .block-background .block-background__image) .text-box :is(h1, h2, h3) {
  text-shadow: 0 2px 14px rgba(0, 0, 0, .35);
}

/* ── Reveal on scroll (only once JS has tagged an element) ── */
.cf-reveal {
  opacity: 0;
  translate: 0 28px;
  transition: opacity .8s var(--cf-ease), translate .8s var(--cf-ease);
  transition-delay: var(--cf-delay, 0ms);
}
.cf-reveal.cf-in {
  opacity: 1;
  translate: 0 0;
}

/* ── Floating back-to-top (moves above the yeeo cart button while it shows) ── */
.cf-top {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 99989;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--cf-ink);
  box-shadow: 0 8px 24px rgba(29, 30, 32, .18);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  translate: 0 16px;
  pointer-events: none;
  transition: opacity .3s ease, translate .4s var(--cf-ease), scale .25s var(--cf-ease), bottom .3s var(--cf-ease);
}
.cf-top.cf-stack { bottom: 92px; }
.cf-top.cf-show {
  opacity: 1;
  translate: 0 0;
  pointer-events: auto;
}
.cf-top:hover { scale: 1.08; }
.cf-top svg { width: 22px; height: 22px; }

/* Pulse on the cart button after "Add to bag" */
@keyframes cf-pop {
  0% { scale: 1; }
  35% { scale: 1.25; }
  60% { scale: .94; }
  100% { scale: 1; }
}
.cf-pop { animation: cf-pop .6s var(--cf-ease); }

/* ── Lightbox for zoomable gallery images ── */
.cf-lb {
  position: fixed;
  inset: 0;
  z-index: 2147482000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 17, 20, .88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .3s ease;
}
.cf-lb.cf-open { opacity: 1; }
.cf-lb[hidden] { display: none; }
.cf-lb__img {
  max-width: min(92vw, 1100px);
  max-height: 84vh;
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
  background: #fff;
  scale: .94;
  transition: scale .4s var(--cf-ease), opacity .25s ease;
}
.cf-lb.cf-open .cf-lb__img { scale: 1; }
.cf-lb__btn {
  position: absolute;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font: 400 26px/1 system-ui, sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color .2s ease, scale .2s var(--cf-ease);
}
.cf-lb__btn:hover { background: rgba(255, 255, 255, .28); scale: 1.08; }
.cf-lb__btn[hidden] { display: none; }
.cf-lb__close { top: 18px; right: 18px; }
.cf-lb__prev { left: 18px; top: 50%; translate: 0 -50%; }
.cf-lb__next { right: 18px; top: 50%; translate: 0 -50%; }
.cf-lb__count {
  position: absolute;
  bottom: 18px;
  left: 50%;
  translate: -50% 0;
  color: rgba(255, 255, 255, .8);
  font: 500 14px/1 system-ui, sans-serif;
  letter-spacing: .05em;
}
@media (max-width: 600px) {
  .cf-lb__prev, .cf-lb__next { top: auto; bottom: 10px; translate: none; }
  .cf-top { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .cf-reveal { opacity: 1; translate: none; }
}
