/* Progressive Category Discounts - Frontend Styles */

.pcd-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pcd-popup-overlay.pcd-popup-show {
    opacity: 1;
    visibility: visible;
}

.pcd-popup {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.3s ease;
    text-align: center;
}

.pcd-popup-show .pcd-popup {
    transform: scale(1) translateY(0);
}

.pcd-popup-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: pcd-bounce 0.6s ease;
}

@keyframes pcd-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.pcd-popup-title {
    font-size: 26px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 16px 0;
    line-height: 1.3;
}

.pcd-popup-message {
    font-size: 16px;
    color: #555;
    margin-bottom: 30px;
    line-height: 1.6;
}

.pcd-popup-message strong {
    color: #e74c3c;
    font-weight: 700;
}

.pcd-popup-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.pcd-popup-button {
    flex: 1;
    min-width: 180px;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.pcd-popup-continue {
    background: #000000;
    color: #fff;
}

.pcd-popup-continue:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.pcd-popup-cart {
    background: #f7a801;
    color: #fff;
}

.pcd-popup-cart:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4);
    color: #fff;
}

.pcd-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: #ecf0f1;
    color: #7f8c8d;
    font-size: 24px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.pcd-popup-close:hover {
    background: #e74c3c;
    color: #fff;
    transform: rotate(90deg);
}

/* Mobile responsiveness */
@media (max-width: 600px) {
    .pcd-popup {
        padding: 30px 20px;
        width: 95%;
    }
    
    .pcd-popup-icon {
        font-size: 48px;
    }
    
    .pcd-popup-title {
        font-size: 22px;
    }
    
    .pcd-popup-message {
        font-size: 14px;
    }
    
    .pcd-popup-actions {
        flex-direction: column;
    }
    
    .pcd-popup-button {
        width: 80%;
        min-width: auto;
    }
}

/* Animation for multiple discount levels */
.pcd-popup[data-level="2"] .pcd-popup-icon {
    animation: pcd-celebrate 0.8s ease;
}

.pcd-popup[data-level="3"] .pcd-popup-icon {
    animation: pcd-party 1s ease;
}

@keyframes pcd-celebrate {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-10deg) scale(1.1); }
    75% { transform: rotate(10deg) scale(1.1); }
}

@keyframes pcd-party {
    0%, 100% { transform: rotate(0deg) scale(1); }
    20% { transform: rotate(-15deg) scale(1.15); }
    40% { transform: rotate(15deg) scale(1.15); }
    60% { transform: rotate(-15deg) scale(1.15); }
    80% { transform: rotate(15deg) scale(1.15); }
}

/* Loading state */
.pcd-popup.pcd-loading {
    pointer-events: none;
    opacity: 0.6;
}

.pcd-popup.pcd-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: pcd-spin 1s linear infinite;
}

@keyframes pcd-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}