/* ═══════════════════════════════════════════════════════════════
 * Spliff Product Slider — Frontend Styles
 * Prefix: .sps-
 * Uses Swiper for carousel.
 * ═══════════════════════════════════════════════════════════════ */

/* ─── Wrapper ──────────────────────────────────────────────── */

.sps-wrapper {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

/* ─── Slider Row: [arrow] [swiper] [arrow] ─────────────────── */

.sps-slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sps-slider-row .sps-slider {
    flex: 1;
    min-width: 0; /* Prevent flex overflow */
}

/* ─── Swiper core (self-sufficient — no dependency on Swiper CSS) ── */

.sps-slider.swiper {
    overflow: hidden;
}

.sps-slider .swiper-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
    box-sizing: content-box;
}

.sps-slider .swiper-slide {
    flex-shrink: 0;
    height: auto;
    position: relative;
}

/* ─── Card ─────────────────────────────────────────────────── */

.sps-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    overflow: hidden;
    transition: box-shadow 0.25s ease;
}

/* No hover shadow on card by default */

/* ─── Product Image ────────────────────────────────────────── */

.sps-product-image {
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.sps-product-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.sps-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.35s ease;
}

.sps-img-hover {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
}

.sps-card:hover .sps-img-main {
    opacity: 0;
}

.sps-card:hover .sps-img-hover {
    opacity: 1;
}

/* When there's no hover image, keep the main image visible. */
.sps-product-image:not(:has(.sps-img-hover)) .sps-img-main {
    opacity: 1 !important;
}

/* ─── Taux Badge ───────────────────────────────────────────── */

.sps-taux-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    padding: 4px 8px;
    border-radius: 4px;
    background: #222;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    pointer-events: none;
    transition: background-color 0.2s ease;
}

/* ─── Product Info ─────────────────────────────────────────── */

.sps-product-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 12px;
}

/* ─── Product Name ─────────────────────────────────────────── */

.sps-product-name {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

.sps-product-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

/* ─── Price ────────────────────────────────────────────────── */

.sps-product-price {
    margin-bottom: 8px;
    line-height: 1.4;
}

.sps-price-prefix {
    color: #888;
    font-size: 12px;
}

.sps-price-value {
    color: #222;
    font-weight: 700;
    font-size: 15px;
}

/* ─── Saveur Badges ────────────────────────────────────────── */

.sps-saveur-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.sps-saveur-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.3;
    transition: background 0.2s ease;
    cursor: default;
}

.sps-saveur-emoji {
    font-size: 13px;
}

/* ─── Product Button ───────────────────────────────────────── */

.sps-product-btn-wrap {
    margin-top: auto;
    padding-top: 4px;
}

.sps-product-btn-wrap.sps-btn-full {
    width: 100%;
}

.sps-product-btn-wrap.sps-btn-full .sps-product-btn {
    width: 100%;
}

.sps-product-btn {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid #222;
    border-radius: 4px;
    background: transparent;
    color: #222;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    line-height: 1.4;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.sps-product-btn:hover {
    background: #222;
    color: #fff;
}

/* ─── Arrows (in flex row, beside swiper) ──────────────────── */

.sps-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.sps-arrow:hover {
    background: #f5f5f5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

.sps-arrow-disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

.sps-arrow svg {
    width: 18px;
    height: 18px;
    fill: #222;
}

/* ─── Pagination ───────────────────────────────────────────── */

.sps-pagination {
    margin-top: 16px;
    text-align: center;
}

.sps-pagination.swiper-pagination-bullets {
    position: relative;
    bottom: auto;
}

.sps-pagination .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: #222;
    opacity: 0.3;
    transition: opacity 0.2s ease;
}

.sps-pagination .swiper-pagination-bullet-active {
    opacity: 1;
}

.sps-pagination.swiper-pagination-progressbar {
    position: relative;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
}

/* ─── View All ─────────────────────────────────────────────── */

.sps-view-all-wrap {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.sps-view-all-btn {
    display: inline-block;
    padding: 10px 28px;
    border: 1px solid #222;
    border-radius: 4px;
    background: transparent;
    color: #222;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    line-height: 1.4;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sps-view-all-btn:hover {
    background: #222;
    color: #fff;
}

/* ─── Responsive ───────────────────────────────────────────── */

@media (max-width: 1024px) {
    .sps-hide-tablet {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .sps-slider-row {
        gap: 8px;
    }

    .sps-arrow {
        width: 32px;
        height: 32px;
    }

    .sps-arrow svg {
        width: 14px;
        height: 14px;
    }

    .sps-hide-mobile {
        display: none !important;
    }
}
