/* ==========================================================================
   MAH Search – Styles
   ========================================================================== */

/* ---- Trigger (add .mah-search-trigger to any element) ---- */
.search-trigger-wrapper {
    display: inline-flex;
    align-items: center;
    margin-right: 1rem;
}

.mah-search-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    font-size: inherit;
}
.mah-search-trigger svg {
    fill: rgb(var(--mdui-color-foam));
}

/* ---- Overlay backdrop ---- */
.mah-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.5);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mah-search-overlay.is-open {
    visibility: visible;
    opacity: 1;
}

/* ---- Right-side panel ---- */
.mah-search-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 500px;
    max-width: 90vw;
    height: 100%;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.mah-search-panel-header {
    background: rgb(var(--mdui-color-stout))
}

.mah-search-overlay.is-open .mah-search-panel {
    transform: translateX(0);
}

/* ---- Close button ---- */
.mah-search-close {
    position: absolute;
    top: 20px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: rgb(var(--mdui-color-foam-light));
    padding: 4px 8px;
    transition: color 0.2s ease;
}

.mah-search-close:hover {
    color: rgb(var(--mdui-color-primary-light));
}

/* ---- Title ---- */
.mah-search-title {
    margin: 0;
    padding: 24px 24px 12px;
    font-size: 30px;
    font-weight: 400;
    line-height: 1.25;
    color: rgb(var(--mdui-color-foam-light));
}

.mah-search-description {
    margin: 0;
    padding: 0 24px 24px;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.25;
    color: rgb(var(--mdui-color-foam-light));
}

/* ---- Search form ---- */
.mah-search-form {
    padding: 0 24px 24px;
}

.mah-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    overflow: visible;
}

.mah-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: #333;
    height: 50px;
}

.mah-search-input::placeholder {
    color: #999;
}

.mah-search-submit {
    background: none;
    border: none;
}

.mah-search-submit:hover {
    color: rgb(var(--mdui-color-primary-light));
}

/* ---- Autocomplete dropdown ---- */
.mah-search-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 240px;
    overflow-y: auto;
    z-index: 10;
    display: none;
}

.mah-search-autocomplete.is-visible {
    display: block;
}

.mah-search-autocomplete li {
    margin: 0;
    padding: 0;
}

.mah-search-autocomplete li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s ease;
}

.mah-search-autocomplete li a .mah-ac-type {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 2px 6px;
    border-radius: 3px;
    color: #fff;
    background: rgb(var(--mdui-color-primary-light));
}

.mah-search-autocomplete li a .mah-ac-type.mah-ac-type--locations {
    background: rgb(var(--mdui-color-golden-ale));
}

.mah-search-autocomplete li:last-child a {
    border-bottom: none;
}

.mah-search-autocomplete li a:hover,
.mah-search-autocomplete li a.is-active {
    background: #f5f8fa;
    color: rgb(var(--mdui-color-primary-light));
}

/* ---- Suggested keywords (initial state) ---- */
.mah-search-suggestions {
    padding: 12px 24px 20px;
}

.mah-search-suggestions.is-hidden {
    display: none;
}

.mah-search-suggestions-label {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mah-search-suggestions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mah-search-suggestion-chip {
    display: inline-block;
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.4;
}

/* ---- Results section ----
   Dynamic results scroll; CTA stays at panel bottom when empty,
   and sits directly under the scrollable results when there are hits. ---- */
.mah-search-results {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0 24px 24px;
}

.mah-search-results-dynamic {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE / legacy Edge */
}

.mah-search-results-dynamic::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Chromium Edge */
}

.search-custom-cta {
    flex-shrink: 0;
    margin-top: auto;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    overflow: hidden;
    background-color: rgb(var(--mdui-color-primary-light));
}

.search-custom-cta-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    text-decoration: none;
    color: rgb(var(--mdui-color-foam-light));
    box-sizing: border-box;
}

.search-custom-cta-content {
    flex: 1;
    min-width: 0;
}

.search-custom-cta-title {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 400;
    line-height: 1.3;
    color: rgb(var(--mdui-color-lager)) !important;
    font-family: "Yellowtail",cursive;
}

.search-custom-cta-subtitle {
    margin: 0;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.35;
}

.search-custom-cta-icon {
    width: 30px;
    height: 30px;
}

.mah-search-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mah-search-result-item {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #f0f0f0;
}

.mah-search-result-item a {
    display: block;
    padding: 14px 0;
    text-decoration: none;
    color: #333;
    transition: color 0.2s ease;
}

.mah-search-result-item a:hover {
    color: rgb(var(--mdui-color-primary-light));
}

.mah-search-result-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

/* ---- Result sections (grouped by post type) ---- */
.mah-search-section {
    margin-bottom: 20px;
}

.mah-search-section-title {
    margin: 0 0 8px;
    padding: 8px 0;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgb(var(--mdui-color-primary-light));
    border-bottom: 2px solid rgb(var(--mdui-color-primary-light));
    font-family: trade-gothic-next, sans-serif;
}

.mah-search-section[data-type="locations"] .mah-search-section-title {
    color: rgb(var(--mdui-color-golden-ale));
    border-bottom-color: rgb(var(--mdui-color-golden-ale));
}

.mah-search-result-desc {
    display: block;
    font-size: 13px;
    color: #777;
    line-height: 1.4;
}

.mah-search-no-results {
    color: #888;
    font-size: 14px;
    text-align: center;
    padding: 24px 0;
}

/* ---- Loading spinner ---- */
.mah-search-loading {
    text-align: center;
    padding: 24px 0;
    color: #999;
    font-size: 14px;
}


/* ---- Responsive ---- */
@media (max-width: 1249px) {
    .mobile-header-trigger-wrapper {
        display: flex;
    }
    .mobile-header-trigger-wrapper .mah-search-trigger {
        margin-right: 10px;
    }
}
@media (max-width: 500px) {
    .mah-search-panel {
        width: 100vw;
        max-width: 100vw;
    }
    .mah-search-title {
        font-size: 24px;
    }
    .mah-search-description {
        font-size: 14px;
    }
}

