﻿/* ============================================
   PRODUCTOS - Estilos Específicos
   ============================================ */

/* Sidebar de Categorías */
.categoria-item {
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 12px 16px;
    color: var(--luna-azul);
}

    .categoria-item:hover {
        background-color: rgba(26, 35, 126, 0.05);
        transform: translateX(5px);
    }

    .categoria-item.active {
        background-color: var(--luna-azul) !important;
        color: white !important;
    }

        .categoria-item.active i {
            color: white !important;
        }

    .categoria-item i {
        margin-right: 8px;
        color: var(--luna-azul);
    }

/* Cards de Productos */
.producto-card {
    transition: all 0.3s ease;
    overflow: hidden;
}

    .producto-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.15) !important;
    }

.producto-imagen {
    transition: all 0.3s ease;
}

.producto-card:hover .producto-imagen {
    transform: scale(1.05);
}

/* Título del Producto */
.producto-titulo {
    color: var(--luna-azul);
    height: 45px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-weight: 600;
    line-height: 1.4;
}

/* Precio */
.producto-precio {
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--luna-rojo);
    margin: 0;
}

/* Badge de Categoría */
.badge-categoria {
    background-color: var(--luna-azul);
    color: white;
    font-size: 0.75rem;
    padding: 5px 10px;
}

/* Botón Agregar al Carrito */
.btn-agregar-carrito {
    background-color: var(--luna-rojo);
    color: white;
    border: none;
    padding: 12px 20px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 1rem;
}

    .btn-agregar-carrito:hover {
        background-color: var(--luna-rojo-hover);
        transform: scale(1.02);
        box-shadow: 0 4px 12px rgba(229, 57, 53, 0.3);
    }

    .btn-agregar-carrito:active {
        transform: scale(0.98);
    }

/* Botón Ver Todos */
.btn-ver-todos {
    background-color: var(--luna-rojo);
    color: white;
    padding: 12px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s ease;
}

    .btn-ver-todos:hover {
        background-color: var(--luna-rojo-hover);
        color: white;
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(229, 57, 53, 0.3);
    }

/* Estado Vacío */
.empty-state {
    padding: 80px 20px;
}

.empty-icon {
    font-size: 5rem;
    color: #d0d0d0;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* Animación de entrada para productos */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.producto-item {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

    .producto-item:nth-child(1) {
        animation-delay: 0.1s;
    }

    .producto-item:nth-child(2) {
        animation-delay: 0.2s;
    }

    .producto-item:nth-child(3) {
        animation-delay: 0.3s;
    }

    .producto-item:nth-child(4) {
        animation-delay: 0.4s;
    }

    .producto-item:nth-child(5) {
        animation-delay: 0.5s;
    }

    .producto-item:nth-child(6) {
        animation-delay: 0.6s;
    }

    .producto-item:nth-child(n+7) {
        animation-delay: 0.6s;
    }

/* Responsive */
@media (max-width: 768px) {
    .sticky-top {
        position: relative !important;
        top: 0 !important;
    }

    .producto-precio {
        font-size: 1.5rem;
    }

    .producto-titulo {
        font-size: 0.95rem;
        height: auto;
    }
}

/* Loading state */
.producto-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

.btn-agregar-carrito.loading {
    position: relative;
    color: transparent;
}

    .btn-agregar-carrito.loading::after {
        content: "";
        position: absolute;
        width: 16px;
        height: 16px;
        top: 50%;
        left: 50%;
        margin-left: -8px;
        margin-top: -8px;
        border: 2px solid white;
        border-radius: 50%;
        border-top-color: transparent;
        animation: spinner 0.6s linear infinite;
    }

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Animaciones de notificaciones */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}
/* Imágenes de productos */
.producto-imagen img {
    transition: transform 0.3s ease;
}

.producto-card:hover .producto-imagen img {
    transform: scale(1.1);
}

/* Animación de carga para imágenes */
.producto-imagen img {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Placeholder mientras carga la imagen */
.producto-imagen {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.producto-imagen img[src] {
    background: white;
    animation: none;
}