*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0e0d0b;          /* piso de fábrica de noche */
  --bg-deep: #080706;
  --surface: #181714;
  --line: #2e2b26;
  --text: #f3f0e9;
  --muted: #aba598;
  --accent: #e3b008;      /* amarillo de demarcación, solo para acciones */
  --accent-hi: #f2c530;
  --on-accent: #15130c;
  --gutter: max(clamp(1.25rem, 5vw, 5rem), calc((100vw - 1320px) / 2));
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

html { scroll-behavior: smooth; scroll-padding-top: 5rem; scrollbar-color: var(--line) var(--bg); }
body { background: var(--bg); color: var(--text); font-family: 'Archivo', system-ui, sans-serif; font-size: 1.0625rem; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; caret-color: var(--accent); }
::selection { background: var(--accent); color: var(--on-accent); }
img, video { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; }
ul { list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

h1, h2, h3 { font-stretch: 115%; font-weight: 800; line-height: 1; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 6.4vw, 5.5rem); }
h2 { font-size: clamp(2rem, 4.2vw, 3.5rem); }
h3 { font-size: 1.375rem; line-height: 1.15; letter-spacing: -0.01em; }

.skip { position: absolute; left: -999px; top: 0; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 0.75rem 1rem; font-weight: 700; }
.skip:focus { left: 0; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 3.25rem; padding: 0 1.75rem; border-radius: 2px; font-weight: 700; font-stretch: 110%; text-decoration: none; white-space: nowrap; transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.1s; }
.btn:active { transform: translateY(1px); }
.btn-sm { min-height: 2.75rem; padding: 0 1.25rem; font-size: 0.9375rem; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hi); }
.btn-ghost { border: 1px solid rgba(243, 240, 233, 0.4); color: var(--text); }
.btn-ghost:hover { border-color: var(--text); background: rgba(243, 240, 233, 0.08); }
.link { color: var(--text); text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 0.3em; padding: 0.5rem 0; }
.link:hover { text-decoration-color: var(--accent); }

/* ---------- Header ---------- */
.header { position: fixed; inset: 0 0 auto 0; z-index: 50; display: flex; align-items: center; gap: 2rem; padding: 1rem var(--gutter); transition: background-color 0.3s, box-shadow 0.3s; }
.header.solid, .header.menu-open { background: rgba(14, 13, 11, 0.94); box-shadow: 0 1px 0 var(--line); }
.brand { display: inline-flex; align-items: center; gap: 0.75rem; font-stretch: 125%; font-weight: 800; font-size: 1.25rem; letter-spacing: 0.02em; text-transform: uppercase; text-decoration: none; }
.brand img { width: auto; height: 2.5rem; background: #fff; padding: 3px; border-radius: 2px; }
.nav { display: flex; gap: 2rem; margin-left: auto; }
.nav a { text-decoration: none; font-size: 0.9375rem; font-weight: 500; color: var(--text); opacity: 0.85; padding: 0.5rem 0; transition: opacity 0.2s; }
.nav a:hover { opacity: 1; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 0.5em; text-decoration-thickness: 2px; }
.order-btn { white-space: nowrap; display: inline-flex; align-items: center; gap: 0.6rem; min-height: 2.75rem; padding: 0 1.1rem; border: 1px solid rgba(243, 240, 233, 0.4); border-radius: 2px; font-weight: 700; font-size: 0.9375rem; transition: border-color 0.2s, background-color 0.2s; }
.order-btn:hover { border-color: var(--text); background: rgba(243, 240, 233, 0.08); }
.order-count { min-width: 1.5rem; height: 1.5rem; padding: 0 0.4rem; display: inline-grid; place-items: center; background: var(--accent); color: var(--on-accent); border-radius: 999px; font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.order-count[hidden] { display: none; }
.menu-btn { display: none; width: 2.75rem; height: 2.75rem; flex-direction: column; align-items: center; justify-content: center; gap: 7px; }
.menu-btn span { width: 24px; height: 2px; background: var(--text); transition: transform 0.25s var(--ease); }
.menu-open .menu-btn span:first-child { transform: translateY(4.5px) rotate(45deg); }
.menu-open .menu-btn span:last-child { transform: translateY(-4.5px) rotate(-45deg); }

@media (max-width: 900px) {
  .header { gap: 0.75rem; }
  .order-btn { margin-left: auto; }
  .menu-btn { display: flex; }
  .nav { display: none; position: absolute; inset: 100% 0 auto 0; flex-direction: column; gap: 0; padding: 0.5rem var(--gutter) 1.5rem; background: rgba(14, 13, 11, 0.97); box-shadow: 0 1px 0 var(--line); }
  .menu-open .nav { display: flex; }
  .nav a { padding: 0.9rem 0; font-size: 1.125rem; border-bottom: 1px solid var(--line); }
}

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; padding: 7rem var(--gutter) 0; overflow: hidden; isolation: isolate; }
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(8, 7, 6, 0.9) 0%, rgba(8, 7, 6, 0.62) 55%, rgba(8, 7, 6, 0.3) 100%), linear-gradient(0deg, var(--bg) 0%, rgba(14, 13, 11, 0) 38%); }
.hero-inner { max-width: 60rem; padding-bottom: clamp(2.5rem, 6vw, 5rem); }
.hero-lead { max-width: 38rem; margin-top: 1.5rem; font-size: clamp(1.0625rem, 1.5vw, 1.3125rem); line-height: 1.5; color: var(--text); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.25rem; }
.hero-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 2rem; padding: 1rem 0; border-top: 1px solid rgba(243, 240, 233, 0.22); }
.hero-facts { display: flex; flex-wrap: wrap; gap: 0.35rem 2.5rem; font-size: 0.9375rem; font-weight: 500; color: var(--text); }
.video-toggle { padding: 0.5rem 0; font-size: 0.875rem; color: var(--muted); text-decoration: underline; text-underline-offset: 0.3em; }
@media (max-width: 1560px) { .hero-foot { padding-right: 7.5rem; } }
.video-toggle:hover { color: var(--text); }

@media (prefers-reduced-motion: no-preference) {
  .hero-inner > * { animation: rise 0.9s var(--ease) both; }
  .hero-inner > :nth-child(2) { animation-delay: 0.12s; }
  .hero-inner > :nth-child(3) { animation-delay: 0.22s; }
  @keyframes rise { from { opacity: 0; transform: translateY(1.5rem); filter: blur(6px); } }
}
@media (max-width: 600px) {
  .hero::after { background: linear-gradient(0deg, var(--bg) 0%, rgba(8, 7, 6, 0.72) 30%, rgba(8, 7, 6, 0.6) 100%); }
  .hero-foot { flex-direction: column; align-items: flex-start; padding-right: 0; padding-bottom: 4.75rem; }
  .hero-facts { flex-direction: column; }
  .hero-actions .btn { flex: 1 1 100%; }
  .brand { font-size: 1.0625rem; gap: 0.6rem; }
  .brand img { height: 2.25rem; }
}

/* ---------- Clientes ---------- */
.clients { display: flex; align-items: center; background: #fff; color: #15130c; }
.clients-title { flex: none; padding: 0 2rem 0 var(--gutter); font-size: 0.9375rem; font-weight: 700; }
.clients-viewport { flex: 1; min-width: 0; overflow: hidden; padding: 1.5rem 0; mask-image: linear-gradient(90deg, transparent, #000 6rem, #000 calc(100% - 6rem), transparent); }
.clients-track { display: flex; width: max-content; animation: marquee 36s linear infinite; }
.clients:hover .clients-track { animation-play-state: paused; }
.clients-track ul { display: flex; align-items: center; }
.clients-track li { padding: 0 2.75rem; }
.clients-track li img { height: 3.5rem; width: auto; max-width: 11rem; object-fit: contain; filter: grayscale(1); opacity: 0.7; transition: filter 0.4s, opacity 0.4s, transform 0.4s var(--ease); }
.clients-track li:hover img { filter: none; opacity: 1; transform: scale(1.08); }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .clients-track { animation: none; width: auto; }
  .clients-track ul { flex-wrap: wrap; gap: 1rem 0; }
  .clients-track ul[aria-hidden] { display: none; }
  .clients-track li img { filter: none; opacity: 1; }
}
@media (max-width: 600px) {
  .clients { flex-direction: column; align-items: flex-start; }
  .clients-title { padding: 1.25rem var(--gutter) 0; }
  .clients-viewport { width: 100%; padding: 1rem 0 1.25rem; }
  .clients-track li { padding: 0 1.5rem; }
  .clients-track li img { height: 2.75rem; }
}

/* ---------- Secciones ---------- */
.section { padding: clamp(4.5rem, 10vw, 9rem) var(--gutter); }
.section-head { display: grid; gap: 1.25rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head p { max-width: 36rem; color: var(--muted); font-size: 1.125rem; }
@media (min-width: 900px) { .section-head { grid-template-columns: 1.2fr 1fr; align-items: end; gap: 3rem; } }

/* ---------- Productos ---------- */
.products { display: grid; gap: 1.25rem; }
.product { display: flex; flex-direction: column; background: var(--surface); }
.product-photo { position: relative; display: block; width: 100%; height: clamp(15rem, 34vw, 28rem); overflow: hidden; background: #fff; }
.product-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 0.25rem; opacity: 0; transform: scale(1.04); transition: opacity 0.9s var(--ease), transform 1.4s var(--ease); }
.product-photo img.on { opacity: 1; transform: none; }
.product-photo:hover img.on { transform: scale(1.05); }
.product-cover .product-photo { background: #24221e; }
.product-cover .product-photo img { object-fit: cover; padding: 0; }
.dots { position: absolute; left: 1rem; bottom: 0.9rem; display: flex; gap: 0.3rem; }
.dots i { width: 1.25rem; height: 3px; background: rgba(21, 19, 12, 0.22); transition: background-color 0.4s, width 0.4s var(--ease); }
.dots i.on { width: 2.25rem; background: var(--accent); }
.product-cover .dots i { background: rgba(255, 255, 255, 0.4); }
.product-cover .dots i.on { background: var(--accent); }
.product-body { display: flex; flex-direction: column; gap: 0.6rem; padding: 1.5rem; flex: 1; }
.product-body p { color: var(--muted); max-width: 34rem; }
.product-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem; margin-top: auto; padding-top: 1rem; }
@media (min-width: 760px) {
  .products { grid-template-columns: repeat(12, 1fr); }
  .product { grid-column: span 5; }
  .product-wide { grid-column: span 7; }
}

.also-title { margin-top: clamp(3.5rem, 7vw, 5.5rem); margin-bottom: 1rem; }
.also li { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1.25rem 0; border-top: 1px solid var(--line); }
.also li:last-child { border-bottom: 1px solid var(--line); }
.also strong { display: block; font-weight: 700; font-size: 1.125rem; }
.also span { color: var(--muted); }

/* ---------- Fábrica ---------- */
.factory { padding: clamp(4.5rem, 10vw, 9rem) var(--gutter); background: var(--bg-deep); }
.factory-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.factory-grid figure { position: relative; overflow: hidden; background: var(--surface); }
.factory-grid video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.factory-grid figure:hover video { transform: scale(1.05); }
.factory-grid figcaption { position: absolute; inset: auto 0 0 0; padding: 3.5rem 1.25rem 1.25rem; background: linear-gradient(0deg, rgba(8, 7, 6, 0.92), rgba(8, 7, 6, 0)); font-size: 0.9375rem; line-height: 1.45; color: var(--text); }
.factory-grid figcaption strong { display: block; font-stretch: 115%; font-weight: 800; font-size: 1.25rem; margin-bottom: 0.15rem; }
.factory-grid figcaption strong::before { content: ''; display: block; width: 2rem; height: 3px; margin-bottom: 0.6rem; background: var(--accent); transition: width 0.5s var(--ease); }
.factory-grid figure:hover figcaption strong::before { width: 4.5rem; }
.f-a { grid-column: span 2; aspect-ratio: 16 / 9; }
.f-b { grid-column: span 2; aspect-ratio: 4 / 5; }
.f-c, .f-d { aspect-ratio: 4 / 3; }
@media (min-width: 900px) {
  .factory-grid { grid-template-columns: repeat(12, 1fr); grid-template-rows: 15rem 15rem 17rem; }
  .factory-grid figure { aspect-ratio: auto; }
  .f-a { grid-column: 1 / 9; grid-row: 1 / 3; }
  .f-b { grid-column: 9 / 13; grid-row: 1 / 3; }
  .f-c { grid-column: 1 / 7; grid-row: 3; }
  .f-d { grid-column: 7 / 13; grid-row: 3; }
}

/* ---------- Historia ---------- */
.story { display: grid; gap: clamp(2rem, 6vw, 6rem); align-items: center; }
.story-photo { aspect-ratio: 3 / 4; max-height: 40rem; overflow: hidden; background: #000; }
.story-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.story-text h2 { margin-bottom: 2rem; }
.story-text p { max-width: 36rem; color: var(--muted); margin-bottom: 1.1rem; }
.story-facts { display: flex; flex-wrap: wrap; gap: 1.5rem 3.5rem; margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.story-facts dt { font-stretch: 125%; font-weight: 800; font-size: clamp(2.25rem, 4vw, 3.25rem); line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.story-facts dd { margin-top: 0.5rem; color: var(--text); max-width: 14rem; line-height: 1.4; }
@media (min-width: 900px) { .story { grid-template-columns: 5fr 7fr; } }

/* ---------- Por qué ---------- */
.why { display: grid; gap: 2.5rem; border-top: 1px solid var(--line); }
.why-list > div { position: relative; display: grid; gap: 0.35rem; padding: 1.5rem 0; border-bottom: 1px solid var(--line); }
.why-list > div:first-child { padding-top: 0; }
.why-list dt { font-stretch: 115%; font-weight: 800; font-size: clamp(1.25rem, 2.2vw, 1.75rem); line-height: 1.15; }
.why-list dd { color: var(--muted); max-width: 34rem; }
@media (min-width: 900px) {
  .why { grid-template-columns: 5fr 7fr; gap: clamp(2rem, 6vw, 6rem); }
  .why h2 { position: sticky; top: 7rem; align-self: start; }
  .why-list > div { grid-template-columns: 1fr 1.4fr; gap: 2rem; align-items: baseline; }
}

/* ---------- FAQ ---------- */
.faq { padding-inline: max(var(--gutter), calc((100vw - 52rem) / 2)); }
.faq h2 { margin-bottom: 2.5rem; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; padding: 1.35rem 0; font-weight: 700; font-size: 1.1875rem; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ''; flex: none; width: 0.7rem; height: 0.7rem; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: translateY(-25%) rotate(45deg); transition: transform 0.3s var(--ease); }
.faq details[open] summary::after { transform: translateY(15%) rotate(225deg); }
.faq summary:hover { color: var(--accent-hi); }
.faq details p { padding: 0 2.5rem 1.5rem 0; color: var(--muted); max-width: 42rem; }

/* ---------- Contacto y formularios ---------- */
.contact { display: grid; gap: 3rem; background: var(--surface); }
.contact-intro p { margin-top: 1.25rem; color: var(--muted); font-size: 1.125rem; max-width: 26rem; }
.contact-direct { margin-top: 2.5rem; display: grid; gap: 0.25rem; }
.contact-direct a { display: inline-block; padding: 0.5rem 0; font-weight: 700; font-size: 1.125rem; text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 0.3em; }
.contact-direct a:hover { text-decoration-color: var(--accent); }
@media (min-width: 900px) { .contact { grid-template-columns: 5fr 7fr; gap: clamp(2rem, 6vw, 6rem); } }

.form { display: grid; gap: 1.25rem; }
.form-row { display: grid; gap: 1.25rem; }
@media (min-width: 600px) { .form-row { grid-template-columns: 1fr 1fr; } }
.form label, .form legend { display: block; font-size: 0.9375rem; font-weight: 600; }
.form small { font-weight: 400; color: var(--muted); font-size: inherit; }
.form fieldset { border: 0; }
.form legend { margin-bottom: 0.75rem; }
.form input[type="text"], .form input[type="email"], .form textarea { display: block; width: 100%; margin-top: 0.45rem; padding: 0.85rem 1rem; background: var(--bg); border: 1px solid #4a463e; border-radius: 2px; font-weight: 400; font-size: 1rem; transition: border-color 0.2s; }
.form textarea { resize: vertical; min-height: 3.25rem; }
.form input:hover, .form textarea:hover { border-color: var(--muted); }
.form input:focus-visible, .form textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.form ::placeholder { color: #8f897c; opacity: 1; }
.form .btn { justify-self: start; }
.checks { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.checks label { display: block; cursor: pointer; }
.checks input { position: absolute; opacity: 0; }
.checks span { display: block; padding: 0.7rem 1.1rem; border: 1px solid #4a463e; border-radius: 2px; font-weight: 500; transition: border-color 0.2s, background-color 0.2s, color 0.2s; }
.checks label:hover span { border-color: var(--muted); }
.checks input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.checks input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Footer ---------- */
.footer { display: grid; gap: 1.25rem; padding: 3.5rem var(--gutter) 6rem; border-top: 1px solid var(--line); }
.footer p { max-width: 34rem; color: var(--muted); }
.footer .footer-legal { font-size: 0.875rem; }

/* ---------- Diálogos ---------- */
.dialog { margin: auto; padding: 0; border: 1px solid var(--line); background: var(--surface); color: var(--text); width: min(60rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); overflow: auto; }
.dialog::backdrop { background: rgba(8, 7, 6, 0.8); }
.dialog-close { position: absolute; top: 0.5rem; right: 0.5rem; z-index: 2; width: 2.75rem; height: 2.75rem; font-size: 1.75rem; line-height: 1; background: rgba(8, 7, 6, 0.6); border-radius: 2px; }
.dialog-close:hover { background: var(--accent); color: var(--on-accent); }
@media (prefers-reduced-motion: no-preference) {
  .dialog[open] { animation: dialog-in 0.35s var(--ease); }
  @keyframes dialog-in { from { opacity: 0; transform: translateY(1rem); } }
}

.product-dialog[open] { display: grid; }
.pd-gallery { background: #fff; }
.pd-gallery > img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; padding: 1rem; }
.cover .pd-gallery { background: #24221e; }
.cover .pd-gallery > img { object-fit: cover; padding: 0; }
.pd-thumbs { background: var(--surface); }
.pd-thumbs { display: flex; gap: 0.5rem; padding: 0.75rem; }
.pd-thumbs button { width: 4rem; height: 3.25rem; opacity: 0.55; border: 2px solid transparent; transition: opacity 0.2s; }
.pd-thumbs button:hover { opacity: 0.9; }
.pd-thumbs button[aria-current="true"] { opacity: 1; border-color: var(--accent); }
.pd-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pd-info { display: flex; flex-direction: column; gap: 1rem; padding: 2rem 1.5rem; }
.pd-info h3 { font-size: 1.75rem; padding-right: 2.5rem; }
.pd-info > p { color: var(--muted); }
.specs { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.specs th, .specs td { padding: 0.6rem 0; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.specs th { width: 38%; font-weight: 500; color: var(--muted); padding-right: 1rem; }
.pd-info .pd-price { color: var(--accent); font-weight: 700; margin-top: auto; }
@media (min-width: 800px) {
  .product-dialog[open] { grid-template-columns: 1.1fr 1fr; }
  .pd-gallery { display: flex; flex-direction: column; }
  .pd-gallery > img { flex: none; aspect-ratio: 1; }
  .product-dialog[open] { align-items: start; }
  .pd-info { padding: 2.5rem 2rem; }
}

.order-dialog { width: min(27rem, 100vw); max-width: none; height: 100dvh; max-height: none; margin: 0 0 0 auto; border-width: 0 0 0 1px; padding: 2rem 1.5rem; }
.order-dialog h3 { font-size: 1.75rem; margin-bottom: 1.5rem; }
.order-empty { color: var(--muted); }
.order-items li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; border-top: 1px solid var(--line); font-weight: 600; line-height: 1.3; }
.order-items li:last-child { border-bottom: 1px solid var(--line); }
.qty { display: inline-flex; align-items: center; flex: none; border: 1px solid #4a463e; border-radius: 2px; }
.qty button { width: 2.5rem; height: 2.5rem; font-size: 1.25rem; }
.qty button:hover { background: var(--accent); color: var(--on-accent); }
.qty output { min-width: 3.5rem; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }
.order-dialog .form { margin-top: 1.5rem; }
.order-note { color: var(--muted); font-size: 0.9375rem; }
.order-dialog .form .btn { justify-self: stretch; white-space: normal; text-align: center; padding-block: 0.75rem; }
@media (prefers-reduced-motion: no-preference) {
  .order-dialog[open] { animation: sheet-in 0.4s var(--ease); }
  @keyframes sheet-in { from { transform: translateX(100%); } }
}

/* ---------- Asistente ---------- */
.assist-fab { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 40; min-height: 3rem; padding: 0 1.25rem; background: var(--surface); border: 1px solid #5a554b; border-radius: 999px; font-weight: 700; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); transition: border-color 0.2s, background-color 0.2s, color 0.2s; }
.assist-fab:hover, .assist-fab[aria-expanded="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.assist { position: fixed; right: 1.25rem; bottom: 5rem; z-index: 40; width: min(23rem, calc(100vw - 2.5rem)); max-height: min(34rem, calc(100dvh - 7rem)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid #5a554b; border-radius: 4px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6); overflow: hidden; }
.assist[hidden] { display: none; }
.assist header { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0.5rem 0.5rem 1rem; border-bottom: 1px solid var(--line); }
.assist header button { width: 2.5rem; height: 2.5rem; font-size: 1.5rem; line-height: 1; }
.assist header button:hover { color: var(--accent); }
.assist-log { flex: 1; min-height: 7rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.6rem; padding: 1rem; font-size: 0.9375rem; line-height: 1.45; scrollbar-width: thin; }
.assist-log p { max-width: 88%; padding: 0.6rem 0.8rem; border-radius: 4px; background: var(--bg); }
.assist-log p.user { align-self: flex-end; background: var(--accent); color: var(--on-accent); font-weight: 600; }
.assist-log a { display: inline-block; margin-top: 0.35rem; font-weight: 700; color: var(--accent-hi); text-underline-offset: 0.25em; }
.assist-topics { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.75rem 1rem; border-top: 1px solid var(--line); }
.assist-topics button { padding: 0.4rem 0.75rem; border: 1px solid #5a554b; border-radius: 999px; font-size: 0.875rem; font-weight: 500; transition: border-color 0.2s, color 0.2s; }
.assist-topics button:hover { border-color: var(--accent); color: var(--accent-hi); }
.assist form { display: flex; border-top: 1px solid var(--line); }
.assist form input { flex: 1; min-width: 0; padding: 0.9rem 1rem; background: transparent; border: 0; font-size: 1rem; }
.assist form input::placeholder { color: #8f897c; opacity: 1; }
.assist form input:focus-visible { outline-offset: -2px; }
.assist form button { padding: 0 1rem; font-weight: 700; color: var(--accent-hi); }
.assist form button:hover { background: var(--accent); color: var(--on-accent); }

/* ---------- Aviso ---------- */
.toast { position: fixed; left: 50%; bottom: 1.5rem; z-index: 60; max-width: calc(100vw - 2rem); padding: 0.85rem 1.25rem; background: var(--text); color: var(--bg); font-weight: 600; border-radius: 2px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); transform: translate(-50%, 200%); transition: transform 0.4s var(--ease); pointer-events: none; }
.toast.show { transform: translate(-50%, 0); }

/* ---------- Efectos e interacciones ---------- */
.progress { position: fixed; inset: 0 0 auto 0; z-index: 70; height: 3px; background: var(--accent); transform-origin: left; transform: scaleX(0); }
@supports (animation-timeline: scroll()) {
  .progress { animation: progress linear both; animation-timeline: scroll(root); }
  @keyframes progress { to { transform: scaleX(1); } }
}

.btn-primary::after { content: ''; width: 0.5rem; height: 0.5rem; margin-left: 0.75rem; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); transition: transform 0.35s var(--ease); }
.btn-primary:hover::after { transform: translateX(0.35rem) rotate(45deg); }

.why-list > div::before { content: ''; position: absolute; left: 0; bottom: -1px; width: 100%; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.7s var(--ease); }
.why-list > div:hover::before { transform: scaleX(1); }
.why-list > div:hover dt { color: var(--accent-hi); }
.why-list dt { transition: color 0.4s; }

.order-count.bump { animation: bump 0.5s var(--ease); }
@keyframes bump { 40% { transform: scale(1.5); } }

@supports (interpolate-size: allow-keywords) {
  .faq details { interpolate-size: allow-keywords; }
  .faq details::details-content { block-size: 0; overflow: hidden; transition: block-size 0.45s var(--ease), content-visibility 0.45s allow-discrete; }
  .faq details[open]::details-content { block-size: auto; }
}

@media (hover: hover) {
  .product { transition: translate 0.5s var(--ease), box-shadow 0.5s var(--ease); }
  .product:hover { translate: 0 -6px; box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.7); }
}

@media (prefers-reduced-motion: no-preference) {

  .js .hero h1 { animation: none; }
  .js h2 .word, .js .hero h1 .word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.12em; margin-bottom: -0.12em; }
  .js .hero h1 .word > span { display: inline-block; animation: word-up 1s var(--ease) both; animation-delay: calc(var(--i) * 70ms + 150ms); }
  @keyframes word-up { from { transform: translateY(110%); } }
  .js .hero-lead { animation-delay: 0.7s; }
  .js .hero-actions { animation-delay: 0.85s; }

  .js [data-reveal]:not([data-reveal="stagger"]), .js [data-reveal="stagger"] > * { opacity: 0; transform: translateY(2.5rem); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
  .js [data-reveal].in:not([data-reveal="stagger"]), .js [data-reveal="stagger"].in > * { opacity: 1; transform: none; }
  .js .story-photo[data-reveal] img { clip-path: inset(0 0 100% 0); scale: 1.15; transition: clip-path 1.3s var(--ease), scale 1.6s var(--ease); }
  .js .story-photo[data-reveal].in img { clip-path: inset(0); scale: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal="stagger"] > .product { transition: opacity 0.9s var(--ease), transform 0.9s var(--ease), translate 0.5s var(--ease), box-shadow 0.5s var(--ease); transition-delay: calc(var(--i, 0) * 90ms), calc(var(--i, 0) * 90ms), 0s, 0s; }
}

/* ---------- Interacciones animadas ---------- */
:root { --spring: cubic-bezier(0.34, 1.56, 0.64, 1); }

@media (min-width: 760px) {
  .product-cover { grid-column: 1 / -1; flex-direction: row; }
  .product-cover .product-photo { flex: 1.4; height: auto; min-height: 22rem; }
  .product-cover .product-body { flex: 1; justify-content: center; padding: 2.5rem; }
  .product-cover .product-actions { margin-top: 0; padding-top: 1.5rem; }
}

.spark { position: fixed; z-index: 90; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-hi); box-shadow: 0 0 8px 2px rgba(242, 197, 48, 0.7); pointer-events: none; }
.fly { position: fixed; z-index: 80; object-fit: contain; background: #fff; border-radius: 4px; pointer-events: none; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5); }

.btn, .order-btn, .assist-fab { transition: background-color 0.2s, border-color 0.2s, color 0.2s, translate 0.45s var(--spring), scale 0.3s var(--spring); }
.btn:hover, .order-btn:hover, .assist-fab:hover { scale: 1.05; }
.btn:active, .order-btn:active, .assist-fab:active { scale: 0.94; transform: none; }
.btn-ghost { position: relative; overflow: hidden; isolation: isolate; }
.btn-ghost::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--text); transform: translateY(101%); transition: transform 0.45s var(--ease); }
.btn-ghost:hover { color: var(--bg); border-color: var(--text); background: none; }
.btn-ghost:hover::before { transform: none; }

.order-count.bump { animation: bump 0.6s var(--spring); }
.order-btn:has(.bump) { animation: nudge 0.6s var(--spring); }
@keyframes nudge { 30% { rotate: -6deg; } 60% { rotate: 5deg; } }

.checks span { transition: border-color 0.2s, background-color 0.2s, color 0.2s, scale 0.3s var(--spring); }
.checks label:active span { scale: 0.97; }

.nav a { position: relative; }
.nav a:hover { text-decoration: none; }
.nav a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0.15rem; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: right; transition: transform 0.4s var(--ease); }
.nav a:hover::after { transform: scaleX(1); transform-origin: left; }

.also li:hover strong { color: var(--accent-hi); }
.also strong { transition: color 0.4s; }

@media (prefers-reduced-motion: no-preference) {
  .assist-fab { animation: wobble 6s 3s infinite; }
  @keyframes wobble { 0%, 88%, 100% { rotate: 0deg; } 91% { rotate: -7deg; } 94% { rotate: 6deg; } 97% { rotate: -3deg; } }
  .assist:not([hidden]) { animation: pop 0.45s var(--spring); transform-origin: bottom right; }
  @keyframes pop { from { opacity: 0; scale: 0.7; } }
  .assist-log p { animation: msg 0.4s var(--spring) both; transform-origin: bottom left; }
  .assist-log p.user { transform-origin: bottom right; }
  @keyframes msg { from { opacity: 0; scale: 0.8; translate: 0 0.5rem; } }
  .toast.show { transition: transform 0.5s var(--spring); }

  .js h2[data-reveal="words"][data-reveal] { opacity: 1; transform: none; }
  .js h2[data-reveal] .word > span { display: inline-block; transform: translateY(110%) rotate(6deg); transform-origin: left bottom; transition: transform 0.9s var(--ease); transition-delay: calc(var(--i) * 60ms); }
  .js h2[data-reveal].in .word > span { transform: none; }

  .js [data-reveal="stagger"] > * { transform: translateY(3rem) scale(0.96); }
  .js [data-reveal="stagger"].in > * { transition-timing-function: var(--spring); }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .products, .factory-grid { perspective: 1200px; }
  .product, .factory-grid figure { transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 0.25s ease-out, translate 0.5s var(--ease), box-shadow 0.5s var(--ease); }
  .js [data-reveal="stagger"].in > .product, .js [data-reveal="stagger"].in > figure { transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
  .js [data-reveal="stagger"].done > .product, .js [data-reveal="stagger"].done > figure { transition: transform 0.25s ease-out, translate 0.5s var(--ease), box-shadow 0.5s var(--ease); transition-delay: 0s; }
}

/* ---------- "También fabricamos": fondo que se desliza, sin mover el contenido ---------- */
.also li::before { content: ''; position: absolute; inset: 0 calc(var(--gutter) * -0.25); z-index: -1; background: var(--surface); transform: scaleY(0); transform-origin: bottom; transition: transform 0.5s var(--ease); }
.also li:hover::before { transform: scaleY(1); }
.also { isolation: isolate; }

/* ---------- Secciones apiladas: la de arriba queda fija y la siguiente la tapa ---------- */
/* "top" lo calcula index.js: 0 si la sección entra en pantalla, negativo si es más alta. */
main > section { position: sticky; top: 0; }
main > .section { background: var(--bg); }
main > .contact { background: var(--surface); }
main > section:nth-child(n + 3) { border-radius: 1.5rem 1.5rem 0 0; box-shadow: 0 -1.5rem 3rem rgba(0, 0, 0, 0.55); }
.why { border-top: 0; }
@media (max-width: 600px) { main > section:nth-child(n + 3) { border-radius: 1rem 1rem 0 0; } }

/* ---------- Asistente: sugerencias y "escribiendo" ---------- */
.assist-log .hints { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.6rem; font-size: 0.875rem; color: var(--muted); }
.assist-log .hints button { padding: 0.3rem 0.65rem; border: 1px solid #5a554b; border-radius: 999px; font-size: 0.8125rem; color: var(--text); }
.assist-log .hints button:hover { border-color: var(--accent); color: var(--accent-hi); }
.assist-log .typing { display: flex; gap: 0.3rem; padding: 0.85rem 0.9rem; }
.assist-log .typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: typing 0.9s infinite; }
.assist-log .typing i:nth-child(2) { animation-delay: 0.15s; }
.assist-log .typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 30% { translate: 0 -4px; opacity: 1; } 0%, 60%, 100% { translate: 0 0; opacity: 0.5; } }

/* ---------- Botón del asistente bien visible ---------- */
.assist-fab { display: inline-flex; align-items: center; gap: 0.6rem; min-height: 3.5rem; padding: 0 1.4rem 0 1.1rem; background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55); }
.assist-fab:hover, .assist-fab[aria-expanded="true"] { background: var(--accent-hi); border-color: var(--accent-hi); color: var(--on-accent); }
.assist-fab::before { content: ''; position: absolute; inset: -1px; border-radius: inherit; border: 2px solid var(--accent); pointer-events: none; opacity: 0; }
.assist { bottom: 5.75rem; }
.assist header strong { display: inline-flex; align-items: center; gap: 0.5rem; margin-right: auto; }
.assist header .online { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #3ecf6e; }
.assist header a { font-size: 0.875rem; font-weight: 600; color: var(--accent-hi); text-underline-offset: 0.25em; padding: 0.5rem; }
.assist-teaser { position: fixed; right: 1.25rem; bottom: 5.75rem; z-index: 40; display: flex; align-items: flex-start; max-width: min(17rem, calc(100vw - 2.5rem)); background: var(--text); color: var(--bg); border-radius: 12px 12px 2px 12px; box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55); }
.assist-teaser[hidden] { display: none; }
.assist-teaser button:first-child { padding: 0.85rem 0.25rem 0.85rem 1rem; text-align: left; font-weight: 600; font-size: 0.9375rem; line-height: 1.35; color: inherit; }
.assist-teaser button:last-child { flex: none; width: 2.25rem; height: 2.25rem; font-size: 1.25rem; line-height: 1; color: inherit; opacity: 0.6; }
.assist-teaser button:last-child:hover { opacity: 1; }
@media (max-width: 600px) { .assist-fab span { display: none; } .assist-fab { padding: 0; width: 3.5rem; justify-content: center; } }
@media (prefers-reduced-motion: no-preference) {
  .assist-fab::before { animation: ring 2.6s 1s infinite; }
  @keyframes ring { 0% { opacity: 0.8; scale: 1; } 70%, 100% { opacity: 0; scale: 1.25 1.6; } }
  .assist-teaser:not([hidden]) { animation: pop 0.5s var(--spring); transform-origin: bottom right; }
}
