/**
 * Trofodiet — estilos globales de la tienda (listados de productos, precios, iOS).
 * Origen: snippets WPCode 39893, 39267 y 39254 (mismo orden y contenido).
 * Ojo: casi todo va con !important porque compite con The7 y Elementor.
 */

/* ===================== Imágenes del listado en iOS (antes snippet 39893) ===================== */
/* Fix iOS Safari: imágenes tienda no llenan el ancho hasta interacción */
.woocom-project img,
.the7-woocommerce-loop-product-image img,
.post-thumbnail-rollover img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
}

/* Forzar el contenedor a ocupar el ancho completo */
.woocom-project .img-css-resize-wrapper,
.the7-woocommerce-loop-product-image .img-css-resize-wrapper {
    width: 100% !important;
    display: block !important;
}

/* Fix específico iOS para lazy loading */
@supports (-webkit-touch-callout: none) {
    .woocom-project img[loading="lazy"],
    .the7-woocommerce-loop-product-image img[loading="lazy"] {
        min-height: 1px;
        content-visibility: auto;
    }
}
/* ===================== Tarjetas de producto en categorías (antes snippet 39267) ===================== */
/* CSS PARA ARREGLAR LAYOUT DE PRODUCTOS EN CATEGORÍAS */

/* ===== LAYOUT GENERAL DE PRODUCTOS ===== */
.woocommerce ul.products li.product {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    min-height: 420px !important; /* Altura mínima consistente */
    padding: 15px !important;
    margin-bottom: 20px !important;
    background: #fff !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    position: relative !important;
    overflow: hidden !important;
}

.woocommerce ul.products li.product:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important;
}

/* ===== IMAGEN DEL PRODUCTO ===== */
.woocommerce ul.products li.product .layzr-bg,
.woocommerce ul.products li.product a:first-child {
    display: block !important;
    margin-bottom: 12px !important;
    overflow: hidden !important;
    border-radius: 6px !important;
}

.woocommerce ul.products li.product img {
    width: 100% !important;
    height: auto !important;
    max-height: 200px !important;
    object-fit: cover !important;
    transition: transform 0.3s ease !important;
}

.woocommerce ul.products li.product:hover img {
    transform: scale(1.05) !important;
}

/* ===== TÍTULO DEL PRODUCTO ===== */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 16px !important;
    line-height: 1.3 !important;
    margin: 0 0 10px 0 !important;
    padding: 0 !important;
    height: auto !important;
    min-height: 40px !important; /* Espacio mínimo para títulos */
    display: flex !important;
    align-items: center !important;
    text-align: center !important;
    font-weight: 600 !important;
    color: #333 !important;
}

/* ===== PRECIOS - ARREGLAR SOLAPAMIENTO ===== */
.woocommerce ul.products li.product .price {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    margin: 10px 0 !important;
    padding: 8px !important;
    background: #f8f9fa !important;
    border-radius: 6px !important;
    font-size: 0 !important; /* Ocultar texto suelto */
    line-height: 1.4 !important;
    min-height: 45px !important; /* Altura mínima para evitar colapsos */
}

.woocommerce ul.products li.product .price > span {
    font-size: 14px !important;
    white-space: nowrap !important;
}

.woocommerce ul.products li.product .price .woocommerce-Price-amount {
    font-weight: bold !important;
    color: #003568 !important;
}

.woocommerce ul.products li.product .price .price_time_opt {
    font-size: 12px !important;
    color: #666 !important;
    margin-left: 4px !important;
}

/* ===== RATING DE ESTRELLAS ===== */
.woocommerce ul.products li.product .star-rating {
    margin: 8px auto !important;
    display: block !important;
    text-align: center !important;
}

/* ===== BOTONES ===== */
.woocommerce ul.products li.product .woocommerce-loop-product__buttons {
    margin-top: auto !important; /* Empujar botones al final */
    padding-top: 10px !important;
}

.woocommerce ul.products li.product .button {
    width: 100% !important;
    padding: 12px 16px !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-align: center !important;
    transition: all 0.3s ease !important;
    border: none !important;
    background: #003568 !important;
    color: white !important;
    text-decoration: none !important;
}

.woocommerce ul.products li.product .button:hover {
    background: #004a7c !important;
    transform: translateY(-1px) !important;
}

/* ===== RESPONSIVE - MÓVIL ===== */
@media (max-width: 768px) {
    .woocommerce ul.products li.product {
        min-height: 380px !important;
        padding: 12px !important;
        margin-bottom: 15px !important;
    }
    
    .woocommerce ul.products li.product .woocommerce-loop-product__title {
        font-size: 14px !important;
        min-height: 35px !important;
        line-height: 1.2 !important;
    }
    
    .woocommerce ul.products li.product .price {
        flex-direction: column !important;
        gap: 2px !important;
        min-height: 50px !important;
        padding: 6px !important;
    }
    
    .woocommerce ul.products li.product .price > span {
        font-size: 13px !important;
    }
    
    .woocommerce ul.products li.product .price .price_time_opt {
        font-size: 11px !important;
    }
    
    .woocommerce ul.products li.product img {
        max-height: 180px !important;
    }
    
    .woocommerce ul.products li.product .button {
        padding: 10px 12px !important;
        font-size: 13px !important;
    }
}

/* ===== MÓVIL EXTRA PEQUEÑO ===== */
@media (max-width: 480px) {
    .woocommerce ul.products li.product {
        min-height: 350px !important;
        padding: 10px !important;
    }
    
    .woocommerce ul.products li.product .price {
        min-height: 55px !important;
        padding: 8px 4px !important;
    }
    
    .woocommerce ul.products li.product .price > span {
        font-size: 12px !important;
        text-align: center !important;
    }
    
    .woocommerce ul.products li.product .woocommerce-loop-product__title {
        font-size: 13px !important;
        min-height: 30px !important;
    }
}

/* ===== GRID ESPECÍFICO DE ELEMENTOR ===== */
.elementor-products-grid ul.products.elementor-grid {
    display: grid !important;
    gap: 20px !important;
}

.elementor-products-grid ul.products.elementor-grid li.product {
    margin: 0 !important;
    width: 100% !important;
}

/* ===== ARREGLAR CONFLICTOS DE TEMA ===== */
.woocommerce ul.products li.product,
.woocommerce div.product .related.products ul.products li.product,
.woocommerce div.product .upsells.products ul.products li.product {
    float: none !important;
    clear: none !important;
    width: auto !important;
}

/* ===== ELIMINAR SOMBRAS INDESEADAS ===== */
.woocommerce ul.products li.product * {
    box-shadow: none !important;
}

.woocommerce ul.products li.product {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important; /* Solo la sombra principal */
}

/* ===== OCULTAR ELEMENTOS INNECESARIOS ===== */
.screen-reader-text {
    position: absolute !important;
    left: -9999px !important;
    opacity: 0 !important;
}
/* Arreglo específico para botones en móvil */
@media (max-width: 480px) {
    .woocommerce ul.products li.product .button {
        font-size: 11px !important;
        line-height: 1.2 !important;
        min-height: 36px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
}

/* ===================== Orden del precio en la tienda (antes snippet 39254) ===================== */
/* CSS COMPLETO - WooCommerce estándar + Elementor/The7 */

/* ====== PARTE 1: WooCommerce estándar (categorías, archivo) ====== */
.woocommerce ul.products li.product .price,
.woocommerce-page ul.products li.product .price,
.products .product .price {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0 !important;
}

.woocommerce ul.products li.product .price > span,
.woocommerce-page ul.products li.product .price > span,
.products .product .price > span {
    font-size: 16px !important;
}

.woocommerce ul.products li.product .price > span.woocommerce-Price-amount.amount:last-child,
.woocommerce-page ul.products li.product .price > span.woocommerce-Price-amount.amount:last-child,
.products .product .price > span.woocommerce-Price-amount.amount:last-child {
    order: 1 !important;
}

.woocommerce ul.products li.product .price > span.woocommerce-Price-amount.amount:first-child,
.woocommerce-page ul.products li.product .price > span.woocommerce-Price-amount.amount:first-child,
.products .product .price > span.woocommerce-Price-amount.amount:first-child {
    order: 3 !important;
}

.woocommerce ul.products li.product .price > span.price_time_opt,
.woocommerce-page ul.products li.product .price > span.price_time_opt,
.products .product .price > span.price_time_opt {
    order: 4 !important;
}

.woocommerce ul.products li.product .price > span.woocommerce-Price-amount.amount:last-child::after,
.woocommerce-page ul.products li.product .price > span.woocommerce-Price-amount.amount:last-child::after,
.products .product .price > span.woocommerce-Price-amount.amount:last-child::after {
    content: " – ";
    order: 2 !important;
}

.woocommerce ul.products li.product .price > span *,
.woocommerce-page ul.products li.product .price > span *,
.products .product .price > span * {
    font-size: 16px !important;
}

/* ====== PARTE 2: Elementor/The7 (página tienda) ====== */
.elementor-widget-the7-wc-products .woocom-list-content .price,
.elementor-widget-the7-wc-products-carousel .woocom-list-content .price,
.woocom-list-content .price {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0 !important;
}

.elementor-widget-the7-wc-products .woocom-list-content .price > span,
.elementor-widget-the7-wc-products-carousel .woocom-list-content .price > span,
.woocom-list-content .price > span {
    font-size: 18px !important;
}

.elementor-widget-the7-wc-products .woocom-list-content .price > span.woocommerce-Price-amount:last-child,
.elementor-widget-the7-wc-products-carousel .woocom-list-content .price > span.woocommerce-Price-amount:last-child,
.woocom-list-content .price > span.woocommerce-Price-amount:last-child {
    order: 1 !important;
}

.elementor-widget-the7-wc-products .woocom-list-content .price > span.woocommerce-Price-amount:first-child,
.elementor-widget-the7-wc-products-carousel .woocom-list-content .price > span.woocommerce-Price-amount:first-child,
.woocom-list-content .price > span.woocommerce-Price-amount:first-child {
    order: 3 !important;
}

.elementor-widget-the7-wc-products .woocom-list-content .price > span.price_time_opt,
.elementor-widget-the7-wc-products-carousel .woocom-list-content .price > span.price_time_opt,
.woocom-list-content .price > span.price_time_opt {
    order: 4 !important;
}

.elementor-widget-the7-wc-products .woocom-list-content .price > span.woocommerce-Price-amount:last-child::after,
.elementor-widget-the7-wc-products-carousel .woocom-list-content .price > span.woocommerce-Price-amount:last-child::after,
.woocom-list-content .price > span.woocommerce-Price-amount:last-child::after {
    content: " – ";
    order: 2 !important;
}

.elementor-widget-the7-wc-products .woocom-list-content .price > span *,
.elementor-widget-the7-wc-products-carousel .woocom-list-content .price > span *,
.woocom-list-content .price > span * {
    font-size: 18px !important;
}