/* =============================================================
   Related / Upsell / Crosssell — dedicated stylesheet
   Loaded only on PDP + cart pages via layout XML.
   Class namespace: rwc-rcs (Related/Crosssell/Upsell — Sections).
   Current scope: RELATED only. Upsell + crosssell still use core
   markup and core classes; their styling lands in a later phase.
   ============================================================= */
.rwc-rcs {
    width: 100%;
    max-width: 1280px;
    margin: 48px auto 0;
    padding: 0 16px;
    clear: both;
    float: none;
}
.rwc-rcs__header {
    border-bottom: 1px solid var(--ss-line, #e5e7eb);
    padding-bottom: 12px;
    margin-bottom: 24px;
}
.rwc-rcs__title {
    margin: 0;
    font-family: 'Syne', sans-serif;
    font-weight: 600;
    font-size: 22px;
    line-height: 1.2;
    color: var(--ss-ink, #0f172a);
    letter-spacing: -0.01em;
}
.rwc-rcs__subtitle {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--ss-ink-3, #64748b);
    line-height: 1.4;
}

/* ── Upsell variant — compact comparison strip.
      Sits between product info and tabs (pre-decision); kept short so it
      doesn't push the tabs/description too far down. ── */
.rwc-rcs--upsell {
    margin-top: 24px;
    margin-bottom: 8px;
    padding-left: 14px;
    border-left: 3px solid #1abc9c; /* teal accent — see feedback_teal_accent */
}
.rwc-rcs--upsell .rwc-rcs__header {
    padding-bottom: 8px;
    margin-bottom: 14px;
    border-bottom-color: rgba(26, 188, 156, .25);
}
.rwc-rcs--upsell .rwc-rcs__title {
    font-size: 17px;
}
.rwc-rcs--upsell .rwc-rcs__subtitle {
    font-size: 12px;
    margin-top: 2px;
}
.rwc-rcs--upsell .rwc-rcs__grid {
    gap: 14px;
}
.rwc-rcs--upsell .rwc-rcs__card {
    padding: 8px;
    gap: 6px;
}
.rwc-rcs--upsell .rwc-rcs__image .product-image-container {
    max-width: 110px;
}
.rwc-rcs--upsell .rwc-rcs__name {
    font-size: 12px;
    min-height: 32px;
}
.rwc-rcs--upsell .rwc-rcs__price .price {
    font-size: 13px;
}
.rwc-rcs--upsell .rwc-rcs__cta {
    padding: 6px 10px;
    font-size: 11px;
}

/* ── Crosssell variant — cart page complement strip.
      Blue left-border to distinguish from upsell's teal; compact like upsell
      so it doesn't dwarf the cart line items and summary. ── */
.rwc-rcs--crosssell {
    margin-top: 32px;
    margin-bottom: 16px;
    padding-left: 14px;
    border-left: 3px solid var(--ss-blue, #0059a3);
}
.rwc-rcs--crosssell .rwc-rcs__header {
    padding-bottom: 8px;
    margin-bottom: 14px;
    border-bottom-color: rgba(0, 89, 163, .2);
}
.rwc-rcs--crosssell .rwc-rcs__title {
    font-size: 17px;
}
.rwc-rcs--crosssell .rwc-rcs__subtitle {
    font-size: 12px;
    margin-top: 2px;
}
.rwc-rcs--crosssell .rwc-rcs__grid {
    gap: 14px;
}
.rwc-rcs--crosssell .rwc-rcs__card {
    padding: 8px;
    gap: 6px;
}
.rwc-rcs--crosssell .rwc-rcs__image .product-image-container {
    max-width: 110px;
}
.rwc-rcs--crosssell .rwc-rcs__name {
    font-size: 12px;
    min-height: 32px;
}
.rwc-rcs--crosssell .rwc-rcs__price .price {
    font-size: 13px;
}
.rwc-rcs--crosssell .rwc-rcs__cta {
    padding: 6px 10px;
    font-size: 11px;
}

/* Cart-page positioning: float into the items column so summary expansion
   on the right doesn't push cross-sell down.
   .cart-container .form-cart  → float:left  width:73%
   .cart-summary               → float:right width:23%
   crosssell mirrors form-cart and clears left to drop under the items. */
.cart-container .rwc-rcs--crosssell {
    float: left;
    clear: left;
    width: 73%;
    margin-right: 4%;
    max-width: none;
    margin-left: 0;
}
@media (max-width: 768px) {
    .cart-container .rwc-rcs--crosssell {
        float: none;
        width: 100%;
        margin-right: 0;
    }
}

/* ── Grid ── */
.rwc-rcs__grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.rwc-rcs__card {
    margin: 0;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--ss-line, #e5e7eb);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.rwc-rcs__card:hover {
    border-color: var(--ss-blue, #0059a3);
    box-shadow: 0 4px 12px rgba(0, 89, 163, .08);
    transform: translateY(-2px);
}

/* ── Image ── */
.rwc-rcs__image {
    display: block;
    text-align: center;
    margin: 0 0 8px;
}
.rwc-rcs__image .product-image-container {
    width: 100%;
    max-width: 180px;
    margin: 0 auto;
}
.rwc-rcs__image img {
    max-width: 100%;
    height: auto;
}

/* ── Name ── */
.rwc-rcs__name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.4;
    min-height: 36px;
    color: var(--ss-ink, #0f172a);
    text-decoration: none;
}
.rwc-rcs__name:hover {
    color: var(--ss-blue, #0059a3);
}

/* ── Price ── */
.rwc-rcs__price .price {
    font-family: var(--ss-mono);
    font-weight: 600;
    font-size: 14px;
    color: var(--ss-blue, #0059a3);
}

/* ── CTA buttons (anchor + button normalized to identical box) ── */
.rwc-rcs__atc-form {
    margin: 0;
    padding: 0;
}
.rwc-rcs__cta {
    display: inline-block;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    line-height: 1.4;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .04em;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    appearance: none;
    -webkit-appearance: none;
    transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.rwc-rcs__cta span {
    display: inline-block;
    line-height: 1.4;
    vertical-align: baseline;
}
/* Both ATC and View Details share the same outline-style button:
   white bg + blue border + blue text → solid blue on hover. */
.rwc-rcs__cta--atc,
.rwc-rcs__cta--view {
    background: #fff;
    color: var(--ss-blue, #0059a3);
    border-color: var(--ss-blue, #0059a3);
}
.rwc-rcs__cta--atc:hover,
.rwc-rcs__cta--view:hover {
    background: var(--ss-blue, #0059a3);
    color: #fff;
}

/* ── Tablet ── */
@media (max-width: 1023px) {
    .rwc-rcs__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── Mobile: horizontal snap-scroll carousel + compact sizing ── */
@media (max-width: 639px) {
    .rwc-rcs {
        margin-top: 24px;
        padding: 0 12px;
        box-sizing: border-box;
        overflow-x: hidden; /* clip carousel cards bleeding past the section right edge */
    }
    .rwc-rcs__header {
        margin-bottom: 16px;
        padding-bottom: 10px;
    }
    .rwc-rcs__title { font-size: 16px; }
    .rwc-rcs__subtitle { font-size: 11px; }

    .rwc-rcs__grid {
        display: flex;
        flex-wrap: nowrap;
        grid-template-columns: none;
        width: 100%;
        box-sizing: border-box;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        gap: 10px;
        padding-bottom: 12px;
        scrollbar-width: thin;
    }
    .rwc-rcs__card {
        flex: 0 0 55%;
        scroll-snap-align: start;
        padding: 8px;
        gap: 4px;
    }
    .rwc-rcs__image .product-image-container { max-width: 110px; }
    .rwc-rcs__name { font-size: 12px; min-height: 32px; }
    .rwc-rcs__price .price { font-size: 13px; }
    .rwc-rcs__cta { font-size: 11px; padding: 6px 8px; }

    /* upsell + crosssell: shrink the teal/blue accent padding-left and title */
    .rwc-rcs--upsell,
    .rwc-rcs--crosssell {
        margin-top: 20px;
        padding-left: 10px;
    }
    .rwc-rcs--upsell .rwc-rcs__title,
    .rwc-rcs--crosssell .rwc-rcs__title { font-size: 15px; }
    .rwc-rcs--upsell .rwc-rcs__subtitle,
    .rwc-rcs--crosssell .rwc-rcs__subtitle { font-size: 11px; }
}
