/* ==========================================================
   Ibarra House Body Shop — sections.css
   Hero con video, mosaico (dashboard), bandas, proceso, servicios,
   TikTok, reseñas, CTA final, footer, héroes internos y bloques
   ========================================================== */

.ih-section { padding-block: var(--ih-section); position: relative; }
.ih-section--tight { padding-block: clamp(3rem, 6vw, 5rem); }
.ih-head { margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.ih-head .ih-badge { margin-bottom: 1.25rem; }
.ih-head .ih-lead { margin-top: 1rem; }

/* ---------- Estados iniciales de animación (solo con JS) ---------- */
.js [data-reveal] { opacity: 0; }
.js [data-reveal="up"] { transform: translateY(46px); }
.js [data-reveal="img"] { transform: translateX(-36px) scale(1.06); filter: blur(14px); }
.js [data-reveal="img-r"] { transform: translateX(36px) scale(1.06); filter: blur(14px); }
.ih-ready [data-reveal], .ih-fallback [data-reveal] { opacity: 1; transform: none; filter: none; }
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1 !important; transform: none !important; filter: none !important; }
}

/* ---------- Hero del home ---------- */
.ih-hero {
  position: relative;
  min-height: 100svh;
  min-height: max(640px, 100svh);
  display: flex;
  align-items: flex-end;
  padding: 9rem 0 clamp(3rem, 7vh, 5.5rem);
  overflow: hidden;
  isolation: isolate;
}
.ih-hero__bg { position: absolute; inset: 0; z-index: -2; }
.ih-hero__bg video,
.ih-hero__bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ih-hero__bg::after {
  /* Capa negra al 80 % sobre el video (ajusta --ih-hero-veil para más o menos opacidad) */
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0) 70%, #000 100%),
    rgba(0, 0, 0, var(--ih-hero-veil, .8));
}
/* Respaldo cuando aún no hay video: cabina de pintura con haces de luz */
.ih-booth {
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(ellipse 60% 50% at 72% 58%, rgba(222, 43, 65, .35), transparent 70%),
    radial-gradient(ellipse 40% 30% at 20% 20%, rgba(255, 255, 255, .06), transparent 70%),
    var(--ih-n0);
  overflow: hidden;
}
.ih-booth::before,
.ih-booth::after {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  width: 22%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .07), transparent);
  transform: skewX(-18deg);
  animation: ih-beam 7s linear infinite;
}
.ih-booth::after { animation-delay: -3.5s; width: 12%; }
@keyframes ih-beam { from { left: -30%; } to { left: 120%; } }
.ih-booth__car {
  position: absolute;
  right: -6%;
  bottom: 6%;
  width: min(1100px, 92%);
  opacity: .9;
}
.ih-booth__car svg { width: 100%; height: auto; display: block; }

.ih-hero__in { position: relative; width: 100%; }
.ih-hero .ih-lead { color: rgba(255, 255, 255, .86); margin: 1.5rem 0 2rem; }
.ih-hero__place { display: flex; align-items: center; gap: .5rem; color: rgba(255, 255, 255, .78); font-size: .9375rem; margin-bottom: 1.25rem; }
.ih-hero__place .ih-i { color: var(--ih-red-hot); }
.ih-hero .ih-pause { right: max(1rem, env(safe-area-inset-right)); bottom: calc(var(--ih-bar-h) + 1rem); }
@media (min-width: 992px) { .ih-hero .ih-pause { bottom: 2rem; right: 2rem; } }

.ih-scroll {
  display: none;
  position: absolute;
  left: 50%;
  bottom: 1.5rem;
  width: 26px;
  height: 42px;
  margin-left: -13px;
  border: 1.5px solid rgba(255, 255, 255, .5);
  border-radius: 14px;
}
.ih-scroll::after {
  content: "";
  position: absolute;
  left: 50%; top: 8px;
  width: 4px; height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: #fff;
  animation: ih-scroll 1.8s var(--ih-ease) infinite;
}
@keyframes ih-scroll { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }
@media (min-width: 992px) { .ih-scroll { display: block; } }

/* ---------- Mosaico (dashboard) ---------- */
.ih-bento {
  display: grid;
  gap: var(--ih-gap);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "ab ab"
    "st st"
    "tt fb"
    "tm tm"
    "sv tr"
    "ct ct"
    "ll rv";
}
.ih-bento > [data-area="ab"] { grid-area: ab; min-height: 420px; }
.ih-bento > [data-area="st"] { grid-area: st; }
.ih-bento > [data-area="tt"] { grid-area: tt; }
.ih-bento > [data-area="fb"] { grid-area: fb; }
.ih-bento > [data-area="tm"] { grid-area: tm; min-height: 460px; }
.ih-bento > [data-area="sv"] { grid-area: sv; min-height: 240px; }
.ih-bento > [data-area="tr"] { grid-area: tr; min-height: 240px; }
.ih-bento > [data-area="ct"] { grid-area: ct; min-height: 220px; }
.ih-bento > [data-area="ll"] { grid-area: ll; min-height: 180px; }
.ih-bento > [data-area="rv"] { grid-area: rv; min-height: 180px; }

@media (min-width: 768px) {
  .ih-bento {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-areas:
      "ab ab ab ab"
      "st st tt fb"
      "tm tm sv sv"
      "tm tm tr tr"
      "ct ct ll rv";
  }
  .ih-bento > [data-area="ab"] { min-height: 460px; }
}
@media (min-width: 1200px) {
  .ih-bento {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: minmax(132px, auto) minmax(360px, auto) minmax(340px, auto) minmax(250px, auto);
    grid-template-areas:
      "ab ab ab ab ab ab ab ab tt fb st st"
      "ab ab ab ab ab ab ab ab tm tm tm tm"
      "sv sv sv sv tr tr tr tr tm tm tm tm"
      "ct ct ct ct ct ct ll ll ll rv rv rv";
  }
  .ih-bento > [data-area="ab"],
  .ih-bento > [data-area="tm"],
  .ih-bento > [data-area="sv"],
  .ih-bento > [data-area="tr"],
  .ih-bento > [data-area="ct"],
  .ih-bento > [data-area="ll"],
  .ih-bento > [data-area="rv"] { min-height: 0; }
  .ih-bento .ih-tile--sq { aspect-ratio: auto; }
}

/* Trabajo del mes */
.ih-tm__label { display: flex; align-items: center; justify-content: space-between; gap: 1rem; position: absolute; top: clamp(1.1rem, 2vw, 1.6rem); left: clamp(1.1rem, 2vw, 1.75rem); right: clamp(1.1rem, 2vw, 1.75rem); }
.ih-tm__label span { font-weight: 500; color: rgba(255, 255, 255, .85); }
.ih-tm__label .ih-i { color: var(--ih-red-hot); width: 22px; height: 22px; }

/* ---------- Banda de datos ---------- */
.ih-band { border-block: 1px solid var(--ih-n4); }
.ih-band .row > div + div { border-top: 1px solid var(--ih-n4); }
.ih-band__item { padding: clamp(1.5rem, 3vw, 2.5rem) 0; }
.ih-band__item p { color: var(--ih-text-2); margin: .5rem 0 0; max-width: 22ch; }
@media (min-width: 768px) {
  .ih-band .row > div + div { border-top: 0; border-left: 1px solid var(--ih-n4); }
  .ih-band__item { padding-inline: clamp(1rem, 2vw, 2rem); }
  .ih-band .row > div:first-child .ih-band__item { padding-left: 0; }
}

/* ---------- Proceso (secuencia real: numeración) ---------- */
.ih-steps { counter-reset: step; display: grid; gap: var(--ih-gap); }
@media (min-width: 768px) { .ih-steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .ih-steps { grid-template-columns: repeat(4, 1fr); } }
.ih-step {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--ih-radius);
  background: var(--ih-n3);
  border: 1px solid rgba(255, 255, 255, .05);
  overflow: hidden;
}
.ih-step .ih-media { aspect-ratio: 4 / 3; }
.ih-step__body { padding: 1.5rem; display: flex; flex-direction: column; gap: .75rem; flex: 1; }
.ih-step__n {
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--ih-red);
  font-family: var(--ih-font-display);
  font-weight: 800;
  font-size: 1.25rem;
}
.ih-step p { color: var(--ih-text-2); margin: 0; }

/* ---------- Riel de servicios (scroll con snap en móvil) ---------- */
.ih-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(82%, 360px);
  gap: var(--ih-gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--ih-n5) transparent;
}
.ih-rail > * { scroll-snap-align: start; }
.ih-rail .ih-tile { min-height: 440px; }
@media (min-width: 1200px) {
  .ih-rail { grid-auto-flow: row; grid-template-columns: repeat(5, 1fr); overflow: visible; }
  .ih-rail .ih-tile { min-height: 480px; }
}

/* ---------- TikTok ---------- */
.ih-reels { display: grid; gap: var(--ih-gap); grid-auto-flow: column; grid-auto-columns: min(62%, 260px); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 1rem; }
.ih-reels > * { scroll-snap-align: start; }
@media (min-width: 992px) { .ih-reels { grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); overflow: visible; } }
.ih-reels-empty {
  display: grid;
  gap: 1.25rem;
  align-items: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  border-radius: var(--ih-radius);
  border: 1px dashed var(--ih-n5);
}

/* ---------- CTA final ---------- */
.ih-cta {
  position: relative;
  border-radius: calc(var(--ih-radius) + 4px);
  overflow: hidden;
  isolation: isolate;
  padding: clamp(2rem, 6vw, 5rem);
  min-height: 480px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.ih-cta > .ih-media { position: absolute; inset: 0; z-index: -1; }
.ih-cta > .ih-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .85) 0%, rgba(0, 0, 0, .2) 75%); }
.ih-cta .ih-lead { color: rgba(255, 255, 255, .85); margin: 1.25rem 0 2rem; }

/* ---------- Héroe de páginas internas ---------- */
.ih-phero {
  position: relative;
  min-height: 74svh;
  min-height: max(560px, 74svh);
  display: flex;
  align-items: flex-end;
  padding: 9rem 0 clamp(2.5rem, 6vh, 4.5rem);
  isolation: isolate;
  overflow: hidden;
}
.ih-phero > .ih-media { position: absolute; inset: 0; z-index: -1; }
.ih-phero > .ih-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, .15) 35%, rgba(0, 0, 0, .6) 75%, #000 100%),
              linear-gradient(90deg, rgba(0, 0, 0, .55), transparent 70%);
}
.ih-phero .ih-lead { color: rgba(255, 255, 255, .86); margin-top: 1.25rem; }
.ih-crumbs { display: flex; gap: .5rem; flex-wrap: wrap; font-size: .9rem; color: var(--ih-text-3); margin-bottom: 1rem; padding: 0; list-style: none; }
.ih-crumbs a { color: var(--ih-text-2); text-decoration: none; }
.ih-crumbs a:hover { color: #fff; }
.ih-crumbs li + li::before { content: "/"; margin-right: .5rem; color: var(--ih-n6); }

/* ---------- Bloques foto + texto (servicios, nosotros) ---------- */
.ih-split { display: grid; gap: var(--ih-gap); align-items: stretch; }
.ih-split + .ih-split { margin-top: var(--ih-gap); }
@media (min-width: 992px) {
  .ih-split { grid-template-columns: 1.05fr 1fr; }
  .ih-split--rev > :first-child { order: 2; }
}
.ih-split__text {
  border-radius: var(--ih-radius);
  background: var(--ih-n3);
  border: 1px solid rgba(255, 255, 255, .05);
  padding: clamp(1.5rem, 4vw, 3rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}
.ih-split__media { border-radius: var(--ih-radius); min-height: 340px; aspect-ratio: 4 / 3; }
@media (min-width: 992px) { .ih-split__media { aspect-ratio: auto; min-height: 460px; } }
.ih-ticks { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .55rem; }
.ih-ticks li { display: flex; gap: .65rem; align-items: flex-start; color: var(--ih-text-2); }
.ih-ticks .ih-i { color: var(--ih-red-hot); margin-top: .15rem; }

/* Galería tipo mosaico */
.ih-gallery { display: grid; gap: var(--ih-gap); grid-template-columns: repeat(2, 1fr); }
.ih-gallery .ih-media { border-radius: var(--ih-radius); aspect-ratio: 1; }
.ih-gallery .ih-media--wide { grid-column: span 2; aspect-ratio: 2 / 1; }
@media (min-width: 992px) {
  .ih-gallery { grid-template-columns: repeat(4, 1fr); }
  .ih-gallery .ih-media--tall { grid-row: span 2; aspect-ratio: auto; }
}

/* Valores */
.ih-values { display: grid; gap: var(--ih-gap); }
@media (min-width: 768px) { .ih-values { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .ih-values { grid-template-columns: repeat(4, 1fr); } }
.ih-value { padding: clamp(1.5rem, 3vw, 2rem); border-radius: var(--ih-radius); background: var(--ih-n3); border: 1px solid rgba(255, 255, 255, .05); display: flex; flex-direction: column; gap: 1rem; }
.ih-value p { color: var(--ih-text-2); margin: 0; }

/* Superficie de lectura (negro más claro) */
.ih-read { background: var(--ih-n2); }

/* ---------- Contacto ---------- */
.ih-contact { display: grid; gap: var(--ih-gap); }
@media (min-width: 768px) { .ih-contact { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .ih-contact { grid-template-columns: repeat(4, 1fr); } }
.ih-contact .ih-tile { min-height: 210px; }
.ih-hours { width: 100%; border-collapse: collapse; }
.ih-hours td { padding: .8rem 0; border-bottom: 1px solid var(--ih-n5); color: var(--ih-text-2); }
.ih-hours td:last-child { text-align: right; color: var(--ih-text); }
.ih-hours tr.is-today td { color: #fff; font-weight: 600; }
.ih-hours tr.is-today td:first-child::after { content: "Hoy"; margin-left: .6rem; padding: .1rem .45rem; border-radius: 4px; background: var(--ih-red); font-size: .75rem; vertical-align: .1em; }

.ih-map {
  position: relative;
  min-height: 420px;
  border-radius: var(--ih-radius);
  overflow: hidden;
  background: var(--ih-carbon);
  background-color: #131315;
  background-size: 20px 20px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 2rem;
}
.ih-map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; filter: grayscale(.9) invert(.92) contrast(.9); }
.ih-map__in { position: relative; display: grid; gap: 1rem; justify-items: center; max-width: 34ch; }

/* Portada del cotizador con foto */
.ih-q-hero { position: relative; isolation: isolate; overflow: hidden; }
.ih-q-hero > .ih-media { position: absolute; inset: 0; z-index: -1; }
.ih-q-hero > .ih-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .7), rgba(0, 0, 0, .78) 60%, #000); }

/* ---------- Footer ---------- */
.ih-footer {
  position: relative;
  background: var(--ih-carbon);
  background-color: #131315;
  background-size: 20px 20px;
  padding: clamp(3.5rem, 7vw, 6rem) 0 2rem;
  isolation: isolate;
}
.ih-footer::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .82) 30%, rgba(0, 0, 0, .9) 100%); }
.ih-footer__logo img { width: 150px; height: 150px; }
.ih-footer h2 { font-family: var(--ih-font-display); font-weight: 800; font-size: 1.25rem; color: var(--ih-red-hot); margin: 0 0 .9rem; }
.ih-footer p, .ih-footer li { color: var(--ih-text-2); }
.ih-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.ih-footer a { color: var(--ih-text); text-decoration: none; }
.ih-footer a:hover { color: var(--ih-red-hot); }
.ih-footer__legal { margin-top: clamp(2.5rem, 5vw, 4rem); padding-top: 1.5rem; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; font-size: .875rem; color: var(--ih-text-3); }
.ih-footer__legal a { color: var(--ih-text-2); }
.ih-footer .ih-footer__big {
  /* Cintillo infinito: el texto se genera aquí, no hace falta tocar el HTML */
  position: relative;
  margin: 0 calc(50% - 50vw) clamp(2rem, 5vw, 4rem);
  overflow: hidden;
  font-size: 0;
  line-height: 0;
  color: transparent;
  white-space: nowrap;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ih-footer .ih-footer__big::before {
  content: "Ibarra House Oficial Bodyshop \2022\00a0 Ibarra House Oficial Bodyshop \2022\00a0 Ibarra House Oficial Bodyshop \2022\00a0 Ibarra House Oficial Bodyshop \2022\00a0 ";
  display: inline-block;
  padding-block: .06em .12em;
  font-family: var(--ih-font-display);
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(3.5rem, 12vw, 11rem);
  line-height: .9;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, .22);
  animation: ih-ticker 40s linear infinite;
  will-change: transform;
}
.ih-footer .ih-footer__big:hover::before { -webkit-text-stroke-color: rgba(222, 43, 65, .7); }
@keyframes ih-ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .ih-footer .ih-footer__big::before { animation: none; }
}

/* ---------- 404 ---------- */
.ih-404 { min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 8rem 1rem 4rem; }

/* ---------- Utilidades (sin estilos en línea, compatibles con la CSP) ---------- */
.ih-mw-12 { max-width: 12ch; }
.ih-mw-14 { max-width: 14ch; }
.ih-mw-16 { max-width: 16ch; }
.ih-mw-34 { max-width: 34ch; }
.ih-mw-72 { max-width: 72ch; }
.ih-legal { padding-top: 9rem; }
.ih-404__n { font-size: clamp(6rem, 20vw, 14rem); color: var(--ih-red); }
.ih-q-page { min-height: 70vh; }
.ih-ratio-43 { aspect-ratio: 4 / 3; border-radius: var(--ih-radius); }
