/*
 * StopNarcotics - Modern CSS Redesign v2.3
 * Сочетает современный дизайн с сохранением всех функциональных стилей.
 */

/* --- 1. Шрифты и базовые стили --- */
 
:root {
    --font-primary:   Verdana, sans-serif;
    --font-secondary: "Times New Roman", serif;
    --color-background: #f9fafb; /* Светло-серый фон */
    --color-surface: #ffffff; /* Цвет карточек */
    --color-text-primary: #1f2937; /* Основной текст */
    --color-text-secondary: #6b7280;
    --color-accent-blue: #2563eb; /* Синий акцент */
    --color-accent-blue-hover: #1d4ed8;
    --color-accent-red: #ef0021; /* Ваш фирменный красный */

    --color-accent-green: #16a34a;
    --color-border: #e5e7eb;
}

* {
    box-sizing: border-box;
}

body {
    background: linear-gradient(111deg, #fcfcfc 0%, #f0f5f1 40%, #e9ebee 69%, #e8e8e8 100%);
    padding: 0;
    margin: 0;
    font-family: var(--font-primary);
    font-size: 16px;
    color: var(--color-text-primary);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-secondary);
    font-weight: 700;
    color: #111827;
    margin: 0;
}
h1 { font-size: 2.25rem; text-align: center; margin-bottom: 2rem; }
h2 { font-size: 1.5rem; margin-bottom: 1.5rem; }
h3 { font-size: 1.25rem; margin: 1rem 0; }
h4 { font-size: 1.125rem; margin: 0; }

/* --- 2. Шапка (Header) --- */
.head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.head a {
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem;
    transition: color 0.2s ease;
}
.head a:hover {
    color: var(--color-accent-red);
}
.head a:hover .icon {
    fill: var(--color-accent-red);
}
.head .icon {
    width: 1.2em;
    height: 1.2em;
    transition: fill 0.2s ease;
}
.lefttopmenu {  flex-basis: 40%;}
.righttopmenu{ display: flex; flex-basis: 40%; justify-content: flex-end;}
.logo img { max-height: 45px;    flex-basis: 20%;}

/* --- 3. Основной макет --- */
.container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
}
.rightblok {
        order: -1;  
    }
@media (min-width: 1024px) {
    .container {
        grid-template-columns: minmax(0, 3fr) minmax(300px, 1fr);
    }
    .rightblok {
        order: 0;  
    }
}

/* --- 4. Карточка клиники --- */
.centerlist {
    display: flex;
    flex-direction: column;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: all 0.3s ease;
}
.centerlist:hover {
    box-shadow: 0 10px 20px rgba(0,0,0,0.07);
    transform: translateY(-4px);
    border-color: #d1d5db;
}
.listfoto { position: relative; flex-shrink: 0; }
.listfoto img { display: block; width: 100%; height: 250px; object-fit: cover; border-radius: 11px 11px 0 0; }
.listfoto b {
    position: absolute; top: 1rem; right: 1rem;
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--color-accent-red);
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%; width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.listdes { display: flex; flex-direction: column; padding: 1.5rem; width: 100%; }
.listdes h4 a {
    color: var(--color-text-primary);
    text-decoration: none;
    font-size: 1.2rem;
}
.listdes h4 a:hover { color: var(--color-accent-red); }
/* Сохраняем ваш стиль для PRO метки */
h4 a span {
    font-size: 0.75rem;
    color:#fff;
    background-color: rgba(30, 160, 36, 0.7);
    margin-right: 0.5rem;
    padding: 3px 10px;
    vertical-align: middle;
    border-radius: 12px;
    font-family: var(--font-primary);
}
h4 a:hover span { background-color: rgba(30, 160, 36, 1); }

.listdes p { margin: 0.25rem 0; color: var(--color-text-secondary); }
.listadr { margin-top: auto;  border-top: 1px solid var(--color-border); }
.listadr div { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.listdes a { color: #4b5563; text-decoration: none; }
.listdes a:hover { color: var(--color-accent-red); }
.spaa {padding-top: 8px;}
a.knopka {
    background-color: rgba(234, 76, 98, 0.1);
    color: #9f1239;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
}
a.knopka:hover { background-color: rgba(234, 76, 98, 0.2); text-decoration: none; }

.listdes .on, .listdes .off {  
    position: absolute; top: 1rem;   
    font-size: 0.8rem; font-weight: 600; padding: 0.25rem 0.75rem;
    border-radius: 12px;
}
.listdes .on { background-color: #dcfce7; color: var(--color-accent-green); }
.listdes .off { background-color: #f3f4f6; color: var(--color-text-secondary); }


@media (max-width: 768px) {
      .listdes .on, .listdes .off { left: 1rem; }
}

@media (min-width: 768px) {
    .centerlist { flex-direction: row; }
    .listfoto img { width: 250px; height: auto; min-height: 100%; border-radius: 11px 0 0 11px; }
    .listdes .on, .listdes .off { right: 1rem; }
     .related-blocks-wrapper {        grid-template-columns: 1fr 1fr;    }
}


/* --- 5. Сайдбар --- */
.rightblok > h3 { text-align: center; }
.otzs { position: sticky; top: 90px; }
.otzs h3, .newclinic h3 { border-bottom: 2px solid var(--color-border); padding-bottom: 0.5rem; }
.otz {
    border: 1px solid var(--color-border); padding: 1rem;
    margin-bottom: 1rem; border-radius: 8px;
}
.otz a { color: #111827; text-decoration: none; font-weight: 600;}
.otz a:hover { color: var(--color-accent-red); }
.otz.red { background-color: #fff1f2; border-left: 4px solid var(--color-danger); }
.otz.green { background-color: #f0fdf4; border-left: 4px solid var(--color-success); }
.otz p { color: #4b5563; margin: 0.25rem 0 0 0; }
.otz i { font-style: normal; font-weight: 600; color: var(--color-text-primary); }
.otz small { display: block; margin-top: 0.5rem; font-size: 0.8rem; color: #9ca3af; }

.newclinic { background-color: #fefce8; border: 1px solid #fde047; border-radius: 8px; padding: 1rem;  }
.newclinic p::after {  content: "";  display: table;  clear: both;}
.newclinic p { margin: 0; padding: 0.5rem 0; border-bottom: 1px solid #fde047;  }
.newclinic p:last-child { border-bottom: none; }
.newclinic a { color: #854d0e; font-weight: 500; }
.newclinic span {padding-left: 20px; white-space: nowrap; font-weight: 100; color: #636b13; font-size: 0.9em;  float:right; }

/* --- 6. Пагинация --- */
.pagination { display: flex; justify-content: center; gap: 0.5rem; margin: 2rem 0; }
.pagination a, .pagination span { color: #374151; padding: 0.5rem 1rem; text-decoration: none; border: 1px solid #d1d5db; border-radius: 8px; background-color: #fff; }
.pagination a:hover { background-color: #f3f4f6; border-color: #9ca3af; text-decoration: none; }
.pagination a.active { background-color: var(--color-accent-green); color: white; border-color: var(--color-accent-green); }

/* --- 7. Футер и фильтры --- */
footer { background-color: #111827; color: #9ca3af; padding: 3rem 1rem; margin-top: 2rem; }
.footer-container { max-width: 1400px; margin: 0 auto; display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.footer-column h3 , .city h3 { color: #fff; font-size: 1.1rem; border-bottom: 1px solid #4b5563; padding-bottom: 0.75rem; margin-bottom: 1rem; }
.footer-list, .footer-links { list-style: none; padding: 0; margin: 0; }
/* Стили для фильтров по услугам и годам */
.footer-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.footer-list li a { display: block; padding: 0.25rem 0.75rem; border: 1px solid #374151; border-radius: 6px; color: #9ca3af; text-decoration: none; font-size: 0.9rem; }
.footer-list li a:hover { background-color: #374151; color: #fff; text-decoration: none; }
.footer-list li a.active { background-color: var(--color-accent); color: #fff; border-color: var(--color-accent); }
/* Стили для фильтра по городам */
footer .city p { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; line-height: 1.8; }
footer .city a { color: #9ca3af; text-decoration: none; border: none; padding: 0; }
footer .city a:hover { color: #fff; }
footer .city a sup { color: #6b7280; }
footer .city a.active { font-weight: 600; color: #fff; }

.footer-bottom { text-align: center; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid #374151; font-size: 0.9rem; }
.footer-links { display: flex; justify-content: center; gap: 1.5rem; margin-top: 0.5rem; }
.footer-links a { color: #9ca3af; text-decoration: none; }
.footer-links a:hover { color: #fff; }

/* --- 8. Форма поиска --- */
.site-search-form { margin-bottom: 2rem; }
.site-search-form form { display: flex; max-width: 700px; margin: 0 auto; }
.site-search-form input[type="search"] { flex-grow: 1; border: 1px solid var(--color-border); border-right: none; padding: 0.75rem 1rem; font-size: 1rem; border-radius: 25px 0 0 25px; }
.site-search-form input[type="search"]:focus { outline: 2px solid var(--color-accent); outline-offset: -2px;}
.site-search-form button { background-color: var(--color-accent-blue); color: white; border: none; padding: 0 1.5rem; cursor: pointer; font-weight: 600; border-radius: 0 25px 25px 0; }
.site-search-form button:hover { background-color: var(--color-accent-blue-hover); }

/* --- 9. Адаптивность для старого макета (если потребуется) --- */
@media (max-width: 960px) {
    .lefttopmenu span { display: none; }
}

 

.related-block h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--color-text-primary);
}

.related-item {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid var(--color-accent-blue);
    transition: box-shadow 0.2s ease;
}

.related-item:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.related-item h3.related-title {
    font-size: 1.1rem;
    font-family: var(--font-primary); /* Используем основной шрифт для лучшей читаемости */
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.related-item h3.related-title a {
    color: var(--color-text-primary);
    text-decoration: none;
}

.related-item h3.related-title a:hover {
    color: var(--color-accent-blue);
    text-decoration: underline;
}

.related-snippet {
    margin: 0 0 0.75rem 0;
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.related-meta {
    font-size: 0.8rem;
    color: #9ca3af;
}

/* --- Стили для AJAX фильтров --- */
.filter-toggle-wrapper {
    text-align: center;
 
 
}
#toggle-filters-btn {
    background-color: var(--color-accent-red);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}
#toggle-filters-btn:hover {
    background-color: var(--color-accent-red-hover);
    transform: translateY(-2px);
}
#filters-container {
    display: none; /* По умолчанию скрыты */
    padding-top: 2rem;
}
#filters-container.loading {
    text-align: center;
    color: #fff;
    padding: 2rem;
}