/**
 * Gestor Secciones Tienda - Estilos Base
 * Version: 1.12.1 (MODIFICADO)
 * Autor: VentaClick
 */

/* ============================================================
 * 0. AJUSTES GLOBALES DE BADGES
 * - Aplicar color en listados/miniaturas
 * - [MODIFICADO] Se eliminó la regla de transparencia forzada
 * ========================================================== */

/* Color de badge SOLO en miniaturas / listados */
.product-miniature .product-discount,
.product-miniature .discount-percentage,
.product-miniature .discount-product {
    display: inline-block !important;
    background-color: #28a745 !important; /* Color de badge en listados */
    color: #fff !important;
    margin-left: 5px !important;
    padding: 2px 5px !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    border-radius: 2px !important;
    text-transform: uppercase !important;
    margin-top: 2px !important;
    box-shadow: none !important;
}

/* [BLOQUE DESACTIVADO POR CONFLICTO]
   Forzaba transparencia e impedía que se viera el fondo verde en la ficha de producto.
*/
/*
body#product .product-discount,
body#product .discount-percentage,
body#product .discount,
body#product .has-discount .discount {
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    border-color: transparent !important;
    color: inherit !important;
}
*/

/* ============================================================
 * 1. LISTADOS / GRILLA (PRECIOS y PAGINACIÓN)
 * ========================================================== */

/* A. OCULTAR PRECIO VIEJO */
.product-miniature .regular-price,
.products .regular-price {
    display: none !important;
}

/* B. PRECIO ACTUAL: NEGRO y 1rem */
.product-miniature .current-price,
.product-miniature .product-price-and-shipping,
.product-miniature .price {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #000000 !important;
    text-decoration: none !important;
}

/* Enlaces dentro del precio (matar el azul) */
.product-miniature .current-price a,
.product-miniature .product-price-and-shipping a {
    color: inherit !important;
}

/* C. ETIQUETA DESCUENTO (listados) -- ya cubierta arriba pero repetimos reglas de layout */
.product-miniature .discount-product,
.product-miniature .discount-percentage,
.product-miniature .discount {
    /* propiedades visuales ya definidas anteriormente para consistencia */
    display: inline-block !important;
    margin-left: 5px !important;
    padding: 2px 5px !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    border-radius: 2px !important;
    text-transform: uppercase !important;
    margin-top: 2px !important;
}

/* ============================================================
 * 2. CARRITO (PROTECCIÓN)
 * ========================================================== */

.cart-grid .regular-price,
.blockcart .regular-price {
    display: none !important;
}

.cart-grid .discount,
.blockcart .discount {
    background-color: transparent !important;
    color: #fff !important;
    font-size: 0.8rem !important;
    padding: 2px 5px !important;
}

.cart-grid .current-price,
.cart-grid .product-price {
    font-size: inherit !important;
    display: block !important;
}

.cart-grid .gst-integer,
.cart-grid .gst-decimals {
    font-size: inherit !important;
    position: static !important;
    vertical-align: baseline !important;
    margin: 0 !important;
    top: 0 !important;
}

.cart-grid .gst-separator-hidden {
    display: inline !important;
}

/* ============================================================
 * 3. FICHA DE PRODUCTO (PDP) - ORDEN CORRECTO
 * ========================================================== */

/* Contenedor principal de precios */
body#product .product-prices,
body#product .product-price.h5 {
    display: block !important;
    width: 100% !important;
}

/* Precio tachado: ARRIBA, bloque separado */
body#product .regular-price,
body#product .product-prices .regular-price {
    display: block !important;
    width: 100% !important;
    margin-bottom: 8px !important;
    margin-top: 0 !important;
    color: #aeaeae !important;
    text-decoration: line-through !important;
    font-size: 1rem !important;
    font-weight: normal !important;
    line-height: normal !important;
}

/* Precio actual: ABAJO, en línea con el badge */
body#product .current-price,
body#product .product-price,
body#product .current-price-value {
    display: inline-block !important;
    vertical-align: middle !important;
    margin-right: 10px !important;
}

/* Badge de descuento: al lado del precio (PDP mantendrá transparencia) */
body#product .product-discount,
body#product .discount-percentage {
    display: inline-block !important;
    vertical-align: middle !important;
    margin-left: 0 !important;
}

/* ============================================================
 * 4. ESTILOS ML (Formato MercadoLibre)
 * ========================================================== */

/* PDP - Parte Entera */
body#product .current-price .gst-integer,
body#product .product-price .gst-integer,
body#product .current-price-value .gst-integer {
    font-size: 2rem !important;
    font-weight: 700 !important;
    line-height: 1;
}

/* PDP - Parte Decimal */
body#product .current-price .gst-decimals,
body#product .product-price .gst-decimals,
body#product .current-price-value .gst-decimals {
    font-size: 0.6em !important;
    font-weight: 700 !important;
    vertical-align: top;
    position: relative;
    margin-left: 1px;
    top: 0.1em;
    line-height: 1;
}

/* Listados - Parte Decimal */
.product-miniature .gst-decimals {
    font-size: 0.6em !important;
    vertical-align: top;
    position: relative;
    top: 0;
}

.gst-separator-hidden {
    display: none !important;
}

/* ESTILO DEFINITIVO DEL BADGE VERDE */
body#product .discount, 
body#product .discount-percentage, 
body#product .product-discount, 
body#product .has-discount .discount {
    display: inline-flex !important;
    align-items: center !important;
    font-size: 1rem !important;
    line-height: normal !important;
    vertical-align: middle !important;
    
    /* El verde estilo ML */
    background-color: #10c916 !important;
    color: #ffffff !important;
    
    margin-left: 10px !important;
    padding: 5px 10px !important;
    text-transform: uppercase !important;
    border-radius: 3px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    
    /* Aseguramos limpieza */
    border: none !important;
    box-shadow: none !important;
}


/* ============================================================
 * 5. SCROLL INFINITO
 * ========================================================== */

#gst-infinite-spinner {
    width: 36px;
    height: 36px;
    margin: 16px auto;
    border-radius: 50%;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: currentColor;
    animation: gstspin 1s linear infinite;
    display: none;
}

@keyframes gstspin {
    to {
        transform: rotate(360deg);
    }
}

.gst-load-more {
    display: block;
    margin: 16px auto;
}

/* ============================================================
 * 6. RESPONSIVE
 * ========================================================== */

@media (max-width: 768px) {
    body#product .current-price .gst-integer,
    body#product .product-price .gst-integer,
    body#product .current-price-value .gst-integer {
        font-size: 1.5rem !important;
    }

    .product-miniature .discount-product,
    .product-miniature .discount-percentage,
    .product-miniature .discount {
        font-size: 0.65rem !important;
        padding: 1px 4px !important;
    }
}

@media (max-width: 480px) {
    body#product .current-price .gst-integer,
    body#product .product-price .gst-integer,
    body#product .current-price-value .gst-integer {
        font-size: 1.25rem !important;
    }
}