/* Страница просмотра клиники */
.clinic-view-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    margin-top: 24px;
}

/* Стили для кнопки звонка в header */
.clinic-call-button-header {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    padding: 14px 24px !important;
    background: #10B981 !important;
    color: white !important;
    text-decoration: none !important;
    border-radius: 10px !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    border: none !important;
    min-height: 56px !important;
    box-sizing: border-box !important;
}

.clinic-call-button-header:active {
    background: #047857 !important;
}

.clinic-call-button-header svg {
    flex-shrink: 0 !important;
    width: 20px !important;
    height: 20px !important;
}

.clinic-call-button-disabled {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    padding: 14px 24px !important;
    background: #e5e7eb !important;
    color: #6b7280 !important;
    border-radius: 10px !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    cursor: not-allowed !important;
    border: none !important;
    min-height: 56px !important;
    box-sizing: border-box !important;
}

.clinic-call-button-disabled svg {
    flex-shrink: 0 !important;
    width: 20px !important;
    height: 20px !important;
    opacity: 0.6 !important;
}

/* Контейнер для кнопки "Позвонить" и статуса */
.clinic-call-wrapper {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
    flex-shrink: 0 !important;
    position: relative !important;
    z-index: 1 !important;
    flex: 0 0 auto !important;
    min-width: 412px !important;
}

/* Кнопка с фиксированной шириной */
.clinic-call-button-header,
.clinic-call-button-disabled {
    flex: 0 0 auto !important;
    min-width: 200px !important;
}

/* Стили для статуса работы клиники рядом с кнопкой "Позвонить" */
.clinic-call-status {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #6b7280 !important;
    margin-top: 0 !important;
    padding: 14px 16px !important;
    background: #f9fafb !important;
    border-radius: 8px !important;
    line-height: 1.5 !important;
    border: 1px solid #e5e7eb !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    min-height: 56px !important;
    box-sizing: border-box !important;
}

.clinic-call-status:empty {
    display: none !important;
}

.clinic-call-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
    flex-shrink: 0;
}

.clinic-call-status[data-status="closed"]::before {
    background: #ef4444;
}


@media (max-width: 768px) {
    .clinic-call-wrapper {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
        width: 100% !important;
        min-width: 100% !important;
        flex: 1 1 100% !important;
    }
    
    .clinic-call-button-header {
        width: 100% !important;
        flex: 1 1 100% !important;
        min-width: 100% !important;
        justify-content: center !important;
        padding: 14px 24px !important;
        font-size: 16px !important;
        font-weight: 700 !important;
        margin-top: 0 !important;
        border-radius: 10px !important;
        gap: 10px !important;
        white-space: nowrap !important;
    }

    /* На мобильной версии скрываем текст "Позвонить", оставляем только номер */
    .clinic-call-button-header span:first-of-type {
        display: none !important;
    }

    .clinic-call-button-header span:nth-of-type(2) {
        white-space: nowrap !important;
    }
    
    .clinic-call-button-header:active {
        background: #047857 !important;
    }
    
    .clinic-call-button-header svg {
        width: 20px !important;
        height: 20px !important;
    }
    
    .clinic-header-info > div:first-child {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    
    .clinic-title {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    .clinic-call-button-disabled {
        width: 100% !important;
        flex: 1 1 100% !important;
        min-width: 100% !important;
        justify-content: center !important;
        padding: 14px 24px !important;
        font-size: 16px !important;
        margin-top: 0 !important;
    }
    
    .clinic-call-button-disabled svg {
        width: 20px !important;
        height: 20px !important;
    }
    
    .clinic-call-status {
        width: 100% !important;
        flex: 1 1 100% !important;
        min-width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
        font-size: 13px !important;
        padding: 14px 16px !important;
        margin-top: 0 !important;
    }
    
    .clinic-call-status::before {
        width: 8px !important;
        height: 8px !important;
    }
}

@media (max-width: 480px) {
    .clinic-call-button-header {
        padding: 14px 20px !important;
        font-size: 16px !important;
        gap: 8px !important;
    }
    
    .clinic-call-button-header svg {
        width: 20px !important;
        height: 20px !important;
    }
    
    .clinic-call-button-disabled {
        padding: 14px 20px !important;
        font-size: 16px !important;
        gap: 8px !important;
    }
    
    .clinic-call-button-disabled svg {
        width: 20px !important;
        height: 20px !important;
    }
    
    .clinic-call-status {
        font-size: 12px !important;
        padding: 6px 12px !important;
    }
    
    .clinic-call-status::before {
        width: 6px !important;
        height: 6px !important;
    }
}

/* Дополнительные улучшения для touch-устройств */
@media (hover: none) and (pointer: coarse) {
    .clinic-call-button-header {
        -webkit-tap-highlight-color: rgba(16, 185, 129, 0.3) !important;
        touch-action: manipulation !important;
    }
    
    .clinic-call-button-header:active {
        transform: scale(0.95) !important;
        transition: transform 0.1s ease !important;
    }
}

.clinic-header-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
}

.clinic-header-content {
    display: flex;
    gap: 24px;
    align-items: start;
    flex-wrap: wrap;
}

.clinic-logo-img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
}

.clinic-header-info {
    flex: 1;
    min-width: 300px;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.clinic-header-info > div:first-child {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}


.clinic-title {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.3;
    flex: 1 1 500px;
    min-width: 500px !important;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.clinic-short-description {
    font-size: 16px;
    color: #4b5563;
    line-height: 1.6;
    margin: 0 0 16px 0;
}

.clinic-badges {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.clinic-badge-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

.badge-24h {
    background: #dcfce7;
    color: #166534;
}

.badge-emergency {
    background: #fee2e2;
    color: #991b1b;
}

.badge-year {
    background: #e0e7ff;
    color: #3730a3;
}

.clinic-not-found {
    padding: 40px;
    text-align: center;
}

.clinic-not-found p {
    margin: 0;
}

.clinic-content-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 24px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.clinic-main-content {
    display: grid;
    gap: 24px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    min-width: 0;
}

.clinic-section-card {
    background: white;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    min-width: 0;
    border-radius: 12px;
    /*padding: 24px;*/
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.clinic-section-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 16px 0;
}

.clinic-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

/* Иконка лупы при наведении на фото */
.photo-zoom-icon {
    transition: opacity 0.3s ease, transform 0.2s ease;
}

.main-photo-container-hover:hover .photo-zoom-icon {
    opacity: 1 !important;
    transform: translate(-50%, -50%) scale(1.05);
}

.clinic-photo-item {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
}

.clinic-services-list {
    display: grid;
    gap: 20px;
}

.clinic-service-group-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 12px 0;
}

.clinic-service-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.clinic-service-tag {
    padding: 6px 12px;
    background: #f3f4f6;
    color: #374151;
    border-radius: 6px;
    font-size: 14px;
}

.clinic-service-tag-link {
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
    cursor: pointer;
}

.clinic-service-tag-link:hover {
    background: #4F46E5;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3);
}

.clinic-service-tag-link.clinic-service-tag-emergency:hover {
    background: #dc2626;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.3);
}

.clinic-service-tag-emergency {
    background: #fee2e2;
    color: #991b1b;
}

.clinic-service-tag-animal {
    background: #dbeafe;
    color: #1e40af;
}

.clinic-service-tag-link.clinic-service-tag-animal:hover {
    background: #3b82f6;
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* Боковая панель (контакты) */
.clinic-content-grid > div:last-child {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    min-width: 0;
}

/* Все дочерние элементы боковой панели */
.clinic-content-grid > div:last-child > div {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Стили для элементов с inline стилями в боковой панели */
div[style*="display: grid; gap: 24px; height: fit-content"] {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
}

div[style*="display: grid; gap: 24px; height: fit-content"] > div {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
}

/* Footer */
.footer {
    margin-top: 60px;
}

.clinic-section-divider {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

/* Промежуточные размеры экрана */
@media (max-width: 1400px) and (min-width: 1201px) {
    .clinic-view-container {
        padding: 0 20px;
    }
    
    .clinic-content-grid {
        grid-template-columns: 1fr 320px;
        gap: 20px;
    }
    
    .clinic-main-content {
        gap: 20px;
    }
    
    .clinic-section-title {
        font-size: 19px;
        margin-bottom: 14px;
    }
    
    #main-photo-container {
        height: 450px !important;
    }
    
    .photo-thumbnail {
        width: 70px !important;
        height: 70px !important;
    }
    
    #prev-photo-btn,
    #next-photo-btn {
        width: 42px !important;
        height: 42px !important;
    }
    
    #clinic-map {
        height: 350px !important;
    }
}

@media (max-width: 1200px) and (min-width: 1025px) {
    .clinic-view-container {
        padding: 0 20px;
    }
    
    .clinic-content-grid {
        grid-template-columns: 1fr 300px;
        gap: 18px;
    }
    
    .clinic-main-content {
        gap: 18px;
    }
    
    .clinic-section-card {
        padding: 18px;
    }
    
    .clinic-section-title {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .clinic-title {
        font-size: 28px;
    }
    
    #main-photo-container {
        height: 400px !important;
    }
    
    .photo-thumbnail {
        width: 65px !important;
        height: 65px !important;
    }
    
    #prev-photo-btn,
    #next-photo-btn {
        width: 40px !important;
        height: 40px !important;
    }
    
    #clinic-map {
        height: 320px !important;
    }
    
    /* Боковая панель */
    .clinic-content-grid > div:last-child {
        width: 100%;
        max-width: 100%;
    }
    
    div[style*="display: grid; gap: 24px; height: fit-content"] {
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .clinic-view-container {
        padding: 0 16px;
    }
    
    .clinic-content-grid,
    #main-grid-container {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    
    .clinic-main-content,
    #main-content {
        display: contents !important;
        gap: 20px;
    }
    
    /* Порядок блоков */
    #clinic-photos-section {
        order: 1 !important;
    }
    
    #contacts-sidebar {
        position: static !important;
        max-height: none !important;
        overflow-y: visible !important;
        order: 2 !important;
        display: grid !important;
        gap: 24px !important;
    }
    
    /* Порядок элементов внутри sidebar на мобильных */
    #contacts-sidebar .contacts-block[data-sidebar-order="1"] {
        order: 1 !important;
    }
    
    #contacts-sidebar [data-sidebar-order="2"] {
        order: 2 !important;
    }
    
    #contacts-sidebar .clinic-ad-banner[data-sidebar-order="3"] {
        order: 3 !important;
    }
    
    /* Расположение на карте - для основного контента (если карта не в sidebar) */
    [data-section-order="3"]:not([data-sidebar-order]) {
        order: 3 !important;
    }
    
    /* Услуги */
    [data-section-order="4"] {
        order: 4 !important;
    }
    
    /* Врачи и персонал */
    [data-section-order="5"] {
        order: 5 !important;
    }
    
    /* График работы */
    [data-section-order="6"] {
        order: 6 !important;
    }
    
    /* Цены на услуги */
    [data-section-order="7"] {
        order: 7 !important;
    }
    
    /* Оборудование */
    [data-section-order="8"] {
        order: 8 !important;
    }
    
    /* Отзывы */
    [data-section-order="9"] {
        order: 9 !important;
    }
    
    .clinic-section-card {
        padding: 18px;
    }
    
    .clinic-section-title {
        font-size: 18px;
    }
    
    .clinic-title {
        font-size: 26px;
    }
    
    #main-photo-container {
        height: 400px !important;
    }
    
    .photo-thumbnail {
        width: 70px !important;
        height: 70px !important;
    }
    
    #prev-photo-btn,
    #next-photo-btn {
        width: 42px !important;
        height: 42px !important;
    }
    
    #clinic-map {
        height: 350px !important;
    }
    
    /* Убеждаемся, что элементы не выходят за границы */
    .clinic-content-grid,
    #main-grid-container,
    .clinic-main-content,
    #main-content,
    .clinic-section-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }
}

@media (max-width: 768px) {
    .clinic-view-container {
        padding: 0 16px;
        margin-top: 16px;
    }
    
    .clinic-header-card {
        padding: 20px !important;
        margin-bottom: 20px;
        border-radius: 12px;
    }
    
    .clinic-header-content {
        flex-direction: column;
        gap: 16px;
    }
    
    .clinic-logo-img {
        width: 100px;
        height: 100px;
        margin: 0 auto;
        border-radius: 10px;
    }
    
    .clinic-header-info {
        min-width: 100%;
        text-align: center;
    }
    
    .clinic-header-info > div:first-child {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        padding-bottom: 16px;
        border-bottom: 1px solid #e5e7eb;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    .clinic-title {
        font-size: 24px !important;
        text-align: center;
        min-width: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        box-sizing: border-box !important;
    }
    
    .clinic-short-description {
        font-size: 14px;
        text-align: center;
    }
    
    .clinic-badges {
        justify-content: center;
        gap: 8px;
    }
    
    .clinic-badge-item {
        font-size: 12px;
        padding: 4px 10px;
    }
    
    .clinic-content-grid,
    #main-grid-container {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    .clinic-main-content,
    #main-content {
        display: contents !important;
        gap: 16px;
    }
    
    /* Порядок блоков для мобильных */
    #clinic-photos-section {
        order: 1 !important;
    }
    
    #contacts-sidebar {
        position: static !important;
        max-height: none !important;
        overflow-y: visible !important;
        order: 2 !important;
        display: grid !important;
        gap: 24px !important;
    }
    
    /* Порядок элементов внутри sidebar на мобильных */
    #contacts-sidebar .contacts-block[data-sidebar-order="1"] {
        order: 1 !important;
    }
    
    #contacts-sidebar [data-sidebar-order="2"] {
        order: 2 !important;
    }
    
    #contacts-sidebar .clinic-ad-banner[data-sidebar-order="3"] {
        order: 3 !important;
    }
    
    /* Расположение на карте - для основного контента (если карта не в sidebar) */
    [data-section-order="3"]:not([data-sidebar-order]) {
        order: 3 !important;
    }
    
    /* Услуги */
    [data-section-order="4"] {
        order: 4 !important;
    }
    
    /* Врачи и персонал */
    [data-section-order="5"] {
        order: 5 !important;
    }
    
    /* График работы */
    [data-section-order="6"] {
        order: 6 !important;
    }
    
    /* Цены на услуги */
    [data-section-order="7"] {
        order: 7 !important;
    }
    
    /* Оборудование */
    [data-section-order="8"] {
        order: 8 !important;
    }
    
    /* Отзывы */
    [data-section-order="9"] {
        order: 9 !important;
    }
    
    .clinic-section-card {
        padding: 16px !important;
    }
    
    .clinic-section-title {
        font-size: 18px !important;
        margin-bottom: 12px;
    }
    
    /* Галерея фотографий */
    #main-photo-container {
        height: 300px !important;
    }
    
    #prev-photo-btn,
    #next-photo-btn {
        width: 40px !important;
        height: 40px !important;
    }
    
    #prev-photo-btn {
        left: 8px !important;
    }
    
    #next-photo-btn {
        right: 8px !important;
    }
    
    #prev-photo-btn svg,
    #next-photo-btn svg {
        width: 20px !important;
        height: 20px !important;
    }
    
    .photo-thumbnail {
        width: 60px !important;
        height: 60px !important;
    }
    
    /* Услуги */
    .clinic-service-group-title {
        font-size: 15px !important;
        margin-bottom: 10px;
    }
    
    .clinic-service-tag {
        font-size: 12px !important;
        padding: 5px 10px !important;
    }
    
    /* Персонал */
    div[style*="display: flex; gap: 16px; padding: 16px"] {
        flex-direction: column !important;
        gap: 12px !important;
        padding: 12px !important;
    }
    
    div[style*="display: flex; gap: 16px; padding: 16px"] img {
        width: 120px !important;
        height: 120px !important;
        max-width: 120px !important;
        margin: 0 auto !important;
    }
    
    div[style*="display: flex; gap: 16px; padding: 16px"] h3 {
        font-size: 16px !important;
        margin-bottom: 4px !important;
        text-align: center;
    }
    
    div[style*="display: flex; gap: 16px; padding: 16px"] p {
        font-size: 13px !important;
        text-align: center;
    }
    
    .certificates-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
        gap: 10px !important;
    }
    
    /* График работы */
    div[style*="display: grid; gap: 8px"] {
        gap: 8px !important;
    }
    
    div[style*="display: flex; justify-content: space-between"] {
        flex-direction: column !important;
        gap: 4px !important;
        align-items: flex-start !important;
    }
    
    /* Цены */
    div[style*="display: flex; justify-content: space-between; align-items: center; padding: 12px"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
    }
    
    /* Контакты */
    div[style*="display: grid; gap: 24px"] {
        gap: 16px !important;
    }
    
    div[style*="display: grid; gap: 16px"] {
        gap: 12px !important;
    }
    
    /* Карта */
    #clinic-map {
        height: 300px !important;
    }
    
    /* Полноэкранная галерея */
    #fullscreenModal {
        padding: 0 !important;
    }
    
    #fullscreenImage {
        max-width: 95% !important;
        max-height: 85% !important;
    }
    
    #fullscreen-prev-btn,
    #fullscreen-next-btn {
        width: 44px !important;
        height: 44px !important;
    }
    
    #fullscreen-prev-btn {
        left: 10px !important;
    }
    
    #fullscreen-next-btn {
        right: 10px !important;
    }
    
    #fullscreen-prev-btn svg,
    #fullscreen-next-btn svg {
        width: 22px !important;
        height: 22px !important;
    }
    
    #fullscreen-thumbnails {
        bottom: 60px !important;
        padding: 6px 8px !important;
    }
    
    .fullscreen-thumbnail {
        width: 50px !important;
        height: 50px !important;
    }
    
    #photo-counter {
        bottom: 15px !important;
        font-size: 12px !important;
        padding: 6px 12px !important;
    }
    
    /* Сертификаты */
    #certificateFullscreenModal {
        padding: 0 !important;
    }
    
    #certificateFullscreenImage {
        max-width: 95% !important;
        max-height: 85% !important;
    }
    
    #certificate-fullscreen-prev-btn,
    #certificate-fullscreen-next-btn {
        width: 44px !important;
        height: 44px !important;
    }
    
    #certificate-fullscreen-prev-btn {
        left: 10px !important;
    }
    
    #certificate-fullscreen-next-btn {
        right: 10px !important;
    }
    
    #certificate-fullscreen-prev-btn svg,
    #certificate-fullscreen-next-btn svg {
        width: 22px !important;
        height: 22px !important;
    }
    
    #certificate-counter {
        bottom: 15px !important;
        font-size: 12px !important;
        padding: 6px 12px !important;
    }
    
    /* Общие стили для мобильных */
    img, video, iframe {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Убираем горизонтальный скролл */
    body, html {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    
    * {
        box-sizing: border-box !important;
    }
    
    /* Убеждаемся, что все элементы не выходят за границы */
    .clinic-view-container,
    .clinic-content-grid,
    .clinic-main-content,
    .clinic-section-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }
    
    /* Галерея фотографий - предотвращение переполнения */
    div[style*="position: relative; margin-bottom: 16px"] {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    #main-photo-container,
    #photo-slider,
    #main-photo {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    #photo-thumbnails {
        max-width: 100% !important;
        overflow-x: auto !important;
    }
    
    /* Персонал - предотвращение переполнения */
    div[style*="display: flex; gap: 16px; padding: 16px"] {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    div[style*="display: flex; gap: 16px; padding: 16px"] img {
        max-width: 100% !important;
    }
    
    /* График работы и цены */
    div[style*="display: grid; gap: 8px"],
    div[style*="display: flex; justify-content: space-between"] {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Контакты */
    div[style*="display: grid; gap: 24px"],
    div[style*="display: grid; gap: 16px"] {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Карта */
    #clinic-map {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Footer */
    .footer {
        margin-top: 40px !important;
    }
}

/* Дополнительные стили для очень маленьких экранов */
@media (max-width: 480px) {
    .clinic-view-container {
        padding: 0 12px;
    }
    
    .clinic-header-card {
        padding: 16px !important;
        border-radius: 12px;
    }
    
    .clinic-header-content {
        gap: 12px;
    }
    
    .clinic-logo-img {
        width: 80px;
        height: 80px;
        border-radius: 10px;
    }
    
    .clinic-header-info > div:first-child {
        gap: 10px;
        padding-bottom: 12px;
    }
    
    .clinic-section-card {
        padding: 12px !important;
    }
    
    .clinic-title {
        font-size: 20px !important;
    }
    
    .clinic-section-title {
        font-size: 16px !important;
    }
    
    #main-photo-container {
        height: 250px !important;
    }
    
    .photo-thumbnail {
        width: 50px !important;
        height: 50px !important;
    }
    
    #prev-photo-btn,
    #next-photo-btn {
        width: 36px !important;
        height: 36px !important;
    }
    
    #prev-photo-btn {
        left: 4px !important;
    }
    
    #next-photo-btn {
        right: 4px !important;
    }
    
    #clinic-map {
        height: 250px !important;
    }
    
    /* Footer */
    .footer {
        margin-top: 40px !important;
        padding: 60px 0 24px !important;
    }
    
    .footer-content {
        gap: 24px !important;
    }
}

/* Стили для полноэкранной галереи */
#fullscreenModal {
    display: none !important;
}

#fullscreenModal.active {
    display: flex !important;
}

#fullscreenImage {
    transition: opacity 0.3s ease;
}

/* Мобильные устройства */
@media (max-width: 768px) {
    #main-photo-container {
        height: 300px !important;
    }
    
    #fullscreenModal {
        padding: 0 !important;
    }
    
    #fullscreenModal > div {
        padding: 5px !important;
    }
    
    #fullscreenImage {
        max-width: 100% !important;
        max-height: 100% !important;
    }
    
    #fullscreen-prev-btn {
        width: 44px !important;
        height: 44px !important;
        left: 10px !important;
    }
    
    #fullscreen-next-btn {
        width: 44px !important;
        height: 44px !important;
        right: 10px !important;
    }
    
    #fullscreen-prev-btn svg,
    #fullscreen-next-btn svg {
        width: 20px !important;
        height: 20px !important;
    }
}

.fullscreen-thumbnail {
    transition: all 0.2s ease;
}

.fullscreen-thumbnail.active {
    border-color: #4F46E5 !important;
    opacity: 1 !important;
}

/* Стили для сертификатов */
.certificates-preview-container {
    margin-top: 8px;
}

.certificates-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.certificate-preview-item {
    position: relative;
    width: 100%;
    padding-top: 100%;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: #f3f4f6;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.certificate-preview-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.certificate-preview-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.certificate-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    color: white;
}

.certificate-preview-item:hover .certificate-preview-overlay {
    opacity: 1;
}

#certificateFullscreenImage {
    transition: opacity 0.3s ease;
}

/* Блок "Ближайшие клиники" - такая же ширина, как у блока "Отзывы" */
.nearby-clinics-container {
    margin: 48px auto 0;
    padding: 0 24px;
    box-sizing: border-box;
    width: 100%;
    max-width: 1280px;
}

/* На десктопе блок должен иметь такую же ширину, как первая колонка grid (как блок "Отзывы") */
/* Ширина первой колонки = (1280px - 48px padding) - 350px (вторая колонка) - 24px (gap) = 858px */
@media (min-width: 1281px) {
    .nearby-clinics-container {
        max-width: 858px;
        margin-left: calc((100% - 1280px) / 2 + 24px);
        margin-right: auto;
        padding: 0;
    }
}

/* На средних десктопах (1025px - 1280px) */
@media (min-width: 1025px) and (max-width: 1280px) {
    .nearby-clinics-container {
        max-width: calc(100% - 350px - 24px - 48px);
        margin-left: 24px;
        margin-right: auto;
        padding: 0;
    }
}

/* На мобильных и планшетах - полная ширина */
@media (max-width: 1024px) {
    .nearby-clinics-container {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
        padding: 0 24px;
    }
}

/* Стили для рекламного баннера */
.clinic-ad-banner {
    margin-top: 24px;
}

.ad-banner-placeholder {
    transition: background-color 0.2s ease;
}

.ad-banner-placeholder:hover {
    background-color: #e5e7eb !important;
}

/* Адаптивность рекламного баннера */
@media (max-width: 1024px) {
    .clinic-ad-banner {
        margin-top: 20px;
        padding: 20px !important;
    }
    
    .ad-banner-placeholder {
        min-height: 200px !important;
    }
}

@media (max-width: 768px) {
    .clinic-ad-banner {
        margin-top: 16px;
        padding: 16px !important;
    }
    
    .ad-banner-placeholder {
        min-height: 180px !important;
    }
    
    .ad-banner-placeholder svg {
        width: 40px !important;
        height: 40px !important;
    }
    
    .ad-banner-placeholder p {
        font-size: 12px !important;
    }
}
