/* ==================================================================
   Machala GPS — Inicio
   Hero navy con mapa de cobertura, cifras, índice de productos,
   plataforma, diferenciales y cierre CTA. Sin tarjetas, sin degradados.
   Tipografía display estilo SPOT (fieldwork ≈ Montserrat 800) en los
   títulos, igual que en la sección SPOT de Productos.
   ================================================================== */

/* impeccable-disable-next-line overused-font: Montserrat es la display de marca aprobada (equivalente libre de fieldwork/findmespot) */
@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@800&display=swap");

/* ---------- Títulos estilo SPOT ---------- */

/* Todos los encabezados del Inicio usan la display (como findmespot) */
.page-home h1,
.page-home h2,
.page-home h3 {
    font-family: "Montserrat", var(--font-sans);
    font-weight: 800;
}

/* Los titulares principales van además en mayúsculas (h1 de SPOT) */
.hero__title,
.page-home .section-title,
.brands__title,
.cta-band__title {
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

/* ==================================================================
   HERO
   ================================================================== */

/* El hero navy se extiende por detrás del header isla flotante
   (altura de la píldora + separación superior e inferior) */
.page-home .site-main {
    margin-top: calc((var(--header-height-mobile) + var(--header-gap) * 2) * -1);
}

@media (min-width: 1024px) {
    .page-home .site-main {
        margin-top: calc((var(--header-height) + var(--header-gap) * 2) * -1);
    }
}

.hero {
    position: relative;
    overflow: hidden;
    background-color: #0a1531;
    padding-top: calc(var(--header-height-mobile) + var(--header-gap) * 2 + clamp(2.5rem, 7vw, 4.5rem));
    padding-bottom: clamp(3rem, 7vw, 5.5rem);
}

/* Video ambiente atenuado: el navy, el texto y el mapa quedan al frente */
.hero__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.22;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .hero__video {
        display: none;
    }
}

@media (min-width: 1024px) {
    .hero {
        padding-top: calc(var(--header-height) + var(--header-gap) * 2 + clamp(2.5rem, 7vw, 4.5rem));
    }
}

.hero__grid {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(2.5rem, 6vw, 5rem);
    align-items: center;
}

@media (min-width: 1024px) {
    .hero__grid {
        grid-template-columns: 1.05fr 0.95fr;
    }
}

.hero__title {
    color: #ffffff;
    font-size: clamp(2.4rem, 5.2vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.06;
}

.hero__accent {
    color: var(--c-yellow-400);
}

.hero__subtitle {
    margin-top: 1.4rem;
    color: #b9c6e4;
    font-size: clamp(1rem, 1.6vw, 1.125rem);
    line-height: 1.7;
    max-width: 44ch;
}

/* Línea de meta del hero: sin botones, datos operativos de la empresa */
.hero__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
    margin-top: 2.4rem;
    list-style: none;
}

@media (min-width: 640px) {
    .hero__meta {
        flex-direction: row;
        align-items: center;
        gap: 0;
    }
}

.hero__meta-item {
    color: #b9c6e4;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
}

@media (min-width: 640px) {
    .hero__meta-item {
        padding-inline: 1.15rem;
        border-left: 1px solid rgba(185, 198, 228, 0.28);
    }

    .hero__meta-item:first-child {
        padding-left: 0;
        border-left: 0;
    }
}


/* Globo 3D del hero: el script mide el contenedor, por eso el alto
   se fija con aspect-ratio. El canvas es transparente (sin fondo). */
.hero__globe {
    position: relative;
    width: min(100%, 560px);
    aspect-ratio: 1 / 1;
    margin-inline: auto;
}

/* three.js escribe width/height inline en el canvas: se fuerza a llenar
   el contenedor cuadrado para que nunca lo estire ni lo deforme. */
.hero__globe-canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
    touch-action: pan-y; /* permite hacer scroll sobre el globo en móvil */
}

@media (max-width: 700px) {
    .hero__globe {
        width: min(100%, 480px);
    }
}

/* Sin animaciones: el bundle del globo no se inicializa, se oculta el hueco */
@media (prefers-reduced-motion: reduce) {
    .hero__globe {
        display: none;
    }
}

/* Entrada orquestada del hero (solo al cargar; CSS puro) */
[data-rise] {
    opacity: 0;
    transform: translateY(18px);
    animation: hero-rise 640ms var(--ease-out) forwards;
    animation-delay: calc(var(--rise-i, 0) * 90ms + 60ms);
}

@keyframes hero-rise {
    to {
        opacity: 1;
        transform: none;
    }
}

/* ==================================================================
   CIFRAS
   ================================================================== */

.stats {
    background-color: var(--c-surface);
    padding-block: clamp(3rem, 6vw, 4.5rem);
}

.stats__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.25rem 1.5rem;
}

@media (min-width: 900px) {
    .stats__grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stats__item {
    display: flex;
    flex-direction: column;
}

@media (min-width: 900px) {
    .stats__item + .stats__item {
        border-left: 1px solid #e2e9f6;
        padding-left: 2rem;
    }
}

.stats__value {
    order: -1;
    margin: 0;
    color: var(--c-navy);
    font-size: clamp(2.3rem, 4vw, 3.25rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.stats__label {
    margin-top: 0.6rem;
    font-size: 0.9375rem;
    max-width: 24ch;
}

/* ==================================================================
   MARCAS (marquee continuo, logos gris → color al pasar el cursor)
   ================================================================== */

.brands {
    background-color: var(--c-surface);
    padding-bottom: clamp(3rem, 6vw, 4.5rem);
}

/* Hairline que separa el marquee de las cifras (misma banda blanca) */
.brands__inner {
    border-top: 1px solid #e2e9f6;
    padding-top: clamp(2.75rem, 5vw, 3.75rem);
}

.brands__title {
    color: var(--c-text-soft);
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-align: center;
}

.brands__viewport {
    display: flex;
    overflow: hidden;
    margin-top: clamp(2rem, 4vw, 2.75rem);
    -webkit-mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
}

.brands__track {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    min-width: max-content;
    gap: clamp(3rem, 6vw, 5rem);
    padding-right: clamp(3rem, 6vw, 5rem);
    list-style: none;
    animation: brands-scroll 38s linear infinite;
}

@keyframes brands-scroll {
    to {
        transform: translateX(-100%);
    }
}

@media (hover: hover) and (pointer: fine) {
    .brands__viewport:hover .brands__track {
        animation-play-state: paused;
    }
}

.brands__item img {
    width: auto;
    height: 34px;
    filter: grayscale(1);
    opacity: 0.55;
    transition:
        filter 200ms ease,
        opacity 200ms ease;
}

@media (hover: hover) and (pointer: fine) {
    .brands__item:hover img {
        filter: none;
        opacity: 1;
    }
}

/* Movimiento reducido: sin marquee, los logos se muestran en rejilla fija */
@media (prefers-reduced-motion: reduce) {
    .brands__viewport {
        -webkit-mask-image: none;
        mask-image: none;
    }

    .brands__track {
        animation: none;
        flex-wrap: wrap;
        flex-shrink: 1;
        justify-content: center;
        width: 100%;
        min-width: 0;
        padding-inline: var(--container-pad);
        gap: 2rem 3rem;
    }

    .brands__track[aria-hidden="true"],
    .brands__item--dup {
        display: none;
    }
}

/* ==================================================================
   PRODUCTOS (índice tipográfico, sin tarjetas)
   ================================================================== */

.products {
    background-color: var(--c-bg);
    padding-block: clamp(3.5rem, 7vw, 5.5rem);
}

.products__header {
    margin-bottom: clamp(2rem, 4.5vw, 3rem);
}

/* Lista + panel de vista previa lado a lado en escritorio */
.products__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 1024px) {
    .products__grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
        gap: clamp(3rem, 6vw, 5.5rem);
        align-items: center;
    }
}

.products__list {
    list-style: none;
}

.product-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.1rem;
    padding-block: clamp(1.1rem, 2.2vw, 1.5rem);
    border-top: 1px solid #d8e2f3;
    text-decoration: none;
}

.products__item:last-child .product-row {
    border-bottom: 1px solid #d8e2f3;
}

/* Miniatura: solo en móvil/tablet; en escritorio manda el panel */
.product-row__thumb {
    width: 74px;
    height: 74px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

@media (min-width: 1024px) {
    .product-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .product-row__thumb {
        display: none;
    }
}

.product-row__body {
    min-width: 0;
}

.product-row__title {
    font-size: clamp(1.2rem, 2vw, 1.45rem);
    font-weight: 800;
    letter-spacing: -0.015em;
    transition: color 200ms ease;
}

.product-row__desc {
    margin-top: 0.2rem;
    color: var(--c-text);
    font-size: 0.9375rem;
}

.product-row__arrow {
    color: var(--c-blue-600);
    opacity: 0.55;
    transition:
        transform 240ms var(--ease-out),
        opacity 200ms ease;
}

/* Fila activa: su imagen es la visible en el panel (solo escritorio) */
@media (min-width: 1024px) {
    .product-row.is-active .product-row__title {
        color: var(--c-blue-600);
    }

    .product-row.is-active .product-row__arrow {
        opacity: 1;
    }
}

@media (hover: hover) and (pointer: fine) {
    .product-row:hover .product-row__title {
        color: var(--c-blue-600);
    }

    .product-row:hover .product-row__arrow {
        opacity: 1;
        transform: translateX(6px);
    }
}

/* Panel de vista previa: crossfade entre las fotos de producto */
.products__preview {
    display: none;
}

@media (min-width: 1024px) {
    .products__preview {
        display: block;
        position: relative;
        aspect-ratio: 4 / 3;
        overflow: hidden;
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-clay);
    }

    .products__preview-img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        opacity: 0;
        transform: scale(1.04);
        transition:
            opacity 320ms var(--ease-out),
            transform 560ms var(--ease-out);
    }

    .products__preview-img.is-active {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==================================================================
   PLATAFORMA
   ================================================================== */

.platform {
    background-color: var(--c-surface);
    padding-block: clamp(4rem, 9vw, 7rem);
}

.platform__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(2.5rem, 6vw, 4.5rem);
    align-items: center;
}

@media (min-width: 1024px) {
    .platform__grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Sin captura de plataforma aún: el texto ocupa un ancho cómodo */
    .platform__grid--solo {
        grid-template-columns: minmax(0, 44rem);
        justify-content: center;
    }
}

.platform__figure img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-clay);
}

.platform__steps {
    list-style: none;
    margin-top: 2rem;
}

.platform__step {
    border-top: 1px solid #e2e9f6;
    padding-block: 1.3rem;
}

.platform__step h3 {
    font-size: 1.125rem;
    font-weight: 800;
}

.platform__step p {
    margin-top: 0.35rem;
    font-size: 0.9375rem;
}

.platform__link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.4rem;
    color: var(--c-blue-600);
    font-weight: 700;
    text-decoration: none;
}

.platform__link svg {
    transition: transform 240ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
    .platform__link:hover {
        text-decoration: underline;
        text-underline-offset: 5px;
        text-decoration-thickness: 2px;
    }

    .platform__link:hover svg {
        transform: translateX(4px);
    }
}

/* ==================================================================
   DIFERENCIALES
   ================================================================== */

.why {
    background-color: var(--c-bg);
    padding-block: clamp(4rem, 9vw, 7rem);
}

.why__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    margin-top: clamp(2.5rem, 5vw, 3.5rem);
}

@media (min-width: 640px) {
    .why__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 3rem 3.5rem;
    }
}

.why__item::before {
    content: "";
    display: block;
    width: 34px;
    height: 3px;
    border-radius: 2px;
    background-color: var(--c-yellow-400);
    margin-bottom: 1.1rem;
}

.why__item h3 {
    font-size: 1.1875rem;
    font-weight: 800;
}

.why__item p {
    margin-top: 0.5rem;
    font-size: 0.9375rem;
    max-width: 40ch;
}

/* ==================================================================
   CIERRE CTA (banda amarilla)
   ================================================================== */

.cta-band {
    background-color: var(--c-yellow-400);
    padding-block: clamp(3.5rem, 8vw, 5.5rem);
}

.cta-band__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.cta-band__title {
    color: var(--c-navy);
    font-size: clamp(1.9rem, 3.5vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.cta-band__text {
    margin-top: 0.9rem;
    color: rgba(12, 27, 63, 0.78);
    font-size: 1.0625rem;
}

.cta-band__actions {
    margin-top: 2rem;
}

.cta-band__whatsapp {
    margin-top: 1.4rem;
    color: var(--c-navy);
    font-size: 0.9375rem;
    font-weight: 600;
}

.cta-band__whatsapp a {
    color: inherit;
    font-weight: 800;
    text-underline-offset: 4px;
}
