/* WooCommerce Professional Popup - Modern & Beautiful Styles */

/* RTL Support */
body.rtl #wc-popup-overlay {
    direction: rtl;
    text-align: right;
}

/* Overlay */
.wc-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.wc-popup-overlay.wc-popup-active {
    display: flex;
    opacity: 1;
}

/* Container Positioning */
.wc-popup-container {
    position: relative;
    max-width: 650px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.wc-popup-overlay.wc-popup-active .wc-popup-container {
    transform: scale(1);
}

/* Position Variants */
.wc-popup-container.wc-popup-position-top {
    align-self: flex-start;
    margin-top: 3rem;
}

.wc-popup-container.wc-popup-position-bottom {
    align-self: flex-end;
    margin-bottom: 3rem;
}

.wc-popup-container.wc-popup-position-center {
    align-self: center;
}

/* Content Box - Glassmorphism */
.wc-popup-content {
    position: relative;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .wc-popup-content {
        background: rgba(30, 30, 35, 0.95);
        color: #f0f0f0;
        box-shadow: 
            0 20px 60px rgba(0, 0, 0, 0.6),
            0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    }
}

/* Close Button */
.wc-popup-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.wc-popup-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    transform: rotate(90deg) scale(1.1);
}

.wc-popup-close:active {
    transform: rotate(90deg) scale(0.95);
}

@media (prefers-color-scheme: dark) {
    .wc-popup-close {
        background: rgba(255, 255, 255, 0.1);
        color: #f0f0f0;
    }
    
    .wc-popup-close:hover {
        background: rgba(239, 68, 68, 0.3);
        color: #fca5a5;
    }
}

/* RTL Close Button */
body.rtl .wc-popup-close {
    right: auto;
    left: 1.5rem;
}

/* Image */
.wc-popup-image {
    margin: -3rem -3rem 2rem -3rem;
    border-radius: 24px 24px 0 0;
    overflow: hidden;
}

.wc-popup-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 300px;
}

/* Body Content */
.wc-popup-body {
    color: #333;
    font-size: 16px;
    line-height: 1.7;
}

@media (prefers-color-scheme: dark) {
    .wc-popup-body {
        color: #e5e5e5;
    }
}

.wc-popup-body h1,
.wc-popup-body h2,
.wc-popup-body h3,
.wc-popup-body h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.wc-popup-body h1 {
    font-size: 2rem;
}

.wc-popup-body h2 {
    font-size: 1.75rem;
}

.wc-popup-body h3 {
    font-size: 1.5rem;
}

.wc-popup-body p {
    margin-bottom: 1rem;
}

.wc-popup-body a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.wc-popup-body a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.wc-popup-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1rem 0;
}

.wc-popup-body ul,
.wc-popup-body ol {
    margin-right: 1.5rem;
    margin-bottom: 1rem;
}

body.rtl .wc-popup-body ul,
body.rtl .wc-popup-body ol {
    margin-right: 0;
    margin-left: 1.5rem;
}

/* Buttons in content */
.wc-popup-body .button,
.wc-popup-body button,
.wc-popup-body input[type="submit"] {
    display: inline-block;
    padding: 0.85rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.wc-popup-body .button:hover,
.wc-popup-body button:hover,
.wc-popup-body input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.wc-popup-body .button:active,
.wc-popup-body button:active,
.wc-popup-body input[type="submit"]:active {
    transform: translateY(0);
}

/* Animations */
@keyframes wc-popup-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes wc-popup-slide-down {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes wc-popup-slide-up {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes wc-popup-zoom {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Apply animations */
.wc-popup-overlay[data-animation="fade"] .wc-popup-container {
    animation: wc-popup-fade-in 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.wc-popup-overlay[data-animation="slide-down"] .wc-popup-container {
    animation: wc-popup-slide-down 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.wc-popup-overlay[data-animation="slide-up"] .wc-popup-container {
    animation: wc-popup-slide-up 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.wc-popup-overlay[data-animation="zoom"] .wc-popup-container {
    animation: wc-popup-zoom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scrollbar Styling */
.wc-popup-container::-webkit-scrollbar {
    width: 8px;
}

.wc-popup-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.wc-popup-container::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 4px;
    transition: background 0.2s;
}

.wc-popup-container::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.8);
}

/* Responsive Design */
@media (max-width: 768px) {
    .wc-popup-container {
        width: 95%;
        max-height: 85vh;
    }
    
    .wc-popup-content {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }
    
    .wc-popup-close {
        top: 1rem;
        right: 1rem;
        width: 36px;
        height: 36px;
    }
    
    body.rtl .wc-popup-close {
        right: auto;
        left: 1rem;
    }
    
    .wc-popup-image {
        margin: -2rem -1.5rem 1.5rem -1.5rem;
        border-radius: 20px 20px 0 0;
    }
    
    .wc-popup-body h1 {
        font-size: 1.5rem;
    }
    
    .wc-popup-body h2 {
        font-size: 1.35rem;
    }
    
    .wc-popup-body h3 {
        font-size: 1.2rem;
    }
    
    .wc-popup-body {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .wc-popup-content {
        padding: 1.5rem 1.25rem;
    }
    
    .wc-popup-body .button,
    .wc-popup-body button,
    .wc-popup-body input[type="submit"] {
        padding: 0.75rem 1.5rem;
        font-size: 14px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .wc-popup-overlay,
    .wc-popup-container,
    .wc-popup-close,
    .wc-popup-body .button {
        animation: none !important;
        transition: none !important;
    }
}

/* Focus styles for accessibility */
.wc-popup-close:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.wc-popup-body a:focus-visible,
.wc-popup-body .button:focus-visible,
.wc-popup-body button:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}
