.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
}

.popup-overlay.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.popup-content {
    background: #fff;
    max-width: 400px;
    width: 90%;
    padding: 35px;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: fadeInUp 0.3s ease-out;
}

/* Сітка тільки у верхній частині (30%) */
.popup-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30%;
    background-image: 
        linear-gradient(rgba(0,0,0,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.02) 1px, transparent 1px);
    background-size: 25px 25px;
    border-radius: 10px 10px 0 0;
    pointer-events: none;
}

/* Заголовок форми */
.popup-form-title {
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    margin: 20px;;
    color: #333;
}

/* Повідомлення без зміщення макету */
.popup-content .wpcf7-response-output {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10;
    max-width: 250px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.popup-content .wpcf7-response-output:not(:empty) {
    opacity: 1;
    visibility: visible;
}

/* Спінер на кнопці */
.popup-content .wpcf7-spinner {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0 !important;
}

/* Показуємо помилки в полях */
.popup-content .wpcf7-not-valid {
    border: 2px solid #ff4444 !important;
    background-color: #fff5f5 !important;
}

.popup-content .wpcf7-not-valid:focus {
    border-color: #ff4444 !important;
    box-shadow: 0 0 5px rgba(255, 68, 68, 0.3) !important;
}

@media (max-width: 480px) {
    .popup-form-title {
        font-size: 20px;
        margin-bottom: 15px;
    }
}

.popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #333;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.open-popup {
    cursor: pointer;
    background-color: #3890ad;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
}

#open-popup {
    cursor: pointer;
}

/* Блокування скролу коли попап відкритий */
body.popup-open {
    overflow: hidden !important;
}

/* Адаптивність */
/* Центрування форми в попапі */
.popup-overlay .popup-content .wpcf7-form {
    text-align: center !important;
}

.popup-overlay .popup-content .uacf7-form-wrapper-container label {
    display: block !important;
    margin-bottom: 10px !important;
	padding-top: 15px;
    text-align: center !important;
}

.popup-overlay .popup-content .wpcf7-form input[type="text"],
.popup-overlay .popup-content .wpcf7-form input[type="tel"] {
    width: 100% !important;
    max-width: 300px !important;
    margin: 0 auto !important;
    display: block !important;
}

.popup-overlay .popup-content .wpcf7-submit {
    width: 100% !important;
    max-width: 300px !important;
    margin: 20px auto 15px !important;
    display: block !important;
    float: none !important;
}

/* Перебиваємо специфічний стиль теми */
.popup-content .wpcf7 .wpcf7-submit {
    float: none !important;
    width: 100% !important;
    max-width: 300px !important;
    margin: 0px auto 0px !important;
    display: block !important;
}

@media (max-width: 480px) {
    .popup-content {
        padding: 20px;
        max-width: 95%;
    }
}
