/**
 * Search Header Styles
 * All CSS related to search functionality: input, results, dropdown, skeleton loading, mobile search
 */

 .et_fixed_nav.et_show_nav #page-container.page-search-header-container {
    padding-top: 135px;
 }

.wf-search-wrapper {
    position: relative;
    width: 100%;
    max-width: 488px;
}

.wf-search-input {
    width: 100%;
    padding: 9px 44px 9px 20px;
    border: 1px solid #f5f5f5;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    background: #f5f5f5;
    color: #686868;
    height: 48px;
    box-sizing: border-box;
}

.wf-search-icon,
.wf-search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

.wf-search-icon:hover,
.wf-search-clear:hover {
    opacity: 1;
}

.wf-search-icon svg,
.wf-search-clear svg {
    width: 24px;
    height: 24px;
}

.wf-search-input:focus {
    outline: none;
    border-color: #f5f5f5;
}

/* When dropdown is open, adjust input border */
.wf-search-wrapper.wf-search-dropdown-open .wf-search-input {
    border-radius: 10px 10px 0 0;
    border-bottom: none;
}

.wf-search-input::placeholder {
    color: #686868;
}

/* Search Results Dropdown */
.wf-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 0 0 10px 10px;
    box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.05);
    z-index: 10000;
    margin-top: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 563px;
}

/* Fade-in animation for results (not skeleton) */
.wf-search-results.wf-search-results-loaded {
    animation: fadeInResults 0.3s ease-in-out;
}

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

.wf-search-result-item {
    padding: 15px 20px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    display: flex;
    align-items: center;
    gap: 17px;
}

.wf-search-result-item:not(:last-of-type) {
    border-bottom: 1px solid #e0e0e0;
}

.wf-search-result-item:hover,
.wf-search-result-item.wf-search-result-active {
    background-color: #f5f5f5;
}

/* Static links should have same hover/active behavior as their original styles */
.wf-search-link-text.wf-search-result-item:hover,
.wf-search-link-text.wf-search-result-item.wf-search-result-active {
    background-color: transparent;
    text-decoration: underline;
}

.wf-search-result-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

.wf-search-result-name {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    color: #000000;
    margin-bottom: 0;
}

.wf-search-result-location {
    font-size: 14px;
    line-height: 1.2;
    color: #747474;
    font-weight: 400;
}

.wf-search-no-results {
    color: #999;
    cursor: default;
    font-size: 14px;
}

.wf-search-no-results:hover {
    background-color: transparent;
}

/* Static Links Section */
.wf-search-static-links {
    padding: 10px 0;
}

.wf-search-link-text {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    color: #000000;
    text-decoration: none;
    display: flex;
    gap: 5px;
}

/* Override wf-search-result-item styles for static links */
.wf-search-link-text.wf-search-result-item {
    padding: 0;
    align-items: unset;
    min-height: auto;
    gap: 0;
}

.wf-search-map-link {
    padding: 15px 20px 15px;
}

.wf-search-map-text-light {
    font-weight: 400;
    color: #747474;
}

.wf-search-map-link .wf-search-link-text {
    display: flex;
    align-items: end;
    gap: 5px;
}

.wf-search-map-icon svg {
    width: 18px;
    height: 18px;
}

.wf-search-link-text:hover {
    text-decoration: underline;
}

/* View All Results Link */
.wf-search-view-all {
    padding: 15px 20px;
    background: #f9f9f9;
    border-bottom: 1px solid #e0e0e0;
}

.wf-search-view-all-link {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    color: #000000;
    text-decoration: none;
    text-align: center;
    padding: 0;
}

.wf-search-view-all-link:hover {
    text-decoration: underline;
    background-color: transparent;
}

.wf-search-categories-section {
    display: flex;
    flex-direction: column;
    padding: 0;
}

.wf-search-category-heading {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    color: #000000;
    padding: 6px 20px 5px;
    text-align: left;
}

.wf-search-category-link {
    font-weight: 400;
    font-size: 14px;
    line-height: 1.2;
    color: #747474;
    text-decoration: none;
    padding: 6px 20px 5px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

/* Override wf-search-result-item styles for category links */
.wf-search-category-link.wf-search-result-item {
    padding: 6px 20px 5px;
    display: block;
    align-items: unset;
    min-height: auto;
    border-bottom: none;
}

/* Skeleton Loading States */
.wf-search-skeleton-item {
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 17px;
    min-height: auto;
}

.wf-search-skeleton-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

.wf-search-skeleton-line {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 50%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.wf-search-skeleton-name {
    width: 70%;
    height: 16.8px; /* 14px font-size * 1.2 line-height */
}

.wf-search-skeleton-location {
    width: 50%;
    height: 16.8px; /* 14px font-size * 1.2 line-height */
}

.wf-search-skeleton-view-all-text {
    width: 20%;
    height: 16.8px; /* 14px font-size * 1.2 line-height */
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Mobile Search Overlay */
.wf-search-mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 999999;
    display: none; /* Hidden by default */
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out, transform 0.2s ease-in-out;
}

/* Show overlay with slide-down and fade-in animation */
.wf-search-mobile-overlay.wf-search-overlay-visible {
    display: flex; /* Show flex container */
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.wf-search-mobile-header {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.wf-search-mobile-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.wf-search-input-mobile {
    width: 100%;
    height: 46px;
    padding: 9px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    background: #f5f5f5;
    color: #686868;
    box-sizing: border-box;
}

.wf-search-input-mobile:focus {
    outline: none;
    background: #f5f5f5;
}

.wf-search-icon-mobile {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.15s ease;
    width: 24px;
    height: 24px;
}

.wf-search-icon-mobile:hover {
    opacity: 1;
}

.wf-search-icon-mobile svg {
    display: block;
    width: 24px;
    height: 24px;
}

.wf-search-mobile-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wf-search-mobile-close svg {
    display: block;
    width: 24px;
    height: 24px;
}

.wf-search-results-mobile {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* Mobile results use same styles as desktop - styles are inherited */

/* Fade-in animation for mobile results */
.wf-search-results-mobile.wf-search-results-loaded {
    animation: fadeInResults 0.3s ease-in-out;
}

/* Responsive */
@media (max-width: 768px) {
    /* Hide desktop search wrapper on mobile */
    .wf-search-desktop {
        display: none;
    }

    /* Show mobile trigger button */
    .wf-search-mobile-trigger {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        width: 24px;
        height: 24px;
        flex-shrink: 0;
    }

    .wf-search-mobile-trigger svg {
        width: 24px;
        height: 24px;
    }

    /* Mobile input font size */
    .wf-search-input-mobile {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Truncate the light text on mobile with ellipsis */
    .wf-search-map-link .wf-search-link-text {
        overflow: hidden; /* Contain the truncation */
    }
    
    .wf-search-map-text-bold {
        display: flex;
        min-width: 0;
        flex: 1; /* Take available space in flex parent */
        overflow: hidden;
        gap: 5px;
    }

    .wf-search-map-text-bold > span {
        white-space: nowrap;
    }
    
    .wf-search-map-text-light {
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (min-width: 769px) {
    /* Hide mobile trigger on desktop */
    .wf-search-mobile-trigger {
        display: none;
    }

    /* Hide mobile overlay on desktop */
    .wf-search-mobile-overlay {
        display: none;
    }
}
