/* =========================================================
   Portada (PAGE-ONLY: solo index.html, fuera de styles.css).
   Hero del ecosistema Ajax según el banner de Teo (27-10-2026) y los
   bloques propios de la home (destacados, sin cuotas, cámaras, familias).
   El bundle global va al 99 % de su presupuesto y las landings siguen
   usando el hero antiguo (.hero en 11-hero.css): este no lo hereda.
========================================================= */

/* ---------- Hero ---------- */
.hero-ajax {
    --hero-ai-from: #5fd0c9;
    --hero-ai-to: #9be7b4;
    position: relative;
    overflow: hidden;
    color: #fff;
    background: radial-gradient(70% 90% at 0% 100%, rgba(17,100,102,.2), transparent 62%), #07090b;
}
.hero-ajax-grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    padding-top: 36px;
}
.hero-ajax-copy { position: relative; z-index: 2; max-width: 640px; }
.hero-title {
    margin: 0;
    color: #fff;
    font-size: clamp(36px, 10vw, 46px);
    line-height: 1.05;
    letter-spacing: -.035em;
}
.hero-title-line { display: block; }
.hero-ajax-word { text-transform: uppercase; letter-spacing: .045em; font-weight: 500; }
.hero-ai { color: var(--hero-ai-from); white-space: nowrap; }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .hero-ai {
        background: linear-gradient(90deg, var(--hero-ai-from), var(--hero-ai-to));
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }
}
@media (forced-colors: active) {
    .hero-ai { background: none; -webkit-text-fill-color: currentColor; }
}
.hero-sparkle {
    display: inline-block;
    width: .46em;
    height: .46em;
    margin-left: .04em;
    vertical-align: .62em;
    fill: var(--hero-ai-to);
}
.hero-ajax .lead {
    max-width: 600px;
    margin: 18px 0 30px;
    color: rgba(255,255,255,.84);
    font-size: 16px;
    line-height: 1.6;
}
.hero-ajax-actions { display: flex; flex-wrap: wrap; gap: 22px 16px; }
.hero-cta-ai,
.hero-cta-cats {
    position: relative;
    gap: 10px;
    min-height: 56px;
    padding: 16px 22px;
    border-radius: 14px;
    font-weight: 700;
}
.hero-cta-ai {
    background: #fff;
    color: #0b1414;
    border: 1px solid #fff;
    box-shadow: 0 12px 30px rgba(0,0,0,.28);
}
.hero-cta-ai:hover { background: #e9f6f4; border-color: #e9f6f4; transform: translateY(-1px); }
.hero-cta-cats {
    color: #fff;
    border: 1px solid rgba(255,255,255,.6);
    background: rgba(255,255,255,.03);
}
.hero-cta-cats:hover { border-color: #fff; background: rgba(255,255,255,.09); }
.hero-cta-sparkle { width: 22px; height: 22px; fill: currentColor; flex: 0 0 auto; }
.hero-cta-arrow { width: 20px; height: 20px; flex: 0 0 auto; }
.hero-cta-badge {
    position: absolute;
    top: -14px;
    right: 18px;
    padding: 4px 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--hero-ai-from), var(--hero-ai-to));
    color: #062b26;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    box-shadow: 0 6px 16px rgba(0,0,0,.3);
}
.hero-ajax-visual { position: relative; margin: 0 calc(-1 * var(--space-4)); }
.hero-visual-img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: 62% 100%;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 16%);
    mask-image: linear-gradient(180deg, transparent 0, #000 16%);
}
.hero-cats { position: relative; z-index: 2; padding-top: 18px; padding-bottom: 28px; }
.hero-cats ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.hero-cats a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 12px;
    background: rgba(12,16,18,.78);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    transition: border-color .15s ease, background .15s ease;
}
.hero-cats a:hover { border-color: var(--hero-ai-from); background: rgba(17,100,102,.32); }
.hero-cats .icon-ui { width: 19px; height: 19px; color: #d7f1ee; }
.hero-ajax .logos-strip { border-top-color: rgba(255,255,255,.08); }

@media (max-width: 559px) {
    .hero-ajax-actions { display: grid; grid-template-columns: 1fr; }
    .hero-cta-ai, .hero-cta-cats { width: 100%; }
}

@media (min-width: 640px) {
    .hero-title { font-size: clamp(44px, 7vw, 56px); }
    .hero-visual-img { max-height: 460px; }
    .hero-ajax .lead { font-size: 17px; }
    .hero-cats a { padding: 10px 14px; font-size: 14px; }
}

/* Lado a lado solo con el contenedor completo: por debajo, el texto invadía la imagen. */
@media (min-width: 1200px) {
    .hero-ajax-grid {
        grid-template-columns: minmax(0, 58fr) minmax(0, 42fr);
        align-items: center;
        gap: 0;
        padding-top: 0;
    }
    .hero-ajax-copy { max-width: 680px; padding: 56px 0 36px; }
    .hero-title { font-size: clamp(44px, 3.9vw, 58px); }
    .hero-ajax .lead { font-size: 18px; }
    .hero-ajax-visual {
        align-self: stretch;
        /* Sangra hasta el borde derecho de la ventana, como el banner. */
        margin: 0 calc((min(100vw, var(--container)) - 100vw) / 2 - var(--space-4)) 0 -16%;
    }
    .hero-ajax-visual picture { display: block; height: 100%; }
    .hero-visual-img {
        height: 100%;
        max-height: none;
        aspect-ratio: auto;
        object-position: 88% 100%;
        -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 13%);
        mask-image: linear-gradient(90deg, transparent 0, #000 13%);
    }
    .hero-cats { padding-top: 14px; padding-bottom: 32px; }
    .hero-cats ul { gap: 10px; }
}

/* ---------- Bloques de la home ---------- */
.home-block { margin-top: var(--space-7); }
.home-block-head {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 12px 24px;
    margin-bottom: var(--space-4);
}
.home-block-head h2,
.home-block-head h3 { margin: 0; }
.home-block-head p { margin: 6px 0 0; max-width: 640px; }
.home-block-head .cat-link { white-space: nowrap; font-weight: 600; color: var(--primary); }
.home-note { margin: 14px 0 0; font-size: 13px; color: var(--text-muted); }

/* Kit agotado (su pieza más escasa no tiene stock): el botón no puede parecer comprable. */
.compare-actions .btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* Productos destacados y cámaras: prerenderizados en el build (build-home-featured.py) */
.home-products { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .home-products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } }
.home-products .product-name { font-size: 14px; }

/* Ventajas de no pagar cuotas */
.nofees-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.nofees-grid li {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
}
.nofees-grid h3 { font-size: 17px; margin-bottom: 6px; }
.nofees-grid p { margin: 0; font-size: 14px; }
.nofees-icon {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-bottom: 12px;
    border-radius: var(--radius);
    background: var(--bg-tint);
    color: var(--primary);
}
.nofees-icon .icon-ui { width: 22px; height: 22px; }
@media (max-width: 900px) { .nofees-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .nofees-grid { grid-template-columns: 1fr; } }

/* Cámaras Ajax */
.cams-grid {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: var(--space-6);
    align-items: start;
}
.cams-points { margin: 0 0 22px; padding: 0; list-style: none; }
.cams-points li {
    position: relative;
    padding: 0 0 10px 26px;
    color: var(--text-soft);
    font-size: 15px;
}
.cams-points li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 8px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--primary);
}
.cams-links { display: flex; flex-wrap: wrap; gap: 10px; }
.cams-grid .home-products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) {
    .cams-grid { grid-template-columns: 1fr; gap: var(--space-4); }
}

/* Familias del ecosistema (enlaces a categorías reales) */
.home-families { margin-bottom: 0; }
.home-families .taxo-card h3 { font-size: 16px; }

/* ---------- Portada de TEHAVI (28-10-2026): el hero propio vuelve, con su vídeo ---------- */
/* El vídeo lo activa initHeroVideo (40-ui.js) solo en escritorio y sin reduced-motion. */
.hero-bg-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .8s ease; }
.hero-bg-video.is-playing { opacity: 1; }
.hero-video-toggle {
    position: absolute; right: 18px; bottom: 18px; z-index: 3;
    width: 40px; height: 40px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,.4); background: rgba(11,20,20,.55); color: #fff;
    font-size: 13px; line-height: 1;
}
.hero-video-toggle:hover { background: rgba(11,20,20,.8); border-color: #fff; }
.hero-tehavi .hero-grid { padding-bottom: 30px; }
@media (max-width: 560px) { .hero-video-toggle { right: 12px; bottom: 12px; width: 36px; height: 36px; } }

/* ---------- «Nuestras marcas» (portada): foto de un producto de la marca, sin logos ajenos ---------- */
.brand-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.brand-card {
    display: flex; flex-direction: column; gap: 6px; padding: 22px 22px 20px;
    border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-card); color: inherit;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.brand-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.brand-card-name { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: -.01em; color: var(--text); }
.brand-card-text { color: var(--text-soft); font-size: 14px; }
.brand-card-count { margin-top: auto; padding-top: 6px; font-size: 13px; font-weight: 600; color: var(--primary); }
.brand-card--main { grid-column: 1 / -1; border-color: transparent; background: linear-gradient(120deg, #07090b 0%, #0f2224 100%); color: #fff; }
.brand-card--main .brand-card-name { color: #fff; font-size: 30px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.brand-card--main .brand-card-text { color: rgba(255,255,255,.84); font-size: 15px; }
.brand-card--main .brand-card-count { color: #8fe3d6; }
.brand-card-tag {
    align-self: flex-start; padding: 3px 10px; border-radius: 999px;
    background: linear-gradient(90deg, #5fd0c9, #9be7b4); color: #062b26; font-size: 12px; font-weight: 700;
}
/* La destacada ocupa la fila entera: la foto va a la derecha y el texto a la izquierda. */
.brand-card--main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 220px); column-gap: 24px; align-content: center; }
.brand-card--main > * { grid-column: 1; }
.brand-card--main .brand-card-tag { justify-self: start; }
.brand-card--main .taxo-card-img { grid-column: 2; grid-row: 1 / span 4; align-self: center; height: 150px; margin: 0; }
@media (max-width: 900px) { .brand-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
    .brand-card--main { display: flex; }
    .brand-card--main .taxo-card-img { height: 132px; margin: -4px -4px 14px; }
}
@media (max-width: 520px) { .brand-cards { grid-template-columns: 1fr; } }

/* ---------- Landings de /marcas/: botones del hero tipográfico y migas del hero de Ajax ---------- */
.taxo-hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
/* .tool-hero a (subrayado y color de enlace) gana a .btn: aquí son botones, no enlaces de texto. */
.taxo-hero-ctas .btn { text-decoration: none; }
.taxo-hero-ctas .btn-primary { color: var(--on-primary); }
.taxo-hero-ctas .btn-ghost { color: #fff; border-color: rgba(255,255,255,.45); background: rgba(255,255,255,.04); }
.taxo-hero-ctas .btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,.1); }
.hero-ajax-crumbs { position: relative; z-index: 3; padding-top: 16px; }
.hero-ajax-crumbs .breadcrumb { margin: 0; font-size: .9rem; color: rgba(255,255,255,.72); }
.hero-ajax-crumbs .breadcrumb a { color: inherit; text-decoration: underline; }

/* ---------- Hero de las demás marcas (29-10-2026) ----------
   El mismo diseño que el banner de Ajax (.hero-ajax), con un collage de fotos reales de la
   marca en lugar de la imagen generada. Lo pinta tools/brand_landing.py. */
.hero-marca .eyebrow { color: var(--hero-ai-from); margin-bottom: 16px; }
.hero-marca .hero-title { font-size: clamp(32px, 8vw, 42px); }
.hero-marca-visual { margin: 0; padding: 0 0 8px; }
.hero-marca-collage {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.hero-marca-collage li { position: relative; }
.hero-marca-collage a {
    display: block;
    aspect-ratio: 1;
    padding: 14px 14px 34px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(0,0,0,.45), 0 0 0 1px rgba(95,208,201,.18);
    transition: transform .2s ease, box-shadow .2s ease;
}
.hero-marca-collage a:hover { transform: translateY(-3px); box-shadow: 0 22px 48px rgba(0,0,0,.5), 0 0 0 1px var(--hero-ai-from); }
.hero-marca-collage img { display: block; width: 100%; height: 100%; object-fit: contain; }
.hero-marca-collage span {
    position: absolute;
    left: 10px;
    bottom: 10px;
    max-width: calc(100% - 20px);
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(7,9,11,.86);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}
@media (min-width: 640px) {
    .hero-marca .hero-title { font-size: clamp(40px, 6vw, 50px); }
    .hero-marca-collage { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
    .hero-marca .hero-title { font-size: clamp(40px, 3.4vw, 52px); }
    /* Sus titulares son más largos que el de Ajax: sin tope, pisaban el borde de la imagen. */
    .hero-marca .hero-ajax-copy { max-width: 600px; }
    .hero-marca-visual { margin: 0; padding: 40px 0 48px 48px; align-self: center; }
    .hero-marca-collage { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
    /* Escalonado, como piezas sobre una mesa: la segunda columna baja un poco. */
    .hero-marca-collage li:nth-child(even) { transform: translateY(26px); }
}
