/*
 * Autor: Sergio Martinez de Unlockers Cloud
 * URL: https://1lockers.net
 *
 * Related products (Jet Woo template 173) — PDP «también puede interesarte».
 * Scoped to .mx-related-wrap (added by related-mixcoco.js).
 */

/* --- Section heading (Elementor template 23) --- */
.single-product .elementor-element-4c35 .elementor-heading-title {
    font-family: "Roboto Condensed", "Poppins", sans-serif;
    font-size: clamp(1.35rem, 2.5vw, 1.875rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #222222;
    text-align: center;
    margin: 0 0 0.25rem;
}

.single-product .elementor-element-b325b18 {
    margin-top: 0.5rem;
}

/* --- Carousel shell (mobile nav injected by JS) --- */
.mx-related-wrap .mx-related-carousel {
    position: relative;
    width: 100%;
}

.mx-related-wrap .mx-related-track {
    width: 100%;
    overflow: visible;
}

.mx-related-wrap .mx-related-nav {
    display: none;
    position: absolute;
    top: 38%;
    transform: translateY(-50%);
    z-index: 5;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #ffffff;
    color: #111827;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.mx-related-wrap .mx-related-nav:hover {
    background: #111827;
    border-color: #111827;
    color: #ffffff;
}

.mx-related-wrap .mx-related-nav--prev {
    left: -0.35rem;
}

.mx-related-wrap .mx-related-nav--next {
    right: -0.35rem;
}

.mx-related-wrap .mx-related-nav[disabled] {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

/* --- Product grid --- */
.mx-related-wrap .related.products {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
    width: 100%;
}

.mx-related-wrap .related.products > h2 {
    display: none !important;
}

.mx-related-wrap .related.products > li {
    margin: 0;
    padding: 0;
    list-style: none;
    height: 100%;
    min-width: 0;
}

/* Card shell (Jet archive template 173) */
.mx-related-wrap .related.products > li > .elementor {
    background: #ffffff;
    border: 1px solid #f3f4f6;
    border-radius: 1rem;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.mx-related-wrap .related.products > li > .elementor .elementor-section-wrap,
.mx-related-wrap .related.products > li > .elementor .elementor-section,
.mx-related-wrap .related.products > li > .elementor .elementor-container,
.mx-related-wrap .related.products > li > .elementor .elementor-column-wrap,
.mx-related-wrap .related.products > li > .elementor .elementor-widget-wrap {
    height: 100%;
}

.mx-related-wrap .related.products > li > .elementor .elementor-widget-wrap {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 0 1rem 1rem;
    gap: 0.35rem;
}

/* Thumbnail — uniform 1:1 */
.mx-related-wrap .jet-woo-builder-archive-product-thumbnail__wrapper,
.mx-related-wrap .jet-woo-builder-archive-product-thumbnail {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f9fafb;
    overflow: hidden;
    margin: 0 -1rem 0.5rem;
    width: calc(100% + 2rem);
}

.mx-related-wrap .jet-woo-builder-archive-product-thumbnail a {
    display: block;
    width: 100%;
    height: 100%;
}

.mx-related-wrap .jet-woo-product-thumbs,
.mx-related-wrap .jet-woo-product-thumbs__inner {
    width: 100%;
    height: 100%;
}

.mx-related-wrap .jet-woo-product-thumbs img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    display: block;
}

/* Sale badge */
.mx-related-wrap .jet-woo-builder-archive-sale-badge .onsale,
.mx-related-wrap .jet-woo-builder-archive-sale-badge span.onsale {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 3;
    background: #ffffff;
    color: #111827;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.mx-related-wrap .jet-woo-builder-archive-product-thumbnail__wrapper {
    position: relative;
}

/* Category */
.mx-related-wrap .jet-woo-builder-archive-cats,
.mx-related-wrap .jet-woo-builder-archive-cats ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.mx-related-wrap .jet-woo-builder-archive-cats a {
    font-size: 0.65rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-decoration: none;
}

/* Title */
.mx-related-wrap .jet-woo-builder-archive-product-title {
    font-family: "Poppins", "Roboto Condensed", sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: #111827;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}

.mx-related-wrap .jet-woo-builder-archive-product-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.25s ease;
}

.mx-related-wrap .jet-woo-builder-archive-product-title a:hover {
    color: #ec4899;
}

/* Price */
.mx-related-wrap .jet-woo-builder-archive-product-price {
    margin-top: auto;
    padding-top: 0.25rem;
}

.mx-related-wrap .jet-woo-product-price,
.mx-related-wrap .jet-woo-product-price .price {
    font-size: 1.05rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.mx-related-wrap .jet-woo-product-price del {
    font-size: 0.85rem;
    color: #9ca3af;
    font-weight: 400;
    margin-right: 0.35rem;
}

.mx-related-wrap .jet-woo-product-price ins {
    text-decoration: none;
    color: #111827;
}

/* Spacer widgets inside card — collapse */
.mx-related-wrap .elementor-widget-spacer .elementor-spacer-inner {
    height: 0 !important;
    min-height: 0 !important;
}

/* --- Add to cart (mx-btn-limpio outside .mx-tienda-wrapper) --- */
.mx-related-wrap .jet-woo-builder-archive-add-to-cart {
    width: 100%;
    margin-top: 0.5rem;
}

.mx-related-wrap .jet-woo-builder-archive-add-to-cart .added_to_cart {
    display: none !important;
}

.mx-related-wrap .jet-woo-builder-archive-add-to-cart a.mx-btn-limpio::before,
.mx-related-wrap .jet-woo-builder-archive-add-to-cart a.mx-btn-limpio::after {
    content: none !important;
    display: none !important;
}

.mx-related-wrap .jet-woo-builder-archive-add-to-cart a.mx-btn-limpio,
.mx-related-wrap .jet-woo-builder-archive-add-to-cart a.button {
    display: flex !important;
    width: 100% !important;
    min-height: 40px !important;
    box-sizing: border-box !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.62rem 0.72rem !important;
    background: transparent !important;
    color: #111827 !important;
    border: 1.5px solid #111827 !important;
    border-radius: 0.5rem !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1.1 !important;
    text-decoration: none !important;
    text-transform: none !important;
    cursor: pointer !important;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease !important;
}

.mx-related-wrap .jet-woo-builder-archive-add-to-cart a.mx-btn-limpio .mx-btn-contenido {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    width: 100% !important;
    pointer-events: none !important;
}

.mx-related-wrap .jet-woo-builder-archive-add-to-cart a.mx-btn-limpio .mx-btn-icono {
    display: inline-flex !important;
    flex: 0 0 16px !important;
    width: 16px !important;
    height: 16px !important;
    align-items: center !important;
    justify-content: center !important;
}

.mx-related-wrap .jet-woo-builder-archive-add-to-cart a.mx-btn-limpio .mx-btn-svg,
.mx-related-wrap .jet-woo-builder-archive-add-to-cart a.mx-btn-limpio .mx-btn-icono svg {
    width: 16px !important;
    height: 16px !important;
    display: block !important;
}

.mx-related-wrap .jet-woo-builder-archive-add-to-cart a.mx-btn-limpio:hover,
.mx-related-wrap .jet-woo-builder-archive-add-to-cart a.button:hover {
    background: #111827 !important;
    color: #ffffff !important;
    border-color: #111827 !important;
}

.mx-related-wrap .jet-woo-builder-archive-add-to-cart a.mx-btn-limpio.loading,
.mx-related-wrap .jet-woo-builder-archive-add-to-cart a.mx-btn-limpio.added {
    opacity: 0.65 !important;
    cursor: wait !important;
}

/* Reveal animation hook (Motion inView) */
.mx-related-wrap .mx-related-reveal {
    opacity: 1;
    transform: none;
}

html:not(.motion-reduce) .mx-related-wrap .mx-related-reveal {
    opacity: 0;
    transform: translateY(16px);
}

/* Hover lift on cards */
@media (hover: hover) and (pointer: fine) {
    html:not(.motion-reduce) .mx-related-wrap .related.products > li > .elementor:hover {
        transform: translateY(-5px);
        box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.08);
    }
}

/* Tablet */
@media (max-width: 1024px) {
    .mx-related-wrap .related.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }
}

/* Mobile — horizontal snap carousel */
@media (max-width: 767px) {
    .mx-related-wrap .mx-related-nav {
        display: inline-flex;
    }

    .mx-related-wrap .mx-related-track {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 0 0.25rem 0.5rem;
    }

    .mx-related-wrap .mx-related-track::-webkit-scrollbar {
        display: none;
    }

    .mx-related-wrap .related.products {
        display: flex;
        flex-wrap: nowrap;
        gap: 0.85rem;
        grid-template-columns: unset;
    }

    .mx-related-wrap .related.products > li {
        flex: 0 0 78%;
        max-width: 78%;
        scroll-snap-align: start;
    }

    .mx-related-wrap .jet-woo-builder-archive-product-title {
        font-size: 0.88rem;
        min-height: 2.5em;
    }
}

/* Reduced motion — static cards */
@media (prefers-reduced-motion: reduce) {
    .mx-related-wrap .related.products > li > .elementor {
        transition: none;
    }

    .mx-related-wrap .mx-related-nav {
        transition: none;
    }
}
