/* ==========================================================================
   СЕКЦІЯ ТАРИФІВ (ADEVE MEDIA)
   ========================================================================== */

   .tariffs-section {
    padding: 80px 5%;
    background-color: #f0f2f5;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tariffs-subtitle {
    font-family: 'Manrope', sans-serif;
    color: #777;
    margin-bottom: 50px;
    text-align: center;
    margin-top: -35px;
}

.tariffs-container {
    max-width: 1100px;
    width: 100%;
    background-color: #ffffff;
    padding: 60px 50px;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.tariffs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 30px;
    align-items: stretch;
}

.tariff-card {
    background: #fdfdfd;
    border: 1px solid #f0f0f0;
    padding: 40px 30px;
    border-radius: 15px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
}

.tariff-card:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    border-color: #007bff;
}

.tariff-card.featured {
    border: 2px solid #007bff;
    background: #fff;
    box-shadow: 0 20px 40px rgba(0, 123, 255, 0.1);
}

.tariff-header h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 28px;
    color: #222222;
    text-align: left;
    margin-bottom: -7px;
}

.tariff-desc {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #a7a7a7;
    margin-bottom: 20px;
    line-height: 1.4;
}

.price {
    font-family: 'Montserrat', sans-serif;
    font-size: 26px;
    font-weight: 550;
    color: #007bff;
    margin-bottom: 15px;
}

.price span {
    font-size: 18px;
    color: hsl(0, 0%, 39%);
    font-weight: 400;
}

.tariff-features {
    list-style: none;
    padding: 0;
    margin: 0 0 35px 0;
    text-align: left;
    flex-grow: 1;
}

.tariff-features li {
    font-family: 'Manrope', sans-serif;
    padding: 10px 0;
    color: #4e4e4e;
    border-bottom: 2px solid #eeeeee;
    font-size: 15px;
    display: flex;
    align-items: center;
}

.tariff-features li::before {
    content: "✓";
    color: #007bff;
    margin-right: 10px;
    font-weight: bold;
}

.tariff-btn {
    display: block;
    padding: 15px 5px;
    background-color: #007bff;
    color: #ffffff !important;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    text-align: center;
    transition: background 0.3s ease, transform 0.2s ease;
    margin-top: auto;
}

.tariff-btn:hover {
    background-color: #0056b3;
}

/* ==========================================================================
   МОДАЛЬНЕ ВІКНО (POPUP)
   ========================================================================== */

   .modal-overlay {
    position: fixed;
    /* Використовуємо 0 для всіх сторін, щоб заповнити екран */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    
    /* Колір фону з прозорістю */
    background: rgba(255, 255, 255, 0.4); 
    
    /* Ефект розмиття (iOS потребує префікс -webkit) */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    
    display: flex;
    justify-content: center;
    align-items: center;
    
    /* Максимальний пріоритет, щоб перекрити меню та шапку */
    z-index: 999999; 
    
    /* Плавна поява */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.modal-overlay.active {
    visibility: visible;
    opacity: 1;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.modal-content {
    background: #ffffff;
    padding: 40px 30px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    max-width: 360px;
    width: 85%;
    position: relative;
    text-align: center;
    
    /* Плавна поява самого вікна */
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.modal-overlay.active .modal-content {
    opacity: 1;
    transform: translateY(0);
}

.modal-content h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    margin-bottom: 25px;
    color: #222;
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-link {
    font-family: 'Montserrat', sans-serif;
    font-weight: bold;
    text-decoration: none;
    padding: 15px;
    border-radius: 12px;
    color: white !important;
    font-size: 16px;
    transition: 0.3s;
    -webkit-tap-highlight-color: transparent;
}

.tg { background-color: #0088cc; }
.fb { background-color: #1877f2; }
.tally { background-color: #000000; }

.modal-link:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f8f9fa;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.modal-close:hover {
    background: #eee;
    color: #333;
}

/* ==========================================================================
   АДАПТИВНІСТЬ
   ========================================================================== */

@media (max-width: 768px) {
    .tariffs-section {
        padding: 40px 5% !important;
    }

    .section-title {
        font-size: 1.8rem;
        margin-bottom: -100px !important;
    }

    .tariffs-subtitle {
        margin-top: -40px !important;
        margin-bottom: 50px !important;
    }

    .tariffs-container {
        padding: 30px 10px !important;
    }

    .tariffs-grid {
        display: flex !important;
        align-items: stretch !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory;
        gap: 20px;
        padding: 10px 5px 20px 5px;
        scrollbar-width: none; 
    }

    .tariffs-grid::-webkit-scrollbar {
        display: none;
    }

    .tariff-card {
        min-width: 280px !important;
        flex-shrink: 0 !important;
        scroll-snap-align: center;
        padding: 25px 20px !important;
    }
    .modal-overlay {
        /* Fix для мобільних браузерів, щоб фон не «стрибав» при появі клавіатури */
        height: -webkit-fill-available; 
        align-items: center; /* Центруємо вікно строго посередині */
    }

    .modal-content {
        padding: 35px 20px;
        width: 88%; /* Трохи ширше на малих екранах */
    }
    
    /* Робимо кнопки зручнішими для натискання пальцем */
    .modal-link {
        padding: 18px !important;
        font-size: 17px !important;
    }
}