/* ==========================================================
   Sun Stories — Cross-Sells Slider (single product page)
   ========================================================== */

.ssc-cross-sells {
    width: 100%;
    position: relative;
}

.ssc-cross-sells .ssc-cs-swiper {
    width: 100%;
    overflow: hidden;
    padding-bottom: 30px;
}

.ssc-cross-sells .ssc-cs-swiper > .swiper-pagination.ssc-cs-pagination {
    bottom: 0;
}

.ssc-cross-sells .swiper-pagination-bullet {
    background: #2d2420;
    opacity: 0.3;
}

.ssc-cross-sells .swiper-pagination-bullet-active {
    opacity: 1;
}

/* Equalise slide heights so cards stretch to the tallest one. */
.ssc-cross-sells .ssc-cs-swiper .swiper-wrapper {
    align-items: stretch;
}

.ssc-cross-sells .ssc-cs-swiper > .swiper-wrapper > .swiper-slide {
    height: auto;
    display: flex;
}

/* ── Card ──────────────────────────────────────────────── */
.ssc-cs-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    height: 100%;
    font-family: "Figtree", sans-serif;
    color: #2d2420;
}

/* Image area: 4:5 aspect ratio + bottom margin per spec. */
.ssc-cs-card .ssc-cs-image-link {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    margin-bottom: 20px;
    text-decoration: none;
    position: relative;
}

.ssc-cs-card .ssc-cs-image-swiper {
    width: 100%;
    height: 100%;
}

.ssc-cs-card .ssc-cs-image-swiper .swiper-slide {
    width: 100%;
    height: 100%;
}

.ssc-cs-card .ssc-cs-img,
.ssc-cs-card .ssc-cs-image-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ssc-cs-card .ssc-cs-image-swiper .swiper-pagination-bullet {
    background: #fff;
    opacity: 0.7;
}

.ssc-cs-card .ssc-cs-image-swiper .swiper-pagination-bullet-active {
    background: #fff;
    opacity: 1;
}

/* ── Title ─────────────────────────────────────────────── */
.ssc-cs-card .ssc-cs-title-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.ssc-cs-card .ssc-cs-title-link:hover,
.ssc-cs-card .ssc-cs-title-link:focus {
    color: inherit;
    text-decoration: none;
}

.ssc-cs-card .ssc-cs-title {
    font-family: "Figtree", sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: #2d2420;
    margin: 0;
    padding: 0;
    line-height: 1.4;
}

/* ── Availability ──────────────────────────────────────── */
.ssc-cs-card .ssc-cs-availability {
    font-family: "Figtree", sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #2d2420;
    margin: 4px 0 0;
    padding: 0;
    line-height: 1.4;
}

/* ── Product Color (replaces old Availability line) ────── */
.ssc-cs-card .ssc-cs-color {
    font-family: "Figtree", sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #2d2420;
    margin: 4px 0 0;
    padding: 0;
    line-height: 1.4;
}

/* ── Price ─────────────────────────────────────────────── */
.ssc-cs-card .ssc-cs-price {
    font-family: "Figtree", sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #2d2420;
    margin: 4px 0 12px;
    padding: 0;
    line-height: 1.4;
}

.ssc-cs-card .ssc-cs-price .woocommerce-Price-amount {
    color: inherit;
    font: inherit;
}

/* ── Action button (Add to Bag / View Cart / View options) ── */
.ssc-cs-card .ssc-cs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    min-height: 34px;
    padding: 6px 20px;
    line-height: 22px;
    font-family: "Figtree", sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #2d2420;
    background: transparent;
    border: 1px solid #2d2420;
    border-radius: 0;
    text-decoration: none;
    cursor: pointer;
    text-align: center;
    box-shadow: none;
    text-transform: none;
    letter-spacing: normal;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.ssc-cs-card .ssc-cs-btn:hover,
.ssc-cs-card .ssc-cs-btn:focus {
    background: #2d2420;
    color: #fff;
    border-color: #2d2420;
    text-decoration: none;
    box-shadow: none;
}

/* Loading state — disabled, spinner inside, no label text. */
.ssc-cs-card .ssc-cs-add-btn.is-loading,
.ssc-cs-card .ssc-cs-add-btn[disabled] {
    pointer-events: none;
    opacity: 0.85;
}

.ssc-cs-card .ssc-cs-add-btn.is-loading:hover,
.ssc-cs-card .ssc-cs-add-btn.is-loading:focus {
    background: transparent;
    color: #2d2420;
}

.ssc-cs-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #2d2420;
    border-top-color: transparent;
    border-radius: 50%;
    animation: ssc-cs-spin 0.7s linear infinite;
    box-sizing: border-box;
}

@keyframes ssc-cs-spin {
    to { transform: rotate(360deg); }
}

/* "View Cart" state — keep outline so layout doesn't shift. */
.ssc-cs-card .ssc-cs-add-btn.is-view-cart {
    background: #2d2420;
    color: #fff;
    border-color: #2d2420;
}

.ssc-cs-card .ssc-cs-add-btn.is-view-cart:hover,
.ssc-cs-card .ssc-cs-add-btn.is-view-cart:focus {
    background: #fff;
    color: #2d2420;
    border-color: #2d2420;
}

/* Inline error message under the button. */
.ssc-cs-error {
    margin: 6px 0 0;
    font-family: "Figtree", sans-serif;
    font-size: 12px;
    color: #c0392b;
    text-align: center;
}

/* ==========================================================
   Responsive: handled via Swiper breakpoints in JS,
   but lock card width on mobile/tablet to prevent overflow.
   ========================================================== */
@media (max-width: 1023px) {
    .ssc-cs-card .ssc-cs-title { font-size: 16px; }
}

/* Mobile: hide pagination — peek-next layout makes it redundant. */
@media (max-width: 767px) {
    .ssc-cross-sells .ssc-cs-swiper {
        padding-bottom: 0;
    }
    .ssc-cross-sells .ssc-cs-swiper > .swiper-pagination.ssc-cs-pagination {
        display: none;
    }
}
