/**
 * Shop Page Premium Styles - UNIVERSAL
 * 
 * Estilos que funcionan con CUALQUIER widget de productos
 * (WooCommerce nativo, JetWooBuilder, shortcodes)
 * 
 * @package Kaffeto
 * @since 1.0.0
 */

/* ========================================
   PRODUCTO INDIVIDUAL - UNIVERSAL
   Aplica a cualquier contenedor de producto
   ======================================== */

/* Targets múltiples para máxima compatibilidad */
.products .product,
.woocommerce ul.products li.product,
.jet-woo-products-grid__item,
.jet-woo-product-thumbnail,
article.product {
    background: #FFFFFF !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 20px rgba(45, 31, 26, 0.08) !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    border: 1px solid rgba(200, 153, 30, 0.1) !important;
    margin-bottom: 30px !important;
}

/* Hover Effect */
.products .product:hover,
.woocommerce ul.products li.product:hover,
.jet-woo-products-grid__item:hover,
article.product:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 16px 40px rgba(200, 153, 30, 0.25) !important;
    border-color: rgba(200, 153, 30, 0.3) !important;
}

/* ========================================
   IMAGEN DEL PRODUCTO
   ======================================== */

.woocommerce ul.products li.product a img,
.products .product img,
.jet-woo-product-thumbnail img,
.attachment-woocommerce_thumbnail {
    border-radius: 16px 16px 0 0 !important;
    transition: transform 0.5s ease !important;
}

.products .product:hover img,
.jet-woo-product-thumbnail:hover img {
    transform: scale(1.05) !important;
}

/* ========================================
   TÍTULO DEL PRODUCTO
   ======================================== */

.woocommerce ul.products li.product .woocommerce-loop-product__title,
.products .product h2,
.products .product h3,
.jet-woo-product-title a,
.jet-woo-product-title {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #2D1F1A !important;
    line-height: 1.4 !important;
    margin: 16px 20px 12px !important;
    transition: color 0.3s ease !important;
}

.products .product:hover h2,
.products .product:hover h3,
.jet-woo-product-title a:hover {
    color: #C8991E !important;
}

/* ========================================
   PRECIO
   ======================================== */

.woocommerce ul.products li.product .price,
.products .product .price,
.jet-woo-product-price {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #C8991E !important;
    margin: 0 20px 20px !important;
    display: block !important;
}

/* Sale Price (Tachado) */
del,
del .amount {
    color: #94a3b8 !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    margin-right: 8px !important;
}

ins,
ins .amount {
    text-decoration: none !important;
    color: #C8991E !important;
}

/* ========================================
   BOTÓN AÑADIR AL CARRITO
   ======================================== */

.woocommerce ul.products li.product .button,
.products .product .button,
.add_to_cart_button,
a.button.product_type_simple,
.jet-woo-product-add-to-cart .button,
.elementor-button {
    display: block !important;
    width: calc(100% - 40px) !important;
    margin: 0 20px 20px !important;
    padding: 16px 24px !important;
    background: linear-gradient(135deg, #C8991E 0%, #E5B03B 100%) !important;
    color: #FFFFFF !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1.2px !important;
    border: none !important;
    border-radius: 50px !important;
    text-align: center !important;
    box-shadow: none !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    text-decoration: none !important;
}

.woocommerce ul.products li.product .button:hover,
.products .product .button:hover,
.add_to_cart_button:hover,
.jet-woo-product-add-to-cart .button:hover {
    background: linear-gradient(135deg, #2D1F1A 0%, #1a110e 100%) !important;
    transform: translateY(-3px) !important;
    box-shadow: none !important;
}

/* ========================================
   CATEGORÍA
   ======================================== */

.posted_in,
.product-category,
.jet-woo-product-categories a {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    color: #C8991E !important;
    padding: 20px 20px 8px !important;
    display: block !important;
    text-decoration: none !important;
}

/* ========================================
   BADGES
   ======================================== */

.onsale,
span.onsale {
    background: linear-gradient(135deg, #C8991E 0%, #E5B03B 100%) !important;
    color: #FFFFFF !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    padding: 8px 16px !important;
    border-radius: 50px !important;
    top: 16px !important;
    left: 16px !important;
    right: auto !important;
}

.out-of-stock-badge,
.stock.out-of-stock {
    background: #dc2626 !important;
    color: #FFFFFF !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    padding: 6px 12px !important;
    border-radius: 50px !important;
    position: absolute !important;
    top: 30px !important;
    right: -35px !important;
}

/* ========================================
   GRID LAYOUT
   ======================================== */

/* Grid con máxima especificidad */
.woocommerce ul.products,
.woocommerce.woocommerce-page ul.products,
ul.products.columns-3,
.products {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 30px !important;
    margin: 30px 0 !important;
    list-style: none !important;
}

/* Ocultar primer elemento si está vacío o es invisible */
.woocommerce ul.products li:first-child:empty,
ul.products li:first-child:not(.product),
.woocommerce ul.products li.product:first-child:not(:has(img)),
ul.products.columns-3 > li:first-child:empty {
    display: none !important;
}

/* Eliminar margin/padding del contenedor de productos */
.woocommerce .products::before {
    display: none !important;
}

/* Responsive */
@media (max-width: 1024px) {
    .woocommerce ul.products,
    .products,
    .jet-woo-products-grid,
    .kaffeto-tab-content ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 24px !important;
    }
}

@media (max-width: 767px) {
    .woocommerce ul.products,
    .products,
    .jet-woo-products-grid,
    .kaffeto-tab-content ul.products,
    .kaffeto-tab-content .woocommerce ul.products,
    .kaffeto-tabs-wrapper ul.products {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    /* Forzar que cada producto ocupe 100% width en mobile */
    .woocommerce ul.products li.product,
    .products li.product,
    .kaffeto-tab-content li.product {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
}

/* ========================================
   FORZAR ESTILOS (si hay conflictos)
   ======================================== */

/* Remover float de WooCommerce legacy */
.woocommerce ul.products li.product {
    float: none !important;
    width: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Asegurar que padding interno funcione */
.jet-woo-products-grid__item-inner,
.jet-woo-product-content {
    padding: 0 !important;
}

/* ========================================
   OUT OF STOCK BADGE - AGOTADO
   ======================================== */

.kaffeto-out-of-stock-badge {
    position: absolute !important;
    top: 30px !important;
    right: -35px !important;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    color: white !important;
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 700 !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    padding: 8px 50px !important;
    transform: rotate(45deg) !important;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4) !important;
    z-index: 10 !important;
    text-align: center !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}

/* Ensure product container has position relative for absolute positioning */
.products .product,
.woocommerce ul.products li.product,
.jet-woo-products-grid__item {
    position: relative !important;
    overflow: hidden !important;
}

/* Darken out-of-stock products slightly */
.products .product.outofstock,
.woocommerce ul.products li.product.outofstock {
    opacity: 0.85 !important;
}

/* Mobile responsive badge */
@media (max-width: 768px) {
    .kaffeto-out-of-stock-badge {
        font-size: 10px !important;
        padding: 6px 40px !important;
        top: 10px !important;
        right: -40px !important;
    }
}

/* ========================================
   NEW BADGE - NUEVO
   ======================================== */

.kaffeto-new-badge {
    position: absolute !important;
    top: 30px !important;
    right: -35px !important;
    left: auto !important;
    background: linear-gradient(135deg, #C8991E 0%, #E5B03B 100%) !important;
    color: white !important;
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 700 !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    padding: 8px 50px !important;
    transform: rotate(45deg) !important;
    box-shadow: 0 4px 15px rgba(200, 153, 30, 0.4) !important;
    z-index: 10 !important;
    text-align: center !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}

/* Mobile responsive badge */
@media (max-width: 768px) {
    .kaffeto-new-badge {
        font-size: 10px !important;
        padding: 6px 40px !important;
        top: 10px !important;
        left: -40px !important;
    }
}
