/* ========================================
   HEADER STYLES
======================================== */

.site-header {
    position: relative;
    z-index: 1000;
}

/* Top Bar */
.header-top {
    background-color: var(--color-primary-green);
    min-height: var(--header-top-height);
    display: flex;
    align-items: center;
}

.header-top__container {
    display: grid;
    grid-template-columns: var(--logo-column-width) 1fr auto;
    align-items: center;
    width: 100%;
}

.header-top__socials {
    display: flex;
    gap: 20px;
    align-items: center;
}

.header-top__social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    transition: var(--transition-default);
}

.header-top__social-link:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

.header-top__social-link svg {
    width: 40px;
    height: 40px;
    fill: var(--color-white);
}

/* Address Link - now aligned via grid column */
.header-top__address-link {
    color: var(--color-white);
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: underline;
    transition: var(--transition-default);
    justify-self: start;
    padding-left: 20px;
    /* Must match .main-menu__link horizontal padding for text-level alignment */
}

.header-top__address-link:hover {
    opacity: 0.9;
}

/* Top Bar CTA Button - exact values from original */
.header-top__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--color-cta-orange);
    color: var(--color-white);
    width: 350px;
    height: 40px;
    border-radius: var(--radius-button);
    font-size: 20px;
    font-weight: 700;
    text-transform: none;
    transition: var(--transition-default);
    white-space: nowrap;
}

.header-top__cta-arrow {
    display: inline-flex;
    align-items: center;
}

.header-top__cta-arrow svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.header-top__cta:hover {
    background-color: #e65a2b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 102, 51, 0.3);
}

/* Main Header */
.header-main {
    background-color: var(--color-cream);
    min-height: var(--header-main-height);
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header-main__container {
    display: grid;
    grid-template-columns: var(--logo-column-width) 1fr auto;
    align-items: center;
    width: 100%;
}

.header-main__logo {
    display: flex;
    align-items: center;
}

.header-main__logo img {
    height: 60px;
    width: auto;
}

/* Navigation */
.header-main__nav {
    flex: 1;
    display: flex;
    justify-content: flex-start;
}

.main-menu {
    display: flex;
    align-items: center;
    gap: var(--gap-menu);
}

.main-menu__item {
    position: relative;
}

/* Menu link - exact values from original */
.main-menu__link {
    font-size: var(--font-size-menu);
    font-weight: 700;
    color: var(--color-primary-green);
    text-transform: none;
    letter-spacing: 0.56px;
    padding: 13px 20px;
    display: block;
    transition: var(--transition-default);
}

.main-menu__link:hover {
    color: var(--color-cta-orange);
}

/* Search Field */
.header-main__search {
    display: flex;
    align-items: center;
}

.header-search {
    position: relative;
    display: flex;
    align-items: center;
    background-color: var(--color-primary-green);
    border: 2px solid var(--color-primary-green);
    border-radius: var(--radius-search);
    overflow: hidden;
    flex-shrink: 0;
    align-self: center;
}

/* Search input — green, white text, blends with container */
.header-search__input {
    padding: 0 3px 0 15px;
    border: none;
    outline: none;
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-family-base);
    width: 185px;
    height: 35px;
    color: #fff;
    background-color: var(--color-primary-green);
    border-radius: 25px;
    letter-spacing: 0.3px;
    position: relative;
    z-index: 1;
}

.header-search__input::placeholder {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
}

/* Button — white bg, slides under input's rounded edge */
.header-search__button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 35px;
    background-color: #fff;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: var(--transition-default);
    flex-shrink: 0;
    margin-left: -22px;
    padding-left: 18px;
    padding-right: 0;
    box-sizing: border-box;
}

.header-search__button:hover {
    opacity: 0.7;
}

.header-search__button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: var(--color-primary-green);
}

/* Clear button (×) — orange instead of default blue */
.header-search__input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z' fill='%23FF6633'/%3E%3C/svg%3E") center/contain no-repeat;
    cursor: pointer;
}

/* ========================================
   RESPONSIVE
======================================== */

@media (max-width: 1279.98px) {
    .header-top__address-link {
        font-size: 16px;
        padding-left: 12px;
    }

    .header-top__cta {
        width: 280px;
        font-size: 16px;
        height: 36px;
    }

    .header-top__social-link {
        width: 35px;
        height: 35px;
    }

    .header-top__social-link svg {
        width: 35px;
        height: 35px;
    }

    .header-main__logo img {
        height: 50px;
    }

    .main-menu__link {
        padding: 10px 12px;
        letter-spacing: 0.3px;
    }

    .header-search__input {
        width: 180px;
        font-size: 16px;
    }
}

@media (max-width: 1023.98px) {
    .header-top {
        min-height: 50px;
    }

    .header-top__container {
        grid-template-columns: 1fr auto;
        gap: 10px;
    }

    .header-top__socials {
        display: none;
    }

    .header-top__address-link {
        display: none;
    }

    .header-top__cta {
        width: 100%;
        max-width: 280px;
        height: 36px;
        font-size: 14px;
        margin: 0 auto;
    }

    .header-main__nav {
        display: none;
    }

    .header-main__search {
        display: none;
    }

    .header-main__container {
        grid-template-columns: 1fr auto;
    }

    .header-main__logo img {
        height: 45px;
    }
}

/* SM: ≤767.98px — скрываем header-top (зелёный блок с CTA),
   т.к. CTA «Записаться» дублируется в bottom-nav.
   Раскомментировать, если bottom-nav будет убран. */
@media (max-width: 767.98px) {
    .header-top {
        display: none;
    }
}



/* ========================================
   SEARCH RESULTS DROPDOWN
======================================== */

.header-main__search {
    position: relative;
}

.search-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    max-height: 420px;
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.search-results-dropdown.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Group */
.search-dropdown__group {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.search-dropdown__group:last-child {
    border-bottom: none;
}

.search-dropdown__group-title {
    padding: 8px 16px 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-primary-green);
}

/* Item */
.search-dropdown__item {
    transition: background-color 0.15s ease;
}

.search-dropdown__item.is-highlighted,
.search-dropdown__item:hover {
    background-color: #f8f8f4;
}

.search-dropdown__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    color: inherit;
}

.search-dropdown__link--page {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

/* Doctor photo */
.search-dropdown__photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.search-dropdown__photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f0ede2;
    font-size: 20px;
    flex-shrink: 0;
}

.search-dropdown__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.search-dropdown__name {
    font-size: 14px;
    font-weight: 600;
    color: #195F40;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-dropdown__name mark {
    background: rgba(255, 102, 51, 0.2);
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}

.search-dropdown__specialty {
    font-size: 12px;
    font-weight: 500;
    color: #FF6633;
}

.search-dropdown__excerpt {
    font-size: 12px;
    color: #FF6633;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Loading */
.search-dropdown__loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    color: #888;
    font-size: 14px;
}

.search-dropdown__spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top-color: var(--color-primary-green);
    border-radius: 50%;
    animation: searchSpin 0.6s linear infinite;
}

@keyframes searchSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Empty state */
.search-dropdown__empty {
    padding: 20px 16px;
    text-align: center;
    color: #888;
    font-size: 14px;
}

/* Responsive dropdown */
@media (max-width: 1279.98px) {
    .search-results-dropdown {
        width: 320px;
    }
}

@media (max-width: 1023.98px) {
    .search-results-dropdown {
        width: 280px;
    }

    .search-dropdown__link {
        padding: 8px 12px;
    }
}