/* Стили для попап-окна */
.popup-modal {
    display: none; /* Скрыто по умолчанию */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: popupFadeIn 0.3s;
    padding: 20px;
    box-sizing: border-box;
}

.popup-content {
    background-color: white;
    margin: auto;
    padding: 25px 20px;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: popupSlideIn 0.3s;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
    
    /* Центрирование по вертикали и горизонтали */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Адаптив для мобильных */
@media (max-width: 768px) {
    .popup-modal {
        padding: 15px;
    }
    
    .popup-content {
        width: 95%;
        max-width: 95%;
        padding: 20px 15px;
        border-radius: 10px;
        max-height: 85vh;
    }
    
    .popup-close {
        top: 10px;
        right: 15px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .popup-modal {
        padding: 10px;
    }
    
    .popup-content {
        width: 100%;
        max-width: 100%;
        padding: 15px 12px;
        border-radius: 8px;
        max-height: 80vh;
        margin: 0;
    }
    
    .popup-close {
        top: 8px;
        right: 12px;
        font-size: 22px;
    }
    
    .popup-content h2 {
        font-size: 1.3rem;
        margin-bottom: 12px;
    }
    
    .popup-content p {
        font-size: 0.95rem;
        line-height: 1.4;
    }
}

/* Для очень маленьких экранов */
@media (max-height: 500px) {
    .popup-content {
        max-height: 80vh;
        top: 50%;
        transform: translate(-50%, -50%);
    }
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.popup-close:hover {
    color: #000;
    background-color: #f5f5f5;
}

/* Улучшенная кнопка */
.popup-btn {
    background-color: #4CAF50;
    color: white;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: inline-block;
}

.popup-btn:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.popup-btn:active {
    transform: translateY(0);
}

/* Анимации */
@keyframes popupFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Для контента внутри попапа */
.popup-content h2 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.5rem;
    line-height: 1.3;
    padding-right: 30px; /* Чтобы текст не заезжал под крестик */
}

.popup-content p {
    margin-bottom: 12px;
    line-height: 1.5;
    color: #555;
    font-size: 1rem;
}

/* Улучшаем прокрутку на мобильных */
.popup-content::-webkit-scrollbar {
    width: 6px;
}

.popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.popup-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.popup-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Предотвращаем скролл страницы при открытом попапе */
body.popup-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}