/* SCH · producto.css — ficha de producto. Depende de base.css (tokens, .sch-size, .sch-price, .sch-sheet, .sch-buybar). */

/* ---------- Página ---------- */
.sch-body--producto .sch-dock { display: none; }
.sch-body--producto { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.sch-body--producto .sch-woo { padding-top: 0; }
.sch-body--producto .sch-crumbs { padding-bottom: 10px; }

.sch-product { display: block; }
.sch-product__top { display: grid; gap: var(--sch-s-5); }
.sch-product__buy { min-width: 0; }
.sch-product__more { display: grid; gap: var(--sch-s-6); margin-top: var(--sch-s-7); }
.sch-product__col { min-width: 0; }
.sch-product__col > .sch-block:first-child { border-top: var(--sch-rule); padding-top: var(--sch-s-5); }

/* ---------- Galería ---------- */
.sch-gallery { position: relative; margin-inline: calc(var(--sch-gutter) * -1); }
.sch-gallery__track {
  display: flex;
  gap: 2px;
  padding-inline: var(--sch-gutter);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--sch-gutter);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.sch-gallery__track::-webkit-scrollbar { display: none; }
.sch-gallery__track:focus-visible { outline: 3px solid var(--sch-focus); outline-offset: -3px; }
.sch-gallery__slide {
  position: relative;
  flex: 0 0 84%;
  margin: 0;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  scroll-snap-align: start;
  background: var(--sch-photo);
}
.sch-gallery__img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sch-gallery__slide--brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 12px;
  padding: var(--sch-s-4);
  background: var(--sch-ink);
  color: var(--sch-on-ink);
  --sch-focus: #fff;
}
.sch-gallery__kicker { margin-bottom: auto; color: var(--sch-on-ink); opacity: 0.8; }
.sch-gallery__ask { font-size: 0.9375rem; line-height: 1.4; text-wrap: pretty; }
.sch-gallery__count {
  position: absolute;
  left: var(--sch-gutter);
  bottom: 0;
  z-index: 2;
  padding: 5px 8px 4px;
  background: var(--sch-ink);
  color: var(--sch-on-ink);
  font-size: var(--sch-fs-11);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sch-gallery__flag {
  position: absolute;
  top: 10px;
  left: var(--sch-gutter);
  z-index: 2;
  padding: 3px 8px;
  background: var(--sch-ink);
  color: var(--sch-on-ink);
  font-size: var(--sch-fs-11);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sch-gallery__flag--ultimo,
.sch-gallery__flag--ultimos { background: var(--sch-rojo); color: var(--sch-on-rojo); }
.sch-gallery__flag--proximo,
.sch-gallery__flag--agotado { background: var(--sch-paper); color: var(--sch-ink); box-shadow: inset 0 0 0 1.5px var(--sch-ink); }
.sch-gallery__thumbs {
  display: flex;
  gap: 6px;
  padding: 8px var(--sch-gutter) 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.sch-gallery__thumbs::-webkit-scrollbar { display: none; }
.sch-gallery__thumb {
  flex: none;
  width: 56px;
  height: 70px;
  padding: 0;
  border: 1.5px solid var(--sch-line);
  background: var(--sch-photo);
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--sch-fast);
}
.sch-gallery__thumb.is-active { border-color: var(--sch-ink); border-width: 2px; }
.sch-gallery__thumb:focus-visible { outline: 3px solid var(--sch-focus); outline-offset: 2px; }
.sch-gallery__thumb-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sch-product--agotado .sch-gallery__slide:not(.sch-gallery__slide--brand) .sch-gallery__img { filter: grayscale(0.55); }

/* ---------- Encabezado de la compra ---------- */
.sch-product__head .sch-kicker { display: flex; flex-wrap: wrap; gap: 0 6px; margin-bottom: 8px; color: var(--sch-gray-700); }
.sch-product__name {
  font-size: clamp(2.5rem, 12vw, 4rem);
  font-stretch: 62%;
  font-weight: 900;
  line-height: 0.95;
  text-transform: uppercase;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.sch-product__desc { margin-top: var(--sch-s-2); color: var(--sch-gray-700); font-size: 0.9375rem; }
.sch-product__desc > * + * { margin-top: 8px; }
.sch-product__buy .sch-price,
.sch-product__buy .sch-alert { margin-top: var(--sch-s-4); }
.sch-product__buy .sch-price__legal { margin-top: 8px; }

/* ---------- Talles ---------- */
.sch-buy { display: grid; gap: 10px; min-width: 0; margin: var(--sch-s-5) 0 0; padding: 0; border: 0; }
.sch-buy__legend { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; width: 100%; margin-bottom: 2px; }
.sch-buy__legend-text {
  font-size: var(--sch-fs-11);
  font-stretch: 125%;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sch-buy__numeracion { color: var(--sch-gray-700); }
.sch-buy__guia { flex: none; font-size: var(--sch-fs-12); }
.sch-buy__grid.sch-sizes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.sch-buy.is-missing .sch-buy__grid { outline: 2px solid var(--sch-alert); outline-offset: 5px; }
.sch-sizes--ficha .sch-size__box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 66px;
  height: auto;
  padding: 8px 4px;
  text-align: center;
  transition: background var(--sch-fast), color var(--sch-fast), border-color var(--sch-fast);
}
.sch-sizes--ficha .sch-size__num { font-size: 1.625rem; font-stretch: 62%; font-weight: 900; line-height: 1; }
.sch-sizes--ficha .sch-size__stock {
  position: static;
  margin: 0;
  font-size: var(--sch-fs-11);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: normal;
  color: var(--sch-gray-700);
}
.sch-sizes--ficha .sch-size--ultimo .sch-size__box { border-color: var(--sch-rojo); }
.sch-sizes--ficha .sch-size--ultimo .sch-size__stock { color: var(--sch-rojo); }
.sch-sizes--ficha .sch-size--pocos .sch-size__stock { color: var(--sch-ink); }
.sch-sizes--ficha .sch-size__input:checked + .sch-size__box .sch-size__stock { color: var(--sch-on-ink); }
.sch-sizes--ficha .sch-size__input:disabled + .sch-size__box .sch-size__stock { color: var(--sch-gray-500); }
.sch-sizes--ficha .sch-size__input:disabled + .sch-size__box .sch-size__num { text-decoration: line-through; text-decoration-thickness: 2px; }
.sch-sizes--ficha .sch-size__input:not(:disabled) + .sch-size__box:hover { background: var(--sch-cream); }
.sch-sizes--ficha .sch-size__input:checked + .sch-size__box:hover { background: var(--sch-ink); }
.sch-product--proximo .sch-sizes--ficha .sch-size__input:disabled + .sch-size__box { background: var(--sch-paper); border-style: dashed; border-color: var(--sch-gray-500); }
.sch-product--proximo .sch-sizes--ficha .sch-size__input:disabled + .sch-size__box .sch-size__num { text-decoration: none; }
.sch-buy__chosen { min-height: 1.4em; margin: 0; font-size: var(--sch-fs-14); font-weight: 600; }
.sch-buy.is-missing .sch-buy__chosen { color: var(--sch-alert); }

.sch-buy__fit { display: flex; align-items: flex-start; gap: 8px; margin-top: var(--sch-s-4); color: var(--sch-gray-700); font-size: var(--sch-fs-14); line-height: 1.4; }
.sch-buy__fit-icon { margin-top: 1px; }
.sch-buy__fit .sch-link { color: var(--sch-ink); }

.sch-buy__actions { display: grid; gap: 10px; margin-top: var(--sch-s-4); }
.sch-buy__actions .sch-btn--lg { font-size: var(--sch-fs-16); }
.sch-buy__hint { margin: 0; color: var(--sch-gray-700); font-size: var(--sch-fs-12); line-height: 1.4; text-align: center; }
.sch-buy__otro { justify-self: center; font-size: var(--sch-fs-12); }

.sch-perks { margin: var(--sch-s-5) 0 0; padding: 0; border-top: var(--sch-hair); list-style: none; }
.sch-perks__item { display: flex; align-items: center; gap: 10px; padding-block: 10px; border-bottom: 1px solid var(--sch-line); font-size: var(--sch-fs-14); line-height: 1.3; }
.sch-perks__item > span:not(.sch-sello) { flex: 1; min-width: 0; }
.sch-perks__item .sch-sellos { flex: none; margin: 0; }

/* ---------- Bloques de abajo ---------- */
.sch-product__block .sch-block__title .sch-icon { width: 26px; height: 26px; }
.sch-product__block .sch-block__lead { max-width: 60ch; }
.sch-product__texto { max-width: 65ch; color: var(--sch-gray-700); }
.sch-product__texto > * + * { margin-top: 10px; }
.sch-product__specs,
.sch-product__tarifas { margin: var(--sch-s-4) 0 0; }
.sch-product__specs + .sch-product__tarifas { margin-top: var(--sch-s-4); }
.sch-product__texto + .sch-product__specs { margin-top: var(--sch-s-4); }
.sch-product__block dl,
.sch-product__block dt,
.sch-product__block dd { margin: 0; }
.sch-product__gratis { color: var(--sch-ok); }
.sch-product__plazo { margin-top: var(--sch-s-3); color: var(--sch-gray-700); font-size: var(--sch-fs-14); }
.sch-product__block-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px var(--sch-s-4); margin-top: var(--sch-s-4); font-size: var(--sch-fs-14); }
.sch-product__block-foot .sch-sellos { margin-left: auto; }
.sch-product__lista { margin: var(--sch-s-4) 0 0; padding: 0; list-style: none; font-size: var(--sch-fs-14); line-height: 1.45; }
.sch-product__lista li { padding-block: 10px; border-bottom: 1px solid var(--sch-line); }
.sch-product__lista li:first-child { padding-top: 0; }
.sch-product__lista strong { display: block; margin-bottom: 2px; font-size: var(--sch-fs-11); font-stretch: 125%; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------- Está en el local ---------- */
.sch-inlocal { display: grid; grid-template-columns: 112px 1fr; background: var(--sch-cream); }
.sch-inlocal__img { display: block; width: 100%; height: 100%; min-height: 240px; object-fit: cover; object-position: 60% 35%; }
.sch-inlocal__img--vacia { background: var(--sch-photo); }
.sch-inlocal__body { display: grid; align-content: start; justify-items: start; gap: 10px; padding: var(--sch-s-4); font-size: 0.9375rem; line-height: 1.4; }
.sch-inlocal__body .sch-kicker { margin-bottom: 0; }
.sch-inlocal__body > p { margin: 0; }
.sch-inlocal__title { font-size: var(--sch-fs-32); font-stretch: 62%; font-weight: 900; line-height: 1; text-transform: uppercase; }
.sch-inlocal__datos { display: grid; gap: 4px; margin: 0; font-size: var(--sch-fs-14); }
.sch-inlocal__datos > div { display: flex; align-items: flex-start; gap: 2px; }
.sch-inlocal__datos dt,
.sch-inlocal__datos dd { margin: 0; }
.sch-inlocal__datos dt { flex: none; }
.sch-inlocal__acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 8px var(--sch-s-4); margin-top: 4px; }

/* ---------- Relacionados ---------- */
.sch-product__related { margin-top: var(--sch-s-7); padding-bottom: 0; }

/* ---------- Barra fija (celular) ---------- */
.sch-buybar--producto { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.sch-buybar__info { display: grid; min-width: 0; gap: 2px; line-height: 1.1; }
.sch-buybar__price { font-size: var(--sch-fs-24); font-stretch: 62%; font-weight: 900; line-height: 1; }
.sch-buybar__size { overflow: hidden; color: var(--sch-gray-700); font-size: var(--sch-fs-12); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.sch-buybar__btn { min-height: 52px; padding-inline: 18px; }

/* ---------- Hoja de la guía de talles ---------- */
.sch-sheet--guia .sch-caja { padding: 0; border: 0; }
.sch-sheet--guia .sch-caja__titulo { display: none; }
.sch-sheet--guia .sch-caja__texto { font-size: var(--sch-fs-16); }
.sch-sheet--guia .sch-nota { margin-top: var(--sch-s-3); }
.sch-sheet--guia .sch-tabla { width: 100%; margin-top: var(--sch-s-4); border-collapse: collapse; }
.sch-sheet--guia .sch-caja__texto .sch-boton,
.sch-sheet--guia .sch-caja__texto > p:last-child .sch-btn { margin-top: var(--sch-s-3); }

/* ---------- Tablet ---------- */
@media (min-width: 600px) {
  .sch-buy__grid.sch-sizes { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .sch-inlocal { grid-template-columns: 180px 1fr; }
  .sch-inlocal__body { padding: var(--sch-s-5); }
  .sch-product__more { grid-template-columns: 1fr 1fr; align-items: start; }
  .sch-sheet--guia .sch-sheet__panel { max-width: 640px; }
}

/* ---------- Escritorio ---------- */
@media (min-width: 900px) {
  .sch-body--producto { padding-bottom: 0; }
  .sch-body--producto .sch-woo { padding-top: var(--sch-s-2); }
  .sch-product__top { grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); gap: var(--sch-s-7); align-items: start; }
  .sch-gallery { margin-inline: 0; }
  .sch-gallery__track { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px; padding: 0; overflow: visible; scroll-snap-type: none; }
  .sch-gallery__slide { flex: none; }
  .sch-gallery__slide--brand { display: none; padding: var(--sch-s-5); }
  .sch-gallery--odd .sch-gallery__slide--brand,
  .sch-gallery--vacia .sch-gallery__slide--brand { display: flex; }
  .sch-gallery__count,
  .sch-gallery__thumbs { display: none; }
  .sch-gallery__flag { left: 0; }
  .sch-product__buy { position: sticky; top: calc(var(--sch-header-h) + 16px); }
  .sch-product__name { font-size: clamp(2.75rem, 4.2vw, 4rem); }
  .sch-product__buy .sch-price__amount { font-size: 3rem; }
  .sch-buy__grid.sch-sizes { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .sch-product__more { gap: var(--sch-s-7); margin-top: var(--sch-s-8); }
  .sch-product__related { margin-top: var(--sch-s-8); }
  .sch-inlocal__img { min-height: 300px; }
}

@media (min-width: 1200px) {
  .sch-product__top { gap: var(--sch-s-8); }
  .sch-buy__grid.sch-sizes { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* Entre 900 y 1419 px el margen no alcanza para el flotante: caería sobre el botón de compra. La ficha ya tiene su propio enlace a WhatsApp. */
@media (min-width: 900px) and (max-width: 1419.98px) {
  .sch-body--producto .sch-wa-flotante { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sch-gallery__track { scroll-behavior: auto; }
}
