/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #f0f0f0 0%, #d0d0d0 100%);
    min-height: 100vh;
    padding: 0;
    max-width: 375px;
    margin: 0 auto;
    position: relative;
    overflow-y: auto;
}

/* Шапка */
.header {
    background: linear-gradient(135deg, #f0f0f0 0%, #d0d0d0 100%);
    border: 2px solid #000;
    border-radius: 15px;
    padding: 20px;
    margin: 15px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    color: #000;
    font-size: 1.5em;
    font-weight: bold;
}

/* КОНТЕЙНЕР С 2 СТОЛБЦАМИ */
.container {
    padding: 0 10px 50px 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: space-between;
}

/* КАРТОЧКА - 48% ШИРИНЫ */
.tariff-card {
    width: calc(50% - 8px);
    text-align: center;
    background: transparent;
}

/* Контейнер для картинки */
.image-container {
    width: 100%;
    position: relative;
    aspect-ratio: 3/4;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* Картинка */
.tariff-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    cursor: pointer;
    display: block;
}

/* КНОПКА ПОДРОБНЕЕ - КАК ШАПКА "ТАРИФЫ ДЛЯ СВОИХ" */
button {
    background: linear-gradient(135deg, #f0f0f0 0%, #d0d0d0 100%);
    color: #000;
    border: 2px solid #000;
    padding: 12px;
    border-radius: 12px;
    width: 100%;
    font-size: 14px;
    cursor: pointer;
    margin-top: 10px;
    font-weight: bold;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

button:hover {
    transform: scale(1.03);
    background: linear-gradient(135deg, #e8e8e8 0%, #c8c8c8 100%);
}

/* УВЕЛИЧЕННОЕ МОДАЛЬНОЕ ОКНО С КАРТИНКОЙ-ШАПКОЙ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 380px; /* Шире */
    width: 95%;
    position: relative;
    max-height: 85vh; /* Выше */
    overflow: hidden; /* Изменили с auto на hidden */
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column; /* Добавили */
}

/* КАРТИНКА-ШАПКА В МОДАЛЬНОМ ОКНЕ */
.modal-header-image {
    width: 100%;
    height: 180px;
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    flex-shrink: 0; /* Чтобы не сжималась */
}

.modal-header-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* КОНТЕНТ МОДАЛЬНОГО ОКНА */
.modal-body {
    padding: 25px;
    overflow-y: auto; /* Добавили прокрутку */
    flex-grow: 1; /* Чтобы занимал оставшееся пространство */
    max-height: calc(85vh - 180px - 50px); /* Высота минус шапка и отступы */
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: white;
    background: rgba(0,0,0,0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

#modal-title {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.4em;
}

#modal-description {
    color: #555;
    line-height: 1.5;
}

#modal-description ul {
    padding-left: 20px;
    margin: 15px 0;
}

#modal-description li {
    margin-bottom: 8px;
}

/* КНОПКА В МОДАЛЬНОМ ОКНЕ - ТАКАЯ ЖЕ КАК "ПОДРОБНЕЕ" */
.contact-btn {
    background: linear-gradient(135deg, #f0f0f0 0%, #d0d0d0 100%);
    color: #000;
    border: 2px solid #000;
    padding: 15px;
    border-radius: 12px;
    width: 100%;
    font-size: 16px;
    cursor: pointer;
    margin-top: 25px;
    font-weight: bold;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    /* УБИРАЕМ ЭТО: position: sticky; */
    /* УБИРАЕМ ЭТО: bottom: 0; */
    display: block; /* Добавляем */
}

.contact-btn:hover {
    background: linear-gradient(135deg, #e8e8e8 0%, #c8c8c8 100%);
    transform: scale(1.03);
}
