/**
 * Xoey - Estilos personalizados para productos
 * CSS custom ≤5% con prefijo xoey-
 * Solo estilos que no se pueden lograr con Bootstrap 5
 */

/* ============================================
   MENSAJE DE LIVE EN MODALES
   ============================================ */

/* Mensaje de Live - Mobile-first */
.xoey-live-notice .alert {
    font-size: 0.875rem;
    line-height: 1.4;
    border-radius: 0.375rem;
}

.xoey-live-notice .icon-lightning {
    color: #ff6b35;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.xoey-live-notice strong {
    font-weight: 600;
}

/* Desktop: aumentar ligeramente el tamaño */
@media (min-width: 768px) {
    .xoey-live-notice .alert {
        font-size: 0.9375rem;
    }
}

/* ============================================
   BADGE DE PRECIO EN VIVO
   ============================================ */

/* Badge de precio en vivo */
.xoey-live-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 0.5rem;
    color: #ff6b35;
    font-size: 0.875rem;
    vertical-align: middle;
    animation: xoey-pulse 2s ease-in-out infinite;
}

.xoey-live-badge .icon {
    display: inline-block;
    font-size: 1rem;
}

.xoey-live-badge:hover {
    color: #ff5722;
}

/* Animación de pulso para el badge live */
@keyframes xoey-pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* Precio especial cuando el modo Live está activo */
.tf-product-info-price .xoey-price-live {
    font-weight: 700;
}

.tf-product-info-price .badges-on-sale.xoey-discount-live {
    background-color: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.tf-product-info-price
    .badges-on-sale.xoey-discount-live
    .xoey-discount-percent {
    color: inherit;
}

/* ============================================
   DESTACADOS EN LISTADO DE PRODUCTOS
   ============================================ */
.card-product .xoey-featured-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 40;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.875rem;
    height: 1.875rem;
    background: linear-gradient(135deg, #f8d77a, #f0b948);
    color: var(--white);
    font-size: 0.875rem;
    border-radius: 50%;
    box-shadow: 0 10px 24px rgba(170, 94, 133, 0.25);
}

.card-product .xoey-featured-badge .icon {
    font-size: 0.875rem;
}

.xoey-featured-card .card-product-wrapper {
    box-shadow: 0 18px 36px rgba(170, 94, 133, 0.18);
    border: 1px solid rgba(170, 94, 133, 0.2);
    transition: box-shadow 0.3s ease;
}

.xoey-featured-card .card-product-wrapper:hover {
    box-shadow: 0 22px 42px rgba(170, 94, 133, 0.24);
}

/* Ajustes para el precio con badge live */
.price.current-price {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

/* Responsive: ajustes móviles */
@media (max-width: 576px) {
    .xoey-live-badge {
        font-size: 0.75rem;
        margin-left: 0.25rem;
    }

    .xoey-live-badge .icon {
        font-size: 0.875rem;
    }
}

/* ============================================
   MODAL QUICK ADD - Corrección de escalado de imágenes
   ============================================ */
.popup-quickadd .tf-product-info-item .image {
    width: 70px;
    height: 98px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.popup-quickadd .tf-product-info-item .image img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}

/* ============================================
   MODAL QUICK VIEW - Galería con relación fija
   ============================================ */
.xoey-quickview-media-item {
    width: 100%;
    aspect-ratio: 3 / 4;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #ffffff;
}

.xoey-quickview-media-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.xoey-quickview-media-img:hover {
    transform: scale(1.025);
}

.tf-product-info-actions {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.tf-product-info-actions .tf-product-info-quantity {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 140px;
}

.tf-product-info-actions .wg-quantity {
    width: 100%;
}

.tf-product-info-actions .tf-btn {
    width: 100%;
}

.tf-product-info-buy-extra {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tf-product-info-buy-extra .btns-full {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.tf-product-info-buy-extra .xoey-whatsapp-btn {
    width: 100%;
    justify-content: center;
}

.tf-product-info-badges {
    gap: 0.75rem;
}

.tf-product-info-badges .badges span,
.tf-product-info-badges .product-status-content {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.tf-product-info-badges .product-status-content p {
    font-size: 0.875rem;
}

/* ============================================
   BOTÓN DE WHATSAPP
   ============================================ */

/* Botón de WhatsApp - Mobile-first */
.xoey-whatsapp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background-color: #25d366;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.xoey-whatsapp-btn:hover {
    background-color: #128c7e;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.xoey-whatsapp-btn:active {
    transform: translateY(0);
}

.xoey-whatsapp-btn .icon-whatsapp {
    font-size: 1.25rem;
}

/* Desktop: aumentar ligeramente el tamaño */
@media (min-width: 768px) {
    .xoey-whatsapp-btn {
        font-size: 1.0625rem;
        padding: 1rem 1.75rem;
    }

    .xoey-whatsapp-btn .icon-whatsapp {
        font-size: 1.375rem;
    }
}

.tf-product-info-buy-button form .btns-full.xoey-whatsapp-btn {
    background-color: #25d366;
    color: #ffffff;
    border: none;
    border-radius: 0.375rem;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.24);
}

.tf-product-info-buy-button form .btns-full.xoey-whatsapp-btn:hover,
.tf-product-info-buy-button form .btns-full.xoey-whatsapp-btn:focus {
    background-color: #128c7e;
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(18, 140, 126, 0.28);
}

.tf-product-info-buy-button form .btns-full.xoey-whatsapp-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(18, 140, 126, 0.2);
}

.xoey-loadmore-hidden {
    display: none !important;
}

@media (max-width: 575.98px) {
    .xoey-tab-scroll {
        overflow-x: auto;
        gap: 12px;
        justify-content: flex-start !important;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .xoey-tab-scroll::-webkit-scrollbar {
        display: none;
    }

    .xoey-tab-scroll .nav-tab-item {
        flex: 0 0 auto;
    }

    .xoey-tab-scroll .nav-tab-item a {
        white-space: nowrap;
    }
}
