/* Exit Popup - iOS/macOS Style */
/* Prevent body scroll when popup is open */
body.wc-exit-popup-open {
    overflow: hidden !important;
}

.wc-exit-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
    box-sizing: border-box;
}

.wc-exit-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.wc-exit-popup {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4),
                0 0 0 1px rgba(0, 0, 0, 0.05);
    max-width: 480px;
    width: 100%;
    padding: 48px 40px;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.wc-exit-popup-overlay.active .wc-exit-popup {
    transform: scale(1);
}

.wc-exit-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.06);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    color: rgba(0, 0, 0, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-exit-popup-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

.wc-exit-popup-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    box-shadow: 0 10px 30px -5px rgba(102, 126, 234, 0.4);
}

.wc-exit-popup-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 12px;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.wc-exit-popup-message {
    font-size: 16px;
    color: #718096;
    margin: 0 0 32px;
    line-height: 1.6;
}

.wc-exit-coupon-box {
    background: linear-gradient(135deg, #f6f8fb 0%, #ffffff 100%);
    border: 2px dashed #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    margin: 0 0 32px;
    position: relative;
    overflow: hidden;
}

.wc-exit-coupon-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.wc-exit-coupon-label {
    font-size: 11px;
    font-weight: 600;
    color: #a0aec0;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.wc-exit-coupon-code {
    font-size: 32px;
    font-weight: 800;
    color: #667eea;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    margin-bottom: 8px;
    text-transform: uppercase;
    word-break: break-all;
}

.wc-exit-coupon-discount {
    font-size: 14px;
    color: #718096;
    font-weight: 500;
}

.wc-exit-popup-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.wc-exit-btn {
    flex: 1;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.wc-exit-btn span {
    font-size: 18px;
}

.wc-exit-btn-primary {
    background: linear-gradient(135deg, #00a32a 0%, #008a20 100%);
    color: white;
    box-shadow: 0 10px 20px -5px rgba(0, 163, 42, 0.4);
}

.wc-exit-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(102, 126, 234, 0.5);
}

.wc-exit-btn-primary:active {
    transform: translateY(0);
}

.wc-exit-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.wc-exit-btn-secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.wc-exit-btn-secondary:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.wc-exit-btn-secondary.copied {
    background: #48bb78;
    color: white;
    border-color: #48bb78;
}

.wc-exit-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: wc-exit-spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes wc-exit-spin {
    to { transform: rotate(360deg); }
}

.wc-exit-popup-footer {
    margin: 0;
}

.wc-exit-popup-footer small {
    font-size: 13px;
    color: #a0aec0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .wc-exit-popup-overlay {
        padding: 10px;
    }
    
    .wc-exit-popup {
        padding: 32px 24px;
        width: 100%;
        max-width: 100%;
        border-radius: 20px;
    }
    
    .wc-exit-popup-title {
        font-size: 22px;
    }
    
    .wc-exit-popup-message {
        font-size: 15px;
    }
    
    .wc-exit-coupon-code {
        font-size: 24px;
        letter-spacing: 1px;
    }
    
    .wc-exit-popup-actions {
        flex-direction: column;
    }
    
    .wc-exit-btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 14px;
    }
    
    .wc-exit-popup-icon {
        width: 64px;
        height: 64px;
        font-size: 36px;
        margin-bottom: 20px;
    }
}

/* Very small screens */
@media (max-width: 380px) {
    .wc-exit-popup {
        padding: 24px 16px;
    }
    
    .wc-exit-popup-title {
        font-size: 20px;
    }
    
    .wc-exit-coupon-code {
        font-size: 20px;
    }
}

/* Design NOU pentru product popup */
.wc-exit-popup-product {
    max-width: 480px;
    padding: 32px;
}

.wc-popup-product-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wc-popup-product-image {
    width: 200px;
    height: 200px;
    border-radius: 16px;
    overflow: hidden;
    background: #f9fafb;
    margin-bottom: 20px;
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.wc-popup-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wc-popup-discount-badge {
    position: absolute;
  top: 0px;
  left: 0px;
    background: linear-gradient(135deg, #00a32a 0%, #008a20 100%);
    color: white;
    font-size: 13px;
    font-weight: 700;
   padding: 5px 5px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 163, 42, 0.4);
    z-index: 1;
}

.wc-popup-product-info {
    width: 100%;
    text-align: center;
}

.wc-exit-popup-product .wc-exit-popup-title {
    font-size: 22px;
    margin-bottom: 12px;
}

.wc-popup-product-name {
    font-size: 15px;
    font-weight: 600;
    color: #4a5568;
    margin: 0 0 16px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: calc(1.4em * 5);
}

.wc-popup-prices {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.wc-popup-price-old {
    font-size: 18px;
    color: #9ca3af;
    text-decoration: line-through;
    font-weight: 500;
}

.wc-popup-price-new {
    font-size: 28px;
    color: #00a32a;
    font-weight: 700;
}

.wc-exit-coupon-compact {
    padding: 16px 20px;
    margin-bottom: 24px;
}

.wc-exit-coupon-compact .wc-exit-coupon-label {
    font-size: 11px;
    margin-bottom: 6px;
}

.wc-exit-coupon-compact .wc-exit-coupon-code {
    font-size: 24px;
    margin-bottom: 0;
}

.wc-exit-btn-text {
    background: transparent;
    color: #9ca3af;
    border: none;
    padding: 12px;
    font-size: 13px;
    cursor: pointer;
    transition: color 0.2s ease;
    margin-top: 8px;
    display: block;
    width: 100%;
}

.wc-exit-btn-text:hover {
    color: #6b7280;
}

@media (max-width: 640px) {
    .wc-exit-popup-product {
        padding: 28px 24px;
    }
    
    .wc-popup-product-image {
        width: 180px;
        height: 180px;
    }
    
    .wc-popup-price-old {
        font-size: 16px;
    }
    
    .wc-popup-price-new {
        font-size: 24px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .wc-exit-popup {
        background: #1a202c;
        color: #e2e8f0;
    }
    
    .wc-exit-popup-title {
        color: #ffffff;
    }
    
    .wc-exit-popup-message {
        color: #cbd5e0;
    }
    
    .wc-exit-coupon-box {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .wc-exit-btn-secondary {
        background: #2d3748;
        color: #e2e8f0;
        border-color: #4a5568;
    }
    
    .wc-exit-btn-secondary:hover {
        background: #4a5568;
    }
    
    .wc-exit-popup-close {
        background: rgba(255, 255, 255, 0.1);
        color: rgba(255, 255, 255, 0.8);
    }
    
    .wc-exit-popup-close:hover {
        background: rgba(255, 255, 255, 0.2);
    }
}

/* iOS safe area support */
@supports (padding: max(0px)) {
    .wc-exit-popup {
        padding-left: max(40px, env(safe-area-inset-left));
        padding-right: max(40px, env(safe-area-inset-right));
        padding-bottom: max(48px, env(safe-area-inset-bottom));
    }
    
    @media (max-width: 640px) {
        .wc-exit-popup {
            padding-left: max(24px, env(safe-area-inset-left));
            padding-right: max(24px, env(safe-area-inset-right));
            padding-bottom: max(32px, env(safe-area-inset-bottom));
        }
    }
}
