/* ===========================================================================
   IMD Industrial · componentes de página
   Las piezas que arman el inicio, el listado de servicios y el detalle de
   servicio. Ordenadas en el mismo orden en que aparecen en el inicio.
   =========================================================================== */

/* ===================================================== 1 · Portada (carrusel) */
.hero { position: relative; background: var(--navy); color: var(--white); isolation: isolate; overflow: hidden; }
.hero__slides { position: absolute; inset: 0; z-index: -1; }
.hero__slide { position: absolute; inset: 0; opacity: 0; transition: opacity 900ms var(--ease-out); }
.hero__slide.is-on { opacity: 1; }
.hero__slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 9s linear; }
.hero__slide.is-on img { transform: scale(1); }
.hero__slide::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 46, 86, .95) 0%, rgba(10, 46, 86, .88) 34%, rgba(10, 46, 86, .42) 68%, rgba(10, 46, 86, .3) 100%),
    linear-gradient(180deg, rgba(10, 46, 86, .55) 0%, rgba(10, 46, 86, 0) 32%);
}

.hero__in {
  min-height: min(72svh, 640px);
  display: flex; align-items: flex-start;   /* texto pegado al encabezado */
  padding-block: clamp(28px, 3vw, 44px) clamp(148px, 12vw, 176px);
}
/* Alineado arriba, pegado al encabezado. El alto reservado (el de la
   diapositiva más alta, ver fijarAlto en app.js) solo deja holgura abajo,
   y es pequeña porque los bloques .hx son compactos. */
.hero__copy { max-width: 48rem; display: flex; flex-direction: column; justify-content: flex-start; transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out); }
.hero__copy.is-out { opacity: 0; transform: translateY(10px); }
.hero__copy .display { margin-bottom: 20px; }
.hero__copy .lead { color: #DCEAFB; max-width: 48ch; }
.hero__btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* Bloque inferior de cada diapositiva (servicios, sectores, categorías) */
.hero__extra { margin-top: 28px; }
.hero__extra > :not(.is-on) { display: none; }   /* el alto total lo fija fijarAlto() en app.js */
.hx { display: grid; grid-template-columns: repeat(4, minmax(0, 190px)); gap: 10px; }
.hx__i {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 10px 12px;
  min-height: var(--hx-h, 0);   /* igualado entre diapositivas por fijarAlto() */
  border: 1px solid rgba(255, 255, 255, .22); border-radius: var(--radius-sm);
  background: rgba(10, 46, 86, .55); backdrop-filter: blur(3px);
  color: var(--white); text-decoration: none; text-align: left;
  font-size: .8125rem; font-weight: 600; line-height: 1.3;
  transition: background-color 160ms ease, border-color 160ms ease;
}
.hx__i svg { width: 24px; height: 24px; color: var(--celeste); }
a.hx__i:hover { background: var(--blue); border-color: var(--blue); }
.hx--prod .hx__i img { width: 40px; height: 40px; object-fit: contain; background: var(--white); border-radius: var(--radius-sm); padding: 4px; }

.hero__ctrl { position: absolute; left: 0; right: 0; bottom: clamp(76px, 8vw, 104px); z-index: 2; }
.hero__ctrl-in { display: flex; align-items: center; gap: 20px; }
.hero__bars { display: flex; gap: 10px; }
.hero__bar { position: relative; width: 58px; height: 22px; border: 0; padding: 0; background: none; cursor: pointer; }
.hero__bar::before, .hero__bar i { content: ""; position: absolute; left: 0; right: 0; top: 9px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .34); }
.hero__bar i { background: var(--celeste); transform-origin: left; transform: scaleX(0); }
.hero__bar.is-done i { transform: scaleX(1); }
.hero__bar.is-on i { animation: barFill var(--dur, 6500ms) linear forwards; }
.hero.is-paused .hero__bar.is-on i { animation-play-state: paused; }
@keyframes barFill { to { transform: scaleX(1); } }

.hero__arrows { display: flex; gap: 8px; margin-left: auto; }
.hero__arrow {
  width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .4);
  background: rgba(10, 46, 86, .3); color: var(--white); display: grid; place-items: center; cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, transform 160ms var(--ease-out);
}
.hero__arrow svg { width: 20px; height: 20px; }
.hero__arrow:hover { background: var(--blue); border-color: var(--blue); }
.hero__arrow:active { transform: scale(.94); }

/* ============================================ 2 · Franja de confianza */
.trust { position: relative; z-index: 3; margin-top: clamp(-72px, -5.5vw, -52px); }
/* 5 atributos: una fila en escritorio, 3 + 2 entre 1025 y 1280 px,
   2 + 2 + 1 en tablet (el último a todo el ancho), 1 columna en móvil.
   Las líneas divisorias son el fondo asomando por el gap de 1 px. */
.trust__grid {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px;
  background: var(--grey-2); border: 1px solid var(--grey-2); border-radius: var(--radius);
  box-shadow: var(--shadow-1); overflow: hidden;
}
.trust__i { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: center; padding: 22px 20px; background: var(--white); }
.trust__ico { width: 40px; height: 40px; color: var(--blue); }
.trust__ico svg { width: 100%; height: 100%; }
.trust__i b { display: block; font-size: 1.0625rem; font-weight: 700; color: var(--navy); line-height: 1.25; }
.trust__i span { display: block; color: var(--ink-soft); font-size: .9063rem; line-height: 1.45; margin-top: 3px; }

/* ================================= 3 · Servicios (grilla 3 / 2 / 1) */
.svcs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.svc {
  display: flex; flex-direction: column; background: var(--white);
  border: 1px solid var(--grey-2); border-radius: var(--radius); overflow: hidden;
  text-decoration: none; color: var(--navy);
  transition: transform 260ms var(--ease-out), box-shadow 260ms ease, border-color 220ms ease;
}
.svc__img { aspect-ratio: 16 / 10; overflow: hidden; background: var(--grey); position: relative; }
.svc__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease-out); }
.svc__ico {
  position: absolute; left: 16px; bottom: 16px; width: 48px; height: 48px; border-radius: var(--radius-sm);
  background: var(--white); color: var(--blue); display: grid; place-items: center; box-shadow: var(--shadow-1);
}
.svc__ico svg { width: 26px; height: 26px; }
.svc__num {
  position: absolute; right: 16px; top: 14px; font-size: .75rem; font-weight: 700; letter-spacing: .12em;
  color: var(--white); background: rgba(10, 46, 86, .72); padding: 5px 10px; border-radius: var(--radius-sm);
}
.svc__b { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.svc__b h3 { font-size: 1.125rem; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; }
.svc__b p { color: var(--ink-soft); font-size: .9688rem; line-height: 1.55; flex: 1; }
.svc__go { margin-top: 6px; }
.svc:active { transform: scale(.995); }
@media (hover: hover) and (pointer: fine) {
  .svc:hover { transform: translateY(-5px); box-shadow: var(--shadow-2); border-color: transparent; }
  .svc:hover .svc__img img { transform: scale(1.05); }
  .svc:hover .svc__go svg { transform: translateX(4px); }
}

/* ========================================== 4 · Productos destacados */
.prods { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.prods--home { grid-template-columns: repeat(5, minmax(0, 1fr)); }   /* 10 destacados = 2 filas */
.prod {
  display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 20px;
  background: var(--white); border: 1px solid var(--grey-2); border-radius: var(--radius);
  transition: box-shadow 240ms ease, transform 240ms var(--ease-out), border-color 200ms ease;
}
.prod__img {
  display: grid; place-items: center; aspect-ratio: 1; margin-bottom: 6px;
  background: var(--white); border-radius: var(--radius-sm); overflow: hidden;
}
.prod__img img { width: 100%; height: 100%; object-fit: contain; transition: transform 400ms var(--ease-out); }
.prod__ph { width: 40%; color: var(--grey-3); }
.prod__ph svg { width: 100%; height: auto; }
.prod__brand { font-size: .75rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--blue); }
.prod h3 { font-size: .9375rem; font-weight: 600; line-height: 1.35; color: var(--navy); flex: 1; }
.prod h3 a { color: inherit; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.prod h3 a:hover { color: var(--blue); }
.prod__sku { font-size: .8125rem; color: var(--ink-soft); }
.prod__price { font-size: 1.125rem; font-weight: 800; color: var(--navy); }
.prod__price small { font-size: .75rem; font-weight: 500; color: var(--ink-soft); }
.prod .btn { margin-top: 8px; width: 100%; }
/* Botón de la tarjeta: ícono de WhatsApp + "Cotizar" (el texto largo no
   entraba en tarjetas angostas). Si aun así faltara espacio, parte en dos
   líneas en vez de salirse del botón. */
.prod__wa { white-space: normal; text-align: center; line-height: 1.2; padding-inline: .75em; }
.prod__wa svg { width: 22px; height: 22px; }
@media (hover: hover) and (pointer: fine) { .prod:hover .prod__img img { transform: scale(1.04); } }

/* Accesos a las categorías del catálogo */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--grey-2); border-radius: 999px; background: var(--white);
  color: var(--navy); font-weight: 600; font-size: .9375rem; text-decoration: none;
  transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease;
}
.chip svg { width: 20px; height: 20px; color: var(--blue); }
.chip:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
@media (hover: hover) and (pointer: fine) {
  .prod:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); border-color: transparent; }
}

/* ======================================= 5 · Por qué elegir IMD */
.why__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.why__i { position: relative; background: var(--white); border-radius: var(--radius); padding: 28px 26px; border: 1px solid var(--grey-2); }
.why__i .why__ico { display: block; width: 52px; height: 52px; color: var(--blue); margin-bottom: 18px; }   /* referencia: ícono lineal sobre el título */
.why__ico svg { width: 100%; height: 100%; stroke-width: 1.4; }
.why__i .why__n { position: absolute; top: 24px; right: 26px; font-size: .8125rem; font-weight: 700; letter-spacing: .1em; color: var(--grey-3); }
.why__i b { display: block; font-size: 1.0625rem; color: var(--navy); margin-bottom: 8px; }
.why__i span { color: var(--ink-soft); font-size: .9688rem; line-height: 1.55; }
.why__i a { color: var(--blue); font-weight: 600; }

/* ==================================== 6 · Proyectos y trabajos realizados */
.inds { margin: 0; }
.inds__scroll { border-radius: var(--radius); overflow: hidden; background: var(--navy); }
.inds__scroll img { display: block; width: 100%; height: auto; }
.inds__hint { display: none; }

/* ======================================= 7 · Marcas que comercializamos */
/* Flex en vez de grid para centrar la última fila incompleta (13 marcas = 5+5+3).
   --cols: marcas por fila; el ancho descuenta los huecos de 16 px. */
.brands { --cols: 5; display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.brands > .brand { flex: 0 0 calc((100% - (var(--cols) - 1) * 16px) / var(--cols)); }
.brand {
  display: grid; place-items: center; min-height: 92px; padding: 16px 12px;
  background: var(--white); border: 1px solid var(--grey-2); border-radius: var(--radius);
  color: var(--ink-soft); font-weight: 700; font-size: 1.0313rem; letter-spacing: .01em;
  text-align: center; line-height: 1.2;
  transition: color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
a.brand { text-decoration: none; }
.brand img {
  max-height: 46px; max-width: 80%; width: auto; object-fit: contain;
  filter: grayscale(1) contrast(1.1); opacity: .78;      /* logos en gris, como la referencia */
  transition: filter 200ms ease, opacity 200ms ease;
}
.brand--txt { font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; color: #6B7A8F; }
@media (hover: hover) and (pointer: fine) {
  .brand:hover { color: var(--navy); border-color: var(--grey-3); box-shadow: var(--shadow-1); }
  .brand:hover img { filter: none; opacity: 1; }
}

/* =============================================== 8 · Franja de cotización */
.band { background: var(--navy); color: var(--white); }
.band__in { padding-block: clamp(44px, 5vw, 68px); display: flex; align-items: center; justify-content: space-between; gap: 28px 40px; flex-wrap: wrap; }
.band__in > div:first-child { flex: 1 1 420px; max-width: 62ch; }
.band h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem); font-weight: 700; letter-spacing: -.02em; }
.band p { color: var(--on-navy-soft); margin-top: 10px; max-width: 54ch; }
.band__btns { display: flex; gap: 12px; flex-wrap: wrap; flex: 0 1 auto; }

/* ======================================= 9 · Contacto (tarjetas de datos) */
.contact__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.contact__i { background: var(--white); border: 1px solid var(--grey-2); border-radius: var(--radius); padding: 28px 26px; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 16px; align-items: start; }
.contact__i svg { width: 24px; height: 24px; color: var(--blue); margin-top: 2px; }
.contact__i b { display: block; color: var(--navy); margin-bottom: 6px; }
.contact__i span { color: var(--ink-soft); font-size: .9688rem; line-height: 1.6; }
.contact__i a { color: var(--ink-soft); }
.contact__i a:hover { color: var(--blue); }

/* ======================================= Página de detalle de servicio */
.phead { background: var(--navy); color: var(--white); position: relative; isolation: isolate; overflow: hidden; }
.phead__bg { position: absolute; inset: 0; z-index: -1; }
.phead__bg img { width: 100%; height: 100%; object-fit: cover; }
.phead__bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 46, 86, .96) 0%, rgba(10, 46, 86, .86) 44%, rgba(10, 46, 86, .5) 100%); }
.phead__in { padding-block: clamp(28px, 4vw, 40px) clamp(48px, 6vw, 80px); }
.phead__t { font-size: clamp(1.875rem, 1.4rem + 2vw, 3rem); font-weight: 800; letter-spacing: -.025em; line-height: 1.08; max-width: 20ch; }
.phead__d { color: #DCEAFB; font-size: var(--t-lead); margin-top: 18px; max-width: 60ch; }
.phead__btns { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.phead__ico { width: 54px; height: 54px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .12); color: var(--celeste); display: grid; place-items: center; margin-bottom: 20px; }
.phead__ico svg { width: 30px; height: 30px; }

.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .875rem; color: var(--on-navy-soft); margin-bottom: 26px; }
.crumbs a { color: var(--on-navy-soft); text-decoration: none; }
.crumbs a:hover { color: var(--white); text-decoration: underline; }
.crumbs span[aria-hidden] { opacity: .5; }
.crumbs b { font-weight: 600; color: var(--white); }

.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(32px, 4vw, 64px); align-items: start; }
.detail__main { min-width: 0; }
.block + .block { margin-top: clamp(40px, 4vw, 56px); }
.block__h { font-size: clamp(1.25rem, 1.1rem + .7vw, 1.625rem); font-weight: 700; letter-spacing: -.02em; color: var(--navy); margin-bottom: 20px; }
.block__p { color: var(--ink-soft); font-size: var(--t-lead); line-height: 1.65; max-width: 68ch; }
.block__p + .block__p { margin-top: 14px; }

.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ticks--2 { grid-template-columns: 1fr 1fr; gap: 12px 28px; }
.ticks li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; align-items: start; color: var(--ink-soft); line-height: 1.5; }
.ticks svg { width: 22px; height: 22px; color: var(--blue); margin-top: 1px; }

.benefit { background: var(--blue-soft); border-left: 4px solid var(--blue); border-radius: var(--radius-sm); padding: 24px 26px; color: var(--navy); font-size: var(--t-lead); line-height: 1.6; }

.gal { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.gal button { padding: 0; border: 0; background: var(--grey); border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; cursor: zoom-in; display: block; }
.gal img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms var(--ease-out); }
.gal button:hover img { transform: scale(1.06); }

.aside { position: sticky; top: calc(var(--hdr-h) + 16px); display: grid; gap: 16px; }
.qcard { background: var(--navy); color: var(--white); border-radius: var(--radius); padding: 28px 26px; }
.qcard h2 { font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; }
.qcard p { color: var(--on-navy-soft); font-size: .9375rem; margin-top: 10px; line-height: 1.55; }
.qcard .btn { width: 100%; margin-top: 20px; }
.qcard__wa { margin-top: 10px; }
.qcard__dl { margin: 20px 0 0; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .16); display: grid; gap: 12px; font-size: .875rem; }
.qcard__dl div { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; color: var(--on-navy-soft); }
.qcard__dl dd { margin: 0; line-height: 1.5; }
.qcard__dl svg { width: 18px; height: 18px; color: var(--celeste); margin-top: 2px; }
.qcard__dl a { color: var(--white); text-decoration: none; }
.qcard__dl a:hover { text-decoration: underline; }

.rel { background: var(--grey); border-radius: var(--radius); padding: 24px 22px; }
.rel h2 { font-size: 1.0625rem; font-weight: 700; color: var(--navy); margin-bottom: 14px; }
.rel ul { list-style: none; margin: 0; padding: 0; display: grid; }
.rel li + li { border-top: 1px solid var(--grey-2); }
.rel a { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; align-items: center; padding: 13px 0; text-decoration: none; color: var(--navy); font-weight: 600; font-size: .9375rem; line-height: 1.35; transition: color 160ms ease; }
.rel svg { width: 24px; height: 24px; color: var(--blue); }
.rel a:hover { color: var(--blue); }

/* ------------------------------------------------------------- Responsive */
@media (max-width: 1280px) {
  .trust__grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .trust__i { grid-column: span 2; }
  .trust__i:nth-child(n+4) { grid-column: span 3; }
}
@media (max-width: 1180px) {
  .prods, .prods--home { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .brands { --cols: 4; }
  .detail { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 1024px) {
  .hero__in { min-height: 0; }   /* tablet: el alto lo da el contenido */
  .trust { margin-top: 0; padding-top: clamp(40px, 5vw, 64px); }
  .trust__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trust__i, .trust__i:nth-child(n+4) { grid-column: auto; }
  .trust__i:last-child { grid-column: 1 / -1; }
  .svcs { grid-template-columns: repeat(2, minmax(0, 1fr)); }   /* tablet: 2 columnas */
  .prods, .prods--home { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .why__grid, .contact__grid { grid-template-columns: 1fr; }
  .detail { grid-template-columns: minmax(0, 1fr); }
  .aside { position: static; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .hero__in { min-height: 0; padding-block: 24px 124px; }
  .hero__extra { display: none !important; }   /* móvil: solo texto y botones */
  .prods, .prods--home { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .hero__arrows { display: none; }
  .hero__btns .btn { flex: 1 1 auto; }
  .trust__grid { grid-template-columns: 1fr; }
  .trust__i:last-child { grid-column: auto; }
  .svcs { grid-template-columns: 1fr; }                          /* móvil: 1 columna */
  .prod { padding: 12px 12px 14px; }
  .brands { --cols: 2; }
  /* En celular la imagen se ve a 960 px y se desliza: los nombres de cada
     industria siguen legibles. */
  .inds__scroll { overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
  .inds__scroll img { width: 960px; max-width: none; }
  .inds__hint { display: block; margin-top: 10px; font-size: .875rem; color: var(--ink-soft); }
  .ticks--2 { grid-template-columns: 1fr; }
  .gal { grid-template-columns: 1fr 1fr; }
  .aside { grid-template-columns: 1fr; }
  .band__in { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__slide { transition: none; }
  .hero__slide:not(.is-on) { display: none; }
  .hero__slide img { transform: none; transition: none; }
}
