/* ==========================================================================
   Componentes compartidos: cabecera de sección, flechas, pista horizontal y
   tarjetas de categoría. Los usan la página principal y el catálogo, para que
   "Nuestras categorías" se vea igual en ambas.
   Marcado: resources/views/partials/category-strip.blade.php
   Comportamiento de las flechas: public/js/carousel.js
   Colores: variables --sos-* de resources/views/layouts/catalog.blade.php

   Al editar este archivo, sube el ?v= de los <link> en home-page.blade.php y
   catalog/index.blade.php.
   ========================================================================== */

/* ---------- Cabecera de sección (título + flechas) ---------- */

.home-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.home-section-head__title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--sos-navy);
}

.home-section-head__title--small {
    font-size: 26px;
}

.home-section-head__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 0.95rem;
    color: #fff;
    background: var(--sos-green);
}

.home-products--top .home-section-head__icon {
    background: var(--sos-pink);
}

.home-products--247 .home-section-head__icon {
    background: var(--sos-sky);
}

.home-section-head__subtitle {
    margin: 4px 0 0;
    font-size: 0.9rem;
    line-height: 1.3;
    color: var(--sos-gray);
}

.home-section-head__actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.home-section-head__link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    color: var(--sos-green);
}

.home-section-head__link:hover {
    color: var(--sos-green-dark);
}

.home-section-head__link i {
    font-size: 0.75rem;
}

.home-arrows {
    display: flex;
    gap: 8px;
}

/* El carrusel no desborda: no hay nada que desplazar */
.home-arrows.is-static {
    display: none;
}

.home-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    font-size: 1.1rem;
    color: var(--sos-gray);
    background: #F2F3F4;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, opacity 0.2s;
}

.home-arrow:hover:not(:disabled) {
    color: #fff;
    background: var(--sos-green);
}

.home-arrow:disabled {
    opacity: 0.4;
    cursor: default;
}

/* ---------- Pista horizontal compartida por los carruseles ---------- */

.home-track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.home-track::-webkit-scrollbar {
    display: none;
}

.home-track > * {
    scroll-snap-align: start;
}

/* ---------- Categorías ---------- */

.home-cat {
    display: flex;
    flex: 0 0 110px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 110px;
    padding: 10px;
    border: 2px solid var(--sos-green);
    border-radius: 12px;
    color: inherit;
    background: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
}

.home-cat:hover {
    color: inherit;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 61, 78, 0.12);
}

.home-cat--top {
    border-color: var(--sos-pink);
}

.home-cat--247 {
    border-color: var(--sos-sky);
}

.home-cat__figure {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 65px;
    margin: 0;
}

.home-cat__figure img {
    max-width: 65px;
    max-height: 55px;
    object-fit: contain;
}

.home-cat__figure i {
    font-size: 2.2rem;
}

.home-cat--top .home-cat__figure i {
    color: var(--sos-pink);
}

.home-cat--247 .home-cat__figure i {
    color: var(--sos-sky);
}

.home-cat__name {
    margin: 6px 0 0;
    font-size: 0.95rem;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
}

/* Móvil: en pantallas táctiles se desliza con el dedo, las flechas sobran */
@media (max-width: 767.98px) {
    .home-arrows {
        display: none;
    }

    .home-section-head__title {
        font-size: 1.15rem;
    }

    .home-section-head__title--small {
        font-size: 26px;
    }

    .home-section-head__icon {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }

    .home-section-head__subtitle {
        font-size: 0.8rem;
    }

    .home-track {
        gap: 10px;
    }
}

/* Móvil pequeño */
@media (max-width: 575.98px) {
    .home-cat {
        flex-basis: 96px;
        height: 100px;
        padding: 8px;
    }

    .home-cat__figure {
        height: 56px;
    }

    .home-cat__figure i {
        font-size: 1.9rem;
    }

    .home-cat__name {
        font-size: 0.85rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-track {
        scroll-behavior: auto;
    }
}
