/**
 * Static Treatment Popups
 * Efficient, mobile-first popup styles
 * 
 * @package tempusbelgravia
 */

/* Popup Overlay */
.treatment-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.treatment-popup.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

/* Popup Container */
.popup-container {
    background-color: var(--white);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    overflow: hidden;
    position: relative;
}

.treatment-popup.show .popup-container {
    transform: scale(1);
}

/* Close Button */
.popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--dark-text);
}

.popup-close:hover {
    background-color: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

/* Popup Content */
.popup-content {
    padding: 40px;
    overflow-y: auto;
    max-height: 90vh;
    -webkit-overflow-scrolling: touch;
}

.popup-title {
    font-family: var(--display-font);
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 20px;
    line-height: 1.2;
}

.popup-subtitle {
    font-size: 1.2rem;
    color: var(--gray);
    font-style: italic;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* Info Grid */
.popup-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 35px;
    padding: 25px;
    background-color: var(--primary-ultralight);
    border-radius: 8px;
}

.popup-info-item {
    text-align: center;
}

.popup-info-item i {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 8px;
    display: block;
}

.popup-info-item strong {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-dark);
    margin-bottom: 4px;
}

.popup-info-item span {
    font-size: 1rem;
    color: var(--dark-text);
}

/* Benefits List */
.popup-benefits {
    margin-bottom: 35px;
}

.popup-benefits h3 {
    font-family: var(--heading-font);
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-light);
}

.popup-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.popup-benefits li {
    position: relative;
    padding-left: 35px;
    margin-bottom: 15px;
    line-height: 1.6;
    color: var(--dark-text);
}

.popup-benefits li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: -2px;
    color: var(--primary);
    font-size: 1.4rem;
    font-weight: bold;
}

/* Process Section */
.popup-process {
    background-color: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    margin-bottom: 35px;
}

.popup-process h3 {
    font-family: var(--heading-font);
    font-size: 1.4rem;
    color: var(--primary);
    margin-bottom: 15px;
}

.popup-process p {
    color: var(--dark-text);
    line-height: 1.8;
    margin: 0;
}

/* CTA Section */
.popup-cta {
    text-align: center;
    padding: 30px;
    background: var(--light);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

.popup-price {
    font-size: 2rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 25px;
    font-family: var(--heading-font);
}

/* Single CTA Button */
.popup-cta .cta-single {
    display: inline-block;
    min-width: 280px;
    padding: 16px 32px;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.popup-cta .cta-single:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.popup-cta .cta-single i {
    margin-left: 8px;
    font-size: 1.2rem;
}

/* Small mobile devices */
@media (max-width: 480px) {
    .popup-content {
        padding: 40px 15px 25px;
    }
    
    .popup-title {
        font-size: 1.6rem;
        padding-right: 45px;
    }
    
    .popup-subtitle {
        font-size: 1rem;
    }
    
    .popup-info-grid {
        padding: 15px;
    }
    
    .popup-info-item {
        padding: 12px;
    }
    
    .popup-benefits li {
        font-size: 0.9rem;
    }
    
    .popup-process {
        padding: 15px;
    }
    
    .popup-process p {
        font-size: 0.9rem;
    }
    
    .popup-price {
        font-size: 1.6rem;
    }
    
    .popup-cta .cta-single {
        padding: 14px 20px;
        font-size: 1rem;
        min-height: 48px;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    .popup-container {
        width: 100%;
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100);
        max-width: 100%;
        max-height: 100vh;
        max-height: calc(var(--vh, 1vh) * 100);
        border-radius: 0;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    
    .treatment-popup.show .popup-container {
        transform: translateY(0);
    }
    
    .popup-content {
        padding: 50px 20px 30px;
        height: calc(100vh - 80px);
        height: calc((var(--vh, 1vh) * 100) - 80px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .popup-title {
        font-size: 1.8rem;
        padding-right: 50px;
        margin-bottom: 15px;
    }
    
    .popup-subtitle {
        font-size: 1.1rem;
        margin-bottom: 25px;
    }
    
    .popup-close {
        top: 15px;
        right: 15px;
        width: 44px;
        height: 44px;
        font-size: 20px;
        background-color: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    
    /* Fallback for browsers without backdrop-filter */
    @supports not (backdrop-filter: blur(10px)) {
        .popup-close {
            background-color: rgba(255, 255, 255, 0.95);
        }
    }
    
    .popup-close:hover {
        background-color: rgba(255, 255, 255, 1);
    }
    
    .popup-info-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 20px;
        margin-bottom: 25px;
    }
    
    .popup-info-item {
        padding: 15px;
        background-color: rgba(255, 255, 255, 0.5);
        border-radius: 8px;
    }
    
    .popup-info-item i {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }
    
    .popup-benefits {
        margin-bottom: 25px;
    }
    
    .popup-benefits ul {
        padding-left: 10px;
    }
    
    .popup-benefits li {
        padding-left: 25px;
        margin-bottom: 12px;
        font-size: 0.95rem;
    }
    
    .popup-process {
        margin-bottom: 25px;
        padding: 20px;
    }
    
    .popup-process p {
        font-size: 0.95rem;
        line-height: 1.7;
    }
    
    .popup-cta {
        margin-top: 25px;
        padding: 25px 20px 30px;
        background: var(--light);
        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .popup-cta .cta-single {
        width: 100%;
        max-width: 350px;
        padding: 16px 24px;
        font-size: 1.1rem;
        min-height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .popup-price {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }
    
    /* Swipe indicator */
    .popup-container::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background-color: rgba(0, 0, 0, 0.3);
        border-radius: 2px;
        z-index: 11;
    }
    
    /* Improved touch targets */
    .popup-close {
        min-width: 44px;
        min-height: 44px;
        touch-action: manipulation;
    }
    
    /* Prevent zoom on double tap */
    .popup-content * {
        touch-action: manipulation;
    }
    
    /* Mobile performance optimizations */
    .popup-container {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        will-change: transform;
    }
    
    .popup-content {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        will-change: scroll-position;
    }
    
    /* Prevent horizontal scrolling */
    .popup-content {
        overflow-x: hidden;
    }
    
    /* Better button spacing on mobile */
    .popup-buttons .cta-button {
        border-radius: 8px;
        font-weight: 600;
        letter-spacing: 0.5px;
    }
    
    .popup-buttons .cta-button-secondary {
        border-radius: 8px;
        font-weight: 500;
    }
    
    /* CTA optimization */
    .popup-cta .cta-single {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        will-change: transform;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.treatment-popup.show .popup-content > * {
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
}

.treatment-popup.show .popup-content > *:nth-child(1) { animation-delay: 0.1s; }
.treatment-popup.show .popup-content > *:nth-child(2) { animation-delay: 0.15s; }
.treatment-popup.show .popup-content > *:nth-child(3) { animation-delay: 0.2s; }
.treatment-popup.show .popup-content > *:nth-child(4) { animation-delay: 0.25s; }
.treatment-popup.show .popup-content > *:nth-child(5) { animation-delay: 0.3s; }

/* Accessibility */
.treatment-popup:focus-within .popup-container {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.popup-close:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Print */
@media print {
    .treatment-popup {
        display: none !important;
    }
}