/* ==========================================================================
   AURUM CLINIC - TOP BAR & INSTANT SEARCH STYLES
   Соответствие Приказу Минздрава РФ № 118н и ГОСТ Р 52872-2019
   ========================================================================== */

/* 1. Верхняя сервисная полоса (Top Bar) */
.aurum-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 38px;
    z-index: 1002;
    background: rgba(14, 20, 23, 0.92);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.aurum-topbar.topbar--hidden {
    transform: translate3d(0, -100%, 0);
}

.aurum-topbar-container {
    width: calc(100% - 3.76rem);
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 1.88rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    box-sizing: border-box;
}

/* Левая часть: Адрес и часы работы */
.aurum-topbar-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
}

.aurum-topbar-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    line-height: 1;
}

.aurum-topbar-icon {
    flex-shrink: 0;
    color: #09c9ce;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.aurum-topbar-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: color 0.2s ease;
}

.aurum-topbar-link:hover {
    color: #09c9ce;
}

.aurum-topbar-hours {
    color: rgba(255, 255, 255, 0.6);
}

.aurum-topbar-divider {
    color: rgba(255, 255, 255, 0.2);
    user-select: none;
    font-size: 0.75rem;
}

/* Правая часть: Кнопки Поиска и Слабовидящих */
.aurum-topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.aurum-topbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 0.775rem;
    font-weight: 500;
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.aurum-topbar-btn:hover {
    background: rgba(9, 201, 206, 0.15);
    border-color: rgba(9, 201, 206, 0.4);
    color: #09c9ce;
    transform: translateY(-1px);
}

.aurum-topbar-btn:hover .aurum-topbar-icon {
    color: #09c9ce;
}

.aurum-topbar-btn.bvi-btn {
    background: rgba(255, 255, 255, 0.08);
}

.aurum-topbar-btn.bvi-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

/* ==========================================================================
   ПРЕМИАЛЬНЫЙ АНИМИРОВАННЫЙ ГРАДИЕНТ МЕНЮ (DEEP AURORA SHIFT)
   Мягкий перелив благородного изумруда и глубокого титанового графита
   ========================================================================== */
@keyframes aurumEmeraldFlow {
    0% {
        background-position: 50% 0%;
    }
    50% {
        background-position: 50% 100%;
    }
    100% {
        background-position: 50% 0%;
    }
}

.navbar,
.navbar:is(.w-nav, .aurum-navbar) {
    background: linear-gradient(
        105deg,
        #36988c 0%,
        #256f67 12%,
        #174843 25%,
        #0f1417 38%,
        #0f1417 62%,
        #174843 75%,
        #256f67 88%,
        #36988c 100%
    ) !important;
    background-size: 100% 250% !important;
    animation: aurumEmeraldFlow 5.5s ease-in-out infinite !important;
    will-change: background-position;
    border: none !important;
    box-shadow: 0 10px 28px -4px rgba(0, 0, 0, 0.45) !important;
}

/* Корректировка отступа основной плашки navbar на десктопе */
@media screen and (min-width: 992px) {
    .navbar:is(.w-nav, .aurum-navbar) {
        inset: 3.15rem 0% auto !important; /* Смещаем парящую плашку вниз под Top Bar */
    }
    
    /* Скрываем адрес в плашке, оставляем только телефон */
    .navbar-text .text-adres {
        display: none !important;
    }
    
    .navbar-text {
        margin-right: 1.5rem !important;
    }
}

/* Адаптивность Top Bar и парящей плашки меню на мобильных */
@media screen and (max-width: 991px) {
    .aurum-topbar {
        height: 38px;
    }
    .aurum-topbar-container {
        width: 100%;
        padding: 0 1rem;
    }
    .aurum-topbar-hours {
        display: none;
    }
    .aurum-topbar-left .aurum-topbar-divider {
        display: none;
    }

    /* Парящая плашка-капсула на смартфонах и планшетах (Floating Pill) */
    .navbar:is(.w-nav, .aurum-navbar) {
        top: 47px !important; /* Отрыв от Top Bar */
        left: 0.75rem !important; /* Отступ 12px слева */
        right: 0.75rem !important; /* Отступ 12px справа */
        width: auto !important;
        max-width: 640px !important;
        margin: 0 auto !important;
        border-radius: 0.9375rem !important; /* Закругляем все 4 угла */
        border: none !important;
        box-shadow: 0 8px 25px -4px rgba(0, 0, 0, 0.45) !important;
        box-sizing: border-box !important;
    }
}

@media screen and (max-width: 600px) {
    .aurum-topbar-left {
        display: none; /* На ультракомпактных экранах освобождаем место под кнопки */
    }
    .aurum-topbar-right {
        width: 100%;
        justify-content: space-between;
    }
    .aurum-topbar-btn {
        flex: 1;
        justify-content: center;
        font-size: 0.72rem;
        padding: 0.3rem 0.5rem;
    }
}

/* ==========================================================================
   2. МОДАЛЬНОЕ ОКНО ПОИСКА (SPOTLIGHT / INSTANT SEARCH)
   ========================================================================== */
.aurum-search-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 5rem 1rem 2rem 1rem;
    box-sizing: border-box;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.aurum-search-modal.is-open {
    display: flex;
}

.aurum-search-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(8, 12, 14, 0.75);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 1;
    cursor: pointer;
    animation: aurumFadeIn 0.25s ease-out;
}

.aurum-search-dialog {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 680px;
    background: #11181c;
    border: 1px solid rgba(9, 201, 206, 0.28);
    border-radius: 1.25rem;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 30px rgba(9, 201, 206, 0.15);
    overflow: hidden;
    animation: aurumSlideDown 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes aurumFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Поле ввода */
.aurum-search-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    gap: 0.75rem;
}

.aurum-search-input-wrap {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 0.75rem;
    background: transparent;
}

.aurum-search-input-icon {
    color: #09c9ce;
    flex-shrink: 0;
}

.aurum-search-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 1.125rem;
    font-family: inherit;
    line-height: 1.4;
}

.aurum-search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-size: 1rem;
}

.aurum-search-clear {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.aurum-search-clear:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.aurum-search-close {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 0;
    transition: color 0.2s;
}

.aurum-search-close:hover {
    color: #ffffff;
}

.esc-badge {
    display: inline-block;
    padding: 0.2rem 0.45rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    letter-spacing: 0.05em;
}

.close-icon-mob {
    display: none;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.2s;
}

@media screen and (max-width: 600px) {
    .esc-badge { display: none; }
    .aurum-search-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.12);
        color: rgba(255, 255, 255, 0.75);
        flex-shrink: 0;
        transition: all 0.2s ease;
    }
    .aurum-search-close:active {
        background: rgba(9, 201, 206, 0.2);
        border-color: rgba(9, 201, 206, 0.4);
        color: #09c9ce;
    }
    .close-icon-mob { 
        display: block;
        width: 14px;
        height: 14px;
    }
    .aurum-search-modal { padding-top: 2rem; }
}

/* Тело поиска: Быстрые теги + Результаты */
.aurum-search-body {
    max-height: 60vh;
    overflow-y: auto;
    padding: 1rem 1.25rem 1.25rem 1.25rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(9, 201, 206, 0.4) transparent;
}

.aurum-search-body::-webkit-scrollbar {
    width: 6px;
}
.aurum-search-body::-webkit-scrollbar-thumb {
    background: rgba(9, 201, 206, 0.3);
    border-radius: 3px;
}

/* Быстрые теги (подсказки) */
.aurum-search-quick-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.quick-tags-title {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-right: 0.25rem;
}

.quick-tag-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.quick-tag-btn:hover {
    background: rgba(9, 201, 206, 0.15);
    border-color: rgba(9, 201, 206, 0.4);
    color: #09c9ce;
}

/* Список результатов */
.aurum-search-results {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search-result-item {
    display: flex;
    flex-direction: column;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.search-result-item:hover,
.search-result-item.is-selected {
    background: rgba(9, 201, 206, 0.1);
    border-color: rgba(9, 201, 206, 0.35);
    transform: translateX(3px);
}

.search-result-header {
    display: flex;
    align-items: flex-start; /* Строго по верхнему краю на десктопе и на мобильных */
    justify-content: space-between;
    margin-bottom: 0.35rem;
    gap: 0.75rem;
}

.search-result-title {
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
    flex: 1;
}

.search-result-item:hover .search-result-title {
    color: #09c9ce;
}

/* Единый контурный стиль бейджей категорий (минималистичный Outline Ghost) */
.search-cat-badge {
    margin-top: 2px; /* Оптически вровень с первой строкой заголовка */
    font-size: 0.625rem; /* 10px - более компактный и аккуратный */
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    color: rgba(255, 255, 255, 0.6) !important;
    transition: all 0.2s ease;
    line-height: 1.2;
}

.search-result-item:hover .search-cat-badge,
.search-result-item.is-selected .search-cat-badge {
    border-color: rgba(9, 201, 206, 0.45) !important;
    color: #09c9ce !important;
}

.search-result-desc {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8125rem;
    line-height: 1.4;
    margin: 0;
}

.search-match-highlight {
    color: #09c9ce;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Состояния пустого поиска */
.search-empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: rgba(255, 255, 255, 0.5);
}

.search-empty-icon {
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
}

.search-empty-title {
    font-size: 1rem;
    color: #ffffff;
    margin-bottom: 0.35rem;
    font-weight: 500;
}

.search-empty-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    max-width: 360px;
    margin: 0 auto 1.25rem auto;
    line-height: 1.4;
}

.search-empty-phone {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #09c9ce;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    background: rgba(9, 201, 206, 0.1);
    border-radius: 9999px;
    border: 1px solid rgba(9, 201, 206, 0.25);
    transition: all 0.2s;
}

.search-empty-phone:hover {
    background: rgba(9, 201, 206, 0.2);
    border-color: #09c9ce;
}

/* 3. Анимация мягкой подсветки найденного элемента при скролле */
@keyframes aurumTargetPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(9, 201, 206, 0.8);
        outline: 3px solid #09c9ce;
    }
    50% {
        box-shadow: 0 0 25px 8px rgba(9, 201, 206, 0.4);
        outline: 3px solid #09c9ce;
    }
    100% {
        box-shadow: 0 0 0 0 rgba(9, 201, 206, 0);
        outline: 3px solid transparent;
    }
}

.aurum-target-highlight {
    animation: aurumTargetPulse 2.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    border-radius: 12px;
}
