﻿/* Contenedor principal de la sección */
.categories-section {
    padding: 4rem 1rem;
    max-width: 1300px;
    margin: 0 auto;
    font-family: 'Inter', sans-serif;
}

/* Título de la sección */
.categories-title {
    text-align: center;
    font-weight: 700;
    font-size: 2.2rem;
    color: #0a101d;
    margin-bottom: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

    .categories-title .folder-icon {
        display: flex;
        align-items: center;
    }

/* Grid moderno (reemplaza las filas/columnas de Bootstrap) */
.categories-grid {
    display: grid;
    /* En escritorio se ajusta automáticamente, mínimo 260px por tarjeta */
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

/* Tarjeta de categoría */
.category-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4 / 3;
    background: #f1f5f9;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    text-decoration: none;
    display: block;
}

    /* Efecto Hover en la tarjeta completa (Escritorio) */
    .category-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 20px 40px rgba(10, 16, 29, 0.15);
    }

/* Contenedor de la imagen */
.category-image {
    width: 100%;
    height: 100%;
    position: relative;
}

    .category-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.6s ease;
    }

/* Placeholder por si no hay imagen */
.category-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
}

/* Efecto de Zoom en la imagen al hacer hover */
.category-card:hover .category-image img {
    transform: scale(1.08);
}

/* Overlay inferior con gradiente */
.category-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px 20px 20px 20px;
    background: linear-gradient(to top, rgba(10, 16, 29, 0.95) 0%, rgba(10, 16, 29, 0.5) 60%, transparent 100%);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    transition: padding 0.3s ease;
}

/* Título de la categoría */
.category-name {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    transform: translateY(10px);
    transition: transform 0.3s ease;
}

/* Enlace/Botón "Ver productos" */
.category-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: #60a5fa;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.3s ease;
    margin-top: 6px;
    display: inline-block;
}

/* Animación del texto en hover (Escritorio) */
.category-card:hover .category-name {
    transform: translateY(0);
}

.category-card:hover .category-link {
    opacity: 1;
    transform: translateY(0);
}


/* =========================================
   DISEÑO RESPONSIVO (Móviles y Tablets)
   ========================================= */
@media (max-width: 768px) {

    /* Forzar exactamente 2 columnas en pantallas pequeñas */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px; /* Reducimos el espacio para que quepan bien */
    }

    /* Ajustar el tamaño del título y mantenerlo centrado */
    .categories-title {
        font-size: 1.6rem;
        margin-bottom: 2rem;
    }

        .categories-title svg {
            width: 22px;
            height: 22px;
        }

    /* Ajustar el padding interno para que no se sature de texto */
    .category-info {
        padding: 20px 12px 12px 12px;
    }

    /* Como en móvil no hay "hover", mostramos la info por defecto */
    .category-name {
        font-size: 1rem;
        transform: translateY(0);
    }

    .category-link {
        font-size: 0.8rem;
        opacity: 1;
        transform: translateY(0);
    }

    /* Desactivar el movimiento de la tarjeta completa en móvil para evitar saltos al hacer tap */
    .category-card:hover {
        transform: none;
    }
}
