/* ===== OVERLAY ===== */
.sw-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.sw-overlay.sw-visible {
    opacity: 1;
}

/* ===== POPUP ===== */
.sw-popup {
    background: #fff;
    border-radius: 16px;
    max-width: 750px;
    width: 95%;
    position: relative;
    overflow: visible;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: sw-slide-up 0.4s ease;
}

@keyframes sw-slide-up {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.sw-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    z-index: 10;
    line-height: 1;
    padding: 4px;
}
.sw-close:hover {
    color: #333;
}

/* ===== CONTENT LAYOUT ===== */
.sw-content {
    display: flex;
    min-height: 400px;
}
.sw-left {
    flex: 1;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.sw-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 30px;
}

.sw-title {
    font-size: 28px;
    font-weight: 800;
    color: #1a1a2e;
    margin: 0 0 10px;
    line-height: 1.2;
}
.sw-subtitle {
    font-size: 15px;
    color: #666;
    margin: 0 0 24px;
    line-height: 1.5;
}

/* ===== FORM ===== */
.sw-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.sw-guest-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.sw-form-row {
    display: flex;
    gap: 8px;
}
.sw-form-row .sw-input {
    flex: 1;
    min-width: 0;
}
.sw-input,
.sw-email-input {
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}
.sw-input:focus,
.sw-email-input:focus {
    border-color: #e74c3c;
}
.sw-input.sw-input-error {
    border-color: #e74c3c;
    background: #fff5f5;
}
.sw-form-error {
    color: #e74c3c;
    font-size: 13px;
    padding: 6px 0;
}
.sw-spin-btn {
    padding: 14px 24px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.sw-spin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}
.sw-spin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== WHEEL ===== */
.sw-wheel-container {
    position: relative;
    width: 340px;
    height: 340px;
}
.sw-pointer {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-top: 30px solid #fff;
    z-index: 5;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
#sw-canvas {
    border-radius: 50%;
    box-shadow: 0 0 0 8px rgba(255,255,255,0.2), 0 0 30px rgba(0,0,0,0.3);
    max-width: 100%;
    height: auto;
}

/* ===== RESULT ===== */
.sw-result,
.sw-no-win,
.sw-gift-result {
    padding: 40px;
    text-align: center;
}
.sw-result-icon {
    font-size: 64px;
    margin-bottom: 16px;
}
.sw-result-title {
    font-size: 28px;
    font-weight: 800;
    color: #1a1a2e;
    margin: 0 0 8px;
}
.sw-result-text {
    font-size: 16px;
    color: #666;
    margin: 0 0 24px;
}

/* ===== GIFT RESULT ===== */
.sw-gift-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #fff;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 1px;
    margin: 16px 0;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
}
.sw-gift-text-display {
    font-size: 16px;
    color: #444;
    line-height: 1.6;
    margin: 0 0 16px;
}
.sw-gift-note {
    font-size: 13px;
    color: #999;
    margin: 12px 0;
}

.sw-coupon-display {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    border: 2px dashed #e74c3c;
    border-radius: 8px;
    padding: 12px 20px;
    margin-bottom: 24px;
}
.sw-coupon-code {
    font-size: 22px;
    font-weight: 800;
    color: #e74c3c;
    letter-spacing: 2px;
    font-family: monospace;
}
.sw-copy-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.sw-copy-btn:hover {
    opacity: 1;
}

.sw-apply-btn {
    display: block;
    width: 100%;
    max-width: 320px;
    margin: 0 auto 12px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #27ae60, #219a52);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s;
}
.sw-apply-btn:hover {
    transform: translateY(-2px);
}

.sw-shop-link {
    display: inline-block;
    color: #999;
    font-size: 14px;
    text-decoration: underline;
    margin-top: 8px;
}

/* ===== EXIT INTENT ===== */
.sw-exit-popup {
    background: #fff;
    border-radius: 16px;
    max-width: 480px;
    width: 95%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: sw-slide-up 0.4s ease;
}
.sw-exit-content {
    padding: 40px 30px;
    text-align: center;
}
.sw-exit-icon {
    font-size: 56px;
    margin-bottom: 12px;
}
.sw-exit-title {
    font-size: 24px;
    font-weight: 800;
    color: #e74c3c;
    margin: 0 0 12px;
}
.sw-exit-message {
    font-size: 15px;
    color: #666;
    margin: 0 0 24px;
    line-height: 1.6;
}

/* ===== COUNTDOWN ===== */
.sw-countdown {
    margin-bottom: 24px;
}
.sw-countdown-timer {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #1a1a2e;
    border-radius: 12px;
    padding: 16px 32px;
}
.sw-minutes,
.sw-seconds {
    font-size: 40px;
    font-weight: 800;
    color: #e74c3c;
    font-family: monospace;
    min-width: 56px;
    display: inline-block;
}
.sw-separator {
    font-size: 36px;
    font-weight: 800;
    color: #e74c3c;
    animation: sw-blink 1s infinite;
}
@keyframes sw-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.sw-countdown-label {
    font-size: 13px;
    color: #999;
    margin: 8px 0 0;
}

.sw-exit-coupon {
    margin-bottom: 20px;
}
.sw-exit-coupon-code {
    display: inline-block;
    background: #fff3f3;
    border: 2px dashed #e74c3c;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 20px;
    font-weight: 800;
    color: #e74c3c;
    letter-spacing: 2px;
    font-family: monospace;
}

.sw-exit-apply-btn {
    display: block;
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 12px;
    transition: transform 0.2s;
}
.sw-exit-apply-btn:hover {
    transform: translateY(-2px);
}
.sw-exit-dismiss {
    background: none;
    border: none;
    color: #bbb;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
}
.sw-exit-dismiss:hover {
    color: #999;
}

/* ===== MOBILE ===== */
@media (max-width: 680px) {
    .sw-content {
        flex-direction: column-reverse;
    }
    .sw-right {
        padding: 20px;
    }
    .sw-wheel-container {
        width: 220px;
        height: 220px;
        margin: 0 auto;
    }
    #sw-canvas {
        width: 220px;
        height: 220px;
    }
    .sw-left {
        padding: 20px 16px;
    }
    .sw-title {
        font-size: 20px;
    }
    .sw-subtitle {
        font-size: 13px;
        margin-bottom: 16px;
    }
    .sw-popup {
        max-height: 95vh;
        overflow-x: hidden;
        overflow-y: auto;
    }
    .sw-form-row {
        flex-direction: column;
        gap: 10px;
    }
    .sw-input,
    .sw-email-input {
        padding: 12px;
        font-size: 14px;
    }
    .sw-spin-btn {
        padding: 12px 20px;
        font-size: 15px;
    }
    .sw-result,
    .sw-no-win,
    .sw-gift-result {
        padding: 24px 16px;
    }
    .sw-result-icon {
        font-size: 48px;
    }
    .sw-result-title {
        font-size: 22px;
    }
    .sw-coupon-code {
        font-size: 18px;
    }
    .sw-exit-content {
        padding: 24px 16px;
    }
    .sw-exit-title {
        font-size: 20px;
    }
    .sw-countdown-timer {
        padding: 12px 20px;
    }
    .sw-minutes,
    .sw-seconds {
        font-size: 32px;
        min-width: 44px;
    }
    .sw-exit-popup {
        max-height: 95vh;
        overflow-y: auto;
    }
    .sw-exit-coupon-code {
        font-size: 16px;
        padding: 8px 16px;
    }
    .sw-gift-badge {
        font-size: 14px;
        padding: 10px 20px;
    }
}

@media (max-width: 380px) {
    .sw-wheel-container {
        width: 180px;
        height: 180px;
    }
    #sw-canvas {
        width: 180px;
        height: 180px;
    }
    .sw-left {
        padding: 16px 12px;
    }
    .sw-title {
        font-size: 18px;
    }
}

/* ===== STICKY BAR ===== */
.sw-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999998;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    transform: translateY(100%);
    transition: transform 0.4s ease;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
}
.sw-sticky-bar.sw-sticky-visible {
    transform: translateY(0);
}
.sw-sticky-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 20px;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
}
.sw-sticky-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.sw-sticky-text {
    font-size: 14px;
    line-height: 1.4;
}
.sw-sticky-label {
    color: #f39c12;
}
.sw-sticky-code {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    border: 1px dashed rgba(255,255,255,0.4);
    border-radius: 4px;
    padding: 2px 10px;
    font-size: 15px;
    font-weight: 800;
    color: #e74c3c;
    letter-spacing: 1px;
    margin: 0 4px;
}
.sw-sticky-apply {
    background: linear-gradient(135deg, #27ae60, #219a52);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s;
    flex-shrink: 0;
}
.sw-sticky-apply:hover {
    transform: translateY(-1px);
}
.sw-sticky-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.2s;
}
.sw-sticky-close:hover {
    color: #fff;
}

@media (max-width: 680px) {
    .sw-sticky-inner {
        padding: 10px 12px;
        gap: 8px;
        justify-content: space-between;
    }
    .sw-sticky-text {
        font-size: 12px;
        flex: 1;
        min-width: 0;
    }
    .sw-sticky-code {
        font-size: 13px;
    }
    .sw-sticky-apply {
        padding: 6px 14px;
        font-size: 12px;
    }
    .sw-sticky-icon {
        display: none;
    }
}
