/* ============================================
   Smart WooBoost - Frontend Styles
   RTL Hebrew ready, mobile-first
   ============================================ */

:root {
    --swb-primary:       #f3447a;
    --swb-primary-dark:  #d42f64;
    --swb-primary-light: #fff4f8;
    --swb-primary-rgb:   243,68,122;
    --swb-success:       #00a651;
    --swb-dark:          #1a1a2e;
    --swb-text:          #333;
    --swb-bg:            #fff;
    --swb-border:        #e0e0e0;
    --swb-shadow:       0 4px 24px rgba(0,0,0,0.12);
    --swb-shadow-lg:    0 8px 48px rgba(0,0,0,0.18);
    --swb-radius:       12px;
    --swb-radius-sm:    6px;
    --swb-z-popup:      9990;
    --swb-z-sticky:     9980;
    --swb-z-chat:       9970;
    --swb-z-spin:       9999;
    --swb-z-proof:      9960;
    --swb-transition:   0.25s ease;
    --swb-font:         inherit;
}

/* ----------------------------------------
   Shared Buttons
   ---------------------------------------- */
.swb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--swb-transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}
.swb-btn--primary {
    background: var(--swb-primary);
    color: #fff;
    border-color: var(--swb-primary);
}
.swb-btn--primary:hover {
    background: var(--swb-primary-dark);
    border-color: var(--swb-primary-dark);
    transform: translateY(-1px);
}
.swb-btn--secondary {
    background: #f5f5f5;
    color: var(--swb-text);
    border-color: #ddd;
}
.swb-btn--secondary:hover { background: #eee; }
.swb-btn--outline {
    background: transparent;
    color: var(--swb-primary);
    border-color: var(--swb-primary);
}
.swb-btn--outline:hover {
    background: var(--swb-primary);
    color: #fff;
}
.swb-btn--lg { padding: 14px 32px; font-size: 16px; }
.swb-btn--sm { padding: 6px 14px; font-size: 12px; }
.swb-btn--full { width: 100%; }
.swb-btn--success {
    background: var(--swb-success);
    border-color: var(--swb-success);
    color: #fff;
}
.swb-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none !important;
}

/* ----------------------------------------
   1. UPSELL POPUP
   ---------------------------------------- */
.swb-upsell-popup {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    z-index: var(--swb-z-popup);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}
.swb-upsell-popup.swb-is-open {
    transform: translateY(0);
    pointer-events: all;
}
.swb-upsell-popup__inner {
    background: var(--swb-bg);
    border-top: 3px solid var(--swb-primary);
    border-radius: var(--swb-radius) var(--swb-radius) 0 0;
    box-shadow: var(--swb-shadow-lg);
    padding: 20px;
    max-width: 640px;
    margin: 0 auto;
    position: relative;
}
.swb-upsell-popup__close {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: #f0f0f0;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--swb-transition);
}
[dir="rtl"] .swb-upsell-popup__close { left: auto; right: 12px; }
.swb-upsell-popup__close:hover { background: #ddd; }

.swb-upsell-popup__header {
    margin-bottom: 14px;
    text-align: center;
}
.swb-upsell-popup__title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 2px;
    color: var(--swb-dark);
}
.swb-upsell-popup__subtitle {
    font-size: 12px;
    color: #888;
    margin: 0;
}

.swb-upsell-products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}
@media (max-width: 480px) {
    .swb-upsell-products {
        grid-template-columns: repeat(2, 1fr);
    }
}

.swb-upsell-product {
    border: 1px solid var(--swb-border);
    border-radius: var(--swb-radius);
    padding: 10px 8px;
    text-align: center;
    position: relative;
    transition: border-color var(--swb-transition), box-shadow var(--swb-transition);
    cursor: pointer;
}
.swb-upsell-product:hover {
    border-color: var(--swb-primary);
    box-shadow: 0 2px 12px rgba(var(--swb-primary-rgb), 0.15);
}

.swb-upsell-product__badge {
    position: absolute;
    top: -6px;
    right: 8px;
    background: var(--swb-primary);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    white-space: nowrap;
}
[dir="rtl"] .swb-upsell-product__badge { right: auto; left: 8px; }

.swb-upsell-product__image {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    margin: 0 auto 6px;
    display: block;
}
.swb-upsell-product__name {
    font-size: 11px;
    font-weight: 600;
    color: var(--swb-text);
    margin: 0 0 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.swb-upsell-product__price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.swb-upsell-product__orig-price {
    font-size: 10px;
    color: #999;
    text-decoration: line-through;
}
.swb-upsell-product__sale-price {
    font-size: 12px;
    font-weight: 700;
    color: var(--swb-primary);
}
.swb-upsell-product__discount-tag {
    font-size: 10px;
    background: #fff4f8;
    color: var(--swb-primary);
    padding: 1px 5px;
    border-radius: 10px;
    font-weight: 700;
}

.swb-upsell-product .swb-btn--sm {
    width: 100%;
    font-size: 11px;
    padding: 5px 8px;
}

.swb-upsell-product.swb-adding {
    opacity: 0.7;
    pointer-events: none;
}
.swb-upsell-product.swb-added {
    border-color: var(--swb-success);
    background: #f0fff4;
}

/* ----------------------------------------
   2. SPIN WHEEL
   ---------------------------------------- */
.swb-spin-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: var(--swb-z-spin);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.swb-spin-modal.swb-is-open {
    opacity: 1;
    pointer-events: all;
}

.swb-spin-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.swb-spin-modal__content {
    position: relative;
    background: #fff;
    border-radius: 20px;
    padding: 28px 24px;
    max-width: 360px;
    width: calc(100vw - 40px); /* never overflow on mobile */
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    box-shadow: var(--swb-shadow-lg);
    animation: swb-pop-in 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes swb-pop-in {
    from { transform: scale(0.8) translateY(20px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}

.swb-spin-modal__title {
    font-size: 22px;
    font-weight: 800;
    color: var(--swb-dark);
    margin: 0 0 8px;
}
.swb-spin-modal__subtitle {
    font-size: 14px;
    color: #666;
    margin: 0 0 20px;
}

.swb-wheel-wrapper {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 0 auto 14px;
    /* Shrink on small modals */
    max-width: calc(100vw - 80px);
}
.swb-wheel-pointer {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 28px;
    color: var(--swb-primary);
    z-index: 2;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    line-height: 1;
}
#swb-wheel-canvas {
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    max-width: 100%;
    display: block;
    margin: 0 auto;
}

.swb-spin-range {
    font-size: 12px;
    color: #888;
    margin-bottom: 16px;
}

.swb-spin-result {
    margin-top: 20px;
    padding: 16px;
    background: linear-gradient(135deg, #fff4f8, #fff4f8);
    border-radius: 12px;
    border: 2px solid #f9b8ce;
}
.swb-spin-result__icon { font-size: 36px; }
.swb-spin-result__title {
    font-size: 20px;
    font-weight: 800;
    color: var(--swb-dark);
    margin: 4px 0 8px;
}
.swb-spin-result__value {
    font-size: 16px;
    font-weight: 700;
    color: var(--swb-primary);
    margin: 0 0 12px;
}

.swb-coupon-box {
    background: #fff;
    border: 2px dashed var(--swb-primary);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
}
.swb-coupon-label {
    font-size: 12px;
    color: #666;
    display: block;
    margin-bottom: 6px;
}
.swb-coupon-code-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}
.swb-coupon-code {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: 800;
    color: var(--swb-dark);
    letter-spacing: 1px;
}
.swb-spin-validity {
    font-size: 11px;
    color: #999;
    margin: 6px 0 12px;
}

/* ----------------------------------------
   3. AI CHAT
   ---------------------------------------- */
.swb-chat-widget {
    /* Position is set dynamically by JS from admin settings */
    position: static;
    z-index: var(--swb-z-chat);
}
[dir="rtl"] .swb-chat-widget {
    /* handled by JS */
}

.swb-chat-trigger {
    position: fixed; /* trigger is always fixed, JS sets bottom/top/left/right */
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--swb-primary);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(var(--swb-primary-rgb), 0.4);
    transition: transform var(--swb-transition), box-shadow var(--swb-transition);
    white-space: nowrap;
    z-index: var(--swb-z-chat);
}
.swb-chat-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(var(--swb-primary-rgb), 0.5);
}
.swb-chat-trigger__icon { font-size: 20px; }
@media (max-width: 480px) {
    .swb-chat-trigger__label { display: none; }
    .swb-chat-trigger { padding: 14px; border-radius: 50%; }
}

.swb-chat-window {
    position: fixed; /* JS positions it above the trigger */
    width: 340px;
    max-height: 500px;
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--swb-shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: swb-chat-open 0.3s ease;
    border: 1px solid #eee;
    z-index: calc(var(--swb-z-chat) + 1);
}

@keyframes swb-chat-open {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.swb-chat-header {
    background: var(--swb-primary);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.swb-chat-header__info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.swb-chat-avatar {
    font-size: 22px;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.swb-chat-header strong { font-size: 14px; display: block; line-height: 1.3; }
.swb-chat-header small  { font-size: 11px; opacity: 0.85; }
.swb-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.85;
    transition: opacity var(--swb-transition);
}
.swb-chat-close:hover { opacity: 1; }

.swb-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 150px;
}

.swb-chat-message {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.5;
}
.swb-chat-message p { margin: 0; }
.swb-chat-message--bot {
    background: #f5f5f5;
    align-self: flex-start;
    border-radius: 4px 16px 16px 16px;
}
.swb-chat-message--user {
    background: var(--swb-primary);
    color: #fff;
    align-self: flex-end;
    border-radius: 16px 4px 16px 16px;
}
.swb-chat-message--thinking {
    background: #f5f5f5;
    align-self: flex-start;
    padding: 10px 14px;
}
.swb-thinking-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}
.swb-thinking-dots span {
    width: 7px; height: 7px;
    background: #bbb;
    border-radius: 50%;
    animation: swb-bounce 1.2s infinite;
}
.swb-thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.swb-thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes swb-bounce {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40%            { transform: scale(1.2); opacity: 1; }
}

/* Product results in chat */
.swb-chat-products {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    width: 100%;
    max-width: 300px;
}
.swb-chat-product {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 8px;
    text-decoration: none;
    color: inherit;
    transition: border-color var(--swb-transition), box-shadow var(--swb-transition);
    position: relative;
}
.swb-chat-product:hover {
    border-color: var(--swb-primary);
    box-shadow: 0 2px 10px rgba(var(--swb-primary-rgb), 0.1);
}
.swb-chat-product__img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 7px;
    flex-shrink: 0;
}
.swb-chat-product__info { flex: 1; min-width: 0; }
.swb-chat-product__name {
    font-size: 12px;
    font-weight: 600;
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.swb-chat-product__reason {
    font-size: 10px;
    color: #888;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.swb-chat-product__meta {
    display: flex;
    align-items: center;
    gap: 6px;
}
.swb-chat-product__price {
    font-size: 13px;
    font-weight: 700;
    color: var(--swb-primary);
}
.swb-chat-product__badge {
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 8px;
    font-weight: 700;
}
.swb-badge--best { background: #fff0f5; color: #856404; }
.swb-badge--sale { background: #fce4ee; color: #c0392b; }
.swb-badge--new  { background: #d4edda; color: #155724; }

.swb-chat-product__atc {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--swb-primary);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    transition: all var(--swb-transition);
}
.swb-chat-product__atc:hover {
    background: var(--swb-primary-dark);
    transform: scale(1.1);
}
.swb-chat-product__atc.swb-added {
    background: var(--swb-success);
}

.swb-chat-add-all {
    width: 100%;
    margin-top: 4px;
}

/* Comparison table in chat */
.swb-chat-comparison {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 10px;
    margin-top: 6px;
    font-size: 11px;
    overflow-x: auto;
}
.swb-chat-comparison table {
    width: 100%;
    border-collapse: collapse;
}
.swb-chat-comparison th {
    background: var(--swb-primary);
    color: #fff;
    padding: 5px 8px;
    font-size: 10px;
    text-align: center;
}
.swb-chat-comparison td {
    padding: 5px 8px;
    border-bottom: 1px solid #eee;
    text-align: center;
}
.swb-comparison-best-col {
    background: #fff4f8;
    font-weight: 700;
}

.swb-chat-input-wrap {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #f0f0f0;
    background: #fff;
    flex-shrink: 0;
}
.swb-chat-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 50px;
    padding: 9px 16px;
    font-size: 13px;
    outline: none;
    transition: border-color var(--swb-transition);
    background: #fafafa;
}
.swb-chat-input:focus { border-color: var(--swb-primary); background: #fff; }
.swb-chat-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--swb-primary);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--swb-transition);
}
.swb-chat-send:hover {
    background: var(--swb-primary-dark);
    transform: scale(1.05);
}
.swb-chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* ----------------------------------------
   4. STICKY CART
   ---------------------------------------- */
.swb-sticky-cart {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--swb-z-sticky);
    background: #fff;
    border-top: 2px solid var(--swb-border);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.34, 1.1, 0.64, 1);
}
.swb-sticky-cart.swb-is-visible {
    transform: translateY(0);
}

.swb-sticky-cart__inner {
    max-width: 860px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: nowrap;
}

.swb-sticky-cart__product {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.swb-sticky-cart__image {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}
.swb-sticky-cart__name {
    font-size: 13px;
    font-weight: 600;
    color: var(--swb-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}
.swb-sticky-cart__price {
    font-size: 13px;
    font-weight: 700;
    color: var(--swb-primary);
    flex-shrink: 0;
}
@media (max-width: 480px) {
    .swb-sticky-cart__name { max-width: 90px; font-size: 12px; }
    .swb-sticky-cart__image { width: 36px; height: 36px; }
}

.swb-sticky-cart__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.swb-qty-wrap {
    display: flex;
    align-items: center;
    border: 1px solid var(--swb-border);
    border-radius: 50px;
    overflow: hidden;
}
.swb-qty-btn {
    width: 30px;
    height: 30px;
    background: #f5f5f5;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    color: #444;
    transition: background var(--swb-transition);
    flex-shrink: 0;
}
.swb-qty-btn:hover { background: #e8e8e8; }
.swb-qty-input {
    width: 36px;
    height: 30px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--swb-border);
    border-right: 1px solid var(--swb-border);
    font-size: 14px;
    font-weight: 600;
    -moz-appearance: textfield;
}
.swb-qty-input::-webkit-outer-spin-button,
.swb-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.swb-sticky-atc {
    padding: 9px 18px;
    font-size: 13px;
    border-radius: 50px;
}
@media (max-width: 480px) {
    .swb-sticky-atc { padding: 8px 12px; font-size: 12px; }
    .swb-qty-wrap    { display: none; }
}

.swb-sticky-cart__upsell {
    font-size: 12px;
    color: #555;
    border-top: 1px solid #f0f0f0;
    padding-top: 6px;
    width: 100%;
    margin-top: 4px;
    text-align: center;
}

/* ----------------------------------------
   5. SOCIAL PROOF
   ---------------------------------------- */
.swb-social-proof {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin: 10px 0 16px;
}

.swb-sp-item {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #fff4f8;
    border: 1px solid #f9b8ce;
    border-radius: 50px;
    padding: 5px 12px;
    font-size: 12px;
    color: #555;
    font-weight: 500;
}

.swb-sp-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ccc;
    flex-shrink: 0;
}
.swb-sp-dot--live {
    background: var(--swb-success);
    box-shadow: 0 0 0 0 rgba(0, 166, 81, 0.5);
    animation: swb-pulse 1.8s infinite;
}
@keyframes swb-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(0, 166, 81, 0.5); }
    70%  { box-shadow: 0 0 0 8px rgba(0, 166, 81, 0); }
    100% { box-shadow: 0 0 0 0   rgba(0, 166, 81, 0); }
}

.swb-sp-count {
    font-weight: 800;
    font-size: 14px;
    color: var(--swb-primary);
    min-width: 18px;
    display: inline-block;
    text-align: center;
    transition: all 0.3s ease;
}
.swb-sp-count.swb-sp-updating {
    transform: scale(1.2);
    color: var(--swb-primary-dark);
}

/* Cart count badge (Sticky ATC) */
.swb-cart-updated {
    animation: swb-cart-pop 0.4s ease;
}
@keyframes swb-cart-pop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* Toast notification */
.swb-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--swb-dark);
    color: #fff;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}
.swb-toast.swb-toast--show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.swb-toast.swb-toast--success { background: var(--swb-success); }

/* ----------------------------------------
   RTL overrides
   ---------------------------------------- */
[dir="rtl"] .swb-chat-message--bot { border-radius: 16px 4px 16px 16px; }
[dir="rtl"] .swb-chat-message--user { border-radius: 4px 16px 16px 16px; }
[dir="rtl"] .swb-upsell-popup__close { left: 12px; right: auto; }

/* ----------------------------------------
   Spin Wheel: Floating side button
   ---------------------------------------- */
.swb-spin-float-btn {
    position: fixed;
    /* JS controls top/right/left + transform on desktop */
    z-index: 9985;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px 10px 16px;
    border: none;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.2;
    letter-spacing: 0.2px;
    box-shadow: 0 3px 16px rgba(0,0,0,0.22);
    transition: box-shadow 0.2s ease;
}
.swb-spin-float-btn:hover {
    box-shadow: 0 4px 22px rgba(0,0,0,0.32);
}
.swb-spin-float-btn__icon  { font-size: 16px; line-height: 1; }
.swb-spin-float-btn__label { font-size: 13px; font-weight: 700; }

/* Mobile: fixed pill, bottom-right, no rotation */
@media (max-width: 768px) {
    .swb-spin-float-btn {
        top: auto !important;
        bottom: 80px !important;
        right: 12px !important;
        left: auto !important;
        transform: none !important;
        transform-origin: unset !important;
        border-radius: 50px !important;
        padding: 10px 16px !important;
    }
    [dir="rtl"] .swb-spin-float-btn {
        right: auto !important;
        left: 12px !important;
    }
}

.swb-spin-modal__close {
    position: absolute;
    top: 12px;
    left: 14px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    color: #555;
    line-height: 1;
}
[dir="rtl"] .swb-spin-modal__close { left: auto; right: 14px; }
.swb-spin-modal__close:hover { background: #e0e0e0; }
.swb-spin-modal__header { margin-bottom: 12px; text-align: center; }

/* ----------------------------------------
   Free Shipping Reminder Bar
   ---------------------------------------- */
.swb-freeship-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    background: var(--swb-primary-light, #fff4f8);
    border: 2px solid var(--swb-primary);
    padding: 8px 20px;
    font-size: 12px;
    font-weight: 600;
    color: #444;
    /* Fixed center-bottom, clear of WhatsApp/chat buttons */
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: min(420px, calc(100vw - 120px)); /* leave room for side buttons */
    min-width: 220px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    z-index: calc(var(--swb-z-sticky) - 1);
    transition: background 0.3s ease, opacity 0.3s ease;
    white-space: nowrap;
}
.swb-freeship-bar--done {
    background: #f0fff4;
    border-color: var(--swb-success);
    color: var(--swb-success);
}
.swb-freeship-bar__icon { font-size: 16px; }
.swb-freeship-bar__text { flex: 1; min-width: 120px; }
.swb-freeship-bar__track {
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 2px;
}
.swb-freeship-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--swb-primary), var(--swb-primary-dark));
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.34, 1.3, 0.64, 1);
}
.swb-freeship-bar--done .swb-freeship-bar__fill {
    background: var(--swb-success);
}
@keyframes swb-freeship-pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.015); box-shadow: 0 0 0 3px rgba(var(--swb-primary-rgb), 0.2); }
}
.swb-freeship-bar--pulse {
    animation: swb-freeship-pulse 0.6s ease 2;
}

/* ============================================
   MOBILE OVERRIDES - comprehensive
   max-width: 768px
   ============================================ */
@media (max-width: 768px) {

    /* --- AI Chat: mobile adjustments --- */
    /* Trigger: JS sets position, we just ensure good size */
    .swb-chat-trigger {
        padding: 12px 16px;
    }
    /* Chat window: full-width bottom sheet on mobile */
    .swb-chat-window {
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: 75vh;
        border-radius: 20px 20px 0 0 !important;
        border-bottom: none;
    }
    .swb-chat-messages {
        max-height: calc(75vh - 130px);
    }
    /* iOS input zoom fix - MUST be 16px+ */
    .swb-chat-input {
        font-size: 16px !important;
    }

    /* --- Upsell Popup: single column on very small --- */
    .swb-upsell-popup__inner {
        padding: 16px 12px;
        border-radius: 16px 16px 0 0;
    }
    .swb-upsell-products {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .swb-upsell-product__image {
        width: 56px;
        height: 56px;
    }

    /* --- Spin Modal: handled by base CSS (width: calc(100vw-40px)) --- */
    .swb-spin-modal__title { font-size: 18px; }
    .swb-wheel-wrapper { width: 100%; max-width: 240px; height: 240px; }

    /* --- Sticky Cart: compact --- */
    .swb-sticky-cart__inner {
        padding: 8px 12px;
        gap: 8px;
    }
    .swb-sticky-cart__name {
        max-width: 80px;
        font-size: 11px;
    }
    .swb-sticky-cart__price {
        font-size: 12px;
    }
    .swb-sticky-cart__image {
        width: 36px;
        height: 36px;
    }
    .swb-qty-wrap {
        display: none; /* hide qty on mobile for simplicity */
    }
    .swb-sticky-atc {
        padding: 9px 14px;
        font-size: 12px;
        white-space: nowrap;
    }

    /* --- Social Proof: stack vertically --- */
    .swb-social-proof {
        flex-direction: column;
        gap: 6px;
    }
    .swb-sp-item {
        font-size: 11px;
        padding: 4px 10px;
    }

    /* --- Toast: full width --- */
    .swb-toast {
        width: calc(100% - 32px);
        left: 16px;
        transform: translateX(0) translateY(20px);
        text-align: center;
        border-radius: 10px;
        white-space: normal;
    }
    .swb-toast.swb-toast--show {
        transform: translateX(0) translateY(0);
    }

    /* --- Free shipping bar: full width on mobile --- */
    .swb-freeship-bar {
        left: 12px;
        right: 12px;
        transform: none;
        max-width: calc(100vw - 24px);
        min-width: unset;
        width: auto;
        bottom: 72px;
        font-size: 11px;
        padding: 7px 16px;
        white-space: normal;
        border-radius: 12px;
    }

    /* --- Buttons: easier tap targets --- */
    .swb-btn {
        min-height: 44px;
    }
    .swb-btn--sm {
        min-height: 36px;
    }
}

/* Extra small phones */
@media (max-width: 380px) {
    .swb-upsell-products {
        grid-template-columns: 1fr 1fr;
    }
    .swb-chat-window {
        max-height: 80vh;
    }
    .swb-wheel-wrapper { max-width: 210px; height: 210px; }
}
