/* ==========================================================================
   Spliff Elementor – Add to Cart Widget  v2.3
   ========================================================================== */

/* ── Container ──────────────────────────────────────────────────────────── */
.spliff-atc {
    position: relative;
    width: 100%;
}

.spliff-atc__content {
    position: relative;
    transition: filter 0.3s ease;
}

/* ── Attribute groups ───────────────────────────────────────────────────── */
.spliff-atc__attr-group + .spliff-atc__attr-group {
    margin-top: 12px;
}

/* ── Variants grid ──────────────────────────────────────────────────────── */
.spliff-atc__variants {
    --per-row: 3;
    --per-row-mob: 2;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

/* ── Variant button ─────────────────────────────────────────────────────── */
.spliff-atc__variant-btn {
    box-sizing: border-box;
    cursor: pointer;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 12px 24px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
    transition: all 250ms ease;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}

/* Width modes */
.spliff-atc--varwidth-auto .spliff-atc__variant-btn {
    flex: 0 1 auto;
}
.spliff-atc--varwidth-fill .spliff-atc__variant-btn {
    flex: 0 1 calc((100% - (var(--per-row) - 1) * 10px) / var(--per-row));
    min-width: 0;
}
.spliff-atc--varwidth-fixed .spliff-atc__variant-btn {
    flex: none;
}

.spliff-atc__variant-btn:focus-visible {
    outline: 2px solid #222;
    outline-offset: 2px;
}

/* ── OOS variant ────────────────────────────────────────────────────────── */
.spliff-atc__variant-btn.is-oos {
    cursor: pointer;
    text-decoration: line-through;
    opacity: 0.6;
    color: #999;
    background-color: #f9f9f9;
    border-color: #eee;
}

.spliff-atc__variant-btn.is-oos.is-active {
    text-decoration: line-through;
    opacity: 1;
}

/* ── Badge cashback ─────────────────────────────────────────────────────── */
.spliff-atc__cashback {
    display: inline-block;
    margin-top: 16px;
    cursor: default;
    user-select: none;
    font-weight: 600;
    text-align: center;
    padding: 10px 28px;
    border-radius: 8px;
    background: #e8f5e9;
    color: #1d6f42;
    border: 1px solid #c8e6c9;
    font-size: 14px;
    line-height: 1.4;
    transition: all 250ms ease;
}

.spliff-atc--cbwidth-full .spliff-atc__cashback {
    display: block;
}

/* ── Bouton ATC ─────────────────────────────────────────────────────────── */
.spliff-atc__button-wrap {
    margin-top: 16px;
}

.spliff-atc__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 600;
    text-align: center;
    padding: 16px 32px;
    border-radius: 8px;
    border: none;
    background: #222;
    color: #fff;
    font-size: 16px;
    line-height: 1.4;
    transition: all 250ms ease;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}

.spliff-atc--btnwidth-full .spliff-atc__button {
    width: 100%;
}
.spliff-atc--btnwidth-auto .spliff-atc__button {
    width: auto;
}

.spliff-atc__button:focus-visible {
    outline: 2px solid #222;
    outline-offset: 2px;
}

.spliff-atc__button-sep {
    margin-left: 10px;
    margin-right: 10px;
    opacity: 0.5;
}

/* ── Loading ────────────────────────────────────────────────────────────── */
.spliff-atc__button.is-loading {
    pointer-events: none;
    opacity: 0.7;
}

.spliff-atc__button.is-loading .spliff-atc__button-label::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: middle;
    animation: spliff-spin 0.6s linear infinite;
}

/* ── Success ────────────────────────────────────────────────────────────── */
.spliff-atc__button.is-success {
    pointer-events: none;
}

/* ── OOS ATC button ─────────────────────────────────────────────────────── */
.spliff-atc__button.is-oos {
    pointer-events: none;
    cursor: not-allowed;
    opacity: 1;
}

/* ── OOS message ────────────────────────────────────────────────────────── */
.spliff-atc__oos-msg {
    margin-top: 16px;
    text-align: center;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.4;
    color: #cc3333;
    background: #fff0f0;
    padding: 10px 20px;
    border-radius: 6px;
}

/* ── Guest overlay ──────────────────────────────────────────────────────── */
.spliff-atc__content.is-blurred {
    filter: blur(10px);
    pointer-events: none;
    user-select: none;
}

.spliff-atc__guest-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.spliff-atc__guest-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* Guest button width modes */
.spliff-atc__guest-buttons--auto .spliff-atc__guest-login,
.spliff-atc__guest-buttons--auto .spliff-atc__guest-register {
    width: auto;
}

.spliff-atc__guest-buttons--full .spliff-atc__guest-login,
.spliff-atc__guest-buttons--full .spliff-atc__guest-register {
    width: 100%;
}

.spliff-atc__guest-buttons--full {
    width: 100%;
    padding: 0 16px;
    box-sizing: border-box;
}

.spliff-atc__guest-login,
.spliff-atc__guest-register {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.4;
    cursor: pointer;
    transition: all 250ms ease;
    white-space: nowrap;
    box-sizing: border-box;
}

.spliff-atc__guest-login {
    padding: 14px 28px;
    border-radius: 8px;
    background: #222;
    color: #fff;
    border: none;
}
.spliff-atc__guest-login:hover {
    background: #444;
    color: #fff;
    text-decoration: none;
}

.spliff-atc__guest-register {
    padding: 14px 28px;
    border-radius: 8px;
    background: #f5f5f5;
    color: #222;
    border: 1px solid #ddd;
}
.spliff-atc__guest-register:hover {
    background: #e0e0e0;
    color: #000;
    text-decoration: none;
}

/* ── Spin ────────────────────────────────────────────────────────────────── */
@keyframes spliff-spin {
    to { transform: rotate(360deg); }
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .spliff-atc__variants {
        --per-row: var(--per-row-mob, 2) !important;
    }
    .spliff-atc--varwidth-fill .spliff-atc__variant-btn {
        flex: 0 1 calc((100% - (var(--per-row-mob, 2) - 1) * 10px) / var(--per-row-mob, 2));
    }
    .spliff-atc__variant-btn {
        font-size: 13px;
        padding: 10px 16px;
    }
    .spliff-atc__button {
        font-size: 14px;
        padding: 14px 20px;
    }
    .spliff-atc__guest-buttons {
        width: 90%;
    }
    .spliff-atc__guest-buttons .spliff-atc__guest-login,
    .spliff-atc__guest-buttons .spliff-atc__guest-register {
        width: 100%;
        white-space: normal;
    }
}
