/*
 * Dueño: C2-Bb. La ficha del producto de NOCTTIVO (sections/at-bb-ficha.liquid y sus fragmentos at-bb-*).
 * Escrito de cero para Antropify. Los valores (medidas, colores, tiempos) se midieron en la tienda de la marca
 * (cliente-1/referencia, dibujada a 375 y 1280 px); los nombres y la forma de armarlo son nuestros.
 *
 * Los bloques de la marca (nbb, nbp y la descripción ncx) traen su propio CSS y se apoyan en lo que heredan de
 * la página: la letra del cuerpo, el contorno de los títulos, los links sin subrayado visible, los <summary> en
 * fila, las fotos al 100 % del ancho. Eso está acá, con la misma fuerza (especificidad) que tiene en la tienda,
 * así su CSS gana o pierde igual que allá.
 */

/* ── La sección: tres columnas (margen · contenido de hasta 1440 · margen) ───────────────────────── */
.at-ficha {
  --at-ficha-margen: var(--at-margen-pagina, 16px);
  --at-ficha-columna: min(1440px, calc(100% - var(--at-ficha-margen) * 2));
  position: relative;
  display: grid;
  grid-template-columns: minmax(var(--at-ficha-margen), 1fr) var(--at-ficha-columna) minmax(var(--at-ficha-margen), 1fr);
  width: 100%;
  color: #000;
  font-family: var(--at-fuente-cuerpo, Inter, sans-serif);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
}
@media (min-width: 750px) {
  .at-ficha { --at-ficha-margen: var(--at-margen-pagina, 40px); }
}

.at-ficha__saltar {
  position: absolute;
  left: -99999px;
  top: 0;
  z-index: 10;
  padding: 16px 24px;
  border-radius: 14px;
  background: #fff;
  color: #000;
}
.at-ficha__saltar:focus { left: var(--at-ficha-margen); }

/* En el celular la galería va de borde a borde y los detalles en la columna del medio. */
.at-ficha__rejilla {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
}
.at-ficha__medios { order: 0; grid-column: 1 / -1; width: 0; min-width: 100%; }
.at-ficha__detalles { order: 1; grid-column: 2 / 3; display: flex; align-self: start; justify-content: center; }

/* Desde 750 px: galería y detalles lado a lado. La columna de detalles toma lo que pida su contenido
   (la caja de confianza de la marca fija 572 px a 1280) y la galería el resto. */
@media (min-width: 750px) {
  .at-ficha__rejilla { grid-column: 2; grid-template-columns: 1fr min(50vw, 25rem); }
  .at-ficha__medios { grid-column: auto; padding-right: calc(var(--at-ficha-hueco, 48px) / 2); }
  .at-ficha__detalles {
    grid-column: auto;
    padding-left: calc(var(--at-ficha-hueco, 48px) / 2);
    position: sticky;
    top: 0;
    z-index: 1;
  }
}
@media (min-width: 1200px) {
  .at-ficha__rejilla { grid-template-columns: 2fr 1fr; }
}

/* ── La columna de detalles: 20 px arriba y abajo y 24 entre bloques en el celular; 24 y 28 desde 990 px ── */
.at-ficha__columna {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  padding-block: 20px;
}
@media (min-width: 990px) {
  .at-ficha__columna { gap: 28px; padding-block: 24px; }
}

.at-ficha__titulo { display: flex; flex-direction: column; width: 100%; }
.at-ficha__titulo h1 {
  width: 100%;
  max-inline-size: min(100%, 32.5em);
  margin: 0;
  color: #000;
  font-family: var(--at-fuente-titulo, Inter, sans-serif);
  font-size: 32px;
  font-weight: 700;
  font-style: normal;
  line-height: 1.1;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.at-ficha__divisor { width: 100%; height: 1px; background: var(--at-borde, #dfdfdf); }

/* ── Lo que heredan los bloques de la marca (la misma fuerza que en la tienda: un solo elemento) ── */
:where(.at-ficha__columna) a {
  color: currentColor;
  text-decoration-color: transparent;
  text-decoration-thickness: .075em;
  text-underline-offset: .125em;
  transition: text-decoration-color .125s ease-in-out, color .125s ease-in-out;
}
:where(.at-ficha__columna) summary {
  display: flex;
  align-items: center;
  padding-block: 11.2px;
  list-style: none;
  cursor: pointer;
}
:where(.at-ficha__columna) summary::-webkit-details-marker { display: none; }
:where(.at-ficha__columna) img { width: 100%; height: auto; }
/* los botones de la marca usan la letra y el color propios del navegador, salvo que su CSS diga otra cosa */
:where(.at-ficha__columna, #nct-sticky-atc, #nct-toast) button { font: revert; color: revert; }
:where(.at-ficha__columna) p:empty { display: none; }
:where(.at-ficha__columna) :is(p, h1, h2, h3, h4, h5, h6) { overflow-wrap: break-word; }
/* el primer párrafo o título de cada caja no empuja hacia arriba, ni el último hacia abajo */
:where(.at-ficha__columna) :is(p, h1, h2, h3, h4, h5, h6):first-child { margin-block-start: 0; }
:where(.at-ficha__columna) :is(p, h1, h2, h3, h4, h5, h6):last-child { margin-block-end: 0; }
/* un link dentro de un párrafo se ve subrayado; suelto, no */
:where(.at-ficha__columna) p:not(.h1, .h2, .h3, .h4, .h5, .h6) a:where(:not(.at-boton)) { text-decoration-color: currentColor; }

/* ── El botón de compra ─────────────────────────────────────────────────────────────────────────────
   Negro de 52 px de alto con radio 14; el CSS de la marca lo pinta verde, a 17 px y en 800. */
.at-compra { display: block; }
.at-compra__formulario { display: block; margin: 0; }
.at-compra__botones { display: flex; flex-direction: column; gap: 5.6px; }
@media (min-width: 750px) { .at-compra__botones { gap: 11.2px; } }
.at-compra__cantidad { display: flex; gap: 11.2px; }
.at-compra__boton {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4.8px;
  width: 100%;
  height: 52px;
  padding: 16px 24px;
  border: 0;
  border-radius: var(--at-boton-radio, 14px);
  background: #000;
  color: #fff;
  font-family: var(--at-fuente-cuerpo, Inter, sans-serif);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .125s ease-in-out, color .125s ease-in-out;
}
.at-compra__boton[aria-busy="true"] { cursor: progress; }
.at-compra__acelerado { display: block; }
.at-compra__acelerado:empty { display: block; }

/* La cantidad: escondida por la marca en la ficha; anda igual (cambia el número, el botón compra 1). */
.at-cantidad {
  display: flex;
  align-items: center;
  height: 52px;
  border: 1px solid var(--at-borde, #dfdfdf);
  border-radius: 14px;
  background: #fff;
  color: #333;
}
.at-cantidad__boton {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
.at-cantidad__boton[disabled] { opacity: .5; cursor: not-allowed; }
.at-cantidad__campo {
  width: 3ch;
  padding: 1px 2px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}
.at-cantidad__campo::-webkit-inner-spin-button,
.at-cantidad__campo::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ── La descripción (el texto largo de la marca, tal cual) ──────────────────────────────────────────
   Una columna flexible que corta los renglones «lindos» (text-wrap: pretty), con 0,5em entre párrafos y
   0,25em alrededor de los títulos salvo que el CSS de la marca diga otra cosa (gana el suyo, que va después). */
.at-ficha__descripcion {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  color: #000;
  text-wrap: pretty;
}
.at-ficha__descripcion > * {
  width: 100%;
  max-inline-size: min(100%, 32.5em);
  text-align: left;
}
/* texto con formato: listas con sangría de 1,5em y 1em abajo, el primer elemento sin margen arriba,
   los links de los párrafos y las listas subrayados */
.at-ficha__descripcion :is(ul, ol) { margin-block-start: 0; padding-inline-start: 1.5em; }
.at-ficha__descripcion ul:not(li ul),
.at-ficha__descripcion ol:not(li ol) { margin-block-end: 1em; }
.at-ficha__descripcion :is(p, h1, h2, h3, h4, h5, h6):first-child,
.at-ficha__descripcion :empty:first-child + :is(p, h1, h2, h3, h4, h5, h6) { margin-block-start: 0; }
.at-ficha__descripcion :is(p, ul, ol, table):not(.h1, .h2, .h3, .h4, .h5, .h6) a:where(:not(.at-boton)) { text-decoration-color: currentColor; }
/* y después, los márgenes del bloque de texto: 0,25em alrededor de los títulos y 0,5em entre párrafos */
.at-ficha__descripcion :is(h1, h2, h3, h4, h5, h6) { margin-block: .25em; }
.at-ficha__descripcion p { margin-block: .5em; }
.at-ficha__descripcion.at-ficha__descripcion > :last-child { margin-block-end: 0; }
.at-ficha__descripcion.at-ficha__descripcion > style + *,
.at-ficha__descripcion.at-ficha__descripcion > :first-child { margin-block-start: 0; }

/* ── La galería ─────────────────────────────────────────────────────────────────────────────────────
   Fija arriba mientras se recorre la columna de detalles. Fotos cuadradas, una por vez. */
.at-galeria { position: sticky; top: 0; z-index: 1; display: block; }
.at-galeria__carrusel { position: relative; display: flex; flex-direction: column; }
.at-galeria__marco { position: relative; display: block; overflow: hidden; background: #fff; }
.at-galeria__pista {
  position: relative;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.at-galeria__pista::-webkit-scrollbar { display: none; }
.at-galeria__foto {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  width: 100%;
  width: round(up, 100%, 1px);
  aspect-ratio: 1;
  margin-inline: auto;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  cursor: zoom-in;
}
.at-galeria__foto img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  object-position: center center;
  background: #fff;
}
@media (min-width: 750px) {
  .at-galeria__foto { max-height: max(500px, calc(100vh - var(--at-alto-encabezado, 66px))); }
}

/* Las flechas: blancas, por diferencia sobre la foto; solo desde 750 px. */
.at-galeria__flechas {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: none;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  mix-blend-mode: difference;
}
@media (min-width: 750px) { .at-galeria__flechas { display: flex; } }
.at-galeria__flecha {
  position: relative;
  display: block;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  cursor: pointer;
  pointer-events: auto;
}
.at-galeria__flecha--anterior { transform: scaleX(-1); }
.at-galeria__flecha .at-icono { position: absolute; top: 8.8px; left: 5.6px; width: 20px; height: 20px; }

/* Las miniaturas: 44 px, 8 entre sí, centradas; en el celular se deslizan. */
.at-galeria__controles {
  display: flex;
  flex-shrink: 0;
  width: 100%;
  min-height: 44px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.at-galeria__controles::-webkit-scrollbar { display: none; }
/* Cuando las miniaturas no entran (lo mide at-ficha.js con --at-bb-avance, de 0 % a 100 %), la punta que todavía
   esconde algo se apaga: la de adelante en su último 10 %; la de atrás, apenas se movió (se corta en el primer
   1 % y se enciende hasta el 10 %). Al final del recorrido la de adelante ya no se apaga. */
.at-galeria__controles[data-at-desborda] {
  --at-bb-mascara: linear-gradient(to right,
    transparent min(var(--at-bb-avance, 0%) * 100, 1%),
    #000 min(var(--at-bb-avance, 0%), 10%),
    #000 max(var(--at-bb-avance, 0%), 90%),
    transparent 100%);
  -webkit-mask-image: var(--at-bb-mascara);
  mask-image: var(--at-bb-mascara);
}
.at-galeria__miniaturas {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
  height: fit-content;
  margin-inline: auto;
  padding: 11.2px;
}
.at-galeria__miniatura {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: none;
  color: #000;
  cursor: pointer;
}
.at-galeria__miniatura img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.at-galeria__miniatura[aria-selected="true"] { outline: 1.5px solid currentColor; outline-offset: 1.4px; }

/* ── El zoom: la galería a pantalla completa ─────────────────────────────────────────────────────── */
.at-zoom {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: #fff;
  color: #000;
  overflow: hidden;
}
.at-zoom::backdrop { background: rgb(0 0 0 / .15); }
.at-zoom[open] { display: block; }
.at-zoom__lista {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  scrollbar-width: none;
}
.at-zoom__lista::-webkit-scrollbar { display: none; }
.at-zoom__foto { display: block; width: 100%; cursor: zoom-out; }
.at-zoom__foto img { display: block; width: 100%; height: auto; }
.at-zoom__cerrar {
  position: absolute;
  top: 13px;
  right: 13px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 1px solid #000;
  border-radius: 50%;
  background: #fff;
  color: #000;
  cursor: pointer;
}
.at-zoom__cerrar .at-icono { width: 13.6px; height: 13.6px; }
.at-zoom__miniaturas {
  position: fixed;
  top: 50%;
  right: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 76px;
  max-height: 80vh;
  padding: 16px;
  overflow-y: auto;
  transform: translateY(-50%);
  scrollbar-width: none;
}
.at-zoom__miniatura {
  display: block;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: #000;
  cursor: pointer;
}
.at-zoom__miniatura img { display: block; width: 100%; height: 100%; object-fit: cover; }
.at-zoom__miniatura[aria-selected="true"] { outline: 1.5px solid currentColor; outline-offset: 1.4px; }
@media (max-width: 749px) {
  .at-zoom__lista { display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; }
  .at-zoom__foto { flex: 0 0 100%; display: flex; align-items: center; scroll-snap-align: start; }
  .at-zoom__miniaturas { top: auto; bottom: 0; right: auto; left: 0; flex-direction: row; width: 100%; max-height: none; transform: none; overflow-x: auto; }
}

/* ── La barra fija del tema (aparece al pasar el botón de compra) ───────────────────────────────── */
.at-barra { display: contents; }
.at-barra__caja {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 14.4px;
  width: 600px;
  padding: 11.2px;
  border-radius: 25.2px;
  background: #fff;
  box-shadow: 0 4px 20px rgb(0 0 0 / .15);
  opacity: 0;
  transform: translate(-50%) translateY(calc(100% + 40px));
  transition-property: transform, opacity;
  transition-duration: .3s;
  transition-timing-function: cubic-bezier(.32, .72, 0, 1);
  pointer-events: none;
}
.at-barra__caja::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  border: 2px solid transparent;
  border-radius: inherit;
  background: linear-gradient(#fff 0 100%) padding-box, linear-gradient(rgb(0 0 0 / .15) 0 100%) border-box;
  -webkit-backdrop-filter: blur(20px) saturate(180%) brightness(1.5);
  backdrop-filter: blur(20px) saturate(180%) brightness(1.5);
}
.at-barra__caja[data-pegada="true"] { opacity: 1; transform: translate(-50%) translateY(0); pointer-events: auto; }
.at-barra__foto { flex-shrink: 0; width: 52px; height: 52px; aspect-ratio: 1; overflow: hidden; border-radius: 14px; background: #f5f5f5; }
.at-barra__foto img { display: block; width: 100%; height: 100%; object-fit: cover; }
.at-barra__info { flex: 1; min-width: 0; }
.at-barra__titulo { margin: 0; overflow: hidden; font-size: 14px; line-height: 1.6; text-overflow: ellipsis; white-space: nowrap; }
.at-barra__variante { margin-top: 2px; color: rgb(0 0 0 / .8); font-size: 14px; }
.at-barra__precio { flex-shrink: 0; font-size: 14px; }
.at-barra__importe, .at-barra__tachado { display: inline-block; }
.at-barra__tachado { color: rgb(0 0 0 / .8); white-space: nowrap; text-decoration-line: line-through; text-decoration-thickness: 1.5px; text-decoration-color: rgb(0 0 0 / .3); }
.at-barra__boton {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4.8px;
  height: 52px;
  padding: 16px 24px;
  border: 0;
  border-radius: 14px;
  background: #000;
  color: #fff;
  font-family: var(--at-fuente-cuerpo, Inter, sans-serif);
  font-size: 14px;
  line-height: 1.6;
  cursor: pointer;
}
.at-barra__boton .add-to-cart-text { display: flex; align-items: center; gap: 4.8px; }
@media (max-width: 749px) {
  .at-barra__caja { bottom: 0; width: 100%; border-radius: 0; }
  .at-barra__caja::before { inset: -1px; border-width: 1px; }
  .at-barra__tachado { display: none; }
  .at-barra__variante { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .at-barra__boton { width: 52px; padding: 16px; overflow: hidden; }
}

/* ── Íconos (dibujados para Antropify) ───────────────────────────────────────────────────────────── */
/* Solo los de la ficha (integración C2-B): sin el :where, en la ficha pintaba de negro los íconos del encabezado y de la lupa, que usan la misma clase. */
:where(.at-ficha, .at-barra, .at-zoom) .at-icono { display: inline-flex; flex-shrink: 0; width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--at-icono) center / contain no-repeat; mask: var(--at-icono) center / contain no-repeat; }
.at-icono--flecha { --at-icono: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.7 10H16M11.7 5.6L16.1 10L11.7 14.4'/%3E%3C/svg%3E"); }
.at-icono--mas { --at-icono: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23000'%3E%3Cpath d='M7 2.6V11.4M2.6 7.2H11.4' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E"); width: 13.6px; height: 13.6px; }
.at-icono--menos { --at-icono: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23000'%3E%3Cpath d='M2.2 7.2H11.8' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E"); width: 13.6px; height: 13.6px; }
.at-icono--cruz { --at-icono: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M3 3l10 10M13 3L3 13'/%3E%3C/svg%3E"); }
.at-icono--bolsa { --at-icono: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23000' stroke-width='1.4' stroke-linejoin='round'%3E%3Cpath d='M4 6.5h12l-1 10H5z'/%3E%3Cpath d='M7.5 8V5.5a2.5 2.5 0 0 1 5 0V8' stroke-linecap='round'/%3E%3C/svg%3E"); }

.at-ficha .at-oculto,
.at-barra .at-oculto,
.at-zoom .at-oculto {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* El error del botón (si el carrito no responde) y el tilde de «listo»: el script de la marca va directo al
   checkout, así que el tilde no se ve nunca; el error, solo si algo falla. */
.at-compra__error { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: #e00; font-size: 14px; }
.at-compra__error[hidden] { display: none; }
.at-compra__error .at-icono { width: 20px; height: 20px; }
.at-compra__listo { position: absolute; display: none; }
.at-icono--listo { --at-icono: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 10.5l3.2 3.2L15 7'/%3E%3C/svg%3E"); }
.at-icono--alerta { --at-icono: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Ccircle cx='7' cy='7' r='6.5' fill='%23000'/%3E%3Cpath d='M7 3.6v4.2' stroke='%23fff' stroke-width='1.5' stroke-linecap='round'/%3E%3Ccircle cx='7' cy='10.2' r='.9' fill='%23fff'/%3E%3C/svg%3E"); }
