/* STEIA Florería — mobile-first, sin dependencias.
   Solo se animan transform y opacity (no afectan Core Web Vitals). */
:root {
  --pink: #FBCEE2;        /* fondo del logotipo */
  --blush: #FFF5F9;
  --brand: #A50F4D;       /* magenta del logotipo */
  --brand-dark: #7A0B38;
  --ink: #43102B;
  --muted: #7A5568;
  --gold: #F2B04A;
  --leaf: #2E6B4E;
  --leaf-dark: #235239;
  --line: #F1D3E2;
  --surface: #FFFFFF;
  --radius: 16px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --display: Optima, Candara, "Segoe UI", "Gill Sans", "Trebuchet MS", system-ui, sans-serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--blush); color: var(--ink); font: 1rem/1.55 var(--sans); }
body.has-items { padding-bottom: 5rem; }
body:has(dialog[open]) { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.1; margin: 0; }
a { color: var(--brand-dark); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }

.wrap { width: min(100% - 2rem, 72rem); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; z-index: 100; padding: .5rem 1rem; background: var(--ink); color: #fff; border-radius: 8px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 46px; padding: .6rem 1.3rem; border: 2px solid transparent; border-radius: 999px;
  font: 600 .95rem/1.2 var(--sans); text-align: center; text-decoration: none; cursor: pointer;
  transition: background-position .5s var(--ease), background-color .2s, color .2s, transform .2s var(--ease);
}
.btn:active { transform: scale(.96); }
.btn--primary {
  color: #fff;
  background: linear-gradient(90deg, var(--brand-dark) 50%, var(--brand) 50%) 100% 0 / 200% 100%;
}
.btn--primary:hover { background-position: 0 0; }
.btn--primary.is-added { background: var(--leaf); }
.btn--outline { background: transparent; color: var(--brand-dark); border-color: var(--brand); }
.btn--outline:hover { background: var(--brand); color: #fff; }
.btn--wa { background: var(--leaf); color: #fff; width: 100%; }
.btn--wa:hover { background: var(--leaf-dark); }
.btn--wa[aria-disabled="true"] { background: var(--line); color: var(--muted); cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--muted); width: 100%; }
.btn--ghost:hover { color: var(--brand-dark); }

.count {
  display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; padding: 0 .4rem;
  background: var(--gold); color: var(--ink); border-radius: 999px; font-size: .8rem; font-weight: 700;
}
.count--light { background: #fff; }
.count.bump { animation: pop .45s var(--ease); }

/* ---------- Header (continúa el rosa del logo y del hero) ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--pink); }
.site-header__row { display: flex; align-items: center; justify-content: space-between; min-height: 4.5rem; gap: 1rem; }
.brand img { height: 3.25rem; width: auto; }
.cart-btn { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--pink); padding: 1.5rem 0 6rem; }
.hero__grid { position: relative; z-index: 1; display: grid; gap: 1.5rem; align-items: center; }
.hero h1 {
  color: var(--brand); font-size: clamp(2.9rem, 13vw, 6rem); letter-spacing: .01em; line-height: 1;
}
.word { display: inline-block; overflow: hidden; vertical-align: top; padding: .12em 0 .16em; }
.word > span { display: inline-block; transform: translateY(115%); animation: word-in .8s var(--ease) forwards; }
.word:nth-child(2) > span { animation-delay: .12s; }
.word:nth-child(3) > span { animation-delay: .24s; }

.rise { opacity: 0; transform: translateY(16px); animation: rise .8s var(--ease) forwards; }
.rise--1 { animation-delay: .5s; }
.rise--2 { animation-delay: .65s; }
.rise--3 { animation-delay: .8s; }
.hero__lead { max-width: 34rem; margin: 1rem 0 1.5rem; font-size: 1.1rem; color: var(--ink); }

.steps { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.5rem 0 0; padding: 0; list-style: none; counter-reset: paso; }
.steps li {
  counter-increment: paso; display: flex; align-items: center; gap: .5rem; padding: .35rem .9rem .35rem .4rem;
  background: rgb(255 255 255 / .6); border-radius: 999px; font-size: .9rem; font-weight: 600;
}
.steps li::before {
  content: counter(paso); display: grid; place-items: center; width: 1.5rem; height: 1.5rem;
  background: var(--brand); color: #fff; border-radius: 50%; font-size: .8rem;
}

/* Composición del hero: tres fotos en arco flotando sobre el emblema */
.hero__art { position: relative; width: min(88vw, 27rem); aspect-ratio: 1 / .98; margin-inline: auto; }
.hero__art .emblem { position: absolute; left: -8%; top: -8%; width: 116%; height: 116%; opacity: .45; z-index: 0; }
.arch {
  position: absolute; z-index: 1; height: auto; object-fit: cover; background: #fff;
  border: 5px solid #fff; border-radius: 999px 999px 16px 16px;
  box-shadow: 0 26px 40px -22px rgb(122 11 56 / .55);
  opacity: 0; transform: translateY(26px);
  animation: rise .9s var(--ease) forwards, float 8s ease-in-out infinite alternate;
}
.arch--a { left: 0; top: 30%; width: 35%; animation-delay: .7s, 1.6s; }
.arch--b { left: 27%; top: 0; width: 46%; z-index: 2; animation-delay: .5s, 1s; }
.arch--c { right: 0; top: 38%; width: 35%; animation-delay: .9s, 2.2s; animation-duration: .9s, 9s; }

/* Emblema SVG: marco geométrico que se dibuja + flor que se abre */
.emblem { width: min(74vw, 24rem); margin-inline: auto; overflow: visible; }
.emblem__spin { transform-origin: 200px 200px; animation: spin 90s linear infinite; }
.hex {
  fill: none; stroke: var(--brand); stroke-width: 1.6; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.6s .3s cubic-bezier(.6, 0, .2, 1) forwards;
}
.hex--b { animation-delay: .7s; opacity: .7; }
.emblem__bloom { transform-origin: 200px 200px; animation: breathe 7s ease-in-out 3s infinite alternate; }
.petal {
  fill: #fff; fill-opacity: .55; stroke: var(--brand); stroke-width: 1.4; stroke-linejoin: round;
  transform-origin: 200px 200px; transform: scale(0);
  animation: bloom 1s cubic-bezier(.2, 1.25, .35, 1) forwards; animation-delay: calc(1s + var(--i, 0) * .09s);
}
.petal--in { fill: var(--brand); fill-opacity: .14; animation-delay: calc(1.8s + var(--i, 0) * .08s); }
.pet g:nth-child(2) .petal { --i: 1; } .pet g:nth-child(3) .petal { --i: 2; }
.pet g:nth-child(4) .petal { --i: 3; } .pet g:nth-child(5) .petal { --i: 4; }
.pet g:nth-child(6) .petal { --i: 5; } .pet g:nth-child(7) .petal { --i: 6; }
.pet g:nth-child(8) .petal { --i: 7; }
.pistil { fill: var(--gold); transform-origin: 200px 200px; transform: scale(0); animation: bloom .7s cubic-bezier(.2, 1.4, .4, 1) 2.6s forwards; }

/* Pétalos que caen suavemente */
.petals { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.petals span {
  position: absolute; top: 0; width: 14px; height: 18px; border-radius: 0 100% 0 100%;
  background: var(--brand); opacity: 0; animation: fall 14s linear infinite;
}
.petals span:nth-child(1) { left: 6%;  --dx: 50px;  --r: 300deg;  animation-duration: 15s; animation-delay: 1s; }
.petals span:nth-child(2) { left: 18%; --dx: -40px; --r: -260deg; animation-duration: 12s; animation-delay: 5s; background: #fff; width: 11px; height: 14px; }
.petals span:nth-child(3) { left: 31%; --dx: 60px;  --r: 400deg;  animation-duration: 17s; animation-delay: 3s; }
.petals span:nth-child(4) { left: 46%; --dx: -50px; --r: -340deg; animation-duration: 13s; animation-delay: 8s; background: #fff; }
.petals span:nth-child(5) { left: 60%; --dx: 40px;  --r: 280deg;  animation-duration: 16s; animation-delay: 2s; width: 10px; height: 13px; }
.petals span:nth-child(6) { left: 72%; --dx: -60px; --r: -380deg; animation-duration: 14s; animation-delay: 6s; background: #fff; width: 12px; height: 15px; }
.petals span:nth-child(7) { left: 84%; --dx: 45px;  --r: 320deg;  animation-duration: 18s; animation-delay: 4s; }
.petals span:nth-child(8) { left: 93%; --dx: -35px; --r: -300deg; animation-duration: 13s; animation-delay: 9s; background: #fff; width: 10px; height: 13px; }

/* Olas que se deslizan al fondo del hero */
.waves { position: absolute; inset: auto 0 -1px 0; height: 4.5rem; overflow: hidden; pointer-events: none; }
.wave { position: absolute; left: 0; bottom: 0; width: 200%; height: 100%; animation: drift 24s linear infinite; }
.wave path { fill: var(--blush); }
.wave--back { opacity: .55; bottom: 6px; animation-duration: 38s; animation-direction: reverse; }

/* ---------- Catálogo ---------- */
.catalog { padding: 1rem 0 3.5rem; }
.catalog h2 { font-size: clamp(1.9rem, 6vw, 2.75rem); color: var(--brand); margin-bottom: 1.25rem; }
.filters { display: flex; gap: .5rem; overflow-x: auto; padding: .15rem .15rem .6rem; margin-bottom: .75rem; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 42px; padding: .4rem 1.1rem; background: var(--surface); color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 999px; font: 600 .9rem var(--sans); cursor: pointer;
  transition: background-color .25s, color .25s, border-color .25s, transform .25s var(--ease);
}
.chip:hover { border-color: var(--brand); }
.chip:active { transform: scale(.95); }
.chip[aria-pressed="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }
.status { color: var(--muted); }
.status:empty { display: none; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin: 0; padding: 0; list-style: none; }
.card {
  display: flex; flex-direction: column; padding: .5rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
/* Marco en arco: la forma distintiva del catálogo */
.card__media {
  position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: #FFD9E8;
  border-radius: 999px 999px 12px 12px;
}
.card:nth-child(4n+2) .card__media { background: #FFE7BD; }
.card:nth-child(4n+3) .card__media { background: #D7EBDD; }
.card:nth-child(4n+4) .card__media { background: #EADDF5; }
.card__img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.card__badge {
  position: absolute; left: 0; right: 0; bottom: .6rem; width: max-content; margin-inline: auto;
  padding: .15rem .7rem; background: var(--gold); color: var(--ink); border-radius: 999px; font-size: .75rem; font-weight: 700;
}
.card__badge:not([hidden]) { animation: pop .5s var(--ease); }
.card__body { display: flex; flex-direction: column; flex: 1; gap: .4rem; padding: .8rem .25rem .25rem; }
.card__title { font-size: 1.2rem; color: var(--ink); }
.card__desc { margin: 0; color: var(--muted); font-size: .88rem; flex: 1; }
.card .btn { width: 100%; margin-top: .4rem; padding-inline: .6rem; font-size: .88rem; }

@media (hover: hover) and (pointer: fine) {
  .card:hover { transform: translateY(-6px); box-shadow: 0 22px 34px -20px rgb(165 15 77 / .45); }
  .card:hover .card__img { transform: scale(1.07); }
}

/* Aparición al hacer scroll (la clase .reveal la pone JS y la quita al terminar) */
.reveal {
  opacity: 0; transform: translateY(26px) scale(.97);
  transition: opacity .6s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0ms);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Footer ---------- */
.site-footer { padding: 2.5rem 0 3rem; background: var(--pink); color: var(--ink); }
.site-footer a { color: var(--brand-dark); font-weight: 600; }
.site-footer__grid { display: grid; gap: 1.5rem; }
.footer-logo { width: 18rem; height: auto; margin-bottom: 1rem; }
.site-footer address { font-style: normal; color: var(--ink); }
.footer-links { display: grid; gap: .6rem; margin: 0; padding: 0; list-style: none; }

/* ---------- Barra inferior móvil ---------- */
.bar {
  position: fixed; inset: auto 0 0 0; z-index: 30; padding: .6rem 1rem calc(.6rem + env(safe-area-inset-bottom));
  background: rgb(255 245 249 / .96); border-top: 1px solid var(--line);
}
.bar[hidden] { display: none; }
.bar:not([hidden]) { animation: bar-in .45s var(--ease); }
.bar__btn { width: 100%; }

/* ---------- Bandeja de pedido ---------- */
.sheet {
  width: 100%; max-width: none; max-height: 90dvh; margin: auto 0 0; padding: 0; border: 0;
  border-radius: 22px 22px 0 0; background: var(--surface); color: var(--ink);
}
.sheet::backdrop { background: rgb(67 16 43 / .55); }
.sheet[open] { animation: sheet-up .45s var(--ease); }
.sheet[open]::backdrop { animation: fade-in .35s ease both; }
.sheet.is-closing { animation: sheet-down .3s cubic-bezier(.4, 0, 1, 1) forwards; }
.sheet.is-closing::backdrop { animation: fade-out .3s ease forwards; }
.sheet__panel { display: flex; flex-direction: column; max-height: 90dvh; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.sheet__head h2 { font-size: 1.6rem; color: var(--brand); }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--ink); font-size: 1.75rem; line-height: 1; cursor: pointer; transition: background-color .2s, transform .3s var(--ease); }
.icon-btn:hover { background: var(--pink); transform: rotate(90deg); }
.sheet__scroll { flex: 1; min-height: 6rem; overflow-y: auto; padding: .5rem 1.25rem; }
.empty { color: var(--muted); }
.empty[hidden] { display: none; }
.lines { margin: 0; padding: 0; list-style: none; }
.line { display: grid; grid-template-columns: 1fr auto; gap: .25rem .75rem; align-items: center; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.line__name { font-weight: 600; }
.stepper { display: inline-flex; align-items: center; gap: .25rem; }
.stepper__btn { width: 40px; height: 40px; border: 1.5px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); font-size: 1.2rem; cursor: pointer; transition: border-color .2s, transform .2s var(--ease); }
.stepper__btn:hover { border-color: var(--brand); }
.stepper__btn:active { transform: scale(.9); }
.stepper__qty { min-width: 2rem; text-align: center; font-weight: 700; }
.link { grid-column: 1 / -1; justify-self: start; padding: 0; border: 0; background: none; color: var(--muted); font: .85rem var(--sans); text-decoration: underline; cursor: pointer; }
.sheet__foot { display: grid; gap: .5rem; padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.sheet__foot [hidden] { display: none; }
.field-label { font-size: .9rem; font-weight: 600; }
.field { width: 100%; padding: .6rem .75rem; border: 1.5px solid var(--line); border-radius: 12px; font: 1rem var(--sans); color: var(--ink); resize: vertical; }
.field:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgb(165 15 77 / .18); }

/* Pétalo que vuela hacia "Mi pedido" */
.fly {
  position: fixed; left: 0; top: 0; z-index: 300; width: 22px; height: 22px; pointer-events: none;
  border-radius: 0 100% 0 100%; background: var(--brand); box-shadow: 0 0 0 3px rgb(251 206 226 / .8);
}

/* ---------- Tablet / escritorio ---------- */
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
  .site-footer__grid { grid-template-columns: 1fr auto; align-items: start; }
}
@media (min-width: 768px) {
  .cart-btn { display: inline-flex; }
  .bar { display: none !important; }
  body.has-items { padding-bottom: 0; }
  .hero { padding: 2.5rem 0 7rem; }
  .hero__grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .waves { height: 6rem; }
  .sheet { margin: 0 0 0 auto; width: min(26rem, 100%); height: 100dvh; max-height: none; border-radius: 22px 0 0 22px; }
  .sheet__panel { height: 100dvh; max-height: none; }
  .sheet[open] { animation-name: slide-in; }
  .sheet.is-closing { animation-name: slide-out; }
}
@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Keyframes ---------- */
@keyframes word-in { to { transform: none; } }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes bloom { to { transform: scale(1); } }
@keyframes breathe { to { transform: scale(1.035) rotate(2.5deg); } }
@keyframes float { to { translate: 0 -12px; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drift { to { transform: translateX(-50%); } }
@keyframes fall {
  0%   { transform: translate3d(0, -30px, 0) rotate(0); opacity: 0; }
  8%   { opacity: .55; }
  88%  { opacity: .4; }
  100% { transform: translate3d(var(--dx, 40px), 100svh, 0) rotate(var(--r, 360deg)); opacity: 0; }
}
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }
@keyframes bar-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@keyframes slide-in { from { transform: translateX(100%); } }
@keyframes slide-out { to { transform: translateX(100%); } }

/* ---------- Movimiento reducido: todo visible y quieto ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .word > span, .petal, .pistil { transform: none; }
  .rise, .reveal, .arch { opacity: 1; transform: none; }
  .hex { stroke-dashoffset: 0; }
  .petals { display: none; }
}
