/* ═══════════ VARIABLES DE DISEÑO ═══════════ */
:root {
    --primary-color: #CE48CE;
    --primary-dark: #A83BA8;
    --primary-light: #E89CE8;
    --accent-color: #F5E6E8;
    --text-primary: #2D2D2D;
    --text-light: #666666;
    --bg-light: #FAFAFA;
    --bg-subtle: #F5F0F2;
    --border-light: #E8D5DA;
    --shadow-sm: 0 2px 8px rgba(206, 72, 206, 0.08);
    --shadow-md: 0 8px 24px rgba(206, 72, 206, 0.12);
    --shadow-lg: 0 16px 48px rgba(206, 72, 206, 0.15);
    --shadow-float: 0 12px 32px rgba(206, 72, 206, 0.18);
}

/* ═══════════ ESTILOS BASE ═══════════ */
body {
    font-family: 'Segoe UI', Trebuchet MS, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #FAFAFA 0%, #F5F0F2 50%, #FAF8FA 100%);
    background-attachment: fixed;
    position: relative;
}

/* Textura sutil de fondo */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(206, 72, 206, 0.02) 35px, rgba(206, 72, 206, 0.02) 70px),
        repeating-linear-gradient(-45deg, transparent, transparent 35px, rgba(206, 72, 206, 0.015) 35px, rgba(206, 72, 206, 0.015) 70px);
    pointer-events: none;
    z-index: 0;
}

/* ═══════════ SECCIÓN DE CATEGORÍAS ═══════════ */
.categoria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 28px;
    padding: 60px 30px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Responsivo */
@media (max-width: 1024px) {
    .categoria-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
        padding: 50px 24px;
    }
}

@media (max-width: 768px) {
    .categoria-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 40px 20px;
    }
}

/* ═══════════ TARJETA DE CATEGORÍA ═══════════ */
.categoria-item {
    position: relative;
    display: block;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow-md);
    background: white;
}

.categoria-item:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-float);
}

/* Imagen de la categoría */
.categoria-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease-out;
}

.categoria-item:hover img {
    transform: scale(1.08);
}

/* ═══════════ OVERLAY - ANTES (ESTADO NORMAL) ═══════════ */
.categoria-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 24px;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.15) 40%,
        rgba(0, 0, 0, 0.4) 100%
    );
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 1;
    pointer-events: none;
}

/* ═══════════ OVERLAY - DESPUÉS (AL PASAR EL MOUSE) ═══════════ */
.categoria-item:hover .categoria-overlay {
    background: linear-gradient(
        135deg,
        rgba(206, 72, 206, 0.95) 0%,
        rgba(168, 59, 168, 0.92) 100%
    );
    padding: 32px;
    justify-content: center;
    align-items: center;
}

/* ═══════════ TÍTULO DE CATEGORÍA ═══════════ */
.categoria-overlay h3 {
    font-size: 1.3em;
    font-weight: 700;
    margin: 0;
    margin-bottom: 8px;
    text-align: left;
    color: white;
    letter-spacing: -0.5px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    width: 100%;
}

.categoria-item:hover .categoria-overlay h3 {
    font-size: 1.9em;
    text-align: center;
    margin-bottom: 16px;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* ═══════════ BOTÓN/LINK DE EXPLORAR ═══════════ */
.categoria-overlay p {
    margin: 0;
    font-size: 0;
    font-weight: 600;
    text-align: center;
    color: white;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 12px 28px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
    text-transform: uppercase;
    display: inline-block;
    white-space: nowrap;
    cursor: pointer;
    position: relative;
}

.categoria-item:hover .categoria-overlay p {
    font-size: 0.9em;
    opacity: 1;
    transform: scale(1);
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.7);
    transition: all 0.4s ease;
}

.categoria-overlay p:active {
    transform: scale(0.95);
}

/* Remover los pseudo-elementos innecesarios */
.categoria-overlay p::before,
.categoria-overlay p::after {
    content: none;
}

/* ═══════════ EFECTO SHINE EN HOVER ═══════════ */
.categoria-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        45deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    pointer-events: none;
    border-radius: 16px;
}

.categoria-item:hover::after {
    transform: translateX(100%);
}

/* ═══════════ SOPORTE PARA DEVICES CON HOVER LIMITADO ═══════════ */
@media (hover: none) and (pointer: coarse) {
    .categoria-item {
        transform: translateY(0);
        box-shadow: var(--shadow-sm);
    }

    .categoria-item:active {
        transform: translateY(-6px);
        box-shadow: var(--shadow-md);
    }

    .categoria-overlay p {
        font-size: 0.85em;
        opacity: 0.9;
        transform: scale(0.95);
    }

    .categoria-item:active .categoria-overlay p {
        opacity: 1;
        transform: scale(1);
    }

    .categoria-overlay {
        background: linear-gradient(
            180deg,
            rgba(0, 0, 0, 0) 0%,
            rgba(0, 0, 0, 0.2) 40%,
            rgba(0, 0, 0, 0.5) 100%
        );
    }

    .categoria-item:active .categoria-overlay {
        background: linear-gradient(
            135deg,
            rgba(206, 72, 206, 0.93) 0%,
            rgba(168, 59, 168, 0.90) 100%
        );
    }
}

/* ═══════════ ANIMACIÓN INICIAL DE CARGA ═══════════ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.categoria-item {
    animation: fadeInUp 0.6s ease-out forwards;
}

.categoria-item:nth-child(1) { animation-delay: 0.05s; }
.categoria-item:nth-child(2) { animation-delay: 0.1s; }
.categoria-item:nth-child(3) { animation-delay: 0.15s; }
.categoria-item:nth-child(4) { animation-delay: 0.2s; }
.categoria-item:nth-child(5) { animation-delay: 0.25s; }
.categoria-item:nth-child(6) { animation-delay: 0.3s; }

/* ═══════════ ACCESIBILIDAD ═══════════ */
@media (prefers-reduced-motion: reduce) {
    .categoria-item,
    .categoria-overlay,
    .categoria-overlay h3,
    .categoria-overlay p {
        transition: none !important;
        animation: none !important;
    }
}

/* ═══════════ FOCUS VISIBLE PARA NAVEGACIÓN CON TECLADO ═══════════ */
.categoria-item:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}