/**
 * Shopify Carousel Styles
 * Responsive carousel con drag functionality
 */

/* Wrapper principal */
.shopify-carousel-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 40px auto;
    padding: 0 20px;
}

/* Contenedor del carrusel */
.shopify-carousel {
    overflow: hidden;
    position: relative;
    cursor: grab;
    user-select: none;
}

.shopify-carousel.dragging {
    cursor: grabbing;
}

/* Track del carrusel */
.carousel-track {
    display: flex;
    gap: 20px;
    transition: transform 0.3s ease-out;
    will-change: transform;
}

.shopify-carousel.dragging .carousel-track {
    transition: none;
}

/* Items del carrusel */
.carousel-item {
    flex: 0 0 350px;
    width: 350px;
    background: transparent;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Link del producto */
.product-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

/* Imagen del producto */
.product-image {
    width: 100%;
    height: 350px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

/* Título del producto */
.product-title {
    font-size: 18px;
    font-weight: 400;
    color: #000;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0px !important;
}

/* Precio del producto */
.product-price {
    font-size: 18px;
    font-weight: 700;
    color: #000;
}

/* Botones de navegación */
.carousel-nav {
    display: none !important;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    font-size: 32px;
    cursor: pointer;
    /*display: flex;*/
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    color: #333;
}

.carousel-nav:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.carousel-nav:active {
    transform: translateY(-50%) scale(0.95);
}

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

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

/* Ocultar navegación si no hay espacio */
@media (max-width: 768px) {
    .carousel-nav {
        display: none;
    }
}

/* Error message */
.shopify-error {
    padding: 20px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 4px;
    color: #c33;
    text-align: center;
}

/* RESPONSIVE - Móvil */
@media (max-width: 768px) {
    .shopify-carousel-wrapper {
        padding: 0 10px;
        margin: 20px auto;
    }

    .carousel-track {
        gap: 15px;
    }

    .carousel-item {
        flex: 0 0 280px;
        width: 280px;
    }

    .product-image {
        height: 280px;
    }

    .product-title {
        font-size: 14px;
        margin: 12px 12px 6px;
        min-height: 40px;
    }

    .product-price {
        font-size: 16px;
        margin: 0 12px 12px;
    }
}

/* Móvil pequeño */
@media (max-width: 480px) {
    .carousel-item {
        flex: 0 0 250px;
        width: 250px;
    }

    .product-image {
        height: 250px;
    }
}

/* Desktop grande */
@media (min-width: 1400px) {
    .shopify-carousel-wrapper {
        max-width: 1400px;
    }
}

/* Animación de carga */
@keyframes shimmer {
    0% {
        background-position: -468px 0;
    }

    100% {
        background-position: 468px 0;
    }
}

.carousel-item.loading {
    background: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
    background-size: 800px 104px;
    animation: shimmer 1.5s infinite linear;
}

/* Accesibilidad */
.carousel-nav:focus {
    outline: 2px solid #4A90E2;
    outline-offset: 2px;
}

.product-link:focus {
    outline: 2px solid #4A90E2;
    outline-offset: 2px;
}

/* Prevenir selección de texto durante drag */
.shopify-carousel.dragging * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}