/**
 * Catálogo accesible y coherente con la portada v2.
 */

body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag, .search-results, .search-no-results) #content {
    background: var(--lmr-color-canvas);
}

body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag, .search-results, .search-no-results) #content > .ast-container {
    display: block;
    width: min(100% - 40px, 1240px);
    max-width: 1240px;
    margin-inline: auto;
    padding: 0;
}

.elementor-location-archive.product > .elementor-section > .elementor-container {
    max-width: 1240px;
}

.elementor-location-archive.product .elementor-page-title {
    margin: 0;
    padding: clamp(3rem, 6vw, 5rem) 0 1.5rem;
}

.elementor-location-archive.product .elementor-page-title h1 {
    max-width: 20ch;
    margin: 0;
    color: var(--lmr-color-forest);
    font-size: clamp(2.25rem, 5vw, 4rem);
    line-height: 1.05;
}

.elementor-location-archive.product .elementor-widget-wc-archive-products {
    margin-bottom: clamp(4rem, 8vw, 7rem);
}

.lmr-catalog-nav {
    clear: both;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    border: 1px solid var(--lmr-color-line);
    border-radius: var(--lmr-radius-card);
    background: #fff;
}

.lmr-catalog-nav__label {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--lmr-color-text);
    font-size: 1rem;
    font-weight: 800;
}

.lmr-catalog-nav__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.lmr-catalog-nav__links a {
    display: inline-flex;
    align-items: center;
    min-height: 46px;
    padding: 0.6rem 1rem;
    border: 2px solid #b9c5bd;
    border-radius: 999px;
    background: #fff;
    color: var(--lmr-color-forest) !important;
    font-weight: 750;
    line-height: 1.2;
    text-decoration: none !important;
}

.lmr-catalog-nav__links a:hover,
.lmr-catalog-nav__links a:focus-visible,
.lmr-catalog-nav__links a.is-current {
    border-color: var(--lmr-color-forest);
    background: var(--lmr-color-forest);
    color: #fff !important;
}

.lmr-catalog-nav__mobile {
    display: none;
}

.elementor-location-archive.product .woocommerce-result-count {
    margin: 0 0 1.25rem;
    color: var(--lmr-color-muted);
    font-size: 1rem;
}

.elementor-location-archive.product .woocommerce-ordering {
    margin: 0 0 1.25rem;
}

.elementor-location-archive.product .woocommerce-ordering select {
    min-width: min(100%, 290px);
    min-height: 50px;
    border: 2px solid #65766c;
    border-radius: 8px;
    background-color: #fff;
    color: var(--lmr-color-text);
    font-size: 1rem;
}

.elementor-location-archive.product ul.products.elementor-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
    clear: both;
}

.elementor-location-archive.product ul.products li.product {
    display: flex;
    float: none !important;
    width: auto !important;
    min-width: 0;
    margin: 0 !important;
    padding: 1rem !important;
    border: 1px solid var(--lmr-color-line) !important;
    border-radius: var(--lmr-radius-card) !important;
    background: #fff !important;
    box-shadow: var(--lmr-shadow-card);
}

/*
 * Standard WooCommerce loop used by relacionados.
 * This route does not use the Elementor archive wrapper above.
 */
.woocommerce section.related.products > ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
    clear: both;
}

.woocommerce section.related.products > ul.products li.product {
    display: flex;
    float: none !important;
    width: auto !important;
    min-width: 0;
    margin: 0 !important;
    margin-right: 0 !important;
    clear: none !important;
    box-sizing: border-box;
    padding: 1rem !important;
    border: 1px solid var(--lmr-color-line) !important;
    border-radius: var(--lmr-radius-card) !important;
    background: #fff !important;
    box-shadow: var(--lmr-shadow-card);
}

.woocommerce section.related.products > ul.products .astra-shop-thumbnail-wrap img {
    width: 100%;
    aspect-ratio: 4 / 5;
    margin: 0 0 1rem !important;
    border-radius: 8px;
    background: #f8f6f1;
    object-fit: contain;
}

.woocommerce section.related.products > ul.products .astra-shop-summary-wrap {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
}

.woocommerce section.related.products > ul.products .ast-woo-product-category {
    color: var(--lmr-color-muted);
    font-size: 0.875rem;
}

.woocommerce section.related.products > ul.products .woocommerce-loop-product__title {
    color: var(--lmr-color-text) !important;
    font-family: inherit !important;
    font-size: 1.0625rem !important;
    font-weight: 750 !important;
    line-height: 1.35 !important;
}

.woocommerce section.related.products > ul.products .price {
    margin: 0.75rem 0 !important;
    color: var(--lmr-color-forest) !important;
    font-size: 1.125rem !important;
    font-weight: 800 !important;
}

.woocommerce section.related.products > ul.products li.product .button {
    width: 100%;
    min-height: 50px;
    margin-top: auto !important;
    padding: 0.75rem 0.9rem !important;
    border-radius: 8px !important;
    text-align: center;
}

.elementor-location-archive.product .astra-shop-thumbnail-wrap img {
    width: 100%;
    aspect-ratio: 4 / 5;
    margin: 0 0 1rem !important;
    border-radius: 8px;
    background: #f8f6f1;
    object-fit: contain;
}

.elementor-location-archive.product .astra-shop-summary-wrap {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
}

.elementor-location-archive.product .ast-woo-product-category {
    color: var(--lmr-color-muted);
    font-size: 0.875rem;
}

.elementor-location-archive.product .woocommerce-loop-product__title {
    color: var(--lmr-color-text) !important;
    font-family: inherit !important;
    font-size: 1.0625rem !important;
    font-weight: 750 !important;
    line-height: 1.35 !important;
}

.elementor-location-archive.product .price {
    margin: 0.75rem 0 !important;
    color: var(--lmr-color-forest) !important;
    font-size: 1.125rem !important;
    font-weight: 800 !important;
}

.elementor-location-archive.product ul.products li.product .button {
    width: 100%;
    min-height: 50px;
    margin-top: auto !important;
    padding: 0.75rem 0.9rem !important;
    border-radius: 8px !important;
    background: var(--lmr-color-forest) !important;
    color: #fff !important;
    text-align: center;
}

.elementor-location-archive.product .ast-shop-product-out-of-stock,
.elementor-location-archive.product .onsale {
    min-width: 0;
    min-height: 32px;
    padding: 0.4rem 0.65rem;
    border-radius: 6px;
    background: #fff !important;
    color: #8a250f !important;
    font-size: 0.875rem;
    font-weight: 850;
    line-height: 1.2;
}

.elementor-location-archive.product .woocommerce-pagination {
    margin-top: 2.5rem;
}

.elementor-location-archive.product .woocommerce-pagination .page-numbers li :is(a, span) {
    display: inline-grid;
    min-width: 48px;
    min-height: 48px;
    place-items: center;
    border-radius: 8px;
    font-size: 1rem;
}

.elementor-products-nothing-found {
    margin: 0 0 clamp(4rem, 10vw, 8rem);
    padding: clamp(2rem, 6vw, 4rem);
    border: 1px solid var(--lmr-color-line);
    border-radius: var(--lmr-radius-card);
    background: #fff;
    color: var(--lmr-color-text);
    font-size: 1.125rem;
    line-height: 1.6;
    text-align: center;
}

/* Native WooCommerce archive loop; independent of Elementor Pro. */
body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag, .search-results, .search-no-results) .woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
    clear: both;
}

body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag, .search-results, .search-no-results) .woocommerce ul.products li.product {
    display: flex;
    float: none !important;
    width: auto !important;
    min-width: 0;
    margin: 0 !important;
    padding: 1rem !important;
    box-sizing: border-box;
    border: 1px solid var(--lmr-color-line) !important;
    border-radius: var(--lmr-radius-card) !important;
    background: #fff !important;
    box-shadow: var(--lmr-shadow-card);
}

body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag, .search-results, .search-no-results) .woocommerce ul.products .astra-shop-thumbnail-wrap img {
    width: 100%;
    aspect-ratio: 4 / 5;
    margin: 0 0 1rem !important;
    border-radius: 8px;
    background: #f8f6f1;
    object-fit: contain;
}

body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag, .search-results, .search-no-results) .woocommerce ul.products .astra-shop-summary-wrap {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
}

body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag, .search-results, .search-no-results) .woocommerce ul.products .ast-woo-product-category {
    color: var(--lmr-color-muted);
    font-size: 0.875rem;
}

body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag, .search-results, .search-no-results) .woocommerce ul.products .woocommerce-loop-product__title {
    color: var(--lmr-color-text) !important;
    font-family: inherit !important;
    font-size: 1.0625rem !important;
    font-weight: 750 !important;
    line-height: 1.35 !important;
}

body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag, .search-results, .search-no-results) .woocommerce ul.products .price {
    margin: 0.75rem 0 !important;
    color: var(--lmr-color-forest) !important;
    font-size: 1.125rem !important;
    font-weight: 800 !important;
}

body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag, .search-results, .search-no-results) .woocommerce ul.products li.product .button {
    width: 100%;
    min-height: 50px;
    margin-top: auto !important;
    padding: 0.75rem 0.9rem !important;
    border-radius: 8px !important;
    background: var(--lmr-color-forest) !important;
    color: #fff !important;
    text-align: center;
}

.search-no-results .elementor-location-archive.product .elementor-widget-wc-archive-products {
    margin-bottom: clamp(3rem, 7vw, 5rem);
}

@media (max-width: 1024px) {
    .elementor-location-archive.product ul.products.elementor-grid,
    .woocommerce section.related.products > ul.products,
    body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag, .search-results, .search-no-results) .woocommerce ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag, .search-results, .search-no-results) #content > .ast-container {
        width: min(100% - 32px, 1240px);
    }

    .elementor-location-archive.product .elementor-page-title {
        padding-top: 2.5rem;
        padding-bottom: 1.25rem;
    }

    .lmr-catalog-nav {
        padding: 1rem;
    }

    .lmr-catalog-nav__desktop {
        display: none;
    }

    .lmr-catalog-nav__mobile {
        display: block;
    }

    .lmr-catalog-nav__mobile summary {
        list-style: none;
        min-height: 48px;
        padding: 0.75rem 0;
        color: var(--lmr-color-text);
        cursor: pointer;
        font-weight: 800;
        line-height: 1.25;
    }

    .lmr-catalog-nav__mobile summary::-webkit-details-marker {
        display: none;
    }

    .lmr-catalog-nav__mobile summary::after {
        float: right;
        color: var(--lmr-color-forest);
        content: '⌄';
        font-size: 1.35rem;
        line-height: 1;
    }

    .lmr-catalog-nav__mobile[open] summary::after {
        content: '⌃';
    }

    .lmr-catalog-nav__links {
        flex-wrap: wrap;
        margin-inline: 0;
        padding: 0 0 0.25rem;
        overflow-x: visible;
    }

    .lmr-catalog-nav__links a {
        flex: 0 0 100%;
        min-height: 48px;
        justify-content: flex-start;
        border-radius: 6px;
    }

    .elementor-location-archive.product .woocommerce-result-count,
    .elementor-location-archive.product .woocommerce-ordering {
        float: none;
        width: 100%;
    }

    .elementor-location-archive.product .woocommerce-ordering select {
        width: 100%;
    }

    .elementor-location-archive.product ul.products.elementor-grid,
    .woocommerce section.related.products > ul.products,
    body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag, .search-results, .search-no-results) .woocommerce ul.products {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .elementor-location-archive.product ul.products li.product,
    .woocommerce section.related.products > ul.products li.product,
    body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag, .search-results, .search-no-results) .woocommerce ul.products li.product {
        padding: 1.125rem !important;
    }

    .elementor-location-archive.product .woocommerce-loop-product__title,
    .woocommerce section.related.products > ul.products .woocommerce-loop-product__title,
    body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag, .search-results, .search-no-results) .woocommerce ul.products .woocommerce-loop-product__title {
        font-size: 1.125rem !important;
    }

    .elementor-products-nothing-found {
        margin-bottom: 3rem;
        padding: 2rem 1.25rem;
        font-size: 1.0625rem;
    }

    .elementor-location-archive.product ul.products li.product .button,
    .woocommerce section.related.products > ul.products li.product .button,
    body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag, .search-results, .search-no-results) .woocommerce ul.products li.product .button {
        min-height: 52px;
        font-size: 1rem !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lmr-catalog-nav__links {
        scroll-behavior: auto;
    }
}

/* Temporary comparison loop with an isolated markup contract. */
.lmr-native-product-loop {
    margin: 4rem 0 6rem;
}

.lmr-native-product-loop__header {
    margin-bottom: 1.5rem;
}

.lmr-native-product-loop__header h2 {
    margin: 0 0 0.35rem;
    color: var(--lmr-color-forest);
    font-size: clamp(1.5rem, 3vw, 2.25rem);
}

.lmr-native-product-loop__header p {
    margin: 0;
    color: var(--lmr-color-muted);
}

.lmr-native-product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
}

.lmr-native-product-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    box-sizing: border-box;
    padding: 1rem;
    border: 1px solid var(--lmr-color-line);
    border-radius: var(--lmr-radius-card);
    background: #fff;
    box-shadow: var(--lmr-shadow-card);
}

.lmr-native-product-card__image {
    display: block;
    margin-bottom: 1rem;
}

.lmr-native-product-card__image img {
    display: block;
    width: 100%;
    height: auto !important;
    aspect-ratio: 4 / 5;
    border-radius: 8px;
    background: #f8f6f1;
    object-fit: contain;
}

.lmr-native-product-card__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.lmr-native-product-card__category {
    color: var(--lmr-color-muted);
    font-size: 0.875rem;
}

.lmr-native-product-card__category a {
    color: inherit;
}

.lmr-native-product-card__title {
    margin: 0.35rem 0 0;
    font-family: inherit;
    font-size: 1.0625rem;
    line-height: 1.35;
}

.lmr-native-product-card__title a {
    color: var(--lmr-color-text);
    text-decoration: none;
}

.lmr-native-product-card__price {
    margin: 0.75rem 0;
    color: var(--lmr-color-forest);
    font-size: 1.125rem;
    font-weight: 800;
}

.lmr-native-product-card__actions {
    margin-top: auto;
}

.lmr-native-product-card__actions a.button {
    display: flex;
    width: 100% !important;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    margin: 0 !important;
    padding: 0.75rem 0.9rem !important;
    border: 1px solid var(--lmr-color-forest) !important;
    border-radius: 8px !important;
    background: var(--lmr-color-forest) !important;
    color: #fff !important;
    text-align: center;
}

@media (max-width: 1024px) {
    .lmr-native-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .lmr-native-product-loop {
        margin: 3rem 0 4rem;
    }

    .lmr-native-product-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .lmr-native-product-card {
        padding: 1.125rem;
    }
}
