/**
 * Estilos para carrusel de productos
 * @package HumoSagrado
 */

/* ==========================================================================
   CARRUSEL DE PRODUCTOS - IMPLEMENTACIÓN NATIVA
   ========================================================================== */

/* Contenedor principal del carrusel */
.products-carousel {
    position: relative;
    margin-bottom: 2rem;
    overflow: hidden;
}

/* Track del carrusel */
.products-carousel-track {
    display: flex;
    transition: transform 0.3s ease;
    width: 100%;
}

/* Items del carrusel */
.product-carousel-item {
    flex: 0 0 25%; /* 4 items por defecto */
    padding: 0 15px;
    box-sizing: border-box;
    height: auto;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    min-width: 0; /* Prevenir overflow */
}

/* Responsive para items del carrusel */
@media (max-width: 1024px) {
    .product-carousel-item {
        flex: 0 0 33.333%; /* 3 items en tablet */
    }
}

@media (max-width: 768px) {
    .product-carousel-item {
        flex: 0 0 50%; /* 2 items en móvil */
    }
}

.product-carousel-item .product-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.product-carousel-item .product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* Imagen del producto */
.product-carousel-item .product-image-wrapper {
    position: relative;
    overflow: hidden;
    height: 250px;
}

.product-carousel-item .product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-carousel-item .product-card:hover .product-image-wrapper img {
    transform: scale(1.05);
}

/* Contenido del producto */
.product-carousel-item .product-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-carousel-item .product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
}

.product-carousel-item .product-title a {
    color: var(--color-text-dark, #333);
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-carousel-item .product-title a:hover {
    color: var(--color-primary, #8B4513);
}

.product-carousel-item .product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-primary, #8B4513);
    margin: 0.75rem 0;
}

.product-carousel-item .product-actions {
    margin-top: auto;
    padding-top: 0.75rem;
}

/* Badges del producto */
.product-carousel-item .product-badges {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.product-carousel-item .product-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-carousel-item .sale-badge {
    background: #e74c3c;
    color: white;
}

.product-carousel-item .featured-badge {
    background: #f39c12;
    color: white;
}

.product-carousel-item .new-badge {
    background: #27ae60;
    color: white;
}

.product-carousel-item .stock-badge {
    background: #95a5a6;
    color: white;
}

.product-carousel-item .stock-badge.low-stock {
    background: #e67e22;
}

/* Acciones rápidas */
.product-carousel-item .product-quick-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
}

.product-carousel-item .product-card:hover .product-quick-actions {
    opacity: 1;
    transform: translateX(0);
}

.product-carousel-item .quick-action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.product-carousel-item .quick-action-btn:hover {
    background: var(--color-primary, #8B4513);
    color: white;
    transform: scale(1.1);
}

/* ==========================================================================
   CONTROLES DEL CARRUSEL - SLICK
   ========================================================================== */

/* Flechas de navegación */
.products-carousel .slick-prev,
.products-carousel .slick-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 0;
}

.products-carousel .slick-prev:hover,
.products-carousel .slick-next:hover {
    background: var(--color-primary, #8B4513);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.products-carousel .slick-prev {
    left: -25px;
}

.products-carousel .slick-next {
    right: -25px;
}

.products-carousel .slick-prev svg,
.products-carousel .slick-next svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Ocultar controles nativos del template */
.products-carousel .carousel-controls,
.products-carousel .carousel-indicators {
    display: none !important;
}

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

@media (max-width: 1200px) {
    .products-carousel .slick-prev {
        left: -20px;
    }
    
    .products-carousel .slick-next {
        right: -20px;
    }
}

@media (max-width: 768px) {
    .products-carousel .slick-prev,
    .products-carousel .slick-next {
        width: 40px;
        height: 40px;
    }
    
    .products-carousel .slick-prev {
        left: -15px;
    }
    
    .products-carousel .slick-next {
        right: -15px;
    }
    
    .product-carousel-item .product-content {
        padding: 1rem;
    }
    
    .product-carousel-item .product-image-wrapper {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .products-carousel .slick-prev,
    .products-carousel .slick-next {
        display: none !important;
    }
    
    .product-carousel-item .product-content {
        padding: 0.75rem;
    }
    
    .product-carousel-item .product-image-wrapper {
        height: 180px;
    }
}

/* ==========================================================================
   ACCESIBILIDAD
   ========================================================================== */

.products-carousel .slick-prev:focus,
.products-carousel .slick-next:focus {
    outline: 2px solid var(--color-primary, #8B4513);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .products-carousel .slick-slide,
    .product-carousel-item .product-card,
    .product-carousel-item .product-image-wrapper img {
        transition: none;
    }
}

/* ==========================================================================
   LOADING STATE
   ========================================================================== */

.products-carousel.loading {
    opacity: 0.6;
    pointer-events: none;
}

.products-carousel.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--color-primary, #8B4513);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 100;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}