/* Inline header search (no modal) */
.wp-block-noyona-search-expand {
    display: inline-flex;
    align-items: center;
}

.search-inline-form {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
}

.search-inline-input {
    /* width: clamp(150px, 16vw, 220px); */
    -webkit-appearance: none;
    appearance: none;
    border: 0;
    border-bottom: 1px solid #e6c7ce;
    border-radius: 0;
    background: transparent;
    background-image: none !important;
    padding: 0.35rem 0;
    font-size: 0.88rem;
    line-height: 1.1;
    color: #1f1f1f;
    outline: none;
}

.search-inline-input::-webkit-search-decoration,
.search-inline-input::-webkit-search-cancel-button,
.search-inline-input::-webkit-search-results-button,
.search-inline-input::-webkit-search-results-decoration {
    display: none;
    -webkit-appearance: none;
}

.search-inline-input::placeholder {
    color: #d9a2ad;
    opacity: 1;
}

.search-inline-submit {
    border: 0;
    background: transparent;
    color: #e199a4;
    cursor: pointer;
}

/* Prevent third-party/icon-font pseudo-elements from injecting wrong icons. */
.search-inline-submit::before,
.search-inline-submit::after {
    content: none !important;
    display: none !important;
}

.search-inline-submit:hover {
    background: rgba(144, 30, 88, 0.08);
}

/* Keep the search icon visually beside wishlist icon */
.search-inline-form .search-inline-submit {
    margin-right: 0.05rem;
}

@media (max-width: 500px) {
    .search-inline-form {
        position: static;
    }

    .search-inline-input {
        display: block;
        position: fixed;
        top: calc(var(--noyona-header-total-offset, 72px) + 8px);
        left: 12px;
        right: 12px;
        width: auto;
        min-width: 0;
        margin: 0;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-6px);
        padding: 0.65rem 0.95rem;
        border: 1px solid #f0d5db;
        border-radius: 999px;
        background: #fff;
        color: #1f1f1f;
        font-size: 0.88rem;
        line-height: 1.2;
        box-shadow: 0 10px 26px rgba(0, 0, 0, 0.10);
        z-index: 2100;
        transition: opacity 0.18s ease, transform 0.18s ease;
    }

    .search-inline-form.is-mobile-expanded .search-inline-input {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }
}

/* Legacy overlay UI disabled */
.search-expand-overlay,
.search-expand-container,
.search-expand-results,
.search-expand-footer {
    display: none !important;
}

/* Base Trigger */
.search-expand-trigger {
    background: transparent;
    border: 0;
    border-bottom: 1px solid #e6c7ce;
    border-radius: 0;
    cursor: pointer;
    font-size: 1rem;
    color: #d9a2ad;
    padding: 0.35rem 0 0.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    min-width: clamp(170px, 18vw, 240px);
}

.search-expand-trigger:focus,
.search-expand-trigger:active {
    outline: none;
    box-shadow: none;
}

.search-expand-trigger:focus-visible {
    outline: 2px solid rgba(225, 153, 164, 0.7);
    outline-offset: 3px;
}

.search-expand-trigger:hover {
    border-bottom-color: #e199a4;
    color: #e199a4;
}

.search-expand-trigger-text {
    font-size: 0.9rem;
    line-height: 1;
    white-space: nowrap;
    color: currentColor;
}

.search-expand-trigger i {
    font-size: 0.95rem;
    color: currentColor;
}

/* Overlay — full-screen click-catcher + (optional) backdrop */
.search-expand-overlay {
    position: fixed;
    inset: 0;
    height: 100dvh;
  
    /* Optional: add a soft backdrop to avoid “floating white box” look */
    background: rgba(0, 0, 0, 0.10);
  
    /* Use padding only for horizontal safe space */
    padding-inline: clamp(8px, 2.5vw, 16px);
  
    display: flex;
    justify-content: center;
    align-items: flex-start;
  
    /* IMPORTANT: avoid ghost/glitch by using visibility too */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  
    transition: opacity 0.2s ease, visibility 0s linear 0.2s;
    z-index: 9999;
  }

  body.search-expand-open .search-expand-overlay {
    top: var(--noyona-header-total-offset, 96px);
    height: calc(100dvh - var(--noyona-header-total-offset, 96px));
  }
  
  .search-expand-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.2s ease;
  }
  
  /* Container */
  .search-expand-container {
    /* Put the spacing HERE (not as overlay padding-top) */
    margin-top: 20px;
  
    width: min(960px, calc(100vw - 24px));
    /* max-height: calc(100dvh - (var(--noyona-header-total-offset, 96px) + 24px)); */
  
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
  
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1rem 1.5rem 1.25rem;
  
    overflow: auto;
    overscroll-behavior: contain;
  
    /* Smooth pop-in */
    transform: translateY(-6px);
    transition: transform 0.2s ease;
  }
  
  .search-expand-overlay.is-open .search-expand-container {
    transform: translateY(0);
  }

/* Input Wrapper */
.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 0;
    border-bottom: 1px solid #e6c7ce;
    border-radius: 0;
    padding: 0.4rem 0;
    background: transparent;
}

.search-icon-input {
    font-size: 1rem;
    color: #d9a2ad;
}

.search-expand-input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 1rem;
    outline: none;
    color: #1f1f1f;
    font-family: inherit;
}

.search-expand-input::placeholder {
    color: #d9a2ad;
    opacity: 1;
}

.search-expand-close {
    background: transparent;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: #d9a2ad;
    transition: color 0.15s ease;
}

.search-expand-close:hover {
    color: #8b5a3c;
}

/* Remove default clear button */
.search-expand-input::-webkit-search-decoration,
.search-expand-input::-webkit-search-cancel-button,
.search-expand-input::-webkit-search-results-button,
.search-expand-input::-webkit-search-results-decoration {
    display: none;
    -webkit-appearance: none;
}

/* Results */
.search-expand-results {
    /* Removed fixed min-height to avoid empty space */
    min-height: 0;
}

.search-suggestions-group {
    display: grid;
    grid-template-columns: 1fr 1.8fr;
    gap: 1.5rem;
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

.suggestions-column h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #9a7d6a;
    margin-bottom: 0.75rem;
    letter-spacing: 0.04em;
}

.suggestions-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.suggestions-list li {
    margin-bottom: 0.65rem;
}

.suggestions-list a {
    text-decoration: none;
    color: #4b2f1e;
    font-size: 1rem;
    transition: color 0.15s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.suggestions-list a:hover {
    color: #8b5a3c;
}

.suggestion-thumb {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* Footer */
.search-expand-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eee;
    padding-top: 0.9rem;
    font-size: 0.9rem;
    color: #9a7d6a;
}

.view-all-results {
    color: #8b5a3c;
    text-decoration: underline;
}

.hidden {
    display: none !important;
}

/* Header pushes down slightly when search is open */
.search-expand-open header.wp-block-template-part {
    z-index: 12000;
}

/* Responsive */
@media (max-width: 800px) {
    .search-expand-container {
        margin-top: -100px;
        width: min(720px, 100%);
    }

    .search-suggestions-group {
        grid-template-columns: 1fr;
    }

    .search-expand-overlay {
        padding-top: calc(var(--noyona-header-total-offset, 72px) + 6px);
    }
}

@media (max-width: 540px) {
    .search-expand-trigger {
        min-width: 0;
        border-bottom: 0;
        padding: 0.5rem;
    }

    .search-expand-trigger-text {
        display: none;
    }

    .search-expand-container {
        padding: 0.9rem 1rem 1rem;
        border-radius: 14px;
    }

    .search-input-wrapper {
        padding-inline: 0.75rem;
    }
}
