/* ==========================================
   SECCIÓN DE CATEGORÍAS - CSS ULTRA LLAMATIVO
   Fondo transparente + Bordes dashed + Efectos WOW
   ========================================== */

/* Contenedor principal - SIN fondo */
.categories-section {
    max-width: 1400px;
    margin: 80px auto;
    padding: 0 2rem;
    background: transparent;
    position: relative;
}

/* Header de la sección */
.section-header {
    text-align: left;
    margin-bottom: 4rem;
    position: relative;
}

.titulo-categorias {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 900;
    color: #1a1a1a;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    background: #0a0a0a;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 300% 300%;
    animation: gradientShift 6s ease-in-out infinite;
    text-transform: uppercase;
    letter-spacing: -2px;
    position: relative;
    display: inline-block;
}

.titulo-categorias::after {
    content: '✨';
    position: absolute;
    right: -50px;
    top: 0;
    font-size: 2rem;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
    50% { transform: scale(1.2) rotate(180deg); opacity: 0.7; }
}

/* Grid de categorías */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    margin-bottom: 2rem;
}

/* Tarjeta de categoría - ULTRA LLAMATIVA */
.category-card {
    background: #ffffff;
    border: 3px dashed #667eea; /* BORDE DASHED */
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.15);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    transform-style: preserve-3d;
}

/* Efecto de brillo rotativo */
.category-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(102, 126, 234, 0.2) 50%,
        transparent 70%
    );
    transform: rotate(0deg);
    transition: transform 0.8s ease;
    z-index: 1;
}

.category-card:hover::before {
    transform: rotate(180deg);
}

/* Hover mega llamativo */
.category-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 
        0 20px 60px rgba(102, 126, 234, 0.4),
        0 0 0 6px rgba(220, 255, 0, 0.3),
        inset 0 0 30px rgba(102, 126, 234, 0.1);
    border-color: #dcff00;
    border-width: 4px;
}

/* Bordes de colores alternos */
.category-card:nth-child(1) { border-color: #667eea; }
.category-card:nth-child(2) { border-color: #f093fb; }
.category-card:nth-child(3) { border-color: #4facfe; }
.category-card:nth-child(4) { border-color: #43e97b; }
.category-card:nth-child(5) { border-color: #fa709a; }
.category-card:nth-child(6) { border-color: #dcff00; }
.category-card:nth-child(7) { border-color: #ff6b9d; }
.category-card:nth-child(8) { border-color: #c44dff; }

.category-card:nth-child(1):hover { border-color: #667eea; box-shadow: 0 20px 60px rgba(102, 126, 234, 0.5); }
.category-card:nth-child(2):hover { border-color: #f093fb; box-shadow: 0 20px 60px rgba(240, 147, 251, 0.5); }
.category-card:nth-child(3):hover { border-color: #4facfe; box-shadow: 0 20px 60px rgba(79, 172, 254, 0.5); }
.category-card:nth-child(4):hover { border-color: #43e97b; box-shadow: 0 20px 60px rgba(67, 233, 123, 0.5); }
.category-card:nth-child(5):hover { border-color: #fa709a; box-shadow: 0 20px 60px rgba(250, 112, 154, 0.5); }
.category-card:nth-child(6):hover { border-color: #dcff00; box-shadow: 0 20px 60px rgba(220, 255, 0, 0.5); }
.category-card:nth-child(7):hover { border-color: #ff6b9d; box-shadow: 0 20px 60px rgba(255, 107, 157, 0.5); }
.category-card:nth-child(8):hover { border-color: #c44dff; box-shadow: 0 20px 60px rgba(196, 77, 255, 0.5); }

/* Contenedor de imagen con efecto parallax */
.card-image-container {
    position: relative;
    width: 100%;
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 2;
}

.category-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: brightness(0.95);
    border-radius: 8px;
}

.category-card:hover .category-image {
    transform: scale(1.15) rotate(2deg);
    filter: brightness(1.1);
}

/* Icono para categorías sin imagen - MÁS LLAMATIVO */
.card-icon {
    font-size: 5rem;
    opacity: 0.4;
    transition: all 0.5s ease;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
}

.category-card:hover .card-icon {
    opacity: 0.8;
    transform: scale(1.3) rotate(15deg);
}

/* Badge de cantidad - ESTILO NEÓN */
.item-count {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    color: #dcff00;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 900;
    z-index: 3;
    transition: all 0.4s ease;
    border: 2px solid #dcff00;
    text-shadow: 0 0 10px rgba(220, 255, 0, 0.8);
    box-shadow: 
        0 0 20px rgba(220, 255, 0, 0.4),
        inset 0 0 10px rgba(220, 255, 0, 0.2);
    animation: neonPulse 2s ease-in-out infinite;
}

@keyframes neonPulse {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(220, 255, 0, 0.4),
            inset 0 0 10px rgba(220, 255, 0, 0.2);
    }
    50% {
        box-shadow: 
            0 0 30px rgba(220, 255, 0, 0.6),
            inset 0 0 15px rgba(220, 255, 0, 0.3);
    }
}

.category-card:hover .item-count {
    transform: scale(1.15) rotate(-5deg);
    background: linear-gradient(135deg, #dcff00, #f0ff33);
    color: #1a1a1a;
    text-shadow: none;
}

/* Contenido de la tarjeta */
.card-content {
    padding: 1.8rem;
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
}

.category-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 1.2rem;
    transition: all 0.4s ease;
    line-height: 1.2;
    letter-spacing: -0.5px;
    position: relative;
    display: inline-block;
}

.category-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #dcff00);
    transition: width 0.4s ease;
}

.category-card:hover .category-title {
    color: #667eea;
    transform: translateX(5px);
}

.category-card:hover .category-title::after {
    width: 100%;
}

/* Footer del card */
.card-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-top: 1.2rem;
    margin-top: auto;
    border-top: 2px dashed rgba(102, 126, 234, 0.2);
}

/* Botón Explore - ULTRA LLAMATIVO */
.explore-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    color: white;
    padding: 0.9rem 2.2rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.4s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 
        0 6px 20px rgba(102, 126, 234, 0.4),
        inset 0 -2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: gradientMove 3s ease infinite;
}

@keyframes gradientMove {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.explore-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.explore-btn:hover::before {
    width: 300px;
    height: 300px;
}

.explore-btn:hover {
    transform: translateX(10px) scale(1.05);
    box-shadow: 
        0 10px 35px rgba(102, 126, 234, 0.6),
        0 0 0 4px rgba(220, 255, 0, 0.3),
        inset 0 -2px 10px rgba(0, 0, 0, 0.2);
    letter-spacing: 2px;
}

/* Efecto de partículas decorativas */
.category-card::after {
    content: '✨';
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 1.5rem;
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 3;
}

.category-card:hover::after {
    opacity: 1;
    transform: translateY(-5px) rotate(20deg);
}

/* Estado vacío */
.category-card:has(.card-content > p) {
    justify-content: center;
    align-items: center;
    min-height: 250px;
    text-align: center;
    border-style: solid;
}

.category-card .card-content > p {
    color: #666;
    font-size: 1.1rem;
    margin: 0;
    font-weight: 500;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

/* Tablets grandes (≤1024px) */
@media (max-width: 1024px) {
    .categories-section {
        margin: 60px auto;
        padding: 0 1.5rem;
    }

    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 2rem;
    }

    .card-image-container {
        height: 220px;
    }

    .category-title {
        font-size: 1.4rem;
    }
}

/* Tablets (≤768px) */
@media (max-width: 768px) {
    .categories-section {
        margin: 50px auto;
        padding: 0 1.25rem;
    }

    .section-header {
        margin-bottom: 2.5rem;
    }

    .titulo-categorias::after {
        right: -35px;
        font-size: 1.5rem;
    }

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

    .card-image-container {
        height: 200px;
    }

    .category-title {
        font-size: 1.2rem;
    }

    .card-content {
        padding: 1.5rem;
    }

    .explore-btn {
        padding: 0.75rem 1.8rem;
        font-size: 0.9rem;
    }
}

/* Móviles (≤480px) */
@media (max-width: 480px) {
    .categories-section {
        margin: 40px auto;
        padding: 0 1rem;
    }

    .section-header {
        margin-bottom: 2rem;
    }

    .titulo-categorias::after {
        display: none;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }

    .category-card {
        border-radius: 16px;
        border-width: 2px;
    }

    .card-image-container {
        height: 160px;
    }

    .category-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .card-content {
        padding: 1.2rem;
    }

    .item-count {
        padding: 0.5rem 0.9rem;
        font-size: 0.8rem;
        top: 0.75rem;
        right: 0.75rem;
    }

    .card-footer {
        padding-top: 1rem;
    }

    .explore-btn {
        width: 100%;
        justify-content: center;
        padding: 0.7rem 1.5rem;
        font-size: 0.85rem;
        letter-spacing: 0.5px;
    }

    .explore-btn:hover {
        transform: scale(1.02);
    }
}

/* ==========================================
   ANIMACIONES DE ENTRADA
   ========================================== */

.category-card {
    opacity: 0;
    animation: fadeInUpScale 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.category-card:nth-child(1) { animation-delay: 0.1s; }
.category-card:nth-child(2) { animation-delay: 0.2s; }
.category-card:nth-child(3) { animation-delay: 0.3s; }
.category-card:nth-child(4) { animation-delay: 0.4s; }
.category-card:nth-child(5) { animation-delay: 0.5s; }
.category-card:nth-child(6) { animation-delay: 0.6s; }
.category-card:nth-child(7) { animation-delay: 0.7s; }
.category-card:nth-child(8) { animation-delay: 0.8s; }

@keyframes fadeInUpScale {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9) rotate(-5deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0deg);
    }
}

/* ==========================================
   ESTILOS PARA EL BOTÓN DE FAVORITOS
   ========================================== */

.favorite-btn {
    position: absolute;
    top: 15px;
    left: 15px;  /* Cambiado de right a left */
    width: 46px;
    height: 46px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
}

.favorite-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.favorite-btn:active {
    transform: scale(0.95);
}

.heart-icon {
    font-size: 1.5rem;
    line-height: 1;
    transition: all 0.3s ease;
    display: inline-block;
}

/* Estado activo (favorito agregado) */
.favorite-btn.active .heart-icon {
    content: '❤️';
}

.favorite-btn.active {
    background: rgba(220, 255, 0, 0.15);
}

/* Animación al hacer clic */
.favorite-btn.animating .heart-icon {
    animation: heartBeat 0.6s ease-in-out;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(0.9); }
    75% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Efecto de pulso sutil cuando está activo */
.favorite-btn.active .heart-icon {
    animation: gentlePulse 2s ease-in-out infinite;
}

@keyframes gentlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ==========================================
   RESPONSIVE DESIGN PARA BOTÓN DE FAVORITOS
   ========================================== */

/* Tablets grandes (≤1024px) */
@media (max-width: 1024px) {
    .favorite-btn {
        width: 44px;
        height: 44px;
        top: 12px;
        left: 12px;  /* Cambiado de right a left */
    }

    .heart-icon {
        font-size: 1.4rem;
    }
}

/* Tablets (≤768px) */
@media (max-width: 768px) {
    .favorite-btn {
        width: 42px;
        height: 42px;
        top: 10px;
        left: 10px;  /* Cambiado de right a left */
    }

    .heart-icon {
        font-size: 1.3rem;
    }
}

/* Móviles (≤480px) */
@media (max-width: 480px) {
    .favorite-btn {
        width: 38px;
        height: 38px;
        top: 38px;
        left: 8px;  /* Cambiado de right a left */
    }

    .heart-icon {
        font-size: 1.2rem;
    }

    .favorite-btn:hover {
        transform: scale(1.05);
    }
}

/* Móviles muy pequeños (≤360px) */
@media (max-width: 360px) {
    .favorite-btn {
        width: 36px;
        height: 36px;
        top: 6px;
        left: 6px;  /* Cambiado de right a left */
    }

    .heart-icon {
        font-size: 1.1rem;
    }
}

/* Mejora de accesibilidad en dispositivos táctiles */
@media (hover: none) and (pointer: coarse) {
    .favorite-btn {
        min-width: 44px;
        min-height: 44px;
    }
}
/* Hace que el enlace ocupe todo el espacio de la tarjeta */
.category-card-link {
  display: block; /* O display: flex; si usas flexbox para alinear */
  text-decoration: none; /* Quita el subrayado del enlace */
  color: inherit; /* Asegura que el texto dentro no herede el color azul del enlace */
}

/* Opcional: Un efecto hover sutil en toda la tarjeta */
.category-card-link:hover .category-card {
  transform: translateY(-5px); /* Ejemplo: levanta la tarjeta al pasar el mouse */
  box-shadow: 0 8px 16px rgba(0,0,0,0.2); /* Ejemplo: aumenta la sombra */
}