/* ===== СБРОС И БАЗОВЫЕ СТИЛИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #136243;
    --primary-dark: #0d4a33;
    --bg-light: #f5f7fa;
    --text-dark: #1e293b;
    --text-soft: #334155;
    --border-color: #d1d5db;
    --white: #ffffff;
    --gray-icon: #4b5563;
    --footer-bg: #111827;
    --footer-text: #e5e7eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --today-highlight: #e8f5e9;
    --promo-bg: #f8f4e9;
    --promo-border: #e2d9c8;
    --promo-text: #136243;
    --promo-close: #9b8c78;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== ИНФОРМАЦИОННАЯ ПЛАШКА ===== */
.info-banner {
    background-color: var(--promo-bg);
    border-bottom: 2px solid var(--promo-border);
    padding: 8px 0;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.info-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.info-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--promo-text);
    transition: color 0.2s;
    flex: 1;
}

.info-link:hover {
    color: var(--primary-dark);
}

.info-icon {
    font-size: 1.3rem;
    line-height: 1;
    min-width: 24px;
    text-align: center;
}

.info-text {
    font-size: 1rem;
    font-weight: 500;
    border-bottom: 1px dashed currentColor;
}

.info-close {
    background: none;
    border: none;
    color: var(--promo-close);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    flex-shrink: 0;
}

.info-close:hover {
    color: var(--primary);
}

/* ===== КОНТЕЙНЕР ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    width: 100%;
    flex: 1;
}

/* ===== ШАПКА ===== */
.header-image {
    width: 100%;
    background-color: var(--primary);
    border-radius: 0 0 16px 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.header-image img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    max-height: 400px;
    min-height: 120px;
    background-color: var(--primary);
}

/* ===== НАВИГАЦИЯ ===== */
.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--white);
    border: 2px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: all 0.2s;
}

.back-btn:hover {
    border-color: var(--primary);
    background-color: #f9f9f9;
}

.back-arrow {
    font-size: 1.2rem;
    color: var(--primary);
}

/* ===== ПОИСК ===== */
.search-container {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 20px;
    padding-right: 45px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--white);
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(19, 98, 67, 0.1);
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--gray-icon);
    cursor: pointer;
    padding: 5px;
    display: none;
}

.search-clear:hover {
    color: var(--primary);
}

.search-input:not(:placeholder-shown) + .search-clear {
    display: block;
}

/* ===== СЕТКА КАРТОЧЕК ===== */
.clinics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.clinic-card {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
}

.clinic-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: var(--primary);
}

.distance-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: var(--primary);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.clinic-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 10px;
    padding-right: 80px;
}

.clinic-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    font-size: 1rem;
    font-weight: 500;
}

.rating-stars {
    color: #fbbf24;
    letter-spacing: 2px;
    font-size: 1.1rem;
}

.rating-value {
    font-weight: 600;
    color: var(--primary);
    background-color: #f0fdf4;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.clinic-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
    flex-grow: 1;
}

.clinic-meta-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.95rem;
    color: var(--text-soft);
}

.clinic-meta-item span:first-child {
    font-weight: 500;
    color: var(--text-dark);
    min-width: 70px;
}

.clinic-meta-item a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.clinic-meta-item a:hover {
    border-bottom-color: var(--primary);
}

.work-status {
    margin: 10px 0 15px;
    font-weight: 500;
    font-size: 1rem;
    padding: 8px 12px;
    background-color: var(--bg-light);
    border-radius: 8px;
    border-left: 4px solid;
}

.work-status.open {
    border-left-color: var(--success);
    color: var(--success);
}

.work-status.closed {
    border-left-color: var(--danger);
    color: var(--danger);
}

.work-status.will_open {
    border-left-color: var(--warning);
    color: var(--warning);
}

/* ===== МОДАЛЬНЫЕ ОКНА ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 30px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    border: 1px solid var(--border-color);
}

.modal-content h2 {
    color: var(--primary);
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 1.8rem;
    border-left: 4px solid var(--primary);
    padding-left: 15px;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 2.5rem;
    cursor: pointer;
    color: var(--gray-icon);
    line-height: 1;
    background: none;
    border: none;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.close-modal:hover {
    background-color: var(--bg-light);
    color: var(--primary);
}

.clinic-detail-item {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.clinic-detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: var(--text-dark);
    display: block;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.schedule-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: var(--bg-light);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.schedule-item.today {
    background-color: var(--today-highlight);
    border-color: var(--success);
    font-weight: 500;
}

.schedule-item.around-clock {
    background-color: #e6f7ff;
    border-color: #1890ff;
}

.schedule-item.around-clock .day-time {
    color: #1890ff;
    font-weight: 600;
}

.schedule-item.today.around-clock {
    background-color: #bae7ff;
    border-color: #1890ff;
}

.schedule-item.today.around-clock .day-time {
    color: #096dd9;
    font-weight: 700;
}

.day-name {
    font-weight: 500;
}

.day-time {
    color: var(--primary);
}

.schedule-item.today .day-time {
    color: var(--primary-dark);
    font-weight: 600;
}

.reviews-section {
    margin: 20px 0;
}

.reviews-list {
    margin-top: 20px;
}

.reviews-list h4 {
    margin-bottom: 15px;
    color: var(--text-dark);
}

.review-item {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.review-item.new-review {
    animation: fadeIn 0.5s ease;
    background-color: #e8f5e9;
    border-left: 4px solid var(--success);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.review-rating {
    color: #fbbf24;
    font-weight: 600;
    margin-bottom: 5px;
}

.review-text {
    color: var(--text-dark);
    word-break: break-word;
}

.review-form {
    background-color: var(--bg-light);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.review-form h4 {
    margin-bottom: 15px;
}

.rating-select {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 5px;
    margin-bottom: 15px;
}

.rating-select input {
    display: none;
}

.rating-select label {
    font-size: 2rem;
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.2s;
}

.rating-select label:hover,
.rating-select label:hover ~ label,
.rating-select input:checked ~ label {
    color: #fbbf24;
}

.review-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    resize: vertical;
    margin-bottom: 15px;
    font-family: inherit;
}

.review-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.submit-review {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
}

.submit-review:hover {
    background-color: var(--primary-dark);
}

.submit-review:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.modal-actions {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-action-btn {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    border: 2px solid var(--border-color);
    background-color: var(--white);
    color: var(--text-dark);
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

.share-btn:hover {
    background-color: var(--primary-dark);
}

.complaint-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-color: var(--danger);
    color: var(--danger);
}

.complaint-btn:hover {
    background-color: var(--danger);
    color: white;
}

.complaint-form {
    margin-top: 20px;
}

.complaint-form textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin: 20px 0;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
}

.complaint-form textarea:focus {
    outline: none;
    border-color: var(--danger);
}

.no-results,
.no-reviews {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    background: var(--white);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    color: var(--text-soft);
    font-size: 1.1rem;
}

.no-reviews {
    margin: 20px 0;
    padding: 20px;
}

.toast-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--text-dark);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 3000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

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

html {
    scroll-behavior: smooth;
}

footer {
    margin-top: 50px;
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 40px 0 30px;
    border-top: 1px solid #2d3748;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px 40px;
    margin-bottom: 20px;
}

.footer-links a {
    color: #9ca3af;
    text-decoration: none;
    font-size: 1rem;
    border-bottom: 1px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    cursor: pointer;
}

.footer-links a:hover {
    color: white;
    border-bottom-color: var(--primary);
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 25px 0;
}

.social-icon {
    display: block;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.social-icon:hover {
    transform: scale(1.15);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.social-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.footer-note {
    text-align: center;
    font-size: 0.9rem;
    color: #6b7280;
    max-width: 800px;
    margin: 20px auto 0;
}

@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
    
    .header-image img {
        max-height: 180px;
    }
    
    .nav-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .back-btn {
        justify-content: center;
    }
    
    .search-container {
        max-width: 100%;
    }
    
    .info-container {
        padding: 0 20px;
    }
}

@media (max-width: 480px) {
    .info-text {
        font-size: 0.9rem;
    }
    
    .info-icon {
        font-size: 1.2rem;
    }
    
    .clinic-card h3 {
        font-size: 1.1rem;
        padding-right: 60px;
    }
    
    .rating-stars {
        font-size: 0.9rem;
    }
}