/* =========================================================================
   ESTILOS — estética cálida / editorial
   ========================================================================= */

:root {
  /* Paleta tomada de los textiles de la marca: lino, ocre, salvia, hilo dorado */
  --bg:        #ece3cf;   /* lino crema */
  --bg-soft:   #f4efe1;   /* crema más claro (paneles/marcos) */
  --paper:     #f6f1e4;
  --ink:       #3c2e1d;   /* café tinta cálido */
  --ink-dim:   #8a795f;   /* topo apagado */
  --line:      rgba(60, 46, 29, 0.16);
  --accent:    #bf963a;   /* ocre / mostaza (acento principal) */
  --accent-2:  #8f9a76;   /* verde salvia (acento secundario) */
  --accent-3:  #c08a73;   /* rosa viejo / terracota (acento terciario) */
  --thread:    #c9a164;   /* hilo dorado */
  --radius:    16px;
  --maxw:      540px;     /* ancho de lectura, mobile-first */
  --ease:      cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Textura de lino sutil en todo el fondo (sensación de tela tejida) */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background-image:
    repeating-linear-gradient(0deg, rgba(60,46,29,0.040) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(60,46,29,0.034) 0 1px, transparent 1px 4px);
  mix-blend-mode: multiply; opacity: 0.7;
}

img { display: block; max-width: 100%; }

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent-2);
  font-weight: 400;
}

/* ---------- Barra de progreso de scroll ---------- */
.scroll-progress {
  position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 60;
  background: transparent; pointer-events: none;
}
.scroll-progress span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
@supports (animation-timeline: scroll()) {
  .scroll-progress span {
    width: 100%; transform-origin: left; transform: scaleX(0);
    animation: grow linear; animation-timeline: scroll(root);
  }
  @keyframes grow { to { transform: scaleX(1); } }
}

/* ---------- Topbar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 1.25rem;
  padding-top: max(0.9rem, env(safe-area-inset-top));
  transition: background 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
}
.topbar.is-stuck {
  background: rgba(236, 227, 207, 0.80);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex; align-items: center; gap: 0.5rem; white-space: nowrap;
  font-family: "Fraunces", serif; font-size: 0.95rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink); text-decoration: none;
  opacity: 0; transition: opacity 0.4s var(--ease);
}
.brand__logo { height: 28px; width: auto; display: block; }
.topbar.is-stuck .brand { opacity: 1; }
.topbar__cta {
  font-size: 0.78rem; letter-spacing: 0.06em; color: var(--ink);
  text-decoration: none; padding: 0.5rem 1rem; border: 1px solid var(--line);
  border-radius: 100px; transition: border-color 0.3s, color 0.3s;
}
.topbar__cta:hover { border-color: var(--accent); color: var(--accent-2); }

/* ---------- HERO ---------- */
.hero {
  min-height: 100svh; display: flex; flex-direction: column;
  justify-content: center; align-items: center; text-align: center;
  padding: 6rem 1.5rem 3rem; position: relative;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(191,150,58,0.16), transparent 60%),
    radial-gradient(100% 60% at 50% 100%, rgba(143,154,118,0.12), transparent 70%);
}
.hero__inner { max-width: var(--maxw); }
.hero__logo {
  width: clamp(168px, 44vw, 250px); height: auto; margin: 0 auto 1.6rem;
  display: block;
  animation: logoReveal 1.3s var(--ease) 0.1s both;
}
@keyframes logoReveal {
  from { opacity: 0; clip-path: inset(0 0 100% 0); transform: translateY(8px); }
  to   { opacity: 1; clip-path: inset(0 0 0% 0); transform: none; }
}
.hero .eyebrow { animation: rise 1s var(--ease) 0.5s both; }
.hero__title {
  font-family: "Fraunces", serif; font-weight: 300;
  font-size: clamp(2.8rem, 14vw, 5.5rem); line-height: 0.98;
  letter-spacing: 0.01em; margin: 0.6rem 0 1.2rem;
  animation: rise 1s var(--ease) 0.08s both;
}
.hero__tagline {
  font-size: clamp(1rem, 4.4vw, 1.25rem); color: var(--ink-dim);
  max-width: 30ch; margin: 0 auto; font-style: italic;
  font-family: "Fraunces", serif; font-weight: 300;
  animation: rise 1s var(--ease) 0.16s both;
}
.hero__scroll {
  position: absolute; bottom: calc(1.5rem + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  font-size: 0.66rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--ink-dim); animation: rise 1s var(--ease) 0.4s both;
}
.hero__line {
  width: 1px; height: 42px; background: linear-gradient(var(--accent-2), transparent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%,100% { opacity: 0.3; transform: scaleY(0.6); } 50% { opacity: 1; transform: scaleY(1); } }

/* ---------- INTRO ---------- */
.intro {
  max-width: var(--maxw); margin: 2rem auto; padding: 3rem 1.5rem;
  text-align: center; border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.intro__text {
  font-family: "Fraunces", serif; font-size: clamp(1.25rem, 5.4vw, 1.7rem);
  font-weight: 300; line-height: 1.45; color: var(--ink);
}
.intro__count { margin-top: 1.4rem; font-size: 0.8rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--accent-2); }

/* ---------- CATÁLOGO ---------- */
.catalog {
  max-width: var(--maxw); margin: 0 auto; padding: 1rem 1rem 4rem;
  display: flex; flex-direction: column; gap: 5.5rem;
}
.card { cursor: pointer; -webkit-tap-highlight-color: transparent; }
/* El marco se adapta a la forma de CADA foto y la muestra completa (sin recortar) */
.card__frame {
  position: relative; overflow: hidden; border-radius: var(--radius);
  aspect-ratio: var(--art-ratio);
  background-color: var(--bg-soft);
  background-image: var(--stable-image);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  box-shadow: 0 24px 50px -28px rgba(74, 56, 33, 0.45);
  transition: box-shadow 0.5s var(--ease), transform 0.5s var(--ease);
}
.card:hover .card__frame { box-shadow: 0 34px 66px -30px rgba(74, 56, 33, 0.55); transform: translateY(-4px); }
.card__img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  transition: filter 0.9s var(--ease); filter: saturate(0.97);
}
.card:hover .card__img { filter: saturate(1.06); }

/* Etiqueta de galería DEBAJO de la obra */
.card__caption {
  padding: 1rem 0.4rem 0;
}
.card__title {
  font-family: "Fraunces", serif; font-weight: 400;
  font-size: clamp(1.35rem, 5.6vw, 1.7rem); line-height: 1.08; color: var(--ink);
}
.card__sub { font-size: 0.78rem; color: var(--ink-dim); margin-top: 0.35rem; }
.card__more {
  display: inline-block; margin-top: 0.5rem; font-size: 0.66rem;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent-2);
}
.card__prices {
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.2rem;
}
.card__price-old {
  white-space: nowrap; font-family: "Fraunces", serif; font-size: 0.95rem;
  color: var(--ink-dim); opacity: 0.7; min-height: 1.4em; display: block;
}
.card__price {
  white-space: nowrap; font-family: "Fraunces", serif; font-size: 1.15rem;
  color: var(--ink); display: block;
}

/* ---------- Animación de aparición ---------- */
.reveal {
  opacity: 0;
  transition: opacity 0.9s var(--ease);
}
.reveal.in { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transition: none; }
}

/* ---------- CONTACTO ---------- */
.contact {
  max-width: var(--maxw); margin: 3rem auto 0; padding: 4rem 1.5rem;
  text-align: center;
  background: radial-gradient(120% 90% at 50% 0%, rgba(201,123,74,0.14), transparent 65%);
}
.contact__title {
  font-family: "Fraunces", serif; font-weight: 300;
  font-size: clamp(2rem, 9vw, 3rem); margin: 0.6rem 0 1rem; line-height: 1.05;
}
.contact__lead { color: var(--ink-dim); max-width: 36ch; margin: 0 auto 2rem; }
.contact__actions { display: flex; flex-direction: column; gap: 0.8rem; max-width: 340px; margin: 0 auto; }
.contact__city { margin-top: 2rem; font-size: 0.78rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--accent-2); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  font-family: "Inter", sans-serif; font-size: 0.95rem; font-weight: 400;
  padding: 0.95rem 1.4rem; border-radius: 100px; cursor: pointer;
  text-decoration: none; border: 1px solid transparent; width: 100%;
  transition: transform 0.25s var(--ease), background 0.3s, border-color 0.3s, color 0.3s;
}
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--accent); color: #2a1408; }
.btn--primary:hover { background: var(--accent-2); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-2); }
.btn svg { flex: none; }

/* ---------- Footer ---------- */
.footer {
  text-align: center; padding: 2.5rem 1.5rem;
  padding-bottom: max(2.5rem, calc(1rem + env(safe-area-inset-bottom)));
  color: var(--ink-dim); font-size: 0.8rem; letter-spacing: 0.06em;
  border-top: 1px solid var(--line);
}
.footer__dot { margin: 0 0.5rem; color: var(--accent); }

/* =========================================================================
   HOJA DE DETALLE
   ========================================================================= */
.sheet, .viz {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end;
  justify-content: center; visibility: hidden; pointer-events: none;
}
.viz { align-items: center; }
.sheet.is-open, .viz.is-open { visibility: visible; pointer-events: auto; }
.sheet__backdrop, .viz__backdrop {
  position: absolute; inset: 0; background: rgba(46, 35, 20, 0.42);
  backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.4s var(--ease);
}
.sheet.is-open .sheet__backdrop, .viz.is-open .viz__backdrop { opacity: 1; }

.sheet__panel, .viz__panel {
  position: relative; width: 100%; max-width: var(--maxw);
  max-height: 94svh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--bg-soft); border-radius: 24px 24px 0 0;
  border-top: 1px solid var(--line);
  transform: translateY(101%); transition: transform 0.5s var(--ease);
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
}
.viz__panel {
  border-radius: 24px; margin: 1.2rem;
  width: calc(100% - 2.4rem); max-width: 540px;
  max-height: calc(100svh - 2.4rem);
  transform: translateY(24px) scale(0.97); opacity: 0;
  transition: transform 0.4s var(--ease), opacity 0.3s var(--ease);
}
.viz.is-open .viz__panel { transform: none; opacity: 1; }
.sheet.is-open .sheet__panel, .viz.is-open .viz__panel { transform: none; }

.sheet__panel[data-exiting] {
  opacity: 0 !important;
  transform: translateY(10px) !important;
  transition: opacity 0.15s ease, transform 0.15s ease !important;
}
@keyframes sheetEnter {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.sheet__panel[data-entering] {
  animation: sheetEnter 0.28s var(--ease) forwards;
}

.sheet__close {
  position: absolute; top: 0.9rem; right: 1rem; z-index: 3;
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(246, 241, 228, 0.78); backdrop-filter: blur(8px);
  color: var(--ink); font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.sheet__back {
  position: absolute; top: 0.9rem; left: 1rem; z-index: 3;
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(246, 241, 228, 0.78); backdrop-filter: blur(8px);
  color: var(--ink); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.sheet-piece { padding-bottom: 1.4rem; margin-bottom: 1.4rem; border-bottom: 1px solid var(--line); }
.sheet-piece:last-child { border-bottom: none; margin-bottom: 0; }
.sheet-piece .sheet__year { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 0.25rem; }
.sheet-piece .sheet__title { font-family: "Fraunces", serif; font-weight: 300; font-size: clamp(1.3rem,4.5vw,1.7rem); line-height: 1.1; color: var(--ink); margin-bottom: 0.25rem; }
.sheet-piece .sheet__medium { font-size: 0.85rem; color: var(--ink-dim); font-style: italic; margin-bottom: 0.4rem; }
.sheet-piece .sheet__desc { font-size: 0.88rem; color: var(--ink); line-height: 1.55; margin-bottom: 0.9rem; }
.sheet-piece__img-wrap img { width: 100%; max-height: 60svh; object-fit: contain; display: block; border-radius: 8px; margin-bottom: 1.2rem; }
.sheet-piece .specs { margin-bottom: 1rem; }
.sheet-piece .btn { display: flex; width: 100%; justify-content: center; margin-bottom: 0.8rem; }

.sheet__info-top { padding: 1.6rem 1.5rem 1rem; border-bottom: 1px solid var(--line); }
.sheet__info-top .sheet__year { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 0.3rem; }
.sheet__info-top .sheet__title { font-family: "Fraunces", serif; font-weight: 300; font-size: clamp(1.4rem,5vw,1.9rem); line-height: 1.1; color: var(--ink); margin-bottom: 0.3rem; }
.sheet__info-top .sheet__medium { font-size: 0.85rem; color: var(--ink-dim); font-style: italic; margin-bottom: 0.5rem; }
.sheet__info-top .sheet__desc { font-size: 0.9rem; color: var(--ink); line-height: 1.55; }

.sheet__viz-hero { width: 100%; background: #111; position: relative; }
.sheet__viz-hero-btn { display: block; width: 100%; border: none; padding: 0; background: none; cursor: pointer; position: relative; }
.sheet__viz-hero-btn img { width: 100%; max-height: 55svh; object-fit: contain; display: block; }
.sheet__viz-hero-actions {
  position: absolute; bottom: 0.7rem; right: 0.7rem;
  display: flex; gap: 0.4rem; opacity: 0;
  transition: opacity 0.2s;
}
.sheet__viz-hero-btn:hover .sheet__viz-hero-actions,
.sheet__viz-hero-btn:focus .sheet__viz-hero-actions { opacity: 1; }
@media (hover: none) { .sheet__viz-hero-actions { opacity: 1; } }
.sheet__viz-disclaimer { padding: 0.5rem 1rem 0.6rem; }

/* Multiple artwork images in viz-detail mode */
.sheet__media .sheet-media__piece { width: 100%; max-height: 40svh; object-fit: contain; display: block; }
/* Normal mode single image */
.sheet__panel:not(:has(#sheet-viz-hero:not([hidden]))) .sheet__media img { max-height: 72svh; }

.sheet__media {
  width: 100%;
  background-color: var(--bg);
  background-image: var(--stable-image);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  display: flex;
}
.sheet__media img { width: 100%; height: auto; display: block; max-height: 72svh; object-fit: contain; }
.sheet__body { padding: 1.8rem 1.5rem 0; }
.sheet__year { font-size: 0.78rem; letter-spacing: 0.16em; color: var(--accent-2); text-transform: uppercase; }
.sheet__title { font-family: "Fraunces", serif; font-weight: 300; font-size: clamp(2rem, 9vw, 2.8rem); line-height: 1.02; margin: 0.4rem 0; }
.sheet__medium { color: var(--ink-dim); font-style: italic; font-family: "Fraunces", serif; margin-bottom: 1.2rem; }
.sheet__desc { color: var(--ink); opacity: 0.92; margin-bottom: 1.8rem; }

.specs { display: flex; flex-direction: column; gap: 0; margin-bottom: 1.8rem;
  border-top: 1px solid var(--line); }
.specs > div { display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.specs dt { color: var(--ink-dim); font-size: 0.9rem; }
.specs dd { text-align: right; }
.specs__price { font-family: "Fraunces", serif; font-size: 1.4rem; color: var(--accent-2); display: none; }

.sheet__body .btn { margin-bottom: 0.8rem; }
.sheet__vizs { margin-top: 2rem; padding-bottom: 1.5rem; }
.sheet__vizs-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.9rem; }
.sheet__vizs-label { font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-2); }
.sheet__vizs-seeall { font-size: 0.78rem; color: var(--thread); text-decoration: underline; background: none; border: none; cursor: pointer; padding: 0; }
.sheet__vizs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.sheet-vcard { display: flex; flex-direction: column; gap: 0.4rem; }
.sheet-vcard__img { all: unset; cursor: pointer; display: block; border-radius: 8px; overflow: hidden; }
.sheet-vcard__img img { width: 100%; height: auto; display: block; border-radius: 8px; transition: opacity 0.2s; }
.sheet-vcard__img:hover img { opacity: 0.85; }
.sheet-vcard__actions { display: flex; gap: 0.4rem; }

/* =========================================================================
   VER EN TU ESPACIO
   ========================================================================= */
.viz__panel { padding: 2rem 1.5rem 2.5rem; overflow-y: auto; }
.viz__title { font-family: "Fraunces", serif; font-weight: 300; font-size: 1.7rem; margin: 0.3rem 0 1.2rem; }

/* Step system */
.viz__step { display: none; }
[data-viz-step="1"] [data-step="1"],
[data-viz-step="2"] [data-step="2"],
[data-viz-step="3"] [data-step="3"] { display: block; }

/* Step 1 — Dropzone */
.viz__dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.6rem; padding: 2.5rem 1.5rem; border-radius: var(--radius);
  border: 1.5px dashed var(--line); background: var(--bg-soft);
  cursor: pointer; text-align: center; transition: border-color 0.2s, background 0.2s;
  color: var(--ink-dim);
}
.viz__dropzone:hover { border-color: var(--accent); background: var(--paper); }
.viz__drop-icon { opacity: 0.5; margin-bottom: 0.4rem; }
.viz__drop-title { font-family: "Fraunces", serif; font-weight: 300; font-size: 1.15rem; color: var(--ink); }
.viz__drop-hint { font-size: 0.83rem; max-width: 22ch; }
.viz__drop-btn { margin-top: 0.8rem; pointer-events: none; gap: 0.45rem; }
.viz__drop-preview { width: 100%; border-radius: calc(var(--radius) - 2px); object-fit: cover; max-height: 220px; }
/* Once photo is selected: show preview, demote the select button */
.viz__dropzone.has-photo { padding: 0.6rem; gap: 0.5rem; }
.viz__dropzone.has-photo .viz__drop-icon,
.viz__dropzone.has-photo .viz__drop-hint { display: none; }
.viz__dropzone.has-photo .viz__drop-title { font-size: 0.8rem; color: var(--ink-dim); }
.viz__dropzone.has-photo .viz__drop-btn {
  background: transparent; color: var(--ink-dim); border: 1px solid var(--line);
  font-size: 0.78rem; padding: 0.35rem 0.9rem;
}
.viz__placement-wrap { margin-top: 1.2rem; display: flex; flex-direction: column; gap: 0.4rem; }
.viz__placement-label { font-size: 0.8rem; color: var(--ink); }
.viz__placement-label span { color: var(--ink-dim); }
.viz__placement-input {
  width: 100%; padding: 0.65rem 0.9rem; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--bg-soft);
  font-size: 0.88rem; color: var(--ink); font-family: inherit;
  transition: border-color 0.2s;
}
.viz__placement-input:focus { outline: none; border-color: var(--accent); }
.viz__inline-error { margin-top: 1rem; padding: 0.75rem 1rem; border-radius: 10px; background: rgba(192,58,43,0.08); color: #b03a2e; font-size: 0.88rem; line-height: 1.45; }
.viz__submit-btn { width: 100%; margin-top: 1.2rem; justify-content: center; gap: 0.5rem; }
.viz__submit-btn:disabled { opacity: 0.4; pointer-events: none; }

/* Step 2 — Their photo + progress indicator */
.viz__generating-wrap {
  position: relative; border-radius: var(--radius); overflow: hidden;
  width: 100%; aspect-ratio: 4/3; min-height: min(88vw, 380px); background: var(--bg-soft);
}
.viz__generating-wall {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: brightness(0.7);
}
.viz__generating-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(25,18,10,0.18), rgba(25,18,10,0.42));
}
.viz__generating-overlay .spinner,
.viz__generating-overlay .viz__gen-pulse {
  display: none;
}
.viz__gen-card {
  width: min(100%, 390px);
  padding: 1rem;
  border-radius: 18px;
  background: rgba(246, 241, 228, 0.86);
  border: 1px solid rgba(255,255,255,0.38);
  box-shadow: 0 18px 48px rgba(32, 23, 12, 0.28);
  backdrop-filter: blur(12px) saturate(130%);
  color: var(--ink);
}
.viz__gen-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 0.25rem;
}
.viz__gen-label {
  color: var(--ink);
  font-family: "Fraunces", serif;
  font-size: 1.16rem;
  line-height: 1.15;
  margin-bottom: 0.8rem;
}
.viz__gen-progress {
  height: 7px;
  border-radius: 999px;
  background: rgba(60,46,29,0.14);
  overflow: hidden;
}
.viz__gen-progress span {
  display: block;
  width: 8%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.7s var(--ease);
}
.viz__gen-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.85rem;
}
.viz__gen-steps li {
  position: relative;
  padding-left: 1.35rem;
  color: var(--ink-dim);
  font-size: 0.82rem;
  line-height: 1.28;
}
.viz__gen-steps li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.28rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  border: 1px solid rgba(60,46,29,0.24);
  background: rgba(246,241,228,0.72);
}
.viz__gen-steps li.is-active {
  color: var(--ink);
  font-weight: 400;
}
.viz__gen-steps li.is-active::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(191,150,58,0.18);
}
.viz__gen-steps li.is-done {
  color: var(--ink);
}
.viz__gen-steps li.is-done::before {
  border-color: var(--accent-2);
  background: var(--accent-2);
}
.viz__gen-time {
  margin-top: 0.85rem;
  color: var(--ink-dim);
  font-size: 0.74rem;
  line-height: 1.35;
}

/* Step 3 — Main result */
.viz__main-result-wrap { border-radius: var(--radius); overflow: hidden; margin-bottom: 0.6rem; position: relative; }
.viz__main-result { width: 100%; display: block; cursor: zoom-in; }

/* Overlay action buttons on the image */
.viz__img-actions {
  position: absolute; top: 0.6rem; right: 0.6rem;
  display: flex; flex-direction: column; gap: 0.4rem;
  opacity: 0; transition: opacity 0.2s;
}
.viz__main-result-wrap:hover .viz__img-actions,
.viz__main-result-wrap:focus-within .viz__img-actions { opacity: 1; }
.viz__img-btn {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(6px);
  color: #fff; display: flex; align-items: center; justify-content: center;
  cursor: pointer; text-decoration: none; flex-shrink: 0;
  transition: background 0.15s, transform 0.15s;
}
.viz__img-btn:hover { background: rgba(0,0,0,0.8); transform: scale(1.08); }
.viz__img-btn.is-fav { background: #c0392b; }

/* Side-by-side compare */
.viz__compare { margin-bottom: 0.6rem; }
.viz__compare-grid { display: flex; gap: 0.4rem; align-items: stretch; }
.viz__compare-item { flex: 1; min-width: 0; position: relative; border-radius: 8px; overflow: hidden; background: var(--bg); display: flex; align-items: center; }
.viz__compare-item img { width: 100%; height: 100%; display: block; object-fit: contain; max-height: 55svh; }
.viz__compare-tag {
  position: absolute; bottom: 0.4rem; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.55); backdrop-filter: blur(4px);
  color: #fff; font-size: 0.65rem; letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem; border-radius: 20px; white-space: nowrap;
  pointer-events: none;
}

.viz__disclaimer {
  display: flex; align-items: flex-start; gap: 0.35rem;
  font-size: 0.72rem; color: var(--ink-dim); line-height: 1.4;
  margin-bottom: 1rem; opacity: 0.8;
}
.viz__main-actions { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.6rem; }
.viz__main-actions .btn { flex: 1; justify-content: center; }
@media (min-width: 560px) {
  .viz__main-actions { flex-direction: row; }
}

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.lightbox.is-open { opacity: 1; pointer-events: all; }
.lightbox__backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.92);
  cursor: pointer;
}
.lightbox__close {
  position: absolute; top: 1rem; right: 1rem;
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.15); color: #fff;
  font-size: 1.4rem; line-height: 1; cursor: pointer; z-index: 1;
  display: flex; align-items: center; justify-content: center;
}
.lightbox__img {
  position: relative; max-width: 96vw; max-height: 88svh;
  object-fit: contain; border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}
.lightbox__actions {
  position: absolute; bottom: 1.2rem; left: 50%; transform: translateX(-50%);
  display: flex; gap: 0.6rem;
}
.lightbox__disclaimer {
  position: absolute; bottom: 0.35rem; left: 50%; transform: translateX(-50%);
  white-space: nowrap; font-size: 0.68rem; color: rgba(255,255,255,0.5);
  letter-spacing: 0.02em;
}

/* On touch devices always show overlay buttons */
@media (hover: none) {
  .viz__img-actions { opacity: 1; }
}

/* "También te puede interesar" */
.viz__also { border-top: 1px solid var(--line); padding-top: 1.2rem; margin-top: 0.8rem; }
.viz__also-title {
  font-family: "Fraunces", serif; font-weight: 300;
  font-size: 1.1rem; color: var(--ink); margin-bottom: 0.9rem;
}
/* Collapsed grid: two small blurry previews side by side */
.viz__also-grid { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.viz__also-card {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.35rem; cursor: pointer;
  transition: flex 0.4s var(--ease);
}
.viz__also-img-wrap { border-radius: 8px; overflow: hidden; }
.viz__also-img-wrap img {
  width: 100%; display: block; aspect-ratio: 4/3; object-fit: cover;
  filter: blur(3px) brightness(0.75); transform: scale(1.05);
  transition: filter 0.35s var(--ease), transform 0.35s var(--ease);
}
.viz__also-card:not(.expanded):hover .viz__also-img-wrap img {
  filter: blur(0) brightness(1); transform: scale(1);
}
.viz__also-label {
  font-size: 0.78rem; color: var(--ink); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.viz__also-dims { font-size: 0.72rem; color: var(--ink-dim); }

/* Expanded: full width, clear image */
.viz__also-card.expanded {
  flex: 0 0 100%;
}
.viz__also-card.expanded .viz__also-img-wrap img {
  filter: none; transform: scale(1); aspect-ratio: auto;
}
/* Once any card is clicked, remove blur from ALL thumbnails permanently */
.viz__also-grid.revealed .viz__also-img-wrap img {
  filter: none !important; transform: scale(1) !important;
}
.viz__also-expanded { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.4rem; }
.viz__also-rationale {
  font-size: 0.82rem; line-height: 1.5; color: var(--ink);
  padding: 0.55rem 0.75rem; background: var(--bg-soft);
  border-radius: 8px; border-left: 2px solid var(--accent);
}
.viz__also-cta { text-align: center; }
.viz__new-photo-btn { cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 1.4rem; width: 100%; }

/* Spinner */
.spinner { width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--accent);
  animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Desktop / tablets: hoja centrada y a dos columnas ---------- */
@media (min-width: 720px) {
  :root { --maxw: 620px; }
  .sheet { align-items: center; }
  .sheet__panel { border-radius: 24px; max-width: 620px; transform: translateY(40px) scale(0.98); opacity: 0; transition: transform 0.5s var(--ease), opacity 0.4s var(--ease); }
  .sheet.is-open .sheet__panel { transform: none; opacity: 1; }
  .sheet__media img { max-height: 64svh; }
  .sheet__body { padding: 2.4rem 2.4rem 0; }
  /* Catálogo tipo galería: 2 columnas con alturas naturales (mampostería) */
  .catalog { max-width: 1000px; display: block; column-count: 2; column-gap: 2.5rem; }
  .catalog .card {
    break-inside: avoid;
    break-inside: avoid-column;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 3rem;
  }
  .hero__title { font-size: clamp(4rem, 9vw, 7rem); }
}

/* =========================================================================
   HILOS ENTRETEJIDOS  (se "cosen" solos al hacer scroll)
   ========================================================================= */
.thread-row {
  max-width: var(--maxw); margin: 0 auto; padding: 1.5rem 1rem;
  display: flex; justify-content: center;
}
@media (min-width: 720px) { .thread-row { max-width: 1000px; } }

.thread { width: 100%; height: 56px; display: block; overflow: visible; }

/* Cordón dorado que se dibuja al entrar en pantalla */
.thread__cord {
  fill: none; stroke: var(--thread); stroke-width: 2.4; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.8s var(--ease);
}
.thread.in .thread__cord { stroke-dashoffset: 0; }

/* Pequeñas puntadas en cruz (salvia) que aparecen después */
.thread__stitch {
  stroke: var(--accent-2); stroke-width: 2; stroke-linecap: round;
  opacity: 0; transition: opacity 0.7s var(--ease) 0.9s;
}
.thread.in .thread__stitch { opacity: 0.85; }

/* Nudos en los extremos */
.thread__knot { fill: var(--thread); opacity: 0; transform: scale(0);
  transform-origin: center; transition: opacity 0.5s var(--ease) 0.6s, transform 0.5s var(--ease) 0.6s; }
.thread.in .thread__knot { opacity: 1; transform: scale(1); }

@media (prefers-reduced-motion: reduce) {
  .thread__cord { transition: none; stroke-dashoffset: 0; }
  .thread__stitch, .thread__knot { transition: none; opacity: 0.85; transform: none; }
}

/* =========================================================================
   GALERÍA — botón flotante + panel (visualizaciones / favoritos / sugerencias)
   ========================================================================= */
.gallery-fab {
  position: fixed; z-index: 200;
  right: max(1.1rem, env(safe-area-inset-right));
  bottom: max(1.1rem, calc(0.6rem + env(safe-area-inset-bottom)));
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #2a1408; border: none; cursor: pointer;
  box-shadow: 0 6px 20px rgba(46, 35, 20, 0.30);
  transition: transform 0.25s var(--ease), background 0.3s;
}
.gallery-fab:hover { background: var(--accent-2); transform: translateY(-2px); }
.gallery-fab:active { transform: scale(0.94); }
.gallery-fab__badge {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px;
  padding: 0 5px; border-radius: 10px; background: var(--accent-3); color: #fff;
  font-size: 0.7rem; font-weight: 500; line-height: 20px; text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
}


.gallery { position: fixed; inset: 0; z-index: 110; display: flex;
  align-items: center; justify-content: center; visibility: hidden; pointer-events: none;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom)); }
.gallery.is-open { visibility: visible; pointer-events: auto; }
.gallery__backdrop {
  position: absolute; inset: 0; background: rgba(46, 35, 20, 0.42);
  backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.4s var(--ease);
}
.gallery.is-open .gallery__backdrop { opacity: 1; }
.gallery__panel {
  position: relative; width: min(100%, 920px);
  max-height: min(86svh, 820px); overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--bg-soft); border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: 0 26px 80px rgba(46, 35, 20, 0.26);
  transform: translateY(28px) scale(0.98); transition: transform 0.5s var(--ease);
  padding: clamp(1.5rem, 4vw, 2.6rem);
}
.gallery.is-open .gallery__panel { transform: none; }
.gallery__title { font-family: "Fraunces", serif; font-weight: 300; font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 0.35rem 2.6rem 1.6rem 0; line-height: 1.08; }

.gallery__tabs { display: flex; flex-wrap: wrap; gap: 0.7rem 1.1rem; border-bottom: 1px solid var(--line); margin-bottom: 1.6rem; }
.gallery__tab {
  position: relative; background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 0.8rem; color: var(--ink-dim);
  padding: 0.65rem 0.1rem; border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.gallery__tab.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.gallery__tab-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-3); margin-left: 2px; vertical-align: top;
}

.gallery__empty {
  text-align: center; color: var(--ink-dim); font-size: 0.9rem;
  padding: 2.5rem 1rem; line-height: 1.6;
}
.gallery__body { min-height: min(48svh, 420px); }
.gallery__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (min-width: 560px) { .gallery__grid { grid-template-columns: 1fr 1fr 1fr; } }
@media (min-width: 820px) { .gallery__grid { grid-template-columns: repeat(4, 1fr); gap: 1.15rem; } }

.gcard {
  display: flex; flex-direction: column; border-radius: 12px; overflow: hidden;
  background: var(--paper); border: 1px solid var(--line);
}
.gcard__img {
  position: relative; padding: 0; border: none; cursor: pointer; background: var(--bg);
  display: block; width: 100%; aspect-ratio: 4/3; overflow: hidden;
}
.gcard__img img { width: 100%; height: 100%; object-fit: cover; }
.gcard__new {
  position: absolute; top: 0.5rem; left: 0.5rem;
  background: var(--accent); color: #fff;
  font-size: 0.6rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.2rem 0.5rem; border-radius: 20px; pointer-events: none;
}
.gcard__bar { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; padding: 0.5rem 0.6rem 0.2rem; }
.gcard__title { font-size: 0.78rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcard__dims { font-size: 0.7rem; color: var(--ink-dim); padding: 0 0.6rem; }
.gcard__actions { display: flex; gap: 0.15rem; flex: none; }
.gcard__icon {
  width: 28px; height: 28px; border-radius: 50%; border: none; cursor: pointer;
  background: transparent; color: var(--ink-dim); display: flex; align-items: center; justify-content: center;
  transition: color 0.2s, background 0.2s;
}
.gcard__icon:hover { background: var(--bg); color: var(--ink); }
.gcard__icon.is-fav { color: #c0392b; }
.gcard__icon.is-fav svg { fill: currentColor; }
.gcard__cta {
  margin: 0.4rem 0.6rem 0.6rem; padding: 0.5rem; border-radius: 100px;
  background: transparent; border: 1px solid var(--line); color: var(--ink);
  font-family: inherit; font-size: 0.78rem; cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.gcard__cta:hover { border-color: var(--accent); color: var(--accent-2); }

/* =========================================================================
   NOTIFICACIONES (toasts)
   ========================================================================= */
.toast-stack {
  position: fixed; z-index: 120; left: 50%; transform: translateX(-50%);
  bottom: max(1rem, calc(0.6rem + env(safe-area-inset-bottom)));
  display: flex; flex-direction: column; gap: 0.5rem; width: min(92vw, 420px);
  pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 0.7rem;
  background: var(--ink); color: var(--paper); border-radius: 14px;
  padding: 0.8rem 0.9rem; box-shadow: 0 8px 28px rgba(46, 35, 20, 0.35);
  font-size: 0.85rem; cursor: pointer;
  transform: translateY(20px); opacity: 0; transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}
.toast.is-in { transform: none; opacity: 1; }
.toast__thumb { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; flex: none; }
.toast__text { flex: 1; line-height: 1.35; }
.toast__action { color: var(--thread); font-weight: 500; white-space: nowrap; }
.toast__close {
  flex: none; width: 24px; height: 24px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,0.12); color: var(--paper); font-size: 1rem; line-height: 1;
}

/* ---------- View Transitions (navegadores modernos) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.4s; }

/* =========================================================================
   ART PICKER — selector de obra cuando hay varias en una sugerencia
   ========================================================================= */
.art-picker {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  visibility: hidden; pointer-events: none;
}
.art-picker.is-open { visibility: visible; pointer-events: auto; }
.art-picker__backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.5);
  opacity: 0; transition: opacity 0.25s var(--ease);
}
.art-picker.is-open .art-picker__backdrop { opacity: 1; }
.art-picker__panel {
  position: relative; background: var(--paper); border-radius: 20px;
  padding: 2rem 1.6rem; width: 100%; max-width: 480px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.28);
  transform: scale(0.94) translateY(12px); opacity: 0;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.art-picker.is-open .art-picker__panel { transform: none; opacity: 1; }
.art-picker__title {
  font-family: "Fraunces", serif; font-size: 1.1rem; font-weight: 400;
  color: var(--ink); margin-bottom: 1.4rem; text-align: center;
}
.art-picker__grid { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.art-picker__item {
  flex: 1; min-width: 130px; max-width: 180px;
  display: flex; flex-direction: column; gap: 0.5rem; align-items: center;
  cursor: pointer; border: 2px solid transparent; border-radius: 14px;
  padding: 0.7rem; transition: border-color 0.2s, background 0.2s;
  background: none;
}
.art-picker__item:hover { border-color: var(--accent); background: rgba(191,150,58,0.06); }
.art-picker__item img {
  width: 100%; object-fit: contain; border-radius: 8px;
  max-height: 220px;
}
.art-picker__item span {
  font-size: 0.82rem; color: var(--ink); text-align: center;
  line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
