/* Miralia Candles — catálogo sencillo. Dirección: the specimen catalogue (tasteskill seed 1783187082).
   Colores sacados de las velas: marfil, vino, pino, kraft y oro. */

:root {
  --bg: #F3F1EC;
  --paper: #FBFAF7;
  --step: #E6E2DA;
  --ink: #1E2420;
  --muted: #535A54;
  --accent: #8B1E2F;
  --accent-strong: #6E1524;
  --accent-ink: #FBFAF7;

  --pine: #2B4D41;
  --kraft: #CDAE87;
  --sage: #C9D4C4;
  --rose: #EBD2CC;
  --gold: #E7D6AC;
  --wine: #8B1E2F;
  --logo: #A8833A;
  --logo-light: #D9C07F;
  --hl-missing: #F2DF9E;

  --font: "Literata", Georgia, "Times New Roman", serif;
  --font-logo: "Cinzel", "Literata", serif;

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
  --step-display: clamp(2.75rem, 1rem + 5.4vw, 5.5rem);

  --margin: clamp(1rem, 2.6vw, 2.5rem);
  --section: clamp(5rem, 10vw, 10rem);
  --top-h: 68px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
  --t-reveal: 800ms;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: var(--step-body); line-height: 1.55; font-optical-sizing: auto; -webkit-font-smoothing: antialiased; }
body.has-order { padding-bottom: 88px; }
h1, h2, h3, p, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
mark { color: inherit; }
h1, h2, h3 { font-weight: 500; text-wrap: balance; }
p { text-wrap: pretty; }
[hidden] { display: none !important; }
[id] { scroll-margin-top: calc(var(--top-h) + 12px); }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

html[lang="es"] body [lang="en"], html[lang="en"] body [lang="es"] { display: none !important; }

.display { font-size: var(--step-display); line-height: 1.02; letter-spacing: -0.03em; }
.head { font-size: var(--step-head); line-height: 1.05; letter-spacing: -0.02em; }
.lead { font-size: var(--step-lead); line-height: 1.35; }
.falta { background: var(--hl-missing); color: var(--ink); padding: 0 0.2em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* ---------- controls ---------- */
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 26px; background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 500; white-space: nowrap; transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease; }
.button:active { transform: scale(0.97); }
.button--paper { background: var(--paper); color: var(--ink); }
.link { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.22em; text-decoration-thickness: 0.07em; transition: text-decoration-color var(--t-hover) ease; }
.link-plain { text-decoration: underline; text-underline-offset: 0.22em; text-decoration-thickness: 0.07em; }
.lang { min-width: 44px; min-height: 44px; font-weight: 600; font-size: var(--step-small); text-decoration: underline; text-underline-offset: 0.25em; text-decoration-thickness: 0.08em; }
@media (hover: hover) and (pointer: fine) {
  .button:hover { background: var(--accent-strong); }
  .button--paper:hover { background: #fff; }
  .link:hover { text-decoration-color: currentColor; }
}

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 40; height: var(--top-h); display: flex; align-items: center; gap: 32px; padding: 0 var(--margin); background: var(--bg); }
.top__mark { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.top__mark .lotus { width: 42px; color: var(--logo); }
.top__name { font-family: var(--font-logo); font-size: 1.5rem; letter-spacing: 0.08em; }
.top__links { margin-left: auto; display: flex; gap: 32px; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "brand brand" "text photo"; }
.hero__brand { grid-area: brand; display: flex; align-items: center; gap: 0.16em; padding: clamp(24px, 4vw, 56px) var(--margin) clamp(24px, 3vw, 40px); font-size: clamp(3.4rem, 0.5rem + 13vw, 13rem); }
.hero__photo { grid-area: photo; aspect-ratio: 4 / 3; }
.hero__text { grid-area: text; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 18px; padding: 24px var(--margin) 64px; }
.hero__lotus { width: 0.92em; flex: none; color: var(--logo); }
.brand { font-family: var(--font-logo); font-weight: 500; font-size: 1em; line-height: 0.9; letter-spacing: 0.06em; }

.hero__line { max-width: 34ch; }
.hero .button { margin-top: 12px; }
.hero__photo { position: relative; overflow: hidden; background: var(--step); }
.hero__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- catalogue ---------- */
.catalog { padding: var(--section) var(--margin); }
.catalog__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px 48px; flex-wrap: wrap; }
.catalog__note { max-width: 44ch; }
.chip__n { color: var(--muted); margin-left: 4px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 64px 28px; align-items: start; margin-top: 56px; }
.item { display: flex; flex-direction: column; }
.item__photo { overflow: hidden; background: var(--step); }
.item__photo img { width: 100%; height: auto; transition: transform 600ms var(--ease-out); }
.item__top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-top: 18px; }
.item__name { font-size: var(--step-lead); font-weight: 500; line-height: 1.25; }
.item__price { font-size: var(--step-lead); font-weight: 600; color: var(--accent); white-space: nowrap; }
.item__fact { margin-top: 6px; line-height: 1.45; }
.item__buy { margin-top: 16px; }
.variants__lead { margin-top: 16px; font-weight: 600; color: var(--accent); line-height: 1.4; }
.variants { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.variant { display: grid; gap: 6px; text-align: center; font-size: var(--step-small); line-height: 1.25; transition: transform var(--t-press) var(--ease-out); }
.variant:active { transform: scale(0.96); }
.variant img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: opacity var(--t-hover) ease; }
.variant[aria-pressed="true"] img { outline: 3px solid var(--accent); outline-offset: -3px; }
.variant[aria-pressed="true"] span { font-weight: 600; }
.item__photo img[data-main] { transition: opacity 220ms ease; }
.item__photo img.is-swapping { opacity: 0.4; }
.stepper { display: flex; align-items: stretch; min-height: 48px; background: var(--accent); color: var(--accent-ink); }
.stepper button { width: 52px; font-size: 1.5rem; line-height: 1; transition: background-color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.stepper button:active { transform: scale(0.94); }
.stepper span { flex: 1; display: grid; place-items: center; font-size: var(--step-small); font-weight: 600; }
.order__ship { font-weight: 400; }
.item__add { min-height: 48px; width: 100%; padding: 0 12px; background: var(--ink); color: var(--paper); font-size: var(--step-small); font-weight: 600; transition: background-color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.item__add:active { transform: scale(0.97); }
.item__add[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
@media (hover: hover) and (pointer: fine) {
  .item:hover .item__photo img { transform: scale(1.03); }
  .item__add:hover { background: #000; }
  .stepper button:hover { background: var(--accent-strong); }
  .variant:hover img { opacity: 0.85; }
}

/* ---------- how to order ---------- */
.steps__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin-top: 56px; }
.steps__list h3 { font-size: var(--step-head); line-height: 1.05; letter-spacing: -0.02em; }
.steps__list p { margin-top: 12px; max-width: 28ch; }
.steps__custom { margin-top: 88px; display: flex; align-items: center; justify-content: space-between; gap: 24px 48px; flex-wrap: wrap; }
.steps__custom p { font-size: var(--step-lead); line-height: 1.35; max-width: 40ch; }

/* ---------- story ---------- */
.story { padding: var(--section) var(--margin); }
.story__text p { margin-top: 24px; font-size: var(--step-lead); line-height: 1.4; max-width: 44ch; }
.story__sign { font-family: var(--font-logo); color: var(--logo); }

/* ---------- shipping & payment ---------- */
.info { background: var(--step); padding: var(--section) var(--margin); }
.info__cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; margin-top: 56px; }
.info h3 { font-size: var(--step-lead); line-height: 1.3; }
.info p { margin-top: 10px; max-width: 30ch; }

/* ---------- footer ---------- */
.foot { background: var(--ink); color: var(--paper); padding: var(--section) var(--margin) 32px; }
.foot__row { display: flex; justify-content: space-between; align-items: flex-end; gap: 48px; flex-wrap: wrap; }
.foot__call { display: grid; gap: 28px; justify-items: start; }
.foot__list { display: grid; gap: 12px; font-size: var(--step-lead); }
.foot__list .falta { color: var(--ink); }
.foot__mark { display: block; margin-top: 96px; color: var(--logo-light); text-decoration: none; }
.foot__mark svg { width: 100%; height: auto; }
.foot__word { font-family: var(--font-logo); font-size: 112px; fill: var(--paper); }
.foot__imprint { margin-top: 32px; font-size: var(--step-small); color: #B9BDB7; }

/* ---------- order bar ---------- */
.order { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 20px; padding: 14px var(--margin); background: var(--ink); color: var(--paper); }
.order__sum { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order__sum b { font-weight: 600; }
.order__clear { font-size: var(--step-small); min-height: 44px; padding: 0 4px; }

.toast { position: fixed; z-index: 60; left: 50%; bottom: 100px; max-width: min(92vw, 560px); padding: 14px 20px; background: var(--accent); color: var(--accent-ink); font-size: var(--step-small); line-height: 1.45; transform: translate(-50%, 24px); opacity: 0; visibility: hidden; transition: transform 320ms var(--ease-out), opacity 320ms var(--ease-out), visibility 0s linear 320ms; }
.toast.is-on { transform: translate(-50%, 0); opacity: 1; visibility: visible; transition: transform 320ms var(--ease-out), opacity 320ms var(--ease-out); }

/* ---------- tablet ---------- */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .info__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 32px; }
}
@media (max-width: 860px) {
  .top__links { display: none; }
  .top .lang { margin-left: auto; }
  .hero { grid-template-columns: 1fr; grid-template-areas: "brand" "text" "photo"; }
  .hero__text { padding: 40px var(--margin) 44px; }
  .steps__list { grid-template-columns: 1fr; gap: 36px; margin-top: 40px; }
  .steps__custom { margin-top: 64px; }
  .story { grid-template-columns: 1fr; gap: 40px; }
}

/* ---------- phone ---------- */
@media (max-width: 600px) {
  :root { --top-h: 60px; }
  .hero__brand { flex-direction: column; align-items: flex-start; gap: 10px; font-size: 16vw; }
  .hero__lotus { width: 64px; }
  .top__mark .lotus { width: 34px; }
  .top__name { font-size: 1.25rem; }
  .grid { grid-template-columns: 1fr; gap: 48px; margin-top: 36px; }
  .info__cols { grid-template-columns: 1fr; gap: 32px; }
  .order { gap: 12px; padding: 10px var(--margin); }
  .order__sum { font-size: var(--step-small); white-space: normal; }
  .order__send { padding: 0 16px; min-height: 48px; }
  .foot__mark { margin-top: 64px; }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* the first screen never waits for an animation to be visible: it only moves */
  [data-rise] { animation: nudge 900ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 90ms); }
  .hero__photo img { animation: settle 1600ms var(--ease-soft) both; }
  .js [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  .order:not([hidden]) { animation: bar-up 360ms var(--ease-out); }
  .item__add.is-pop { animation: pop 320ms var(--ease-out); }
}
@keyframes nudge { from { transform: translateY(18px); } to { transform: none; } }
@keyframes settle { from { transform: scale(1.08); } to { transform: none; } }
@keyframes bar-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes pop { 40% { transform: scale(1.04); } to { transform: none; } }
