/* --- ПЕРЕМЕННЫЕ И СБРОС --- */
:root {
    --orange: #e67e22;
    --dark: #333;
    --light-bg: #f9f9f9;
    --white: #ffffff;
    --red: #b22222;
    --footer-bg: #2c3e50;
}
* { box-sizing: border-box; }
html { overflow-y: scroll; scroll-behavior: smooth; }
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: var(--dark);
    background-color: #fff;
}

/* --- ШАПКА (Header) --- */
header.top-header {
    height: 80px;
    padding: 0 5%;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}
.logo-wrap {
    display: flex;
    align-items: center;
    gap: 15px;
    max-height: 100%;
}
.welcome-msg {
    font-size: 14px;
    color: #888;
}

/* --- НАВИГАЦИЯ (Desktop) --- */
nav {
    height: 55px;
    border-top: 1px solid #ddd;
    border-bottom: 2px solid var(--orange);
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.nav-container {
    display: flex;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
}
nav a {
    padding: 0 20px;
    text-decoration: none;
    color: var(--dark);
    font-weight: bold;
    text-transform: uppercase;
    font-size: 13px;
    display: flex;
    align-items: center;
    transition: 0.3s;
}
nav a.active, nav a:hover {
    color: var(--orange);
    box-shadow: inset 0 -3px 0 var(--orange);
}

/* --- КНОПКА БУРГЕР-МЕНЮ --- */
.burger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 22px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002;
    position: relative;
}
.burger-menu span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--dark);
    border-radius: 2px;
    transition: all 0.3s ease;
}
.burger-menu.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.burger-menu.active span:nth-child(2) { opacity: 0; }
.burger-menu.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* --- ГЕРОЙ-БАННЕР (КРОССФЕЙД + РАМКИ) --- */
.hero-section {
    position: relative;
    min-height: 400px;
    padding: 20px 5%;
    display: flex;
    align-items: center;
    overflow: hidden;
}
.hero-bg-layer {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: opacity 1.5s ease-in-out;
    opacity: 0;
    z-index: 0;
}
.hero-bg-layer.active { opacity: 1; z-index: 1; }

/* Прозрачный контейнер-распределитель */
.hero-overlay {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

/* Отдельные полупрозрачные рамки для текста */
.hero-text-box {
    background: rgba(255, 255, 255, 0.9);
    padding: 25px 30px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    flex: 0 1 45%;
    min-width: 280px;
}
#hero-load-area { text-align: left; }
#hero-load-area-2 { text-align: right; }

.hero-overlay h2, .red-glow {
    color: var(--red);
    text-transform: uppercase;
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 10px;
}
.hero-overlay p {
    margin: 5px 0;
    color: #333;
    font-weight: bold;
    font-size: 18px;
}

/* --- ЗАГОЛОВОК H1 (SEO) --- */
.page-title-h1 {
    color: var(--orange);
    font-size: 26px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-top: 0;
}

/* --- ОСНОВНОЙ КОНТЕЙНЕР --- */
.container {
    display: flex;
    padding: 30px 5%;
    gap: 20px;
    max-width: 1450px;
    margin: 0 auto;
    align-items: flex-start;
}
.left-sidebar { flex: 1; min-width: 250px; }
main { flex: 2; padding: 0 10px; }
.right-sidebar { flex: 1; min-width: 280px; }

.container.no-sidebars {
    display: block;
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 5%;
}
.container.no-sidebars main {
    flex: none;
    padding: 0;
    width: 100%;
}

/* КАРТОЧКИ И БАННЕРЫ */
.card {
    border: 1px solid #eee;
    margin-bottom: 20px;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
}
.sidebar-title {
    background: var(--orange);
    color: white;
    padding: 10px;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
    font-size: 14px;
}
.card-content { padding: 15px; font-size: 14px; }
.banner-ad {
    border: 1px solid #ddd;
    margin-bottom: 20px;
    padding: 15px;
    text-align: center;
    border-radius: 4px;
    background: #fff;
}

/* --- ПРАЙС-ЛИСТ --- */
.category-title {
    background: #f4f4f4;
    border-left: 5px solid var(--orange);
    padding: 10px;
    margin: 20px 0 15px 0;
    font-weight: bold;
}
.price-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
    gap: 20px;
}
.price-row span:first-child { flex: 1; text-align: left; }
.service-cost {
    font-weight: bold;
    color: var(--dark);
    white-space: nowrap;
    text-align: right;
    min-width: 110px;
}
.service-info {
    display: block;
    font-size: 0.85rem;
    color: #777;
    margin-top: 4px;
    font-weight: normal;
}

/* --- ВРАЧИ (GRID СЕТКА) --- */
.doctor-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 15px;
}
.dr-item {
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 5px;
    background: #fff;
}
.badge {
    background: #fff3e0;
    color: #e65100;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 3px;
    display: inline-block;
    margin-top: 5px;
}

/* --- ЭСТЕТИЧЕСКАЯ ГИНЕКОЛОГИЯ --- */
.doctor-profile {
    display: flex;
    gap: 30px;
    align-items: flex-start; /* Блоки не растягиваются, фото не обрезается */
    margin-top: 20px;
    background: #fff;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    flex-wrap: wrap;
}
.doctor-photo-container { flex: 1; min-width: 300px; max-width: 350px; }
.photo-placeholder {
    width: 100%;
    height: 100%;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
}
.doctor-info-text { flex: 2; min-width: 300px; }
.doctor-info-text p { margin-bottom: 15px; text-align: justify; }
.service-list-styled { list-style: none; padding: 0; margin: 20px 0; }
.service-list-styled li { padding-left: 30px; position: relative; margin-bottom: 10px; font-weight: 500; }
.service-list-styled li::before {
    content: "✦";
    position: absolute;
    left: 0;
    color: var(--orange);
    font-size: 1.2rem;
}
.cta-box {
    background: #fff5eb;
    border: 1px solid var(--orange);
    padding: 25px;
    border-radius: 8px;
    margin-top: 30px;
    text-align: center;
}
.cta-box h3 { color: var(--orange); margin-top: 0; }
.phone-link {
    font-size: 22px;
    font-weight: bold;
    color: var(--dark);
    text-decoration: none;
    display: inline-block;
    margin: 10px 15px;
    transition: 0.3s;
}
.phone-link:hover { color: var(--orange); }

/* --- КАРТЫ --- */
.location-card {
    border: 1px solid #eee;
    margin-bottom: 25px;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
}
.map-container iframe { width: 100%; border: 0; }

/* --- ФУТЕР --- */
.main-footer {
    background-color: var(--footer-bg);
    color: #ecf0f1;
    padding: 40px 5%;
    font-size: 13px;
    margin-top: 50px;
    border-top: 5px solid var(--orange);
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
}
.footer-column h4 {
    color: var(--orange);
    margin: 0 0 15px 0;
    border-bottom: 1px solid #555;
    padding-bottom: 10px;
    text-transform: uppercase;
}
.footer-column p { margin: 8px 0; line-height: 1.5; }
.footer-column a { color: #fff; text-decoration: none; border-bottom: 1px dashed #777; }
.footer-column a:hover { color: var(--orange); }
.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #555;
    opacity: 0.6;
}

/* --- КНОПКА "НАВЕРХ" --- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: var(--orange);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    background: #d35400;
    transform: translateY(-3px);
}

/* --- SEO & Accessibility Helpers --- */
[aria-current="page"] { color: var(--orange); box-shadow: inset 0 -3px 0 var(--orange); }
.phone-link-sidebar {
    color: var(--orange); font-size: 16px; display: block; margin: 5px 0; text-decoration: none;
}
.phone-link-sidebar:hover { text-decoration: underline; }
.services-list { padding-left: 20px; line-height: 1.8; }
.info-block {
    background:#f9f9f9; padding:15px; border:1px solid #eee; border-radius:4px; margin-top:20px;
}
.info-block p { margin:0; font-size:13px; }
.work-hours {
    background:#fdf2e9; padding:10px; border-radius:4px; margin-top:15px;
}
.license-text { font-size: 11px; opacity: 0.8; }

/* --- АДАПТИВНОСТЬ --- */
@media (max-width: 1100px) {
    .container { flex-direction: column; }
    .left-sidebar, .right-sidebar, main { width: 100%; }
    .left-sidebar { order: 2; }
    main { order: 1; }
    .right-sidebar { order: 3; }
    header.top-header { height: auto; flex-direction: column; padding: 15px; text-align: center; }
    .welcome-msg { margin-top: 10px; }
    .hero-overlay { max-width: 100%; }
    .hero-section { min-height: auto; }
}

@media (max-width: 768px) {
    /* Навигация и бургер */
    nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 5%;
        height: auto;
        border-bottom: 2px solid var(--orange);
    }
    .burger-menu { display: flex; }
    .nav-container {
        display: none;
        flex-direction: column;
        width: 100%;
        background: #fff;
        padding: 10px 0;
        border-top: 1px solid #eee;
        margin-top: 10px;
    }
    .nav-container.active { display: flex; }
    nav a {
        padding: 12px 0;
        border-bottom: 1px solid #f5f5f5;
        font-size: 14px;
    }
    nav a:last-child { border-bottom: none; }
    nav a.active, nav a:hover {
        box-shadow: none;
        background: #fdf2e9;
        border-radius: 4px;
        padding-left: 10px;
    }

    /* Hero: рамки по центру, текст внутри тоже по центру */
    .hero-overlay { flex-direction: column; align-items: center; gap: 15px; }
    .hero-text-box { flex: 0 1 90%; max-width: 100%; text-align: center !important; }
    #hero-load-area-2 { text-align: center !important; }

    /* Гинекология: фото без обрезки, блоки друг под другом */
    .doctor-profile { flex-direction: column; align-items: center; gap: 20px; }
    .doctor-photo-container { max-width: 100%; width: 100%; }
    .photo-placeholder { height: auto; max-height: none; background: #fff; }
    .photo-placeholder img { width: 100%; height: auto; object-fit: contain; display: block; }
    .doctor-info-text { width: 100%; min-width: auto; }
}

@media (max-width: 480px) {
    .price-row { flex-direction: column; gap: 5px; }
    .service-cost { text-align: left; min-width: auto; }
    .back-to-top { bottom: 20px; right: 20px; width: 40px; height: 40px; font-size: 18px; }
}