/**
 * FST - WooCommerce Grid Multiaceros
 * Mejora visual de grillas WooCommerce clásicas y WooCommerce Blocks.
 */

/* =========================================================
   1. Grilla categorías / archivo WooCommerce clásico
   ========================================================= */

/* Contenedor principal */
.woocommerce.archive .site-main,
.woocommerce-page.archive .site-main {
    max-width: 1320px;
    margin: 0 auto;
    padding: 30px 24px 60px;
}

/* Título categoría */
.woocommerce-products-header__title,
.woocommerce.archive h1.page-title,
.woocommerce.archive .page-title {
    text-align: center;
    color: #ed3237;
    font-size: 30px;
    font-weight: 700;
    margin: 25px 0 45px;
}

/* Resultado y ordenamiento */
.woocommerce .woocommerce-result-count {
    margin-bottom: 22px;
    color: #344054;
    font-size: 14px;
}

.woocommerce .woocommerce-ordering {
    margin-bottom: 22px;
}

.woocommerce .woocommerce-ordering select {
    min-width: 230px;
    height: 42px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    padding: 0 12px;
    background-color: #ffffff;
    color: #344054;
    outline: none;
}

/* Grilla productos clásica */
.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    margin: 0 auto 60px !important;
    padding: 0 !important;
}

/* Reset columnas del theme/WooCommerce */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    float: none !important;
    clear: none !important;
}

/* Tarjeta */
.woocommerce ul.products li.product {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 330px;
    background: #ffffff;
    border: 1px solid #e4e7ec;
    border-radius: 12px;
    padding: 22px 18px 18px !important;
    text-align: center;
    box-shadow: 0 8px 20px rgba(16, 24, 40, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.woocommerce ul.products li.product:hover {
    transform: translateY(-4px);
    border-color: #ff9900;
    box-shadow: 0 14px 30px rgba(16, 24, 40, 0.12);
}

/* Link producto */
.woocommerce ul.products li.product a.woocommerce-LoopProduct-link {
    display: flex;
    flex-direction: column;
    flex: 1;
    text-decoration: none;
}

/* Imagen producto */
.woocommerce ul.products li.product a img,
.woocommerce ul.products li.product img {
    display: block;
    width: 100%;
    max-width: 170px;
    height: 170px;
    max-height: 180px;
    object-fit: contain;
    margin: 0 auto 18px !important;
    transition: transform 0.2s ease;
}

.woocommerce ul.products li.product:hover img {
    transform: scale(1.04);
}

/* Nombre producto */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    min-height: 48px;
    color: #ed3237;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.3px;
    padding: 0 !important;
    margin: 0 0 12px !important;
}

/* Precio */
.woocommerce ul.products li.product .price {
    display: block;
    color: #ed3237 !important;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.35;
    margin: auto 0 16px;
}

.woocommerce ul.products li.product .price span,
.woocommerce ul.products li.product .price .amount,
.woocommerce ul.products li.product .price .woocommerce-Price-currencySymbol {
    color: #ed3237 !important;
    font-weight: 800;
}

/* Botón */
.woocommerce ul.products li.product .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 42px;
    border-radius: 8px;
    background: #ff9900 !important;
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 700;
    border: none;
    padding: 12px 16px;
    text-align: center;
    text-decoration: none;
    line-height: 1.2;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.woocommerce ul.products li.product .button:hover {
    background: #ed3237 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(237, 50, 55, 0.22);
}

/* Link Ver carrito luego de agregar */
.woocommerce ul.products li.product a.added_to_cart {
    display: block;
    margin-top: 10px;
    color: #ed3237;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
}

.woocommerce ul.products li.product a.added_to_cart:hover {
    color: #ff9900;
}

/* Mejor uso del alto cuando hay pocos productos */
.woocommerce.archive #content,
.woocommerce-page.archive #content {
    min-height: 620px;
}


/* =========================================================
   2. Carrito vacío / WooCommerce Blocks
   ========================================================= */

/* Contenedor general carrito */
.woocommerce-cart .site-main,
.woocommerce-cart .entry-content,
.woocommerce-cart .wp-block-woocommerce-cart {
    max-width: 1320px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

/* Mensaje carrito vacío */
.woocommerce-cart .wc-block-cart__empty-cart__title,
.woocommerce-cart .cart-empty,
.woocommerce-cart .woocommerce-info {
    color: #1f2933;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
}

/* Icono triste del carrito vacío */
.woocommerce-cart .wc-block-cart__empty-cart__title::before {
    color: #ed3237;
}

/* Título "Nuevo en la tienda" */
.woocommerce-cart h2,
.woocommerce-cart .wc-block-grid__title {
    margin: 38px 0 28px;
    color: #1f2933;
    font-size: 26px;
    font-weight: 800;
    text-align: center;
}

/* Contenedor bloque WooCommerce Blocks */
.woocommerce-cart .wc-block-grid,
.woocommerce-cart .wc-block-grid.has-4-columns {
    max-width: 1120px;
    margin: 0 auto;
}

/* Grilla de productos WooCommerce Blocks */
.woocommerce-cart .wc-block-grid.has-4-columns .wc-block-grid__products,
.woocommerce-cart .wc-block-grid__products {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 26px !important;
    width: 100% !important;
    max-width: 1120px !important;
    margin: 0 auto 60px !important;
    padding: 0 !important;
    list-style: none !important;
}

/* Fix clave: mata el flex/max-width nativo de WooCommerce Blocks */
.theme-twentytwenty .wc-block-grid.has-4-columns .wc-block-grid__product,
.woocommerce-cart .wc-block-grid.has-4-columns .wc-block-grid__product,
.woocommerce-cart .wc-block-grid__product {
    width: 100% !important;
    max-width: none !important;
    flex: none !important;
    flex-basis: auto !important;
    box-sizing: border-box !important;
}

/* Tarjeta producto bloque */
.woocommerce-cart .wc-block-grid__product {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    min-height: 345px;
    padding: 24px 18px 18px !important;
    background: #ffffff;
    border: 1px solid #e4e7ec;
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(16, 24, 40, 0.07);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.woocommerce-cart .wc-block-grid__product:hover {
    transform: translateY(-4px);
    border-color: rgba(237, 50, 55, 0.35);
    box-shadow: 0 14px 32px rgba(16, 24, 40, 0.13);
}

/* Evita achicamiento interno */
.woocommerce-cart .wc-block-grid__product-link,
.woocommerce-cart .wc-block-grid__product-image,
.woocommerce-cart .wc-block-grid__product-title,
.woocommerce-cart .wc-block-grid__product-price,
.woocommerce-cart .wc-block-grid__product-add-to-cart {
    width: 100% !important;
    max-width: 100% !important;
}

/* Link producto */
.woocommerce-cart .wc-block-grid__product-link {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    color: inherit;
    text-decoration: none;
}

/* Imagen */
.woocommerce-cart .wc-block-grid__product-image {
    display: flex !important;
    align-items: center;
    justify-content: center;
    height: 185px;
    margin-bottom: 18px;
}

.woocommerce-cart .wc-block-grid__product-image img {
    display: block !important;
    width: auto !important;
    max-width: 170px !important;
    height: auto !important;
    max-height: 170px !important;
    object-fit: contain !important;
    margin: 0 auto !important;
    /*filter: drop-shadow(0 8px 10px rgba(16, 24, 40, 0.12));*/
    transition: transform 0.2s ease;
}

.woocommerce-cart .wc-block-grid__product:hover .wc-block-grid__product-image img {
    transform: scale(1.04);
}

/* Nombre */
.woocommerce-cart .wc-block-grid__product-title {
    min-height: 46px;
    margin: 0 0 10px !important;
    color: #ed3237;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: 0.2px;
    text-align: center;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
}

/* Precio */
.woocommerce-cart .wc-block-grid__product-price,
.woocommerce-cart .wc-block-grid__product-price .amount,
.woocommerce-cart .wc-block-grid__product-price .woocommerce-Price-currencySymbol {
    color: #ed3237 !important;
    font-size: 16px;
    font-weight: 800;
}

.woocommerce-cart .wc-block-grid__product-price {
    margin: auto 0 16px !important;
    opacity: 1 !important;
    line-height: 1.35;
    text-align: center;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
}

/* Contenedor botón */
.woocommerce-cart .wc-block-grid__product-add-to-cart {
    width: 100%;
    margin: 0 !important;
}

/* Botón */
.woocommerce-cart .wc-block-grid__product-add-to-cart .wp-block-button__link,
.woocommerce-cart .wc-block-grid__product-add-to-cart a,
.woocommerce-cart .wp-block-button__link.add_to_cart_button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 42px;
    padding: 12px 16px !important;
    background: linear-gradient(135deg, #ff9900 0%, #ff7a00 100%) !important;
    border: 0 !important;
    border-radius: 9px !important;
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    line-height: 1.2;
    text-align: center;
    text-decoration: none !important;
    box-shadow: 0 6px 14px rgba(255, 153, 0, 0.25);
    opacity: 1 !important;
    white-space: normal !important;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.woocommerce-cart .wc-block-grid__product-add-to-cart .wp-block-button__link:hover,
.woocommerce-cart .wc-block-grid__product-add-to-cart a:hover,
.woocommerce-cart .wp-block-button__link.add_to_cart_button:hover {
    background: linear-gradient(135deg, #ed3237 0%, #d51f29 100%) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(237, 50, 55, 0.28);
}

/* Oculta tooltip raro del theme/plugin */
.woocommerce-cart .wc-block-grid__product-add-to-cart .tooltiptext-1 {
    display: none !important;
}

/* Separadores/puntos raros */
.woocommerce-cart .wp-block-separator,
.woocommerce-cart .wc-block-components-totals-wrapper:empty {
    display: none !important;
}


/* =========================================================
   3. Responsive
   ========================================================= */

@media (max-width: 1100px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .woocommerce-cart .wc-block-grid.has-4-columns .wc-block-grid__products,
    .woocommerce-cart .wc-block-grid__products {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 768px) {
    .woocommerce.archive .site-main,
    .woocommerce-page.archive .site-main,
    .woocommerce-cart .site-main,
    .woocommerce-cart .entry-content,
    .woocommerce-cart .wp-block-woocommerce-cart {
        padding-left: 16px;
        padding-right: 16px;
    }

    .woocommerce ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .woocommerce ul.products li.product {
        padding: 18px 14px 16px !important;
    }

    .woocommerce ul.products li.product a img,
    .woocommerce ul.products li.product img {
        max-width: 145px;
        height: 145px;
        max-height: 145px;
    }

    .woocommerce ul.products li.product .woocommerce-loop-product__title {
        font-size: 14px;
        min-height: 44px;
    }

    .woocommerce ul.products li.product .price {
        font-size: 15px;
    }

    .woocommerce-cart .wc-block-grid.has-4-columns .wc-block-grid__products,
    .woocommerce-cart .wc-block-grid__products {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 18px !important;
    }

    .woocommerce-cart .wc-block-grid__product {
        min-height: 315px;
        padding: 20px 14px 16px !important;
    }

    .woocommerce-cart .wc-block-grid__product-image {
        height: 150px;
    }

    .woocommerce-cart .wc-block-grid__product-image img {
        max-width: 140px !important;
        max-height: 140px !important;
    }

    .woocommerce-cart .wc-block-grid__product-title {
        font-size: 14px;
        min-height: 42px;
    }
}

@media (max-width: 480px) {
    .woocommerce ul.products,
    .woocommerce-cart .wc-block-grid.has-4-columns .wc-block-grid__products,
    .woocommerce-cart .wc-block-grid__products {
        grid-template-columns: 1fr !important;
    }

    .woocommerce .woocommerce-result-count,
    .woocommerce .woocommerce-ordering {
        float: none;
        width: 100%;
        text-align: left;
    }

    .woocommerce .woocommerce-ordering select {
        width: 100%;
    }
}

/* =========================================================
   4. Normalización grilla Elementor / Product Category
   Aplica a product-category/metalworking y grillas Woo clásicas
   ========================================================= */

/* Contenedor grilla Elementor WooCommerce */
.woocommerce.archive ul.products.elementor-grid,
.woocommerce-page.archive ul.products.elementor-grid,
.tax-product_cat ul.products.elementor-grid,
.product-category ul.products.elementor-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 26px !important;
    width: 100% !important;
    max-width: 1120px !important;
    margin: 0 auto 60px !important;
    padding: 0 !important;
    list-style: none !important;
}

/* Mata columnas/floats heredados del theme, Elementor o WooCommerce */
.woocommerce.archive ul.products.elementor-grid li.product,
.woocommerce-page.archive ul.products.elementor-grid li.product,
.tax-product_cat ul.products.elementor-grid li.product,
.product-category ul.products.elementor-grid li.product,
.woocommerce ul.products.elementor-grid.columns-4 li.product {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    flex: none !important;
    flex-basis: auto !important;
    float: none !important;
    clear: none !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* Tarjeta normalizada igual al carrito */
.woocommerce.archive ul.products.elementor-grid li.product,
.woocommerce-page.archive ul.products.elementor-grid li.product,
.tax-product_cat ul.products.elementor-grid li.product,
.product-category ul.products.elementor-grid li.product {
    display: flex !important;
    flex-direction: column !important;
    min-height: 345px;
    padding: 24px 18px 18px !important;
    background: #ffffff;
    border: 1px solid #e4e7ec;
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(16, 24, 40, 0.07);
    text-align: center;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.woocommerce.archive ul.products.elementor-grid li.product:hover,
.woocommerce-page.archive ul.products.elementor-grid li.product:hover,
.tax-product_cat ul.products.elementor-grid li.product:hover,
.product-category ul.products.elementor-grid li.product:hover {
    transform: translateY(-4px);
    border-color: rgba(237, 50, 55, 0.35);
    box-shadow: 0 14px 32px rgba(16, 24, 40, 0.13);
}

/* Link principal */
.woocommerce.archive ul.products.elementor-grid li.product a.woocommerce-LoopProduct-link,
.woocommerce-page.archive ul.products.elementor-grid li.product a.woocommerce-LoopProduct-link,
.tax-product_cat ul.products.elementor-grid li.product a.woocommerce-LoopProduct-link,
.product-category ul.products.elementor-grid li.product a.woocommerce-LoopProduct-link {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    width: 100% !important;
    color: inherit;
    text-decoration: none;
}

/* Imagen normalizada */
.woocommerce.archive ul.products.elementor-grid li.product img,
.woocommerce-page.archive ul.products.elementor-grid li.product img,
.tax-product_cat ul.products.elementor-grid li.product img,
.product-category ul.products.elementor-grid li.product img {
    display: block !important;
    width: auto !important;
    max-width: 170px !important;
    height: 170px !important;
    max-height: 170px !important;
    object-fit: contain !important;
    margin: 0 auto 18px !important;
    /*filter: drop-shadow(0 8px 10px rgba(16, 24, 40, 0.12));*/
    transition: transform 0.2s ease;
}

.woocommerce.archive ul.products.elementor-grid li.product:hover img,
.woocommerce-page.archive ul.products.elementor-grid li.product:hover img,
.tax-product_cat ul.products.elementor-grid li.product:hover img,
.product-category ul.products.elementor-grid li.product:hover img {
    transform: scale(1.04);
}

/* Título normalizado */
.woocommerce.archive ul.products.elementor-grid li.product .woocommerce-loop-product__title,
.woocommerce-page.archive ul.products.elementor-grid li.product .woocommerce-loop-product__title,
.tax-product_cat ul.products.elementor-grid li.product .woocommerce-loop-product__title,
.product-category ul.products.elementor-grid li.product .woocommerce-loop-product__title {
    min-height: 46px;
    margin: 0 0 10px !important;
    padding: 0 !important;
    color: #ed3237;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: 0.2px;
    text-align: center;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
}

/* Precio normalizado */
.woocommerce.archive ul.products.elementor-grid li.product .price,
.woocommerce-page.archive ul.products.elementor-grid li.product .price,
.tax-product_cat ul.products.elementor-grid li.product .price,
.product-category ul.products.elementor-grid li.product .price {
    display: block !important;
    margin: auto 0 16px !important;
    color: #ed3237 !important;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
    opacity: 1 !important;
}

.woocommerce.archive ul.products.elementor-grid li.product .price *,
.woocommerce-page.archive ul.products.elementor-grid li.product .price *,
.tax-product_cat ul.products.elementor-grid li.product .price *,
.product-category ul.products.elementor-grid li.product .price * {
    color: #ed3237 !important;
    font-weight: 800;
}

/* Botón normalizado */
.woocommerce.archive ul.products.elementor-grid li.product .button,
.woocommerce-page.archive ul.products.elementor-grid li.product .button,
.tax-product_cat ul.products.elementor-grid li.product .button,
.product-category ul.products.elementor-grid li.product .button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    min-height: 42px;
    margin-top: auto !important;
    padding: 12px 16px !important;
    background: linear-gradient(135deg, #ff9900 0%, #ff7a00 100%) !important;
    border: 0 !important;
    border-radius: 9px !important;
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    line-height: 1.2;
    text-align: center;
    text-decoration: none !important;
    box-shadow: 0 6px 14px rgba(255, 153, 0, 0.25);
    opacity: 1 !important;
    white-space: normal !important;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.woocommerce.archive ul.products.elementor-grid li.product .button:hover,
.woocommerce-page.archive ul.products.elementor-grid li.product .button:hover,
.tax-product_cat ul.products.elementor-grid li.product .button:hover,
.product-category ul.products.elementor-grid li.product .button:hover {
    background: linear-gradient(135deg, #ed3237 0%, #d51f29 100%) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(237, 50, 55, 0.28);
}

/* Oculta tooltip duplicado bajo botones */
.woocommerce.archive ul.products.elementor-grid li.product .tooltiptext-1,
.woocommerce-page.archive ul.products.elementor-grid li.product .tooltiptext-1,
.tax-product_cat ul.products.elementor-grid li.product .tooltiptext-1,
.product-category ul.products.elementor-grid li.product .tooltiptext-1 {
    display: none !important;
}

/* Mantiene oculto WCMLIM si viene inline, sin romper layout */
.woocommerce.archive ul.products.elementor-grid li.product .wcmlim-stock-container,
.woocommerce-page.archive ul.products.elementor-grid li.product .wcmlim-stock-container,
.tax-product_cat ul.products.elementor-grid li.product .wcmlim-stock-container,
.product-category ul.products.elementor-grid li.product .wcmlim-stock-container {
    width: 100% !important;
}

/* Responsive Elementor/Product Category */
@media (max-width: 1100px) {
    .woocommerce.archive ul.products.elementor-grid,
    .woocommerce-page.archive ul.products.elementor-grid,
    .tax-product_cat ul.products.elementor-grid,
    .product-category ul.products.elementor-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 768px) {
    .woocommerce.archive ul.products.elementor-grid,
    .woocommerce-page.archive ul.products.elementor-grid,
    .tax-product_cat ul.products.elementor-grid,
    .product-category ul.products.elementor-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 18px !important;
    }

    .woocommerce.archive ul.products.elementor-grid li.product,
    .woocommerce-page.archive ul.products.elementor-grid li.product,
    .tax-product_cat ul.products.elementor-grid li.product,
    .product-category ul.products.elementor-grid li.product {
        min-height: 315px;
        padding: 20px 14px 16px !important;
    }

    .woocommerce.archive ul.products.elementor-grid li.product img,
    .woocommerce-page.archive ul.products.elementor-grid li.product img,
    .tax-product_cat ul.products.elementor-grid li.product img,
    .product-category ul.products.elementor-grid li.product img {
        max-width: 140px !important;
        height: 140px !important;
        max-height: 140px !important;
    }

    .woocommerce.archive ul.products.elementor-grid li.product .woocommerce-loop-product__title,
    .woocommerce-page.archive ul.products.elementor-grid li.product .woocommerce-loop-product__title,
    .tax-product_cat ul.products.elementor-grid li.product .woocommerce-loop-product__title,
    .product-category ul.products.elementor-grid li.product .woocommerce-loop-product__title {
        font-size: 14px;
        min-height: 42px;
    }
}

@media (max-width: 480px) {
    .woocommerce.archive ul.products.elementor-grid,
    .woocommerce-page.archive ul.products.elementor-grid,
    .tax-product_cat ul.products.elementor-grid,
    .product-category ul.products.elementor-grid {
        grid-template-columns: 1fr !important;
    }
}

/* =========================================================
   5. Productos relacionados / Single Product
   Normaliza sección "Productos relacionados"
   ========================================================= */

/* Contenedor general */
.single-product .related.products {
    max-width: 1120px;
    margin: 56px auto 64px;
    padding: 0 24px;
}

/* Título productos relacionados */
.single-product .related.products > h2,
.single-product .related.products .elementor-heading-title {
    margin: 0 0 28px !important;
    color: #1f2933;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
}

/* Grilla */
.single-product .related.products ul.products,
.single-product .related.products ul.products.elementor-grid,
.single-product .related.products ul.products.columns-4 {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 26px !important;
    width: 100% !important;
    max-width: 1120px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    list-style: none !important;
}

/* Reset columnas heredadas */
.single-product .related.products ul.products li.product,
.single-product .related.products ul.products.elementor-grid li.product,
.single-product .related.products ul.products.columns-4 li.product {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    flex: none !important;
    flex-basis: auto !important;
    float: none !important;
    clear: none !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* Tarjeta */
.single-product .related.products ul.products li.product {
    display: flex !important;
    flex-direction: column !important;
    min-height: 345px;
    padding: 24px 18px 18px !important;
    background: #ffffff;
    border: 1px solid #e4e7ec;
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(16, 24, 40, 0.07);
    text-align: center;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.single-product .related.products ul.products li.product:hover {
    transform: translateY(-4px);
    border-color: rgba(237, 50, 55, 0.35);
    box-shadow: 0 14px 32px rgba(16, 24, 40, 0.13);
}

/* Link principal */
.single-product .related.products ul.products li.product a.woocommerce-LoopProduct-link,
.single-product .related.products ul.products li.product a.woocommerce-loop-product__link {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    width: 100% !important;
    color: inherit;
    text-decoration: none;
}

/* Imagen */
.single-product .related.products ul.products li.product img {
    display: block !important;
    width: auto !important;
    max-width: 170px !important;
    height: 170px !important;
    max-height: 170px !important;
    object-fit: contain !important;
    margin: 0 auto 18px !important;
    /*filter: drop-shadow(0 8px 10px rgba(16, 24, 40, 0.12));*/
    transition: transform 0.2s ease;
}

.single-product .related.products ul.products li.product:hover img {
    transform: scale(1.04);
}

/* Título */
.single-product .related.products ul.products li.product .woocommerce-loop-product__title {
    min-height: 46px;
    /*margin: 0 0 10px !important;*/
    padding: 0 !important;
    color: #ed3237;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: 0.2px;
    text-align: center;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
}

/* Precio */
.single-product .related.products ul.products li.product .price {
    display: block !important;
    margin: auto 0 16px !important;
    color: #ed3237 !important;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
    opacity: 1 !important;
}

.single-product .related.products ul.products li.product .price *,
.single-product .related.products ul.products li.product .price .amount,
.single-product .related.products ul.products li.product .price .woocommerce-Price-currencySymbol {
    color: #ed3237 !important;
    font-weight: 800;
}

/* Botón */
.single-product .related.products ul.products li.product .button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    min-height: 42px;
    margin-top: auto !important;
    padding: 12px 16px !important;
    background: linear-gradient(135deg, #ff9900 0%, #ff7a00 100%) !important;
    border: 0 !important;
    border-radius: 9px !important;
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    line-height: 1.2;
    text-align: center;
    text-decoration: none !important;
    box-shadow: 0 6px 14px rgba(255, 153, 0, 0.25);
    opacity: 1 !important;
    white-space: normal !important;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.single-product .related.products ul.products li.product .button:hover {
    background: linear-gradient(135deg, #ed3237 0%, #d51f29 100%) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(237, 50, 55, 0.28);
}

/* Oculta tooltip duplicado */
.single-product .related.products ul.products li.product .tooltiptext-1 {
    display: none !important;
}

/* WCMLIM no debe romper layout */
.single-product .related.products ul.products li.product .wcmlim-stock-container {
    width: 100% !important;
}

/* Responsive relacionados */
@media (max-width: 1100px) {
    .single-product .related.products ul.products,
    .single-product .related.products ul.products.elementor-grid,
    .single-product .related.products ul.products.columns-4 {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 768px) {
    .single-product .related.products {
        padding: 0 16px;
        margin-top: 42px;
    }

    .single-product .related.products ul.products,
    .single-product .related.products ul.products.elementor-grid,
    .single-product .related.products ul.products.columns-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 18px !important;
    }

    .single-product .related.products ul.products li.product {
        min-height: 315px;
        padding: 20px 14px 16px !important;
    }

    .single-product .related.products ul.products li.product img {
        max-width: 140px !important;
        height: 140px !important;
        max-height: 140px !important;
    }

    .single-product .related.products ul.products li.product .woocommerce-loop-product__title {
        font-size: 14px;
        min-height: 42px;
    }
}

@media (max-width: 480px) {
    .single-product .related.products ul.products,
    .single-product .related.products ul.products.elementor-grid,
    .single-product .related.products ul.products.columns-4 {
        grid-template-columns: 1fr !important;
    }
}

/* =========================================================
   FST - Mejora Mobile Product Grid / Categorías WooCommerce
   ========================================================= */

/* Mobile general */
@media (max-width: 768px) {
    body.woocommerce.archive,
    body.tax-product_cat {
        overflow-x: hidden;
    }

    .woocommerce.archive .site-main,
    .woocommerce-page.archive .site-main,
    .tax-product_cat .site-main {
        max-width: 100%;
        padding: 22px 12px 36px !important;
    }

    .woocommerce-products-header__title,
    .woocommerce.archive h1.page-title,
    .woocommerce.archive .page-title {
        margin: 22px 0 28px !important;
        font-size: 22px !important;
        line-height: 1.25;
    }

    .woocommerce .woocommerce-result-count {
        float: none !important;
        width: 100%;
        margin: 0 0 18px !important;
        font-size: 12px;
        text-align: center;
    }

    .woocommerce .woocommerce-ordering {
        float: none !important;
        width: 100%;
        margin: 0 auto 18px !important;
        text-align: center;
    }

    .woocommerce .woocommerce-ordering select {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: 40px;
        font-size: 12px;
        border-radius: 8px;
    }

    .woocommerce ul.products,
    .woocommerce.archive ul.products.elementor-grid,
    .woocommerce-page.archive ul.products.elementor-grid,
    .tax-product_cat ul.products.elementor-grid,
    .product-category ul.products.elementor-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto 34px !important;
        padding: 0 !important;
    }

    .woocommerce ul.products li.product,
    .woocommerce.archive ul.products.elementor-grid li.product,
    .woocommerce-page.archive ul.products.elementor-grid li.product,
    .tax-product_cat ul.products.elementor-grid li.product,
    .product-category ul.products.elementor-grid li.product {
        min-height: 245px !important;
        padding: 14px 10px 12px !important;
        border-radius: 12px;
        box-shadow: 0 6px 16px rgba(16, 24, 40, 0.08);
    }

    .woocommerce ul.products li.product a.woocommerce-LoopProduct-link,
    .woocommerce.archive ul.products.elementor-grid li.product a.woocommerce-LoopProduct-link,
    .tax-product_cat ul.products.elementor-grid li.product a.woocommerce-LoopProduct-link {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 !important;
        width: 100% !important;
    }

    .woocommerce ul.products li.product img,
    .woocommerce ul.products li.product a img,
    .woocommerce.archive ul.products.elementor-grid li.product img,
    .woocommerce-page.archive ul.products.elementor-grid li.product img,
    .tax-product_cat ul.products.elementor-grid li.product img,
    .product-category ul.products.elementor-grid li.product img {
        width: auto !important;
        max-width: 96px !important;
        height: 96px !important;
        max-height: 96px !important;
        object-fit: contain !important;
        margin: 0 auto 12px !important;
    }

    .woocommerce ul.products li.product .woocommerce-loop-product__title,
    .woocommerce.archive ul.products.elementor-grid li.product .woocommerce-loop-product__title,
    .woocommerce-page.archive ul.products.elementor-grid li.product .woocommerce-loop-product__title,
    .tax-product_cat ul.products.elementor-grid li.product .woocommerce-loop-product__title,
    .product-category ul.products.elementor-grid li.product .woocommerce-loop-product__title {
        min-height: 38px !important;
        margin: 0 0 8px !important;
        font-size: 12px !important;
        line-height: 1.25 !important;
        letter-spacing: 0;
    }

    .woocommerce ul.products li.product .price,
    .woocommerce.archive ul.products.elementor-grid li.product .price,
    .woocommerce-page.archive ul.products.elementor-grid li.product .price,
    .tax-product_cat ul.products.elementor-grid li.product .price,
    .product-category ul.products.elementor-grid li.product .price {
        margin: auto 0 10px !important;
        font-size: 13px !important;
        line-height: 1.25;
    }

    .woocommerce ul.products li.product .button,
    .woocommerce.archive ul.products.elementor-grid li.product .button,
    .woocommerce-page.archive ul.products.elementor-grid li.product .button,
    .tax-product_cat ul.products.elementor-grid li.product .button,
    .product-category ul.products.elementor-grid li.product .button {
        min-height: 34px !important;
        padding: 9px 8px !important;
        border-radius: 8px !important;
        font-size: 10.5px !important;
        line-height: 1.15 !important;
    }

    .woocommerce ul.products li.product:hover,
    .woocommerce.archive ul.products.elementor-grid li.product:hover,
    .tax-product_cat ul.products.elementor-grid li.product:hover {
        transform: none;
    }

    .woocommerce ul.products li.product:hover img,
    .woocommerce.archive ul.products.elementor-grid li.product:hover img,
    .tax-product_cat ul.products.elementor-grid li.product:hover img {
        transform: none;
    }

    .woocommerce.archive #content,
    .woocommerce-page.archive #content {
        min-height: auto !important;
    }
}

/* Mobile chico: deja una columna más elegante */
@media (max-width: 420px) {
    .woocommerce.archive .site-main,
    .woocommerce-page.archive .site-main,
    .tax-product_cat .site-main {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .woocommerce ul.products,
    .woocommerce.archive ul.products.elementor-grid,
    .woocommerce-page.archive ul.products.elementor-grid,
    .tax-product_cat ul.products.elementor-grid,
    .product-category ul.products.elementor-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .woocommerce ul.products li.product,
    .woocommerce.archive ul.products.elementor-grid li.product,
    .woocommerce-page.archive ul.products.elementor-grid li.product,
    .tax-product_cat ul.products.elementor-grid li.product,
    .product-category ul.products.elementor-grid li.product {
        display: grid !important;
        grid-template-columns: 92px 1fr;
        grid-template-areas:
            "img title"
            "img price"
            "img button";
        column-gap: 14px;
        align-items: center;
        min-height: 128px !important;
        padding: 14px !important;
        text-align: left !important;
    }

    .woocommerce ul.products li.product a.woocommerce-LoopProduct-link,
    .woocommerce.archive ul.products.elementor-grid li.product a.woocommerce-LoopProduct-link,
    .tax-product_cat ul.products.elementor-grid li.product a.woocommerce-LoopProduct-link {
        display: contents !important;
    }

    .woocommerce ul.products li.product img,
    .woocommerce ul.products li.product a img,
    .woocommerce.archive ul.products.elementor-grid li.product img,
    .woocommerce-page.archive ul.products.elementor-grid li.product img,
    .tax-product_cat ul.products.elementor-grid li.product img,
    .product-category ul.products.elementor-grid li.product img {
        grid-area: img;
        max-width: 82px !important;
        width: 82px !important;
        height: 82px !important;
        max-height: 82px !important;
        margin: 0 auto !important;
    }

    .woocommerce ul.products li.product .woocommerce-loop-product__title,
    .woocommerce.archive ul.products.elementor-grid li.product .woocommerce-loop-product__title,
    .woocommerce-page.archive ul.products.elementor-grid li.product .woocommerce-loop-product__title,
    .tax-product_cat ul.products.elementor-grid li.product .woocommerce-loop-product__title,
    .product-category ul.products.elementor-grid li.product .woocommerce-loop-product__title {
        grid-area: title;
        min-height: auto !important;
        margin: 0 0 4px !important;
        font-size: 13px !important;
        line-height: 1.25 !important;
        text-align: left !important;
    }

    .woocommerce ul.products li.product .price,
    .woocommerce.archive ul.products.elementor-grid li.product .price,
    .woocommerce-page.archive ul.products.elementor-grid li.product .price,
    .tax-product_cat ul.products.elementor-grid li.product .price,
    .product-category ul.products.elementor-grid li.product .price {
        grid-area: price;
        margin: 0 0 8px !important;
        font-size: 13px !important;
        text-align: left !important;
    }

    .woocommerce ul.products li.product .button,
    .woocommerce.archive ul.products.elementor-grid li.product .button,
    .woocommerce-page.archive ul.products.elementor-grid li.product .button,
    .tax-product_cat ul.products.elementor-grid li.product .button,
    .product-category ul.products.elementor-grid li.product .button {
        grid-area: button;
        width: 100% !important;
        min-height: 32px !important;
        padding: 8px 10px !important;
        font-size: 10.5px !important;
    }
}