/* ==========================================================================
   DIAMANTE — Hero oscuro (index.php)
   Calcado de proto/diamante-nexus-completo/css/diamante.css.
   Sin el padding-top de compensación del prototipo: ahí el header es
   position:fixed (flota sobre el contenido); acá .site-header es
   position:sticky (empuja el contenido, nunca lo tapa), así que no hace
   falta ese hueco artificial arriba.
   ========================================================================== */
@keyframes dm-rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dm-wipe {
    0% { clip-path: inset(0 100% 0 0); opacity: 1; }
    45% { clip-path: inset(0 0 0 0); }
    55% { clip-path: inset(0 0 0 0); }
    100% { clip-path: inset(0 0 0 100%); opacity: 1; }
}
@keyframes dm-drift { from { transform: scale(1.12) translate3d(3%, 0, 0); opacity: 0; } to { transform: scale(1) translate3d(0,0,0); opacity: 1; } }

.anim-rise { animation: dm-rise 0.85s cubic-bezier(0.16,0.84,0.3,1) both; }
.anim-drift { animation: dm-drift 1.15s cubic-bezier(0.16,0.84,0.3,1) both; }
.anim-wipe { animation: dm-wipe 0.95s cubic-bezier(0.65,0,0.35,1) both; }

.dm-hero {
    position: relative;
    isolation: isolate;
    min-height: 560px;
    overflow: hidden;
    /* Fondo del hero — antes era un div aparte (.dm-hero__base) absoluto
       con z-index negativo; un background-image ya pinta siempre detrás
       de todo el contenido del elemento, sin necesitar esa capa extra. */
    background-image: linear-gradient(120deg, var(--ink) 0%, var(--steel) 55%, #EDEEF0 100%);
}
/* Resplandor decorativo (antes .dm-hero__glow, div aparte) — un
   ::before cubre el mismo rol sin sumar un nodo al DOM. */
.dm-hero::before {
    content: '';
    pointer-events: none;
    position: absolute; z-index: 0; right: -14vmax; top: -16vmax;
    height: 70vmax; width: 70vmax; border-radius: 50%; filter: blur(64px);
    background: radial-gradient(circle, rgba(201, 168, 76, 0.22) 0%, transparent 62%);
}
/* Desde 768px, el hero ocupa exactamente lo que sobra de la pantalla
   completa debajo del topbar+header y de la sección .dm-catalog
   ("Explora por categoría", ver más abajo) — fórmula activada a
   pedido: topbar + header + .dm-catalog + hero = 100vh.
   --header-h/--iconbar-h las mide main.js -> setHeroHeight() en cada
   carga y resize; los valores por defecto son el fallback si el JS
   todavía no corrió (primer paint). */
@media (min-width: 768px) {
    .dm-hero { height: calc(100vh - var(--header-h, 130px) - var(--iconbar-h, 90px)); min-height: 400px; }
}

/* Banda de olas (SVG de 60 líneas, cada una con su propio vaivén) detrás
   del texto y la imagen — se inyecta y anima por JS (ver initHeroOlas()
   en main.js). A pedido explícito queda SIEMPRE visible, en todos los
   breakpoints (antes se ocultaba en mobile). */
.dm-hero__olas {
    pointer-events: none;
    position: absolute; z-index: 1;
    left: 0; right: 0; top: 50%;
    transform: translateY(-50%);
}
.dm-hero__olas svg { display: block; width: 100%; height: auto; }
@keyframes dm-hero-ola-flotar {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(var(--amplitud, 60px)); }
}

.dm-hero__wipe {
    pointer-events: none; position: absolute; inset: 0; z-index: 10; opacity: 0;
    background: rgba(245, 245, 245, 0.6); /* velo claro, a tono con el fondo del tema actual */
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
}
.dm-hero__wipe.is-active { opacity: 1; }

/* Los dos bloques del slider (texto 65% / imagen 35%) — en mobile la
   imagen desaparece (ver .dm-hero__image) y el texto pasa a ocupar todo
   el ancho; las olas de fondo siguen visibles en todo momento. */
.dm-hero__row {
    position: relative; z-index: 2; height: 100%;
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    padding-block: 3.5rem;
}
@media (min-width: 768px) {
    .dm-hero__row {
        grid-template-columns: 60% 40%;
        justify-content: flex-start;
    }
}

.dm-hero__text {
    max-width: 48rem;
    /* Ítem de grid: sin esto, el ancho mínimo por defecto es "auto" (el
       ancho del contenido más largo, ej. el tagline en una sola línea),
       y la fila se estira más allá del viewport en vez de dejar que el
       texto haga wrap — se corta en el borde en vez de verse completo. */
    min-width: 0;
}
.dm-hero__meta { display: flex; align-items: center; gap: 1rem; }
.dm-hero__meta .tech-label:first-child { color: var(--gold); }
.dm-hero__meta-rule { height: 1px; width: 2.5rem; background: rgba(201, 168, 76, 0.5); }
.dm-hero__meta .tech-label:last-child { color: rgba(13, 31, 60, 0.5); }

.dm-hero__title {
    margin: 1.25rem 0 0; font-weight: 800;
    /* 13vw solo se ve así de grande en mobile chico (<640px) — a pedido
       explícito, se achica solo acá, tablet/desktop quedan igual (ver
       media queries de abajo, sin tocar). */
    font-size: 9.5vw; line-height: 0.9; letter-spacing: -0.04em; color: var(--bone);
}
@media (min-width: 768px) { .dm-hero__title { font-size: 2vw; } }
.dm-hero__title span { display: block; }

.dm-hero__sub { margin: 1.5rem 0 0; max-width: 28rem; font-size: 0.875rem; line-height: 1.65; color: rgba(13, 31, 60, 0.6); }
@media (min-width: 768px) { .dm-hero__sub { font-size: 1rem; } }

.dm-hero__actions { margin-top: 2rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; }
.dm-hero__explore { font-size: 0.78rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.16em; color: rgba(13, 31, 60, 0.8); }
.dm-hero__explore:hover { color: var(--bone); }

.dm-hero__indicator { margin-top: 2.5rem; display: flex; align-items: flex-end; gap: 1.5rem; }
@media (min-width: 768px) { .dm-hero__indicator { position: absolute; bottom: 2rem; left: 1.5rem; margin-top: 0; } }
@media (min-width: 1024px) { .dm-hero__indicator { left: 2.5rem; } }

/* Bloque 2 del slider: la imagen (35% del ancho en tablet/desktop).
   En mobile se oculta por completo a pedido explícito — las olas de
   fondo (.dm-hero__olas) quedan como único elemento visual detrás del
   texto, que pasa a ocupar el 100% del ancho (ver .dm-hero__row). */
.dm-hero__image { display: none; }
@media (min-width: 768px) {
    .dm-hero__image { display: block; position: relative; height: 100%; }
}
.dm-hero__img-inner { position: absolute; inset: 0; }
.dm-hero__img {
    height: 100%; width: 100%;
    object-fit: contain; object-position: right center;
    /* mix-blend-mode:lighten calcado del prototipo. No depende de
       transparencia (verificado: los .webp/.png de hero no tienen canal
       alfa) — funciona porque son fotos con esquinas casi negras sobre
       fondo oscuro, así que el blend las funde sin volverlas
       invisibles. Si en el futuro se suben fotos con fondo CLARO/blanco,
       este blend las "quemará" a blanco — para esas, quitar el blend
       en esa foto puntual o pedir fondo oscuro al fotografiar. */
    mix-blend-mode: lighten;
    filter: drop-shadow(0 40px 80px rgba(0,0,0,0.6));
}

/* Solo mobile: en pantallas chicas el hero ocupaba mucho scroll para lo
   poco que cabe -> se ahorra espacio comprimiendo interlineado, botones
   y el padding general, sin tocar tablet/desktop (que ya tienen su
   propio tamaño calibrado aparte). Va DESPUÉS de todas las reglas base
   que toca (título, sub, acciones, indicador) para ganarles en el
   cascade — mismo criterio ya aprendido con el bug de .dm-hero__img. */
@media (max-width: 767.98px) {
    .dm-hero { min-height: 400px; }
    .dm-hero__row { padding-block: 2rem; text-align: center; }
    .dm-hero__title { font-size: 7.5vw; line-height: 0.85; margin-top: 0.85rem; }
    .dm-hero__sub { line-height: 1.4; margin-top: 1rem; margin-inline: auto; }
    .dm-hero__meta { justify-content: center; }
    .dm-hero__actions { margin-top: 1.25rem; gap: 1rem; justify-content: center; }
    .dm-hero__actions .btn-quote { padding: 0.65rem 1.1rem; font-size: 0.68rem; }
    .dm-hero__explore { font-size: 0.7rem; }
    .dm-hero__indicator { margin-top: 1.5rem; justify-content: center; }
}
.dm-hero__index { font-size: 1.5rem; font-weight: 700; color: var(--bone); }
.dm-hero__bars { display: flex; gap: 0.5rem; padding-bottom: 0.375rem; }
.dm-hero__bar {
    position: relative; height: 1px; width: 3.5rem; background: rgba(13, 31, 60, 0.25);
    border: none; cursor: pointer; padding: 0;
    font-family: inherit; /* <button>, no hereda solo */
}
@media (min-width: 768px) { .dm-hero__bar { width: 5rem; } }
.dm-hero__bar-fill { position: absolute; inset-block: 0; left: 0; width: 0; background: var(--gold); transition: width 0.3s ease; }
.dm-hero__bar:hover .dm-hero__bar-fill { width: 33%; }
.dm-hero__bar.is-active .dm-hero__bar-fill { width: 100%; transition-property: width; }
.dm-hero__bar-code {
    position: absolute; left: 0; top: -1.25rem; right: 0; font-family: var(--font-mono); font-size: 0.625rem;
    letter-spacing: 0.05em; text-transform: uppercase; color: rgba(13, 31, 60, 0.25);
    transition: color 0.3s ease;
    /* Los slugs reales pueden ser largos (ej. "sistema-contra-incendio"),
       a diferencia de los códigos cortos inventados del prototipo
       (VALVES, FLANGES) — sin esto se desbordaban y chocaban con la
       barra vecina. */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dm-hero__bar:hover .dm-hero__bar-code { color: var(--gold); }
.dm-hero__total { padding-bottom: 0.125rem; font-family: var(--font-mono); font-size: 0.625rem; letter-spacing: 0.28em; text-transform: uppercase; color: rgba(13, 31, 60, 0.35); }

.dm-hero__controls {
    display: flex; align-items: center; justify-content: center; gap: 1rem;
    margin-top: 1.5rem;
}
@media (min-width: 768px) {
    .dm-hero__controls {
        position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
        margin-top: 0; z-index: 10;
    }
}
.dm-hero__control-btn {
    display: flex; align-items: center; justify-content: center;
    width: 2.75rem; height: 2.75rem;
    border-radius: 50%;
    border: 1px solid rgba(201, 168, 76, 0.4);
    background: color-mix(in srgb, var(--ink) 85%, transparent);
    backdrop-filter: blur(8px);
    color: var(--bone);
    cursor: pointer;
    transition: border-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}
.dm-hero__control-btn svg { width: 1.1rem; height: 1.1rem; }
.dm-hero__control-btn:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-2px); }
.dm-hero__control-btn--pause { width: 2.25rem; height: 2.25rem; }
.dm-hero__control-btn--pause svg { width: 0.9rem; height: 0.9rem; }
.dm-hero__control-btn--pause.is-paused svg { fill: none; stroke: currentColor; stroke-width: 2; }

/* ==========================================================================
   "EXPLORA POR CATEGORÍA" (index.php) — calcado de
   proto/diamante-nexus-completo/css/diamante.css (.dm-catalog / .dm-cat-strip).
   Reemplaza la franja de íconos plana que había antes justo debajo del
   hero. h2 hereda font-family de la regla global "h1,h2,h3,h4" de
   style.css — no hace falta redeclarar --font-display acá.
   ========================================================================== */
.text-gold-shine {
    background-image: var(--grad-gold);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.dm-catalog { border-top: 1px solid rgba(13, 31, 60, 0.1); padding: 2rem 1.5rem; }
@media (min-width: 1024px) { .dm-catalog { padding-inline: 2.5rem; } }
.dm-catalog__inner { margin-inline: auto; display: flex; max-width: 1500px; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2rem; }
.dm-catalog__eyebrow { color: var(--gold); }
.dm-catalog__title { margin: 0.75rem 0 0; font-weight: 700; letter-spacing: -0.02em; color: var(--bone); }
.dm-catalog__title--sm { font-size: 1.5rem; }
@media (min-width: 768px) { .dm-catalog__title--sm { font-size: 2rem; } }

/* Solo mobile: menos aire arriba/abajo del bloque "Explora por
   categoría" y el título más chico. El <br> de "EXPLORA POR / CATEGORÍA."
   se oculta para que quede en una sola línea — el selector va con
   ".dm-catalog" adelante para no afectar el <br> del otro título que
   comparte la misma clase .dm-catalog__title--sm más abajo en la página
   ("EMPRESAS QUE / CONFÍAN EN NOSOTROS."). */
@media (max-width: 767.98px) {
    .dm-catalog { padding-block: 1.25rem; }
    .dm-catalog__title { margin-top: 0.4rem; }
    .dm-catalog__title--sm { font-size: 1.15rem; }
    .dm-catalog .dm-catalog__title--sm br { display: none; }
}

.dm-catalog__arrow { display: block; margin: 1.25rem auto 0; width: 70px; color: var(--gold); }
.dm-catalog__arrow svg { width: 100%; height: auto; animation: dm-catalog-arrow-slide 1.8s ease-in-out infinite; }
@keyframes dm-catalog-arrow-slide {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-12px); }
}
/* Solo mobile: la flechita animada sobra en el espacio chico de mobile. */
@media (max-width: 767.98px) {
    .dm-catalog__arrow { display: none; }
}

.dm-cat-strip { flex: 1 1 420px; min-width: 0; border-left: 1px solid rgba(13, 31, 60, 0.1); padding-left: 2rem; overflow: hidden; }
.dm-cat-strip__track { display: flex; justify-content: space-between; gap: 1.5rem; overflow-x: auto; scrollbar-width: none; }
.dm-cat-strip__track::-webkit-scrollbar { display: none; }

/* Modo marquee: igual que el topbar (assets/js/main.js) — solo se activa
   por JS cuando los íconos no entran en el ancho disponible. Se duplica el
   contenido una vez y se desliza en loop continuo sin perder los links. */
.dm-cat-strip__track.is-marquee {
    justify-content: flex-start;
    width: max-content;
    overflow: visible;
    animation-name: dm-cat-strip-marquee;
    animation-duration: 40s;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    cursor: grab;
    /* Deja el scroll vertical de la página libre; el gesto horizontal lo
       captura JS (pointerdown/move/up) para el control manual del loop. */
    touch-action: pan-y;
    user-select: none;
}
.dm-cat-strip__track.is-marquee:hover { animation-play-state: paused; }
.dm-cat-strip__track.is-dragging { cursor: grabbing; }
.dm-cat-strip__track.is-dragging .dm-cat-strip__item { pointer-events: none; }
@keyframes dm-cat-strip-marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}
.dm-cat-strip__item {
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
    gap: 0.65rem; flex-shrink: 0; width: 118px; padding: 0.4rem 0.2rem;
    text-decoration: none; color: rgba(13, 31, 60, 0.7);
}
.dm-cat-strip__item--featured { width: 172px; }
.dm-cat-strip__icon {
    display: flex; align-items: flex-end; justify-content: center;
    width: 100%; height: 172px;
}
.dm-cat-strip__icon-float {
    width: 100%; display: flex; align-items: flex-end; justify-content: center;
    animation: dm-cat-strip-float 3.2s ease-in-out infinite;
}
.dm-cat-strip__icon svg { width: 100%; aspect-ratio: 1 / 1; height: auto; overflow: visible; transition: transform 3000ms ease; }

@keyframes dm-cat-strip-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}
.dm-cat-strip__item:nth-child(2) .dm-cat-strip__icon-float { animation-delay: 0.3s; }
.dm-cat-strip__item:nth-child(3) .dm-cat-strip__icon-float { animation-delay: 0.6s; }
.dm-cat-strip__item:nth-child(4) .dm-cat-strip__icon-float { animation-delay: 0.9s; }
.dm-cat-strip__item:nth-child(5) .dm-cat-strip__icon-float { animation-delay: 1.2s; }

.dm-cat-strip__item--featured:hover .dm-cat-strip__icon-float { animation: none; }
.dm-cat-strip__item--featured:hover .dm-cat-strip__icon svg {
    animation: dm-cat-strip-pulse 3s ease-in-out infinite;
}
@keyframes dm-cat-strip-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes dm-cat-strip-float-hover {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.dm-cat-strip__item:not(.dm-cat-strip__item--featured):hover .dm-cat-strip__icon-float {
    animation: dm-cat-strip-float-hover 1.4s ease-in-out infinite;
}

/* Animación de "dibujo": el contorno se traza al hover y luego se rellena.
   El largo real de cada path lo calcula assets/js/main.js (getTotalLength). */
.dm-cat-strip__icon svg path {
    fill: currentColor;
    fill-opacity: 0.25;
    stroke: currentColor;
    stroke-width: 10;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke-dashoffset 900ms ease, fill-opacity 500ms ease 400ms;
}
.dm-cat-strip__item:hover .dm-cat-strip__icon svg path {
    stroke-dashoffset: 0 !important;
    fill-opacity: 1;
}

.dm-cat-strip__name {
    font-size: 1rem; font-weight: 700; letter-spacing: 0.05em;
    text-transform: uppercase; text-align: center; line-height: 1.25; white-space: nowrap;
    padding-top: 10px;
}
@media (max-width: 767px) {
    .dm-cat-strip { flex-basis: 100%; border-left: none; padding-left: 0; border-top: none; padding-top: 1.5rem; }
    /* .dm-cat-strip__icon mide 172px fijo (pensado para el tamaño de
       escritorio) y el ícono se ancla abajo (align-items:flex-end) ->
       en mobile eso dejaba un hueco enorme vacío arriba del ícono. */
    .dm-cat-strip__icon { height: 90px; }
    /* La categoría "featured" (172px) es más ancha que el resto (118px)
       -> en mobile deben verse todas del mismo tamaño. */
    .dm-cat-strip__item--featured { width: 118px; }
}
