/* MRE Frontend — recommendation slider rows */

.mre-recommendations {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    margin: 34px 0;
    padding: 24px;
    clear: both;
    position: relative;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

.single-product .mre-recommendations {
    margin-top: 28px;
    margin-bottom: 28px;
}

.mre-recommendations__title {
    margin: 0 0 18px;
    padding: 0 0 14px;
    border-bottom: 1px solid #e2e8f0;
    color: #111827;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.25;
}

/* ── Slider wrapper ──────────────────────────────────────────────── */

.mre-recommendations__slider {
    position: relative;
    overflow: visible;
    border-radius: 8px;
}

.mre-recommendations__track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    padding: 2px 48px 12px 2px;
    cursor: grab;
    scroll-padding: 48px;
}

.mre-recommendations__track.mre-dragging {
    cursor: grabbing;
    user-select: none;
    -webkit-user-select: none;
}

.mre-recommendations__track::-webkit-scrollbar {
    display: none;
}

/* ── Arrow buttons ───────────────────────────────────────────────── */

.mre-recommendations__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #111827;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    padding: 0;
    font-size: 0;
    line-height: 1;
}

.mre-recommendations__arrow:hover {
    border-color: #fecaca;
    background-color: #ffffff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
    color: #f73030;
}

.mre-recommendations__arrow:focus {
    background-color: #ffffff;
    color: #111827;
}

.mre-recommendations__arrow--left {
    left: -8px;
}

.mre-recommendations__arrow--right {
    right: -8px;
}

.mre-recommendations__arrow[disabled] {
    opacity: 0;
    pointer-events: none;
}

/* Arrows always visible in infinite mode */
.mre-loaded .mre-recommendations__arrow[disabled] {
    opacity: 1;
    pointer-events: auto;
}

.mre-recommendations__arrow svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── Product cards ───────────────────────────────────────────────── */

.mre-recommendations__item {
    flex: 0 0 190px;
    position: relative;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: visible;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

@media (min-width: 768px) {
    .mre-recommendations__item {
        flex-basis: 204px;
    }
}

@media (min-width: 1200px) {
    .mre-recommendations__item {
        flex-basis: 212px;
    }
}

@media (max-width: 767px) {
    .mre-recommendations {
        width: 100%;
        margin: 22px 0;
        padding: 16px;
    }

    .mre-recommendations__track {
        padding-left: 14px;
        padding-right: 14px;
        scroll-padding: 14px;
    }

    .mre-recommendations__title {
        font-size: 18px;
    }

    .mre-recommendations__arrow {
        display: none;
    }

    .mre-recommendations__item {
        flex-basis: 174px;
    }
}

.mre-recommendations__item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.1);
    transform: translateY(-3px);
}

.mre-recommendations__link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.mre-recommendations__image {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mre-recommendations__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    transition: transform 0.24s ease;
}

/* Lazy-load placeholder: invisible until src is set */
.mre-recommendations__image img[data-src]:not([src]) {
    visibility: hidden;
}

.mre-recommendations__item:hover .mre-recommendations__image img {
    transform: scale(1.035);
}

.mre-recommendations__info {
    padding: 12px 13px 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-height: 94px;
}

.mre-recommendations__product-title {
    color: #111827;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
}

.mre-recommendations__price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 5px;
    color: #f73030;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.2;
    margin-top: auto;
}

.mre-recommendations__price del {
    font-weight: 700;
    color: #94a3b8;
    font-size: 12px;
}

.mre-recommendations__price ins {
    text-decoration: none;
}

.mre-recommendations__price-note {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    margin-left: 0.25em;
}

/* ── Add-to-cart button ──────────────────────────────────────────── */

.mre-recommendations__add-to-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: auto 13px 13px;
    min-height: 38px;
    padding: 9px 10px;
    font-size: 12px;
    font-weight: 900;
    text-align: center;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    border: 1px solid #f73030;
    background: #f73030;
    color: #fff;
    border-radius: 6px;
    transition: background 0.2s ease, border-color 0.2s ease;
    line-height: 1.3;
    text-decoration: none;
    white-space: nowrap;
}

.mre-recommendations__add-to-cart::before {
    content: "+";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    color: inherit;
    font-size: 20px;
    font-weight: 500;
    line-height: 14px;
}

.mre-recommendations__add-to-cart:hover,
.mre-recommendations__add-to-cart:focus-visible {
    border-color: #d91f1f;
    background: #d91f1f;
    color: #ffffff;
    text-decoration: none;
}

.mre-recommendations__add-to-cart:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* ── Stock badges ────────────────────────────────────────────────── */

.mre-recommendations .mwl-btn--shortcode {
    position: absolute;
    top: 9px;
    right: 9px;
    z-index: 12;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    color: #8b98aa;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.mre-recommendations .mwl-btn--shortcode:hover,
.mre-recommendations .mwl-btn--shortcode:focus-visible,
.mre-recommendations .mwl-btn--shortcode.mwl-btn--active {
    border-color: rgba(247, 48, 48, 0.25);
    background: #ffffff;
    color: #f73030;
}

.mre-recommendations .mwl-btn--shortcode .mwl-btn__text {
    display: none;
}

.mre-recommendations .mwl-btn--shortcode .mwl-heart {
    width: 19px;
    height: 19px;
}

.mre-recommendations .nasa-badges-wrap {
    position: absolute;
    top: 9px;
    right: 51px;
    left: 9px;
    z-index: 11;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 5px;
    max-width: calc(100% - 60px);
    pointer-events: none;
}

.mre-recommendations .nasa-badges-wrap .badge {
    position: relative;
    float: none;
    clear: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 24px;
    margin: 0;
    padding: 5px 8px;
    border: 1px solid rgba(255, 255, 255, 0.68);
    border-radius: 999px;
    box-shadow: 0 9px 20px rgba(15, 23, 42, 0.15);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.mre-recommendations .nasa-badges-wrap .badge::before {
    content: "";
    display: block;
    width: 11px;
    height: 11px;
    flex: 0 0 11px;
    background: currentColor;
}

.mre-recommendations .nasa-badges-wrap .badge.sale-label {
    min-height: 26px;
    padding: 6px 9px;
    background: linear-gradient(135deg, #ff5f63 0%, #f73030 52%, #b91c1c 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.72);
    box-shadow: 0 11px 24px rgba(247, 48, 48, 0.28);
}

.mre-recommendations .nasa-badges-wrap .badge.sale-label::before {
    -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M20.59 13.41 12.42 21.58a2 2 0 0 1-2.83 0L2.41 14.4A2 2 0 0 1 1.83 13V4a2 2 0 0 1 2-2h9a2 2 0 0 1 1.41.59l7.18 7.18a2 2 0 0 1 0 2.83ZM7.5 8A1.5 1.5 0 1 0 7.5 5a1.5 1.5 0 0 0 0 3Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M20.59 13.41 12.42 21.58a2 2 0 0 1-2.83 0L2.41 14.4A2 2 0 0 1 1.83 13V4a2 2 0 0 1 2-2h9a2 2 0 0 1 1.41.59l7.18 7.18a2 2 0 0 1 0 2.83ZM7.5 8A1.5 1.5 0 1 0 7.5 5a1.5 1.5 0 0 0 0 3Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.mre-recommendations .nasa-badges-wrap .badge.out-of-stock-label {
    background: rgba(17, 24, 39, 0.9);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.62);
}

.mre-recommendations .nasa-badges-wrap .badge.out-of-stock-label::before {
    -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm5.3 13.9-9.2-9.2A8 8 0 0 1 17.3 15.9ZM6.7 8.1l9.2 9.2A8 8 0 0 1 6.7 8.1Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm5.3 13.9-9.2-9.2A8 8 0 0 1 17.3 15.9ZM6.7 8.1l9.2 9.2A8 8 0 0 1 6.7 8.1Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.mre-recommendations .nasa-badges-wrap .badge.new-label {
    background: rgba(240, 253, 244, 0.95);
    color: #166534;
    border-color: rgba(34, 197, 94, 0.34);
}

.mre-recommendations .nasa-badges-wrap .badge.new-label::before {
    width: 8px;
    height: 8px;
    flex-basis: 8px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}

.mre-recommendations .nasa-badges-wrap .badge.featured-label,
.mre-recommendations .nasa-badges-wrap .badge.backorders-label {
    background: rgba(248, 250, 252, 0.96);
    color: #334155;
    border-color: rgba(203, 213, 225, 0.86);
}

.mre-recommendations .nasa-badges-wrap .badge.featured-label::before,
.mre-recommendations .nasa-badges-wrap .badge.backorders-label::before {
    -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='m12 2.8 2.7 5.5 6 .9-4.35 4.24 1.03 5.99L12 16.6l-5.38 2.83 1.03-5.99L3.3 9.2l6-.9L12 2.8Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='m12 2.8 2.7 5.5 6 .9-4.35 4.24 1.03 5.99L12 16.6l-5.38 2.83 1.03-5.99L3.3 9.2l6-.9L12 2.8Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.mre-recommendations__image-wrap {
    position: relative;
}

/* ── Skeleton loading animation ──────────────────────────────────── */

@keyframes mre-shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.mre-skeleton .mre-skeleton__block {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: mre-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.mre-skeleton .mre-skeleton__image {
    aspect-ratio: 1;
    width: 100%;
}

.mre-skeleton .mre-skeleton__title {
    height: 14px;
    width: 85%;
    margin-bottom: 6px;
}

.mre-skeleton .mre-skeleton__price {
    height: 16px;
    width: 50%;
    margin-top: auto;
}

.mre-skeleton .mre-recommendations__info {
    padding: 12px 13px 10px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-height: 94px;
}

/* Fade in real content replacing skeleton */
.mre-loaded .mre-recommendations__slider {
    animation: mre-fade-in 0.3s ease-out;
}

@keyframes mre-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
