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

body {
    font-family: 'Segoe UI', sans-serif;
    color: #333;
    background: #f9f9f9;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =====================================================
   ШАПКА И НАВИГАЦИЯ
   ===================================================== */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 16px 0;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 22px;
    font-weight: 700;
    color: #1a7fc1;
    text-decoration: none;
}

.main-nav a {
    margin-left: 24px;
    text-decoration: none;
    color: #555;
    font-size: 15px;
}

.main-nav a:hover {
    color: #1a7fc1;
}

.main-nav a.nav-active {
    color: #1a7fc1;
    font-weight: 700;
    border-bottom: 2px solid #1a7fc1;
    padding-bottom: 2px;
}

/* =====================================================
   КНОПКИ
   ===================================================== */
.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: #fff;
    color: #1a7fc1;
}

.btn-primary:hover {
    background: #e8f4fd;
}

.btn-outline {
    background: transparent;
    color: #1a7fc1;
    border: 1.5px solid #1a7fc1 !important;
    font-size: 14px;
    padding: 10px 16px !important;
}

.btn-outline:hover {
    background: #e8f4fd;
}

/* =====================================================
   СЕКЦИИ
   ===================================================== */
.section {
    margin-bottom: 48px;
}

.section h2 {
    font-size: 26px;
    margin-bottom: 24px;
    color: #1a7fc1;
}

/* =====================================================
   КАРТОЧКИ
   ===================================================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.card {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.card h3 {
    font-size: 17px;
    margin-bottom: 8px;
    color: #222;
}

.card p {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* =====================================================
   ГЛАВНАЯ — ГЕРОЙ
   ===================================================== */
.hero {
    background: linear-gradient(135deg, #1a7fc1, #0d5a8a);
    color: #fff;
    text-align: center;
    padding: 80px 20px;
    margin-bottom: 48px;
    border-radius: 12px;
    margin-top: 32px;
}

.hero h1 {
    font-size: 36px;
    margin-bottom: 16px;
}

.hero p {
    font-size: 18px;
    margin-bottom: 32px;
    opacity: 0.9;
}

/* =====================================================
   ГЛАВНАЯ — О НАС
   ===================================================== */
.about-grid {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.about-text p {
    font-size: 15px;
    color: #444;
    line-height: 1.7;
}

.about-stats {
    display: flex;
    gap: 32px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-num {
    font-size: 32px;
    font-weight: 700;
    color: #1a7fc1;
}

.stat-label {
    font-size: 13px;
    color: #888;
    margin-top: 4px;
}

/* =====================================================
   ГЛАВНАЯ — КОНТАКТЫ
   ===================================================== */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.contact-card {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    text-align: center;
}

.contact-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.contact-card h3 {
    font-size: 16px;
    color: #1a7fc1;
    margin-bottom: 8px;
}

.contact-card p {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
}

/* =====================================================
   ВРАЧИ — СПИСОК
   ===================================================== */
.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-tab {
    padding: 8px 18px;
    border-radius: 20px;
    border: 1.5px solid #1a7fc1;
    color: #1a7fc1;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.filter-tab:hover {
    background: #e8f4fd;
}

.filter-tab.active {
    background: #1a7fc1;
    color: #fff;
}

/* =====================================================
   ФОТО ВРАЧЕЙ — УНИВЕРСАЛЬНЫЕ СТИЛИ
   ===================================================== */
.doctor-photo {
    width: 100%;
    height: 260px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    background: #f0f0f0;
}

.doctor-photo img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.spec-badge {
    display: inline-block;
    background: #e8f4fd;
    color: #1a7fc1;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    margin-bottom: 8px;
}

.doctor-card {
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    overflow: hidden;
    height: 100%;
}

.doctor-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.doctor-contacts {
    margin-top: 10px;
    font-size: 13px;
    color: #555;
    line-height: 1.8;
}

/* =====================================================
   ВРАЧИ — СТРАНИЦА ВРАЧА
   ===================================================== */
.back-link {
    display: inline-block;
    margin-bottom: 24px;
    color: #1a7fc1;
    text-decoration: none;
    font-size: 14px;
}

.back-link:hover {
    text-decoration: underline;
}

.doctor-profile {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    margin-bottom: 32px;
}

.doctor-profile-photo {
    flex-shrink: 0;
    width: 160px;
    height: 160px;
    overflow: hidden;
    border-radius: 50%;
}

.doctor-profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
}

.doctor-profile-info h1 {
    font-size: 26px;
    margin-bottom: 12px;
}

.doctor-bio {
    margin-top: 16px;
    font-size: 15px;
    color: #444;
    line-height: 1.7;
}

.profile-block {
    background: #fff;
    border-radius: 12px;
    padding: 24px 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    margin-bottom: 24px;
}

.profile-block h2 {
    font-size: 20px;
    color: #1a7fc1;
    margin-bottom: 16px;
}

/* =====================================================
   УСЛУГИ — ТАБЛИЦА
   ===================================================== */
.services-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.services-table th {
    text-align: left;
    padding: 10px 16px;
    background: #f0f7fd;
    color: #1a7fc1;
    font-weight: 600;
}

.services-table td {
    padding: 10px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.services-table tr:last-child td {
    border-bottom: none;
}

/* =====================================================
   РАСПИСАНИЕ — СЛОТЫ
   ===================================================== */
.slots-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 16px;
    border: 1.5px solid #1a7fc1;
    border-radius: 8px;
    text-decoration: none;
    color: #1a7fc1;
    transition: all 0.2s;
    background: transparent;
    cursor: pointer;
}

.slot:hover,
.slot.active {
    background: #1a7fc1;
    color: #fff;
}

.slot-date {
    font-size: 13px;
    font-weight: 600;
}

.slot-time {
    font-size: 15px;
}

/* =====================================================
   ФОРМА ЗАПИСИ
   ===================================================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #1a7fc1;
}

/* =====================================================
   СТРАНИЦА СПЕЦИАЛИЗАЦИИ
   ===================================================== */
.spec-hero {
    background: linear-gradient(135deg, #1a7fc1, #0d5a8a);
    color: #fff;
    padding: 40px;
    border-radius: 12px;
    margin-bottom: 32px;
}

.spec-hero h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.spec-hero p {
    font-size: 16px;
    opacity: 0.9;
}

.head-doctor {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.head-doctor-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.head-doctor-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
}

.head-doctor-info h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.head-badge {
    background: #fff3cd;
    color: #856404;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 8px;
}

/* =====================================================
   ПОДВАЛ
   ===================================================== */
/* .site-footer {
    background: #222;
    color: #aaa;
    text-align: center;
    padding: 32px 0;
    margin-top: 64px;
    font-size: 14px;
    line-height: 2;
} */

/* =====================================================
   КАРТОЧКИ ВРАЧЕЙ В СПЕЦИАЛИЗАЦИИ
   ===================================================== */
.profile-block .cards-grid .card {
    padding: 0 !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.profile-block .cards-grid .card .head-badge {
    margin: 12px 16px 4px 16px;
}

.profile-block .cards-grid .card h3 {
    padding: 0 16px;
    margin-bottom: 6px;
}

.profile-block .cards-grid .card p {
    padding: 0 16px 16px 16px;
}

.doctor-card {
    height: auto !important;
}

.doctor-card .doctor-photo {
    height: 260px !important;
    min-height: 260px !important;
    max-height: 260px !important;
}

.doctor-card .doctor-photo img {
    height: 100% !important;
    width: 100% !important;
    object-fit: cover !important;
    object-position: center top !important;
}

/* =====================================================
   ГЛАВНАЯ — ТОП ВРАЧИ
   ===================================================== */
   .top-doctors-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.top-doctor-card {
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.top-doctor-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(26,127,193,0.2);
}

.top-doctor-photo {
    width: 100%;
    height: 260px;
    overflow: hidden;
    position: relative;
}

.top-doctor-photo img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.top-doctor-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.top-badge {
    display: inline-block;
    background: linear-gradient(135deg, #1a7fc1, #0d5a8a);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    width: fit-content;
}

.top-doctor-info h3 {
    font-size: 16px;
    color: #222;
    margin: 0;
}

.top-doctor-info p {
    font-size: 13px;
    color: #666;
    margin: 0;
}

/* =====================================================
   АКЦИИ
   ===================================================== */
   .promo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.promo-card {
    border-radius: 16px;
    padding: 32px;
    display: flex;
    align-items: center;
    gap: 24px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.promo-early {
    background: linear-gradient(135deg, #e8f4fd, #c8e6f9);
    border-left: 6px solid #1a7fc1;
}

.promo-home {
    background: linear-gradient(135deg, #e8f9f0, #c8f0d8);
    border-left: 6px solid #28a745;
    justify-content: space-between;
}

.promo-icon {
    font-size: 56px;
    flex-shrink: 0;
}

.promo-content h3 {
    font-size: 20px;
    color: #222;
    margin-bottom: 8px;
}

.promo-content p {
    font-size: 14px;
    color: #444;
    line-height: 1.6;
    margin-bottom: 12px;
}

.promo-badge {
    display: inline-block;
    background: #1a7fc1;
    color: #fff;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
}

.promo-badge-green {
    background: #28a745;
}

.promo-tag {
    display: inline-block;
    background: rgba(0,0,0,0.08);
    color: #444;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
}

.promo-discount {
    font-size: 56px;
    font-weight: 900;
    color: #1a7fc1;
    opacity: 0.15;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

/* Анимация мопеда */
.promo-moped {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 120px;
}

.moped-animation {
    font-size: 48px;
    animation: drive 2s linear infinite;
    display: block;
}

.road {
    width: 120px;
    height: 4px;
    background: repeating-linear-gradient(
        90deg,
        #28a745 0px,
        #28a745 20px,
        transparent 20px,
        transparent 40px
    );
    margin-top: 4px;
    animation: road-move 0.5s linear infinite;
}

@keyframes drive {
    0% { transform: translateX(-10px); }
    50% { transform: translateX(10px); }
    100% { transform: translateX(-10px); }
}

@keyframes road-move {
    0% { background-position: 0px; }
    100% { background-position: -40px; }
}

/* Плавное появление при прокрутке */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Анимированные кнопки */
.btn {
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Пульсирующий телефон */
.contact-icon-pulse {
    display: inline-block;
    animation: phonePulse 1.5s ease-in-out infinite;
}

@keyframes phonePulse {
    0%   { transform: scale(1) rotate(0deg); }
    25%  { transform: scale(1.2) rotate(-15deg); }
    50%  { transform: scale(1.2) rotate(15deg); }
    75%  { transform: scale(1.1) rotate(-5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* Анимации для иконок контактов */
.icon-bounce {
    animation: bounce 2s ease-in-out infinite;
}

.icon-spin {
    animation: spin 3s linear infinite;
}

.icon-pulse {
    animation: iconPulse 1.5s ease-in-out infinite;
}

.icon-shake {
    animation: shake 1.5s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
}

/* =====================================================
   HAMBURGER МЕНЮ
   ===================================================== */
   .burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 100;
}

.burger span {
    display: block;
    width: 26px;
    height: 3px;
    background: #1a7fc1;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.burger-active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.burger-active span:nth-child(2) {
    opacity: 0;
}
.burger-active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* =====================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ
   ===================================================== */
@media (max-width: 768px) {

    /* Шапка */
    .site-header .container {
        flex-wrap: wrap;
        position: relative;
    }

    .burger {
        display: flex;
    }

    .main-nav {
        display: none;
        flex-direction: column;
        width: 100%;
        background: #fff;
        border-top: 1px solid #e0e0e0;
        padding: 12px 0;
        margin-top: 8px;
    }

    .main-nav.nav-open {
        display: flex;
    }

    .main-nav a {
        margin: 0;
        padding: 12px 16px;
        border-bottom: 1px solid #f0f0f0;
        font-size: 15px;
    }

    .main-nav a:last-child {
        border-bottom: none;
    }

    /* Герой */
    .hero {
        padding: 48px 16px;
        margin-top: 16px;
        border-radius: 8px;
    }

    .hero h1 {
        font-size: 24px;
    }

    .hero p {
        font-size: 15px;
    }

    /* Сетки — одна колонка */
    .cards-grid,
    .top-doctors-grid {
        grid-template-columns: 1fr;
    }

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

    /* Статистика */
    .about-stats {
        gap: 16px;
        justify-content: center;
    }

    /* Профиль врача */
    .doctor-profile {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px;
    }

    .doctor-profile-photo {
        width: 120px;
        height: 120px;
    }

    /* Специализация */
    .head-doctor {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    /* Таблица записей — горизонтальный скролл */
    .services-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Слоты */
    .slots-grid {
        gap: 8px;
    }

    .slot {
        padding: 8px 12px;
        font-size: 13px;
    }

    /* Акции */
    .promo-card {
        flex-direction: column;
        padding: 20px;
        text-align: center;
    }

    .promo-discount {
        display: none;
    }

    /* Контакты */
    .contacts-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Профиль блок */
    .profile-block {
        padding: 16px;
    }

    /* Админ статистика */
    .stats-row {
        grid-template-columns: 1fr 1fr;
    }

    /* Админ табы */
    .admin-tabs {
        flex-wrap: wrap;
    }

    .admin-tab {
        padding: 8px 14px;
        font-size: 13px;
    }

    /* Форма */
    .form-grid {
        grid-template-columns: 1fr !important;
    }

    /* Контейнер */
    .container {
        padding: 0 12px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 20px;
    }

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

    .stats-row {
        grid-template-columns: 1fr 1fr;
    }

    .about-stats {
        flex-direction: column;
        align-items: center;
    }

    .section h2 {
        font-size: 20px;
    }
}