/* ==========================================================
   BIVARIA · Diseño paramétrico + CNC
   ========================================================== */

/* --------- Variables --------- */
:root {
    --header-height: 88px;

    /* Paleta: madera sobre penumbra */
    --bg: #0f0b09;          /* fondo general (igual en todas las páginas) */
    --bg-2: #17110e;        /* secciones alternas */
    --bg-3: #1e1713;        /* superficies (campos, miniaturas) */
    --text: #ede7e0;
    --text-soft: #b8aca1;
    --text-mute: #857a70;
    --accent: #c9a77c;      /* arena / bronce: detalles y estados activos */
    --wood: var(--accent);
    --line: rgba(237, 231, 224, .12);
    --line-strong: rgba(237, 231, 224, .28);
    --radius: 2px;          /* esquinas apenas suavizadas: estilo arquitectónico */

    /* Tipografía */
    --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
    --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    /* Márgenes laterales fluidos (16px en móvil → 88px en escritorio) */
    --gutter: clamp(16px, 6.3vw, 88px);

    --ease: cubic-bezier(.22, .61, .36, 1);
}

/* --------- Reset básico --------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    /* Barra de scroll oscura, al tono de la página */
    scrollbar-color: #3a2f27 var(--bg);
    scrollbar-width: thin;
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: #3a2f27;
    border: 3px solid var(--bg);
    border-radius: 10px;
}

::selection {
    background-color: var(--accent);
    color: var(--bg);
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-weight: 350;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Grano sutil tipo película sobre toda la página (imagen fija, no consume al scrollear) */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 90;
    pointer-events: none;
    opacity: .07;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

p {
    text-wrap: pretty;
}

/* Aparición suave (la activa js/comun.js; sin JS todo se ve igual) */
.revelar {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .9s var(--ease) var(--retraso, 0ms), transform .9s var(--ease) var(--retraso, 0ms);
}

.revelar.is-visible {
    opacity: 1;
    transform: none;
}

body.menu-open {
    overflow: hidden;
}

h1,
h2,
h3,
p {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    color: inherit;
}

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

:focus-visible {
    outline: 1px solid var(--wood);
    outline-offset: 4px;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 100;
    padding: 10px 16px;
    background: var(--text);
    color: var(--bg);
    font-size: 14px;
}

.skip-link:focus {
    top: 16px;
}

/* --------- Utilidades --------- */
.eyebrow {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: .32em;
    text-transform: uppercase;
    color: var(--text-mute);
}

/* Línea fina antes de cada etiqueta */
.eyebrow::before {
    content: "";
    flex: none;
    width: 28px;
    height: 1px;
    background-color: var(--accent);
    opacity: .7;
}

.tarjeta .eyebrow::before {
    display: none;
}

/* Títulos en serif un poco más ajustados */
h1,
h2,
h3 {
    letter-spacing: -.015em;
}

.contenedor {
    width: 100%;
    padding: 0 var(--gutter);
}

/* ==========================================================
   HEADER / NAV
   ========================================================== */
.header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 50;
    height: var(--header-height);
    transition: background-color .4s var(--ease), height .4s var(--ease), backdrop-filter .4s;
}

/* Al hacer scroll: barra compacta con fondo translúcido */
.header.scrolled {
    --header-height: 68px;
    background-color: rgba(15, 11, 9, .72);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}

.nav {
    position: relative;
    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 var(--gutter);
}

.nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.logo {
    display: block;
    font-family: var(--font-sans);
    font-weight: 300;
    font-size: 21px;
    letter-spacing: .34em;
    line-height: 1;
    margin-right: -.34em; /* compensa el espaciado de la última letra */
    color: var(--text);
}

.logo--small {
    font-size: 15px;
}

/* Links centrados respecto de la página */
.nav-links {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);

    display: flex;
    align-items: center;
    gap: 56px;
}

.nav-links a,
.nav-links-btn {
    font-size: 15px;
    font-weight: 400;
    color: var(--text);
    opacity: .88;
    transition: opacity .25s;
}

.nav-links a:hover,
.nav-links-btn:hover {
    opacity: 1;
}

.nav-links-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border: none;
    background: none;
    cursor: pointer;
}

.chevron {
    transition: transform .3s var(--ease);
}

.nav-tienda {
    position: relative;
}

.nav-links-categoria {
    position: absolute;
    top: calc(100% + 14px);
    left: 50%;
    min-width: 230px;

    padding: 10px 0 !important;
    background-color: rgba(26, 19, 16, .92);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1px solid var(--line);

    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -6px);
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
}

.nav-links-categoria a {
    display: block;
    padding: 10px 22px;
    font-size: 14px;
}

.nav-links-categoria a:hover {
    color: var(--wood);
}

.nav-links-categoria.open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.nav-links-btn[aria-expanded="true"] .chevron {
    transform: rotate(180deg);
}

/* Al hacer scroll (o con el menú abierto) se ocultan los links y queda solo el menú */
.header.scrolled .nav-links,
.menu-open .nav-links {
    opacity: 0;
    visibility: hidden;
}

.nav-links {
    transition: opacity .3s, visibility .3s;
}

/* --------- Botón hamburguesa --------- */
.menu-btn {
    position: relative;
    z-index: 60;
    width: 44px;
    height: 44px;
    margin-right: -10px;
    border: none;
    background: none;
    cursor: pointer;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.menu-btn span {
    display: block;
    width: 24px;
    height: 1px;
    background-color: var(--text);
    transition: transform .35s var(--ease), opacity .2s;
}

.menu-btn[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-btn[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.menu-btn[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* --------- Panel del menú --------- */
.menu-panel {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    padding: calc(var(--header-height) + 24px) var(--gutter) 48px;
    background-color: rgba(15, 11, 9, .97);
    opacity: 0;
    transition: opacity .35s var(--ease);
}

.menu-panel.is-visible {
    opacity: 1;
}

.menu-panel[hidden] {
    display: none;
}

.menu-panel-inner {
    width: 100%;
    max-width: 640px;
    outline: none;
}

.menu-list {
    margin: 14px 0 48px;
    padding: 0;
    list-style: none;
}

.menu-list a {
    display: inline-block;
    padding: 4px 0;
    font-family: var(--font-serif);
    font-size: clamp(32px, 6vw, 56px);
    line-height: 1.15;
    transition: color .25s, transform .35s var(--ease);
}

.menu-list--small a {
    font-family: var(--font-sans);
    font-size: 18px;
    font-weight: 300;
    line-height: 1.9;
}

.menu-list a:hover {
    color: var(--wood);
    transform: translateX(8px);
}

/* ==========================================================
   HERO
   ========================================================== */
#hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    overflow: hidden;
    isolation: isolate;

    display: flex;
    align-items: center;

    background-color: var(--bg);
    background-image: url("../img/hero-bg.jpg");
    background-image: image-set(url("../img/hero-bg.webp") type("image/webp"), url("../img/hero-bg.jpg") type("image/jpeg"));
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center bottom;
}

/* Viñeta para dar profundidad y legibilidad al texto */
#hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 60% 55% at 58% 55%, rgba(120, 72, 40, .14), transparent 70%),
        linear-gradient(90deg, rgba(15, 11, 9, .55) 0%, rgba(15, 11, 9, .1) 45%, transparent 70%),
        linear-gradient(180deg, rgba(15, 11, 9, .5) 0%, transparent 22%, transparent 78%, rgba(15, 11, 9, .7) 100%);
}

/* El final del hero se funde con la sección siguiente */
#hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 120px;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, var(--bg));
}

/* Pieza paramétrica */
.hero-background {
    position: absolute;
    z-index: -1;
    right: 3%;
    top: 50%;
    width: min(60vw, 920px);
    transform: translateY(-38%);
    pointer-events: none;
    /* El extremo izquierdo se funde con el fondo para no competir con el texto */
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 24%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 24%);
}

.pieza {
    width: 100%;
    height: auto;
    overflow: visible;
    transition: transform .8s var(--ease);
}

.hero-content {
    position: relative;
    padding: calc(var(--header-height) + 24px) var(--gutter) 120px;
    padding-left: calc(var(--gutter) + 6.5vw);
    max-width: 960px;
}

.hero-content h1 {
    margin: 22px 0 26px;
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: clamp(46px, 6.6vw, 104px);
    line-height: .98;
    letter-spacing: -.01em;
    color: var(--text);
    text-wrap: balance;
}

.hero-frase {
    max-width: 340px;
    font-size: clamp(15px, 1.15vw, 17px);
    line-height: 1.55;
    color: var(--text-soft);
}

.link-cta {
    position: relative;
    display: inline-flex;
    gap: 10px;
    margin-top: 52px;
    padding-bottom: 8px;
    font-size: 15px;
    font-weight: 400;
    color: var(--text);
}

.link-cta::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background-color: currentColor;
    transform-origin: left;
    transition: transform .5s var(--ease);
}

.link-cta span {
    transition: transform .35s var(--ease);
}

.link-cta:hover span {
    transform: translateX(5px);
}

.link-cta:hover::after {
    transform: scaleX(.6);
}

/* Animación de entrada del texto */
.hero-content > * {
    opacity: 0;
    transform: translateY(18px);
    animation: aparecer 1s var(--ease) forwards;
}

.hero-content > :nth-child(2) { animation-delay: .1s; }
.hero-content > :nth-child(3) { animation-delay: .25s; }
.hero-content > :nth-child(4) { animation-delay: .4s; }

@keyframes aparecer {
    to {
        opacity: 1;
        transform: none;
    }
}

/* --------- Puntos (selector de piezas) --------- */
.hero-dots {
    position: absolute;
    left: var(--gutter);
    bottom: 88px;
    display: flex;
    gap: 4px;
}

.dot {
    position: relative;
    width: 32px;
    height: 24px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
}

.dot::before {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 24px;
    height: 1px;
    background-color: var(--text);
    opacity: .3;
    transform: scaleX(.5);
    transition: opacity .3s, transform .4s var(--ease);
}

.dot:hover::before {
    opacity: .6;
}

.dot.is-active::before {
    opacity: 1;
    transform: none;
}

.hero-pieza-nombre {
    position: absolute;
    left: calc(var(--gutter) + 156px);
    bottom: 89px;
    font-size: 11px;
    letter-spacing: .28em;
    text-transform: uppercase;
    color: var(--text-mute);
    transition: opacity .3s;
}

/* --------- Indicador de scroll --------- */
.scroll-hint {
    position: absolute;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-size: 10px;
    letter-spacing: .3em;
    text-transform: uppercase;
    color: var(--text-mute);
    margin-right: -.3em;
}

.scroll-hint i {
    position: relative;
    display: block;
    width: 1px;
    height: 40px;
    overflow: hidden;
    background-color: var(--line);
}

.scroll-hint i::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: var(--text-soft);
    animation: linea-scroll 2.4s var(--ease) infinite;
}

@keyframes linea-scroll {
    0%   { transform: translateY(-100%); }
    60%  { transform: translateY(0); }
    100% { transform: translateY(100%); }
}

/* ==========================================================
   SECCIONES DEL INICIO: QUÉ HACEMOS Y CONTACTO
   ========================================================== */
.seccion {
    padding: clamp(88px, 11vw, 150px) 0;
    border-top: 1px solid var(--line);
}

#que-hacemos {
    background-color: var(--bg);
}

#contacto {
    background-color: var(--bg-2);
}

.seccion h2 {
    margin: 18px 0 0;
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: clamp(32px, 4.2vw, 60px);
    line-height: 1.08;
    text-wrap: balance;
}

.seccion-texto {
    max-width: 460px;
    color: var(--text-soft);
}

.seccion-cabecera {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 32px 64px;
    align-items: end;
}

/* --------- Pasos --------- */
.pasos {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin: clamp(56px, 7vw, 88px) 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--line);
}

.pasos li {
    padding: 28px 32px 0 0;
}

.pasos li + li {
    padding-left: 32px;
    border-left: 1px solid var(--line);
}

.paso-numero {
    font-size: 12px;
    letter-spacing: .2em;
    color: var(--wood);
}

.pasos h3 {
    margin: 14px 0 10px;
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 24px;
}

.pasos p {
    font-size: 15px;
    color: var(--text-soft);
}

/* --------- Collage --------- */
.collage {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: clamp(150px, 15vw, 220px);
    gap: clamp(10px, 1.4vw, 18px);
    margin-bottom: 48px;
}

.collage-item {
    position: relative;
    margin: 0;
    overflow: hidden;
    background-color: var(--bg-2);
}

.collage-item--grande { grid-column: span 2; grid-row: span 2; }
.collage-item--alta   { grid-row: span 2; }
.collage-item--ancha  { grid-column: span 2; }

.collage-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s var(--ease);
}

.collage-item:hover img {
    transform: scale(1.04);
}

/* Lugar reservado mientras no haya foto: rayas como costillas de madera */
.foto-pendiente {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse 70% 60% at 50% 50%, rgba(150, 96, 58, .16), transparent 75%),
        repeating-linear-gradient(90deg, rgba(236, 230, 223, .045) 0 2px, transparent 2px 14px),
        linear-gradient(180deg, #1c1410, #16100c);
    border: 1px dashed rgba(236, 230, 223, .14);
}

.foto-pendiente span {
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background-color: rgba(15, 11, 9, .7);
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--text-mute);
    white-space: nowrap;
}

.collage-item figcaption {
    position: absolute;
    left: 14px;
    bottom: 12px;
    font-size: 12px;
    color: var(--text-soft);
    text-shadow: 0 1px 8px rgba(0, 0, 0, .6);
}

/* --------- Contacto --------- */
.contacto {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 56px 80px;
    align-items: start;
}

.contacto .seccion-texto {
    margin-top: 22px;
}

.btn-whatsapp--auto {
    display: inline-flex;
    width: auto;
    margin-top: 36px;
    padding-inline: 28px;
}

.redes-lista {
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--line);
}

.red {
    display: grid;
    grid-template-columns: 22px auto 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 18px 4px;
    border-bottom: 1px solid var(--line);
    transition: padding .35s var(--ease), color .25s;
}

.red svg {
    width: 22px;
    height: 22px;
}

.red-nombre {
    font-size: 16px;
    font-weight: 400;
}

.red-detalle {
    justify-self: end;
    font-size: 13px;
    color: var(--text-mute);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.red-flecha {
    color: var(--text-mute);
    transition: transform .35s var(--ease), color .25s;
}

.red[href]:hover {
    padding-left: 12px;
    color: var(--wood);
}

.red[href]:hover .red-flecha {
    color: var(--wood);
    transform: translate(3px, -3px);
}

.red.is-pendiente {
    color: var(--text-mute);
    cursor: default;
}

.red.is-pendiente .red-flecha {
    visibility: hidden;
}

@media (max-width: 900px) {
    .seccion-cabecera,
    .contacto {
        grid-template-columns: 1fr;
    }

    .pasos {
        grid-template-columns: 1fr;
        border-top: none;
    }

    .pasos li,
    .pasos li + li {
        padding: 24px 0;
        border-left: none;
        border-top: 1px solid var(--line);
    }

    .collage {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .foto-pendiente span {
        padding: 5px 10px;
        font-size: 9px;
        letter-spacing: .12em;
    }
}

@media (max-width: 760px) {
    .btn-whatsapp--auto {
        display: flex;
        width: 100%;
    }
}

/* ==========================================================
   PÁGINAS INTERNAS (tienda y producto)
   ========================================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* El header ya arranca con fondo: no hay foto detrás */
.interior .header {
    background-color: rgba(15, 11, 9, .72);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}

.interior main {
    padding-top: var(--header-height);
    min-height: 80vh;
}

.titulo-pagina {
    margin: 16px 0 18px;
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: clamp(40px, 5.4vw, 76px);
    line-height: 1;
}

.titulo-seccion {
    margin-bottom: 28px;
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: clamp(26px, 2.6vw, 36px);
}

/* Fondo de "estudio" para las vistas 3D y miniaturas */
.tarjeta-media,
.visor {
    background:
        radial-gradient(ellipse 70% 55% at 50% 58%, rgba(150, 96, 58, .2), transparent 72%),
        linear-gradient(180deg, #1c1410 0%, #211812 60%, #18110d 100%);
}

/* --------- Tienda --------- */
.tienda-cabecera {
    padding-top: clamp(48px, 8vw, 96px);
    padding-bottom: 36px;
}

.tienda-intro {
    max-width: 520px;
    color: var(--text-soft);
}

.filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 36px;
}

.filtro,
.chip span {
    display: inline-block;
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: none;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: .02em;
    color: var(--text-soft);
    cursor: pointer;
    transition: border-color .25s, color .25s, background-color .25s;
}

.filtro:hover,
.chip:hover span {
    border-color: var(--line-strong);
    color: var(--text);
}

.filtro[aria-pressed="true"],
.chip input:checked + span {
    border-color: var(--text);
    background-color: var(--text);
    color: var(--bg);
}

.tienda-cantidad {
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-mute);
}

.grilla {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: clamp(48px, 5vw, 64px) clamp(16px, 2.4vw, 32px);
    margin: 0 0 120px;
    padding: 0;
    list-style: none;
}

.grilla--3 {
    margin-bottom: 0;
}

.grilla li[hidden] {
    display: none;
}

.tarjeta {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tarjeta-media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: border-color .4s;
}

.tarjeta:hover .tarjeta-media {
    border-color: var(--line-strong);
}

/* Marca de carga sutil mientras se genera la vista 3D */
.tarjeta-media[data-render]::before {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 28px;
    height: 1px;
    background: var(--text-mute);
    animation: cargando 1.4s var(--ease) infinite;
}

.tarjeta-media:has(img.is-lista)::before {
    display: none;
}

@keyframes cargando {
    0%, 100% { transform: scaleX(.2); opacity: .3; }
    50% { transform: scaleX(1); opacity: .8; }
}

.tarjeta-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.03);
    transition: opacity .6s var(--ease), transform 1.2s var(--ease);
}

.tarjeta-media img.is-lista {
    opacity: 1;
    transform: none;
}

.tarjeta:hover .tarjeta-media img.is-lista {
    transform: scale(1.04);
}

.tarjeta-cuerpo {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 22px 2px 0;
}

.tarjeta-nombre {
    margin: 10px 0 8px;
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 26px;
    line-height: 1.15;
}

.tarjeta-resumen {
    font-size: 14px;
    color: var(--text-soft);
}

.tarjeta-meta {
    margin-top: 14px;
    font-size: 12px;
    letter-spacing: .06em;
    color: var(--text-mute);
}

.tarjeta-cta {
    margin-top: auto;
    padding-top: 20px;
    font-size: 14px;
    font-weight: 400;
}

.tarjeta-cta span {
    display: inline-block;
    transition: transform .35s var(--ease);
}

.tarjeta:hover .tarjeta-cta span {
    transform: translateX(5px);
}

/* --------- Ficha de producto --------- */
.migas {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 28px 0;
    font-size: 13px;
    color: var(--text-mute);
}

.migas a:hover {
    color: var(--text);
}

.producto-grilla {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: clamp(28px, 4vw, 64px);
    align-items: start;
}

.visor {
    position: sticky;
    top: calc(var(--header-height) + 20px);
    aspect-ratio: 4 / 3.2;
    max-height: calc(100vh - var(--header-height) - 40px);
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--line);
}

.visor canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
    opacity: 0;
    transition: opacity .6s var(--ease);
}

.visor canvas:active {
    cursor: grabbing;
}

.visor.is-listo canvas {
    opacity: 1;
}

.visor-estado,
.visor-ayuda {
    position: absolute;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 12px;
    letter-spacing: .08em;
    color: var(--text-mute);
    pointer-events: none;
}

.visor-estado {
    top: 50%;
    transform: translateY(-50%);
}

.visor-ayuda {
    bottom: 16px;
    opacity: 0;
    transition: opacity .6s .6s;
}

.visor.is-listo .visor-ayuda {
    opacity: 1;
}

.visor-zoom {
    position: absolute;
    right: 12px;
    top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 0;
    transition: opacity .4s;
}

.visor.is-listo .visor-zoom {
    opacity: 1;
}

.visor-zoom button {
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background-color: rgba(15, 11, 9, .6);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: border-color .25s, background-color .25s;
}

.visor-zoom button:hover {
    border-color: var(--line-strong);
    background-color: rgba(15, 11, 9, .9);
}

.titulo-producto {
    margin: 14px 0 10px;
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: clamp(36px, 3.8vw, 56px);
    line-height: 1.05;
}

.producto-precio {
    font-size: 16px;
    font-weight: 400;
    color: var(--wood);
}

.producto-desc {
    margin-top: 22px;
    color: var(--text-soft);
}

.opciones {
    margin-top: 36px;
    display: grid;
    gap: 26px;
}

.opcion {
    margin: 0;
    padding: 0;
    border: none;
    min-width: 0;
}

.opcion legend {
    padding: 0;
    margin-bottom: 12px;
    font-size: 12px;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--text-mute);
}

.opcion-elegida {
    letter-spacing: .04em;
    text-transform: none;
    color: var(--text);
}

.opcion-valores {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip,
.muestra {
    position: relative;
    cursor: pointer;
}

.chip input,
.muestra input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.chip input:focus-visible + span,
.muestra input:focus-visible + .muestra-color {
    outline: 1px solid var(--wood);
    outline-offset: 3px;
}

.muestra-color {
    display: block;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--bg-2);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
    transition: box-shadow .25s, transform .25s var(--ease);
}

.muestra:hover .muestra-color {
    transform: scale(1.06);
}

.muestra input:checked + .muestra-color {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 0 0 2px var(--bg), 0 0 0 3px var(--text);
}

.campo {
    display: grid;
    gap: 10px;
}

.campo-titulo {
    font-size: 12px;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--text-mute);
}

.campo input {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background-color: var(--bg-3);
    color: var(--text);
    font: inherit;
    font-size: 16px; /* evita el zoom automático en iPhone */
    transition: border-color .25s;
}

.campo input::placeholder {
    color: var(--text-mute);
}

.campo input:focus {
    outline: none;
    border-color: var(--wood);
}

.producto-dim {
    margin-top: 28px;
    font-size: 13px;
    color: var(--text-mute);
}

.btn-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    margin-top: 16px;
    padding: 18px 28px;
    border-radius: var(--radius);
    background-color: var(--text);
    color: var(--bg);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    transition: background-color .3s, transform .3s var(--ease);
}

.btn-whatsapp:hover {
    background-color: var(--accent);
    transform: translateY(-2px);
}

.btn-whatsapp svg {
    flex: none;
}

.producto-nota {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-mute);
}

.specs {
    margin: 40px 0 0;
    border-top: 1px solid var(--line);
}

.specs div {
    display: grid;
    grid-template-columns: 9.5em 1fr;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}

.specs dt {
    color: var(--text-mute);
}

.specs dd {
    margin: 0;
    color: var(--text-soft);
}

.relacionados {
    padding: 120px 0;
}

.vacio {
    padding: 120px 0;
    max-width: 560px;
}

.vacio p:not(.eyebrow) {
    color: var(--text-soft);
}

/* Ficha en tablet y móvil: la vista 3D arriba, opciones abajo */
@media (max-width: 900px) {
    .producto-grilla {
        grid-template-columns: 1fr;
    }

    /* Más bajo en móvil: deja lugar arriba y abajo para scrollear la página */
    .visor {
        position: relative;
        top: 0;
        aspect-ratio: 1 / 0.8;
        max-height: 56vh;
    }

    .relacionados {
        padding: 88px 0;
    }
}

@media (max-width: 760px) {
    .specs div {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .grilla {
        margin-bottom: 88px;
    }
}

/* ==========================================================
   FOOTER
   ========================================================== */
.footer {
    padding: 72px 0 32px;
    background-color: #0a0706;
    border-top: 1px solid var(--line);
}

.footer-grilla {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
    gap: 40px;
}

.footer-marca p {
    max-width: 280px;
    margin-top: 18px;
    font-size: 14px;
    color: var(--text-mute);
}

.footer-titulo {
    margin-bottom: 16px;
    font-size: 11px;
    letter-spacing: .24em;
    text-transform: uppercase;
    color: var(--text-mute);
}

.footer-col ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-col li + li {
    margin-top: 10px;
}

.footer-col a {
    font-size: 14px;
    color: var(--text-soft);
    transition: color .25s;
}

.footer-col a:hover {
    color: var(--accent);
}

.footer-redes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px !important;
}

.footer-redes li + li {
    margin-top: 0;
}

.footer-red {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: border-color .25s, color .25s;
}

.footer-red svg {
    width: 17px;
    height: 17px;
}

.footer-red:hover {
    border-color: var(--accent);
}

.footer-base {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    margin-top: 56px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.footer-base small {
    font-size: 12px;
    letter-spacing: .04em;
    color: var(--text-mute);
}

@media (max-width: 900px) {
    .footer-grilla {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-marca {
        grid-column: 1 / -1;
    }
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */

/* Tablet */
@media (max-width: 1024px) {
    .nav-links {
        gap: 40px;
    }

    .hero-content {
        padding-left: var(--gutter);
    }

    .hero-background {
        right: -8%;
        width: 74vw;
        transform: translateY(-22%);
    }

    .scroll-hint {
        display: none;
    }
}

/* Móvil: solo logo + hamburguesa, la pieza va debajo del texto */
@media (max-width: 760px) {
    :root {
        --header-height: 72px;
    }

    .header.scrolled {
        --header-height: 60px;
    }

    .logo {
        font-size: 17px;
    }

    .nav-links {
        display: none;
    }

    #hero {
        align-items: flex-start;
        /* En móvil la foto se ampliaba demasiado (se veía pixelada y con bandas).
           En su lugar, una "luz de estudio" hecha con degradados: nítida en
           cualquier pantalla y sin peso de descarga. */
        background-image:
            radial-gradient(ellipse 80% 22% at 50% 72%, rgba(130, 80, 46, .16), transparent 70%),
            radial-gradient(ellipse 120% 60% at 30% 30%, rgba(52, 34, 24, .28), transparent 70%),
            linear-gradient(180deg, #0f0b08 0%, #140e0b 62%, #191210 76%, #0e0a08 100%);
        background-size: auto;
    }

    #hero::before {
        background:
            linear-gradient(180deg, rgba(15, 11, 9, .55) 0%, rgba(15, 11, 9, .2) 40%, transparent 60%, rgba(15, 11, 9, .75) 100%);
    }

    .hero-content {
        padding-top: calc(var(--header-height) + 40px);
        padding-bottom: 0;
    }

    .hero-content h1 {
        margin: 16px 0 18px;
    }

    .link-cta {
        margin-top: 32px;
    }

    /* La pieza se achica junto con la pantalla y queda centrada con aire a los lados */
    .hero-background {
        top: auto;
        bottom: clamp(90px, 14vh, 130px);
        right: auto;
        left: 50%;
        width: clamp(260px, 72vw + 40px, 600px);
        transform: translateX(-50%);
        -webkit-mask-image: none;
        mask-image: none;
    }

    .hero-dots {
        bottom: 36px;
    }

    .hero-pieza-nombre {
        bottom: 37px;
    }

    .scroll-hint {
        display: none;
    }

    .seccion {
        padding: 88px 0;
    }
}

/* Pantallas bajas (laptops chicas, móvil horizontal) */
@media (max-height: 640px) and (min-width: 761px) {
    .hero-content h1 {
        font-size: clamp(40px, 5.2vw, 72px);
    }

    .link-cta {
        margin-top: 32px;
    }

    .scroll-hint {
        display: none;
    }
}

/* Accesibilidad: menos movimiento si el usuario lo pide */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}
