/* ══════════════════════════════════════════════════════════════
 * Spliff Category Products — Widget Styles
 * ══════════════════════════════════════════════════════════════ */

/* ── Wrapper ── */
.scp-wrapper {
    width: 100%;
}

/* ── Toolbar: filter + sort ── */
.scp-toolbar {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
}

.scp-toolbar-sort-row {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

/* ── Filters ── */
.scp-filters {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.scp-filter-label {
    font-weight: 600;
    margin-right: 8px;
}

.scp-filter-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.scp-filter-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    user-select: none;
    gap: 4px;
}

.scp-filter-bubble {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
    /* Default size set by Elementor control */
    width: 56px;
    height: 56px;
}

.scp-filter-item:hover .scp-filter-bubble {
    transform: scale(1.08);
}

.scp-filter-item.active .scp-filter-bubble {
    transform: scale(1.05);
}

.scp-filter-emoji {
    font-size: 24px;
    line-height: 1;
}

.scp-filter-name {
    font-size: 12px;
    text-align: center;
    white-space: nowrap;
    transition: font-weight 0.15s ease;
}

.scp-filter-item.active .scp-filter-name {
    font-weight: 700;
}

/* ── Sort ── */
.scp-sort-wrapper {
    position: relative;
    flex-shrink: 0;
    align-self: flex-start;
}

.scp-sort-trigger {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.scp-sort-trigger:hover {
    opacity: 0.7;
}

.scp-sort-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 220px;
    background-color: #FFFFFF;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    z-index: 100;
    overflow: hidden;
    margin-top: 4px;
}

.scp-sort-dropdown.open {
    display: block;
}

.scp-sort-option {
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    white-space: nowrap;
}

.scp-sort-option:hover {
    background-color: #F5F5F5;
}

.scp-sort-option.active {
    font-weight: 700;
}

/* ── Grid ── */
.scp-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: stretch;
}

/* ── Product Card ── */
.scp-product-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.scp-product-card.scp-hidden {
    display: none;
}

/* ── Image ── */
.scp-product-image {
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

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

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

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

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

.scp-product-card:hover .scp-img-hover {
    opacity: 1;
}

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

/* ── Taux Badge ── */
.scp-taux-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    font-weight: 600;
    line-height: 1;
    display: inline-block;
    transition: background-color 0.2s ease;
    pointer-events: none;
}

/* ── Product Info ── */
.scp-product-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 12px;
}

.scp-product-name {
    margin: 0;
    font-size: 15px;
    line-height: 1.3;
}

.scp-product-name a {
    color: inherit;
    text-decoration: none;
}

.scp-product-name a:hover {
    color: inherit;
}

/* ── Price ── */
.scp-product-price {
    margin-bottom: 8px;
}

.scp-price-prefix {
    font-size: 12px;
}

.scp-price-value {
    font-weight: 600;
    font-size: 14px;
}

/* ── Saveur Badges ── */
.scp-saveur-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
    max-height: calc(2 * (28px + 6px)); /* 2 rows approx */
    overflow: hidden;
}

.scp-saveur-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
    transition: background-color 0.2s ease;
    max-width: calc(50% - 3px);
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Button ── */
.scp-product-btn-wrap {
    margin-top: auto;
}

.scp-product-btn {
    display: inline-block;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
    font-size: 14px;
    padding: 10px 20px;
    line-height: 1.2;
}

.scp-product-btn:hover {
    text-decoration: none;
}

/* ── Load More ── */
.scp-product-card.scp-paged {
    display: none;
}

.scp-loadmore-wrap {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.scp-loadmore-btn {
    cursor: pointer;
    padding: 12px 32px;
    font-size: 14px;
    border: 1px solid #CCCCCC;
    background-color: #FFFFFF;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.scp-loadmore-btn:hover {
    opacity: 0.85;
}

.scp-loadmore-wrap.scp-lm-hidden {
    display: none;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .scp-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .scp-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .scp-toolbar {
        flex-direction: column;
    }

    .scp-sort-wrapper {
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .scp-grid {
        grid-template-columns: 1fr;
    }
}
