/* ===== Общие стили ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans', sans-serif;
    color: #333;
    line-height: 1.5;
    background-color: #f9f9f9;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Кнопки */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 36px;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 16px;
    line-height: 1;
    padding: 12px 24px;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    background-color: transparent;
}

.button--red {
    background-color: #e95a5a;
    color: white;
}
.button--red:hover {
    background-color: #d14b4b;
    box-shadow: 0 4px 8px rgba(233, 90, 90, 0.3);
}

.button--white {
    background-color: white;
    color: #e95a5a;
    border: 1px solid #e95a5a;
}
.button--white:hover {
    background-color: #fff0f0;
}

.button--violet-light {
    background-color: #f0ecff;
    color: #6a4e9b;
}
.button--violet-light:hover {
    background-color: #e2d9ff;
}

.button--transparent {
    background-color: transparent;
    color: #333;
    padding: 8px 16px;
}
.button--transparent:hover {
    background-color: rgba(0,0,0,0.05);
}

/* Шапка */
.header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: 24px;
    color: #e95a5a;
    text-decoration: none;
}
.logo span {
    color: #6a4e9b;
    font-weight: 500;
    font-size: 14px;
    margin-left: 8px;
}

.nav-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.user-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Поиск */
.search-section {
    background: white;
    padding: 30px 0;
    border-bottom: 1px solid #eee;
}

.search-form {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.search-input {
    flex: 1 1 400px;
}

.search-input input {
    width: 100%;
    padding: 16px 24px;
    border: 1px solid #ddd;
    border-radius: 40px;
    font-size: 16px;
    font-family: 'Noto Sans', sans-serif;
    transition: border-color 0.2s;
}
.search-input input:focus {
    outline: none;
    border-color: #e95a5a;
}

.search-button {
    background-color: #f0ecff;
    border: none;
    border-radius: 40px;
    padding: 16px 32px;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    color: #6a4e9b;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 16px;
}
.search-button:hover {
    background-color: #e2d9ff;
}

/* Фильтры-чипсы */
.filters {
    padding: 20px 0;
    background-color: #f9f9f9;
}

.filter-chips {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.chip {
    display: inline-block;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 30px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.chip:hover, .chip.active {
    background-color: #e95a5a;
    border-color: #e95a5a;
    color: white;
}

/* Карточки учреждений */
.catalog-section {
    padding: 40px 0;
}

.section-title {
    font-family: 'Manrope', sans-serif;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 30px;
    color: #222;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.card {
    background: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.03);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 30px rgba(0,0,0,0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.card-title {
    font-family: 'Manrope', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #222;
    text-decoration: none;
}
.card-title:hover {
    color: #e95a5a;
}

.card-badge {
    background-color: #f0ecff;
    color: #6a4e9b;
    border-radius: 30px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.card-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.stars {
    color: #ffb800;
    font-size: 18px;
    letter-spacing: 2px;
}
.rating-value {
    font-weight: 600;
    color: #333;
}
.reviews-count {
    color: #777;
    font-size: 14px;
}

.card-address {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    border-top: 1px solid #eee;
    padding-top: 16px;
}

.review-button {
    background: none;
    border: none;
    color: #6a4e9b;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
}
.review-button:hover {
    color: #e95a5a;
}

.more-link {
    color: #e95a5a;
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
}

/* Пагинация */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 40px 0;
    flex-wrap: wrap;
}
.page {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: white;
    color: #333;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid #ddd;
}
.page.active {
    background-color: #e95a5a;
    color: white;
    border-color: #e95a5a;
}
.page:hover:not(.active) {
    background-color: #f0ecff;
}

/* Страница учреждения */
.institution-header {
    background: white;
    border-radius: 24px;
    padding: 30px;
    margin-bottom: 30px;
}

.reviews-block {
    background: white;
    border-radius: 24px;
    padding: 30px;
}

.review-item {
    border-bottom: 1px solid #eee;
    padding: 20px 0;
}
.review-item:last-child {
    border-bottom: none;
}

.review-avatar {
    width: 48px;
    height: 48px;
    background: #f0ecff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #6a4e9b;
    flex-shrink: 0;
}

.review-meta {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

/* Форма отзыва */
.review-form input,
.review-form select,
.review-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 30px;
    font-family: inherit;
    font-size: 16px;
}
.review-form textarea {
    border-radius: 20px;
    resize: vertical;
}
.review-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}
.review-form .form-group {
    margin-bottom: 15px;
}

/* Футер */
.footer {
    background-color: white;
    padding: 30px 0;
    border-top: 1px solid #eee;
    text-align: center;
    color: #777;
    margin-top: 40px;
}

/* Чекбокс с текстом на одной строке */
.form-group.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.form-group.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}
.form-group.checkbox-group label {
    margin: 0;
    white-space: nowrap;
}

/* Оценки в отзыве */
.review-scores {
    margin-top: 10px;
    font-size: 14px;
    background: #f5f5f5;
    padding: 10px;
    border-radius: 12px;
}
.review-score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 300px;
    margin-top: 5px;
}

/* Гамбургер-меню */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 10px;
}
.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 2px 0;
    transition: 0.3s;
}

/* ===== Медиазапросы (объединены) ===== */

/* Общие адаптации до 700px */
@media (max-width: 700px) {
    .header__inner {
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
    }

    .logo {
        flex: 1 1 auto;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-right: 10px;
    }

    .logo span {
        display: none;
    }

    .menu-toggle {
        display: flex;
        order: 2;
        flex-shrink: 0;
    }

    .user-actions {
        order: 3;
        width: 100%;
        margin-top: 10px;
        justify-content: flex-end;
    }

    .nav-links {
        display: none;
        width: 100%;
        order: 4;
        flex-direction: column;
        align-items: center;
        background: white;
        padding: 15px 0;
        border-radius: 20px;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        margin-top: 10px;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links .button--transparent {
        width: 100%;
        text-align: center;
        padding: 12px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }
}

/* Дополнительные адаптации для страницы учреждения */
@media (max-width: 600px) {
    .institution-header h1 {
        font-size: 28px;
        word-break: break-word;
    }

    .institution-header > div:last-child {
        flex-wrap: wrap;
        gap: 10px;
    }

    .institution-header > div:last-child span:first-child {
        font-size: 36px;
    }

    .reviews-block .review-item > div {
        flex-direction: column;
        align-items: flex-start;
    }

    .review-avatar {
        margin-bottom: 10px;
    }

    .form-group.checkbox-group label {
        white-space: normal;
    }
}

/* Узкие мобильные (до 500px) */
@media (max-width: 500px) {
    .institution-header > div[style*="border-radius:50px"] {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 15px;
    }
    .institution-header > div[style*="border-radius:50px"] span:first-child {
        font-size: 32px;
    }
    .institution-header > div[style*="border-radius:50px"] .stars {
        font-size: 20px;
    }

    .rating-block {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 15px;
    }
    .rating-block .rating-number {
        font-size: 32px;
    }
    .rating-block .stars {
        font-size: 20px;
    }
    .rating-block .rating-count {
        font-size: 14px;
    }
}
/* Светло-фиолетовый фон для карты */
.violet-bg {
    background-color: #f0ecff;
    padding: 20px;
    border-radius: 24px;
    margin-bottom: 30px;
}

/* Адаптация для мобильных */
@media (max-width: 600px) {
    .violet-bg {
        padding: 10px;
    }
}
/* Голосование */
.review-votes {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}
.vote-button {
    background: none;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 5px 15px;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}
.vote-button:hover {
    background: #f0f0f0;
}
.vote-button.voted {
    background: #f0ecff;
    border-color: #6a4e9b;
    color: #6a4e9b;
}
.vote-count {
    font-weight: 600;
}

/* Затемнённые отзывы (при 10+ несогласных) */
.review-dimmed {
    opacity: 0.6;
    filter: grayscale(30%);
    transition: opacity 0.3s;
}