/* ============================================
   SYSPRO UPSELL - ESTILO FARMA2GO
   Versión 4.0 - Carrusel horizontal moderno
   ============================================ */

/* Contenedor principal */
.syspro-upsell-farma2go {
    margin: 20px 0;
    padding: 0;
    position: relative;
}

/* Título */
.syspro-upsell-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 20px 0;
    padding: 0 15px;
    text-align: left;
}

/* Wrapper del carrusel */
.syspro-upsell-carousel-wrapper {
    position: relative;
    padding: 0 50px;
}

/* Contenedor del carrusel */
.syspro-upsell-carousel {
    overflow: hidden;
    position: relative;
}

/* Track del carrusel */
.syspro-upsell-carousel-track {
    display: flex;
    gap: 15px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 5px 0;
}

/* Tarjeta de producto */
.syspro-upsell-card {
    flex: 0 0 auto;
    width: 180px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.syspro-upsell-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: #ddd;
}

/* Link de la tarjeta */
.syspro-upsell-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Badge de descuento */
.syspro-discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #333;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Wrapper de imagen */
.syspro-upsell-image-wrapper {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    overflow: hidden;
    position: relative;
}

/* Imagen del producto */
.syspro-upsell-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.syspro-upsell-card:hover .syspro-upsell-image {
    transform: scale(1.05);
}

/* Sin imagen placeholder */
.syspro-upsell-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f8f8;
    color: #ccc;
}

/* Contenido de la tarjeta */
.syspro-upsell-card-content {
    padding: 12px;
}

/* Nombre del producto */
.syspro-upsell-name {
    font-size: 13px;
    line-height: 1.4;
    color: #333;
    margin: 0 0 8px 0;
    height: 36px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-weight: 400;
}

/* Contenedor de precios */
.syspro-upsell-prices {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Precio regular (tachado) */
.syspro-regular-price {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
}

/* Precio actual */
.syspro-price {
    font-size: 16px;
    font-weight: 700;
    color: #2d9f4f;
}

/* Botones de navegación del carrusel */
.syspro-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.syspro-carousel-btn:hover {
    background: #f5f5f5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #ccc;
}

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

.syspro-carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.syspro-carousel-prev {
    left: 0;
}

.syspro-carousel-next {
    right: 0;
}

.syspro-carousel-btn svg {
    color: #333;
}

/* Responsive: Tablet */
@media (max-width: 768px) {
    .syspro-upsell-card {
        width: 160px;
    }
    
    .syspro-upsell-image-wrapper {
        height: 160px;
    }
    
    .syspro-upsell-carousel-wrapper {
        padding: 0 40px;
    }
    
    .syspro-carousel-btn {
        width: 36px;
        height: 36px;
    }
}

/* Responsive: Mobile */
@media (max-width: 480px) {
    .syspro-upsell-card {
        width: 140px;
    }
    
    .syspro-upsell-image-wrapper {
        height: 140px;
    }
    
    .syspro-upsell-carousel-wrapper {
        padding: 0 35px;
    }
    
    .syspro-carousel-btn {
        width: 32px;
        height: 32px;
    }
    
    .syspro-upsell-name {
        font-size: 12px;
        height: 32px;
    }
    
    .syspro-price {
        font-size: 14px;
    }
    
    .syspro-upsell-carousel-track {
        gap: 10px;
    }
}

/* Animación suave al cargar */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.syspro-upsell-farma2go {
    animation: fadeInUp 0.5s ease-out;
}

/* ============================================
   GARANTIZAR DIMENSIONES DE LAS CARDS
   ============================================ */

/* Asegurar que las cards tengan ancho explícito */
.syspro-upsell-card {
    flex: 0 0 auto;
    width: 180px !important; /* Forzar ancho */
    min-width: 180px; /* Ancho mínimo garantizado */
    box-sizing: border-box;
}

/* Asegurar que el track sea flexible pero mantenga el contenido */
.syspro-upsell-carousel-track {
    display: flex !important;
    gap: 15px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 5px 0;
    will-change: transform;
}

/* Prevenir que las imágenes afecten el layout prematuramente */
.syspro-upsell-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
}

.syspro-upsell-image-wrapper {
    width: 100% !important;
    height: 180px !important;
}