/*
 * Portadas aprobadas · 2026-10-16
 * Las maquetas ya integran ambiente, productos, apoyos y sombras. Esta hoja
 * coloca cada arte como una sola escena y conserva copy/CTA reales del CMS.
 */

/*
 * Reserva la portada antes de que se inicialice el CMS y adelanta la descarga
 * de la primera escena. Al montar las diapositivas, `:empty` deja de aplicar y
 * la misma imagen ya está disponible para el <picture> real.
 */
.hero-stage:empty {
  position: relative;
  min-height: clamp(650px, 50vw, 900px);
  overflow: hidden;
  background-color: #f8f3ec;
}

.hero-stage.hero-stage-official-loading:empty {
  background-image: url("../hero-reference/portfolio.png");
  background-image: -webkit-image-set(url("../hero-reference/portfolio.avif") type("image/avif"), url("../hero-reference/portfolio.png") type("image/png"));
  background-image: image-set(url("../hero-reference/portfolio.avif") type("image/avif"), url("../hero-reference/portfolio.png") type("image/png"));
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.hero-stage.hero-stage-official-loading:empty::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, #f8f3ec 0 34%, rgba(248,243,236,.94) 40%, transparent 48%);
  pointer-events: none;
}

html[data-theme="dark"] .hero-stage:empty {
  background-color: #071d22;
}

html[data-theme="dark"] .hero-stage.hero-stage-official-loading:empty {
  background-image: url("../hero-reference/portfolio-dark.png");
  background-image: -webkit-image-set(url("../hero-reference/portfolio-dark.avif") type("image/avif"), url("../hero-reference/portfolio-dark.png") type("image/png"));
  background-image: image-set(url("../hero-reference/portfolio-dark.avif") type("image/avif"), url("../hero-reference/portfolio-dark.png") type("image/png"));
}

html[data-theme="dark"] .hero-stage.hero-stage-official-loading:empty::after {
  background: linear-gradient(90deg, #071d22 0 34%, rgba(7,29,34,.94) 40%, transparent 48%);
}

.hero-slide.hero-product-slide:not(.hero-has-photo) {
  --hero-accent: #f1561f;
  --hero-panel: #f8f3ec;
  --hero-panel-dark: #071d22;
  --hero-ink: #07333a;
  --hero-muted: #334e52;
  position: relative;
  color: var(--hero-ink);
  background: var(--hero-panel);
  overflow: hidden;
}

/*
 * El carrusel alterna `hidden` de inmediato. Si estas portadas conservaran la
 * transición global de opacity, la saliente desaparecería antes de que la
 * entrante terminara de aparecer y quedaría un destello vacío entre escenas.
 */
.hero-stage > .hero-slide.hero-product-slide { transition: none; }

.hero-slide.hero-product-slide.hero-brand-brixil:not(.hero-has-photo) { --hero-accent: #0169ab; --hero-panel: #f5f6f3; }
.hero-slide.hero-product-slide.hero-brand-selecta:not(.hero-has-photo) { --hero-accent: #0a7260; --hero-panel: #f5f7ef; }
.hero-slide.hero-product-slide.hero-brand-toppet:not(.hero-has-photo),
.hero-slide.hero-product-slide.hero-brand-top-pet:not(.hero-has-photo) { --hero-accent: #67244f; --hero-panel: #f5eef0; }
.hero-slide.hero-product-slide.hero-brand-diclotrin:not(.hero-has-photo) { --hero-accent: #c42026; --hero-panel: #f7f3ed; }
.hero-slide.hero-product-slide.hero-brand-automotriz:not(.hero-has-photo),
.hero-slide.hero-product-slide.hero-brand-daytona:not(.hero-has-photo) { --hero-accent: #a75a00; --hero-panel: #f1eee8; }
.hero-slide.hero-product-slide.hero-brand-bobby:not(.hero-has-photo) { --hero-accent: #ce1a55; --hero-panel: #f8f2ed; }

.hero-product-slide .hero-layout {
  position: relative;
  display: block;
  width: 100%;
  max-width: none;
  min-height: clamp(650px, 50vw, 900px);
  margin: 0;
}

.hero-product-slide .hero-showcase,
.hero-product-slide .hero-showcase-scene,
.hero-product-slide .hero-scene-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-product-slide .hero-showcase { z-index: 0; min-width: 0; pointer-events: none; }
.hero-product-slide .hero-showcase-scene { overflow: hidden; background: var(--hero-panel); }
.hero-product-slide .hero-scene-media { display: block; }

.hero-product-slide .hero-scene-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--scene-position, center);
  filter: none;
  transform: none;
}

/* Oculta el copy de referencia sin tocar la mitad de productos. */
.hero-product-slide .hero-scene-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(90deg,
    var(--hero-panel) 0%,
    color-mix(in srgb, var(--hero-panel) 99%, transparent) 34%,
    color-mix(in srgb, var(--hero-panel) 94%, transparent) 40%,
    color-mix(in srgb, var(--hero-panel) 52%, transparent) 45%,
    transparent 50%);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(90deg, #000 0 42%, rgba(0,0,0,.55) 46%, transparent 51%);
  mask-image: linear-gradient(90deg, #000 0 42%, rgba(0,0,0,.55) 46%, transparent 51%);
}

.hero-product-slide.hero-brand-portfolio .hero-scene-shade {
  background: linear-gradient(90deg,
    var(--hero-panel) 0%,
    color-mix(in srgb, var(--hero-panel) 99%, transparent) 29%,
    color-mix(in srgb, var(--hero-panel) 91%, transparent) 34%,
    color-mix(in srgb, var(--hero-panel) 45%, transparent) 38%,
    transparent 43%);
  -webkit-mask-image: linear-gradient(90deg, #000 0 35%, rgba(0,0,0,.5) 39%, transparent 44%);
  mask-image: linear-gradient(90deg, #000 0 35%, rgba(0,0,0,.5) 39%, transparent 44%);
}

.hero-product-slide .hero-copy {
  position: absolute;
  top: 50%;
  left: clamp(44px, 5.55vw, 106px);
  z-index: 4;
  width: min(35vw, 570px);
  padding: 0;
  transform: translateY(-50%);
}

.hero-product-slide .hero-eyebrow { display: none; }

.hero-product-slide .hero-brand,
.hero-slide.hero-product-slide:not(.hero-has-photo) .hero-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0 0 clamp(24px, 2vw, 34px);
  color: var(--hero-ink);
  font-size: clamp(.78rem, .77vw, .94rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .25em;
  text-transform: uppercase;
}

.hero-product-slide .hero-brand::before {
  content: "";
  width: clamp(34px, 2.9vw, 54px);
  height: 3px;
  flex: 0 0 auto;
  border-radius: 99px;
  background: var(--hero-accent);
}

.hero-product-slide .hero-copy h1,
.hero-slide.hero-product-slide:not(.hero-has-photo) .hero-copy h1 {
  max-width: 100%;
  margin: 0 0 clamp(18px, 1.45vw, 28px);
  color: var(--hero-ink);
  font-size: clamp(3rem, 4.2vw, 5rem);
  font-weight: 850;
  line-height: .98;
  letter-spacing: -.055em;
  text-wrap: balance;
  text-shadow: none;
}

.hero-product-slide .hero-description,
.hero-slide.hero-product-slide:not(.hero-has-photo) .hero-description {
  max-width: 500px;
  margin: 0 0 clamp(24px, 2vw, 36px);
  color: var(--hero-muted);
  font-size: clamp(1rem, 1.08vw, 1.25rem);
  line-height: 1.55;
  text-shadow: none;
}

.hero-product-slide .hero-copy .button-row { gap: 0; }
.hero-slide.hero-product-slide:not(.hero-has-photo) .button-transparent { display: none; }

.hero-slide.hero-product-slide:not(.hero-has-photo) .button-white {
  min-height: clamp(50px, 3.2vw, 58px);
  padding: 13px clamp(22px, 1.8vw, 32px);
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--hero-accent);
  box-shadow: 0 13px 30px color-mix(in srgb, var(--hero-accent) 26%, transparent);
  font-size: clamp(.95rem, .95vw, 1.1rem);
  font-weight: 700;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.hero-slide.hero-product-slide:not(.hero-has-photo) .button-white:hover,
.hero-slide.hero-product-slide:not(.hero-has-photo) .button-white:focus-visible {
  color: #fff;
  filter: brightness(1.06);
  transform: translateY(-2px);
  box-shadow: 0 17px 36px color-mix(in srgb, var(--hero-accent) 34%, transparent);
}

.hero-slide.hero-product-slide:not(.hero-has-photo) .button-white .icon { width: 17px; height: 17px; }

/* Reproduce los saltos de línea de las siete maquetas. */
.hero-brand-portfolio .hero-copy { width: min(33vw, 545px); }
.hero-brand-brixil .hero-copy { width: min(34vw, 570px); }
.hero-brand-selecta .hero-copy { width: min(32vw, 525px); }
.hero-brand-toppet .hero-copy { width: min(34vw, 555px); }
.hero-brand-diclotrin .hero-copy { width: min(30vw, 470px); }
.hero-brand-automotriz .hero-copy { width: min(30vw, 470px); }
.hero-brand-bobby .hero-copy { width: min(30vw, 475px); }

@media (max-width: 1180px) {
  .hero-stage:empty { min-height: 660px; }
  .hero-product-slide .hero-layout { min-height: 660px; }
  .hero-product-slide .hero-copy { left: 40px; width: min(39vw, 500px); }
  .hero-brand-portfolio .hero-copy { width: min(37vw, 480px); }
  .hero-product-slide .hero-copy h1,
  .hero-slide.hero-product-slide:not(.hero-has-photo) .hero-copy h1 { font-size: clamp(2.75rem, 4.65vw, 3.75rem); }
}

@media (max-width: 820px) and (min-width: 651px) {
  .hero-stage:empty { min-height: 620px; }
  .hero-product-slide .hero-layout { min-height: 620px; }
  .hero-product-slide .hero-copy { left: 30px; width: 41vw; }
  .hero-product-slide .hero-copy h1,
  .hero-slide.hero-product-slide:not(.hero-has-photo) .hero-copy h1 { font-size: 2.7rem; }
  .hero-product-slide .hero-description,
  .hero-slide.hero-product-slide:not(.hero-has-photo) .hero-description { font-size: .98rem; }
  .hero-product-slide .hero-scene-shade {
    background: linear-gradient(90deg, var(--hero-panel) 0 40%, rgba(248,245,239,.84) 46%, transparent 56%);
    -webkit-mask-image: linear-gradient(90deg,#000 0 46%,transparent 58%);
    mask-image: linear-gradient(90deg,#000 0 46%,transparent 58%);
  }
}

@media (max-width: 650px) {
  .hero-stage:empty { min-height: clamp(520px, calc(84.5vw + 225px), 600px); }

  .hero-stage.hero-stage-official-loading:empty {
    background-image: url("../hero-reference/portfolio-mobile.png");
    background-image: -webkit-image-set(url("../hero-reference/portfolio-mobile.avif") type("image/avif"), url("../hero-reference/portfolio-mobile.png") type("image/png"));
    background-image: image-set(url("../hero-reference/portfolio-mobile.avif") type("image/avif"), url("../hero-reference/portfolio-mobile.png") type("image/png"));
    background-position: center bottom;
    background-size: 100% auto;
  }

  html[data-theme="dark"] .hero-stage.hero-stage-official-loading:empty {
    background-image: url("../hero-reference/portfolio-dark-mobile.png");
    background-image: -webkit-image-set(url("../hero-reference/portfolio-dark-mobile.avif") type("image/avif"), url("../hero-reference/portfolio-dark-mobile.png") type("image/png"));
    background-image: image-set(url("../hero-reference/portfolio-dark-mobile.avif") type("image/avif"), url("../hero-reference/portfolio-dark-mobile.png") type("image/png"));
  }

  .hero-stage.hero-stage-official-loading:empty::after { display: none; }
  .hero-slide.hero-product-slide:not(.hero-has-photo) { background: var(--hero-panel); }
  .hero-product-slide .hero-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 0;
  }

  .hero-product-slide .hero-copy,
  .hero-brand-portfolio .hero-copy,
  .hero-brand-brixil .hero-copy,
  .hero-brand-selecta .hero-copy,
  .hero-brand-toppet .hero-copy,
  .hero-brand-diclotrin .hero-copy,
  .hero-brand-automotriz .hero-copy,
  .hero-brand-bobby .hero-copy {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    order: 1;
    width: auto;
    margin: 18px 20px 10px;
    transform: none;
  }

  .hero-product-slide .hero-brand,
  .hero-slide.hero-product-slide:not(.hero-has-photo) .hero-brand {
    gap: 10px;
    margin-bottom: 12px;
    font-size: .69rem;
    letter-spacing: .18em;
  }

  .hero-product-slide .hero-brand::before { width: 31px; height: 2px; }

  .hero-product-slide .hero-copy h1,
  .hero-slide.hero-product-slide:not(.hero-has-photo) .hero-copy h1 {
    max-width: 360px;
    margin-bottom: 9px;
    font-size: clamp(1.8rem, 7.6vw, 2.05rem);
    line-height: 1;
    text-wrap: balance;
  }

  .hero-product-slide .hero-description,
  .hero-slide.hero-product-slide:not(.hero-has-photo) .hero-description {
    max-width: 355px;
    margin-bottom: 11px;
    font-size: clamp(.84rem, 3.35vw, .94rem);
    line-height: 1.38;
  }

  .hero-slide.hero-product-slide:not(.hero-has-photo) .button-white { min-height: 46px; padding: 10px 20px; font-size: .9rem; }

  .hero-product-slide .hero-showcase {
    position: relative;
    inset: auto;
    order: 2;
    width: 100%;
    height: auto;
  }

  .hero-product-slide .hero-showcase-scene {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    aspect-ratio: 1050 / 887;
  }

  .hero-product-slide.hero-brand-portfolio .hero-showcase-scene { aspect-ratio: 1174 / 887; }
  .hero-product-slide .hero-scene-media { position: absolute; inset: 0; }
  .hero-product-slide .hero-scene-image { object-fit: cover; object-position: var(--scene-position-mobile, center) center; }

  .hero-product-slide .hero-scene-shade,
  .hero-product-slide.hero-brand-portfolio .hero-scene-shade {
    display: none;
  }
}

@media (max-width: 390px) {
  .hero-stage:empty { min-height: clamp(505px, calc(84.5vw + 225px), 555px); }
  .hero-product-slide .hero-copy { margin: 16px 18px 8px; }
  .hero-product-slide .hero-copy h1,
  .hero-slide.hero-product-slide:not(.hero-has-photo) .hero-copy h1 { font-size: clamp(1.78rem, 7.6vw, 2rem); }
}

html[data-theme="dark"] .hero-slide.hero-product-slide:not(.hero-has-photo) {
  --hero-ink: #f8f4e9;
  --hero-muted: #d1d8d3;
  background: var(--hero-panel-dark);
}

html[data-theme="dark"] .hero-product-slide .hero-showcase-scene { background: var(--hero-panel-dark); }

html[data-theme="dark"] .hero-product-slide .hero-scene-shade,
html[data-theme="dark"] .hero-product-slide.hero-brand-portfolio .hero-scene-shade {
  background: linear-gradient(90deg,
    var(--hero-panel-dark) 0%,
    color-mix(in srgb, var(--hero-panel-dark) 99%, transparent) 36%,
    color-mix(in srgb, var(--hero-panel-dark) 86%, transparent) 42%,
    color-mix(in srgb, var(--hero-panel-dark) 42%, transparent) 47%,
    transparent 52%);
}

html[data-theme="dark"] .hero-product-slide .hero-copy h1,
html[data-theme="dark"] .hero-slide.hero-product-slide:not(.hero-has-photo) .hero-copy h1,
html[data-theme="dark"] .hero-product-slide .hero-brand,
html[data-theme="dark"] .hero-slide.hero-product-slide:not(.hero-has-photo) .hero-brand { color: var(--hero-ink); }

html[data-theme="dark"] .hero-product-slide .hero-description,
html[data-theme="dark"] .hero-slide.hero-product-slide:not(.hero-has-photo) .hero-description { color: var(--hero-muted); }

html[data-theme="dark"] .hero-slide.hero-product-slide:not(.hero-has-photo) .button-white {
  color: #fff;
  background: var(--hero-accent);
  box-shadow: 0 13px 30px color-mix(in srgb, var(--hero-accent) 32%, transparent);
}

html[data-theme="dark"] .hero-slide.hero-product-slide:not(.hero-has-photo) .button-white:hover,
html[data-theme="dark"] .hero-slide.hero-product-slide:not(.hero-has-photo) .button-white:focus-visible {
  color: #fff;
  background: var(--hero-accent);
  filter: brightness(1.12);
}

@media (max-width: 650px) {
  html[data-theme="dark"] .hero-product-slide .hero-scene-shade,
  html[data-theme="dark"] .hero-product-slide.hero-brand-portfolio .hero-scene-shade {
    display: none;
  }
}

/* La escena y su copy aparecen completos desde el primer fotograma. */
.hero-stage > .hero-product-slide:not([hidden]) .hero-scene-image,
.hero-stage > .hero-product-slide:not([hidden]) .hero-copy { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .hero-stage > .hero-product-slide:not([hidden]) .hero-scene-image,
  .hero-stage > .hero-product-slide:not([hidden]) .hero-copy { animation: none !important; }
  .hero-slide.hero-product-slide:not(.hero-has-photo) .button-white { transition: none; }
}

@media (forced-colors: active) {
  .hero-slide.hero-product-slide:not(.hero-has-photo) { color: CanvasText; background: Canvas; }
  .hero-product-slide .hero-scene-image { opacity: .18; filter: grayscale(1); }
  .hero-product-slide .hero-scene-shade { display: none; }
  .hero-product-slide .hero-copy h1,
  .hero-product-slide .hero-brand,
  .hero-product-slide .hero-description { color: CanvasText !important; }
  .hero-slide.hero-product-slide:not(.hero-has-photo) .button-white {
    border: 1px solid ButtonText;
    color: ButtonText;
    background: ButtonFace;
    box-shadow: none;
  }
}
