/* ============================================
   HOME - Carrusel + Productos + Video
   ============================================ */

/* CARRUSEL HERO */
.hero {
    position: relative;
    height: 540px;
    overflow: hidden;
    background: #000;
}
.hero__slides {
    position: relative;
    width: 100%;
    height: 100%;
}
.hero__slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transform: scale(1.08);
    transition: opacity 1.2s ease, transform 7s ease;
}
.hero__slide.is-active {
    opacity: 1;
    transform: scale(1);
}
.hero__slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0) 50%);
}
.hero__caption {
    position: absolute;
    left: 0;
    top: 38%;
    color: var(--color-white);
    max-width: 720px;
    z-index: 5;
    padding: 22px 140px 22px 8%;
    /* fondo marrón degradado, difuminado hacia la derecha */
    background: linear-gradient(
        90deg,
        rgba(80, 50, 30, 0.78) 0%,
        rgba(80, 50, 30, 0.70) 55%,
        rgba(80, 50, 30, 0.35) 80%,
        rgba(80, 50, 30, 0) 100%
    );
}
.hero__caption-line1 {
    font-family: Arial, var(--font-display), sans-serif;
    font-weight: 700;
    font-style: italic;
    font-size: 44px;       /* equivalente a ~50pt en pantalla */
    letter-spacing: 1px;
    line-height: 1.15;
    text-shadow: 0 2px 12px rgba(0,0,0,0.55);
}
.hero__caption-line2 {
    font-family: Arial, var(--font-display), sans-serif;
    font-weight: 700;
    font-style: italic;
    font-size: 38px;
    margin-top: 6px;
    margin-left: 80px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.55);
}

/* Barra oscura-transparente en el borde inferior del hero */
.hero::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 56px;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.55) 100%
    );
    z-index: 4;
    pointer-events: none;
}

/* Indicadores y flecha del hero */
.hero__scroll {
    position: absolute;
    right: 30px;
    bottom: 18px;
    color: var(--color-white);
    width: 32px;
    height: 32px;
    z-index: 10;
    animation: bounce 2.5s infinite;
    display: block;
}
.hero__scroll svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

.hero__dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}
.hero__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    border: 1px solid rgba(255,255,255,0.6);
    transition: background var(--t-fast);
}
.hero__dot.is-active { background: var(--color-white); }

/* MÁS VENDIDOS — sección */
.bestsellers {
    padding: 50px 0 40px;
    position: relative;
}
.bestsellers__head {
    display: flex;
    align-items: stretch;   /* el título se estira a la altura del dot */
    gap: 0;                 /* el título arranca justo al final del dot */
    margin-bottom: 28px;
    padding-left: 0;        /* dot pegado al borde izquierdo de la página */
}
.bestsellers__title {
    font-family: Arial, var(--font-display), sans-serif;
    font-weight: 700;
    font-style: italic;
    font-size: 30px;          /* Arial Bold Italic 36pt boceto */
    letter-spacing: 2px;
    color: var(--color-text-muted);   /* 645e5a */
    padding: 0 24px;
    display: flex;
    align-items: flex-end;            /* texto alineado al final del cuadrado de puntos */
    border-bottom: 2px solid #3a3a3a; /* línea oscura bajo el título */
    padding-bottom: 6px;
}

/* Filtro de animales */
.animal-filter {
    display: flex;
    gap: 24px;
    align-items: center;
    justify-content: flex-start;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 18px;
    margin-bottom: 36px;
    overflow-x: auto;
    padding-left: 4px;
}
.animal-filter__btn {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-grey-icon);   /* off: 999999 (boceto) */
    transition: color var(--t-base), transform var(--t-fast);
    position: relative;
    cursor: pointer;
    overflow: visible;     /* evita que se corten los iconos */
    padding: 4px;
}
/* En HOME por default todos grises; al hover o si activo -> marrón */
.animal-filter__btn:hover { color: var(--color-brown-active); transform: translateY(-2px); }
.animal-filter__btn.is-active { color: var(--color-brown-active); }   /* on: 7f644f */
/* Resaltado por hover sobre un PRODUCTO: los animales para los que sirve
   ese producto se pintan en dorado (mismo estado visual que activo).
   Es solo visual, no altera el filtro seleccionado. */
.animal-filter__btn.is-hover-animal { color: var(--color-brown-active); transform: translateY(-2px); }
/* Modo "highlight": en categoría pintamos disponibles en marrón desde el inicio */
.animal-filter.is-highlight .animal-filter__btn[data-available="true"] {
    color: var(--color-brown-active);
}
.animal-filter.is-highlight .animal-filter__btn[data-available="false"] {
    color: var(--color-grey-icon);
    opacity: 0.55;
}
.animal-filter__btn svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
    transition: fill var(--t-base);
    overflow: visible;
}
/* Imagen única (compatibilidad con animales que solo tienen icon_url) */
.animal-filter__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
/* Cuando se subieron DOS imágenes (activa + desactivada) las apilamos.
   Por defecto se muestra la versión OFF; al activarse / hover / cuando es
   "available" en modo highlight, se cambia a la versión ON. */
.animal-filter__img--on,
.animal-filter__img--off {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity var(--t-base);
}
.animal-filter__img--on  { opacity: 0; }
.animal-filter__img--off { opacity: 1; }

/* HOVER y ACTIVO: muestra la imagen "activa" */
.animal-filter__btn:hover .animal-filter__img--on,
.animal-filter__btn.is-active .animal-filter__img--on,
.animal-filter__btn.is-hover-animal .animal-filter__img--on {
    opacity: 1;
}
.animal-filter__btn:hover .animal-filter__img--off,
.animal-filter__btn.is-active .animal-filter__img--off,
.animal-filter__btn.is-hover-animal .animal-filter__img--off {
    opacity: 0;
}

/* Modo "highlight" (categoría): disponibles -> imagen activa,
   no disponibles -> imagen desactivada */
.animal-filter.is-highlight .animal-filter__btn[data-available="true"] .animal-filter__img--on {
    opacity: 1;
}
.animal-filter.is-highlight .animal-filter__btn[data-available="true"] .animal-filter__img--off {
    opacity: 0;
}
.animal-filter.is-highlight .animal-filter__btn[data-available="false"] .animal-filter__img--on {
    opacity: 0;
}
.animal-filter.is-highlight .animal-filter__btn[data-available="false"] .animal-filter__img--off {
    opacity: 1;
}

/* Grid de productos en HOME
   Mitad izquierda: tarjetas de producto en 2 columnas (p1..p5).
   Mitad derecha: feature card arriba + promo card debajo.
   4 columnas iguales => productos = 2fr (50%), feature/promo = 2fr (50%).
   A partir de la 6ª tarjeta el grid crece hacia abajo: las filas nuevas
   se generan solas (grid-auto-rows) y usan las 4 columnas completas. */
.bestsellers__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    align-items: start;
    grid-auto-rows: auto;
    grid-auto-flow: row;
    grid-template-areas:
        "p1 p2 video video"
        "p3 p4 video video"
        "p5 .  promo promo";
}
.bestsellers__grid .product-card:nth-child(1) { grid-area: p1; }
.bestsellers__grid .product-card:nth-child(2) { grid-area: p2; }
.bestsellers__grid .product-card:nth-child(3) { grid-area: p3; }
.bestsellers__grid .product-card:nth-child(4) { grid-area: p4; }
.bestsellers__grid .product-card:nth-child(5) { grid-area: p5; }
.bestsellers__grid .feature-card { grid-area: video; align-self: stretch; }
.bestsellers__grid .promo-card { grid-area: promo; align-self: start; }

/* TARJETA DE PRODUCTO */
.product-card {
    background: var(--color-white);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: transform var(--t-base);
    position: relative;
}
.product-card:hover { transform: translateY(-4px); }

.product-card__image-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
 
    overflow: hidden;
    margin-bottom: 14px;
}
.product-card__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    
    transition: transform var(--t-slow);
}
.product-card:hover .product-card__image { transform: scale(1.05); }

/* Estado seleccionado o hover: barra marrón 7f644f (boceto) + flecha */
.product-card.is-selected .product-card__image-wrap::after,
.product-card:hover .product-card__image-wrap::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 32px;
    background: var(--color-brown-active);
}
.product-card.is-selected .product-card__image-wrap::before,
.product-card:hover .product-card__image-wrap::before {
    content: '→';
    position: absolute;
    bottom: 6px;
    right: 16px;
    color: var(--color-white);
    font-size: 18px;
    z-index: 2;
    font-weight: 700;
}
.product-card.is-selected .product-card__name,
.product-card:hover .product-card__name {
    color: #7f644f;
}

.product-card__name {
    font-family: Arial;
    font-weight: 600;
    font-size: 24px;
    letter-spacing: 1.4px;
    color: #000;
    padding: 4px 4px 0;
    transition: color var(--t-base);
}

/* FEATURE CARD - imagen grande del producto destacado */
.feature-card {
    position: relative;
    overflow: hidden;
    background: #1a1a1a;
    min-height: 460px;
}
.feature-card__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 8s ease;
}
.feature-card:hover .feature-card__bg { transform: scale(1.08); }

/* PROMO CARD - video instalación */
.promo-card {
    position: relative;
    background: #000;
    border: 4px solid var(--color-brown);
    aspect-ratio: 1.1 / 1;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}
.promo-card__head {
    background: var(--color-brown);
    color: var(--color-white);
    padding: 8px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 2px;
}
.promo-card__brand {
    background: var(--color-red);
    color: var(--color-white);
    padding: 3px 10px;
    font-size: 11px;
    letter-spacing: 1px;
    font-weight: 700;
    font-style: italic;
}
.promo-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--color-white);
    padding: 20px;
    text-align: center;
    background: linear-gradient(160deg, #1a1a1a 0%, #0a0a0a 100%);
    position: relative;
}
.promo-card__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 26px;
    letter-spacing: 2px;
    line-height: 1.15;
}
.promo-card__model {
    margin-top: 14px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 20px;
    letter-spacing: 2px;
}
.promo-card__model strong {
    color: var(--color-red);
    font-weight: 800;
}
.promo-card__play {
    position: absolute;
    bottom: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--t-fast);
}
.promo-card:hover .promo-card__play { transform: scale(1.1); }
.promo-card__play svg { width: 16px; height: 16px; fill: currentColor; margin-left: 2px; }

.video-note {
    margin-top: 18px;
    text-align: center;
    font-size: 12px;
    color: var(--color-text-muted);
    font-style: italic;
}

/* ============================================
   RESPONSIVO HOME
   ============================================ */
@media (max-width: 1024px) {
    .hero { height: 460px; }
    .hero__caption-line1 { font-size: 30px; }
    .hero__caption-line2 { font-size: 24px; margin-left: 40px; }
    .bestsellers__grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-areas:
            "p1 p2"
            "p3 p4"
            "p5 video";
    }
    /* La promo card deja de tener celda fija y se coloca sola al final:
       order alto = se ubica después de TODOS los productos, incluidos los
       que pasan del quinto y caen en filas nuevas. */
    .bestsellers__grid .promo-card {
        grid-row: auto;
        grid-column: 1 / -1;
        order: 999;
    }
    .feature-card { min-height: 360px; }
}

@media (max-width: 600px) {
    .hero { height: 360px; }
    .hero__caption { top: 30%; left: 5%; }
    .hero__caption-line1 { font-size: 22px; }
    .hero__caption-line2 { font-size: 18px; margin-left: 20px; }
    .bestsellers__head { gap: 16px; }
    .dot-pattern { width: 56px; height: 56px; }
    .bestsellers__grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-areas:
            "p1 p2"
            "p3 p4"
            "p5 video";
        gap: 14px;
    }
    /* Igual que arriba: promo card siempre al final del grid. */
    .bestsellers__grid .promo-card {
        grid-row: auto;
        grid-column: 1 / -1;
        order: 999;
    }
    .feature-card { min-height: 260px; }
    .animal-filter { gap: 14px; }
    .animal-filter__btn { width: 48px; height: 48px; }
}