/* ─── Glance Live Search — Modern UI ─── */

/* Wrapper */
.glse-search-wrapper {
    max-width: 100%;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    position: relative;
    color-scheme: light;

    /* ── Default variables (overridden by admin inline CSS) ── */
    --glse-primary: #123375;
    --glse-primary-rgb: 18, 51, 117;
    --glse-bar-height: 52px;
    --glse-bar-bg: #f4f4f5;
    --glse-bar-bg-focus: #ffffff;
    --glse-border-width: 1px;
    --glse-border-color: #e5e7eb;
    --glse-radius: 14px;
    --glse-font-size: 15px;
    --glse-text-color: #18181b;
    --glse-placeholder-color: #a1a1aa;
    --glse-shadow: none;
    --glse-btn-bg: #123375;
    --glse-btn-hover: #0e2a5c;
    --glse-btn-color: #ffffff;
    --glse-btn-radius: 10px;
}

/* ─── Defensive reset: neutralizes theme and plugin overrides */
.glse-search-wrapper * {
    box-sizing: border-box;
}

/* Input: resets most common theme styles */
.glse-search-wrapper .glse-search-input {
    border: none !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 16px !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    color-scheme: light; 
}

/* Result links: prevents theme from overriding color and decoration.
 * Doubled selectors: .glse-results-container is portaled to document.body
 * in dropdown mode — no longer a child of .glse-search-wrapper. */
.glse-search-wrapper .glse-result-item,
.glse-search-wrapper .glse-result-item:hover,
.glse-search-wrapper .glse-result-item:visited,
.glse-search-wrapper .glse-result-item:focus,
.glse-results-container .glse-result-item,
.glse-results-container .glse-result-item:hover,
.glse-results-container .glse-result-item:visited,
.glse-results-container .glse-result-item:focus {
    color: inherit !important;
    text-decoration: none !important;
}

/* Result images: prevents max-width:100% and theme borders */
.glse-search-wrapper .glse-result-img,
.glse-results-container .glse-result-img {
    max-width: none !important;
    max-height: none !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 6px !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 44px !important;
    height: 44px !important;
    object-fit: cover !important;
}

/* Result section titles: prevents theme margins and borders */
.glse-search-wrapper .glse-section-title,
.glse-results-container .glse-section-title {
    border: none !important;
    background: none !important;
    margin: 0 !important;
}

/* Form: prevents theme from adding styles on form */
.glse-search-wrapper .glse-search-form {
    list-style: none !important;
}

/* ─── Theme defensive overrides ─────────────────────────────────────────────
 * Scoped rules that protect Glance elements from aggressive theme CSS.
 * !important is required to win against theme rules with high specificity.
 * ─────────────────────────────────────────────────────────────────────────── */

/* Wrapper — full width inside any theme container */
.glse-search-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Form — protect the flex row that holds category-select + input-group */
.glse-search-wrapper .glse-search-form {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* Input group — flex row that holds input + spinner + button */
.glse-search-wrapper .glse-input-group {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    flex: 1 1 0% !important;
    min-width: 0 !important;
    position: relative !important;
}

/* Input — prevent theme padding/height overrides that push siblings out */
.glse-search-wrapper .glse-search-input {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    height: 100% !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    box-sizing: border-box !important;
}

/* Button (inside mode) — stay inline, keep size and background */
.glse-search-wrapper .glse-search-btn {
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    clip: auto !important;
    clip-path: none !important;
    position: static !important;
    visibility: visible !important;
    opacity: 1 !important;
    overflow: visible !important;
    box-sizing: border-box !important;
}

/* Button (outside mode) — relative position for focus-ring overlay */
.glse-search-wrapper .glse-search-btn--outside {
    clip: auto !important;
    clip-path: none !important;
    position: relative !important;
    visibility: visible !important;
}

/* Outside-button wrapper — force flex so form + button sit side by side */
.glse-search-wrapper--btn-outside {
    display: flex !important;
    flex-wrap: nowrap !important;
}

/* ─── Category filter (bar, desktop only) ─── */
.glse-cat-select {
    flex-shrink: 0;
    height: 100%;
    padding: 0 28px 0 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--glse-text-color);
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none; /* L5: Firefox select reset */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    max-width: 160px;
}

.glse-cat-divider {
    flex-shrink: 0;
    width: 1px;
    height: 22px;
    background: var(--glse-border-color);
    opacity: .7;
    align-self: center;
}

/* hidden on mobile */
@media (max-width: 768px) {
    .glse-cat-select,
    .glse-cat-divider {
        display: none;
    }
}

/* ─── Inner positioner — anchors the dropdown to the form, not the wrapper ─── */
/* Prevents themes with flex headers from stretching the anchor height. */
.glse-search-inner {
    position: relative;
    width: 100%;
    flex: 1;
    min-width: 0;
}

/* ─── Form ─── */
.glse-search-form {
    display: flex;
    align-items: center;
    height: var(--glse-bar-height);
    border-radius: var(--glse-radius);
    background: var(--glse-bar-bg);
    border: var(--glse-border-width) solid var(--glse-border-color);
    box-shadow: var(--glse-shadow);
    overflow: hidden;
    transition: background .2s, border-color .25s, box-shadow .25s;
}

.glse-search-form:focus-within {
    background: var(--glse-bar-bg-focus);
}
/* Focus ring — enabled via --glse-focus-ring: 1 on .glse-search-wrapper */
.glse-search-wrapper--focus-ring .glse-search-form:focus-within {
    border-color: var(--glse-focus-ring-color, #3b82f6);
    box-shadow: 0 0 0 1px var(--glse-focus-ring-color, #3b82f6);
}
/* When button is outside, extend focus ring to include the button.
 * .glse-search-inner:focus-within ~ .glse-search-btn--outside targets
 * the sibling button when the form inside .glse-search-inner has focus. */
.glse-search-wrapper--focus-ring.glse-search-wrapper--btn-outside .glse-search-form:focus-within {
    box-shadow: none;
    border-color: var(--glse-focus-ring-color, #3b82f6);
}
.glse-search-wrapper--focus-ring.glse-search-wrapper--btn-outside .glse-search-inner:focus-within ~ .glse-search-btn--outside {
    border-color: var(--glse-focus-ring-color, #3b82f6) !important;
    box-shadow: 0 0 0 1px var(--glse-focus-ring-color, #3b82f6);
}

/* ─── Input group ─── */
.glse-input-group {
    display: flex;
    flex: 1;
    align-items: center;
    min-width: 0;
    position: relative;
}

/* ─── Input ─── */
.glse-search-input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 16px;
    font-size: var(--glse-font-size);
    font-weight: 600;
    letter-spacing: .01em;
    border: none;
    outline: none;
    background: transparent;
    color: var(--glse-text-color);
    box-sizing: border-box;
}

.glse-search-input::placeholder {
    color: var(--glse-placeholder-color);
    font-weight: 600;
}

/* ─── Bouton recherche ─── */
/* Defensive button reset: prevents themes/plugins from overriding styles */
.glse-search-wrapper .glse-search-btn,
.glse-search-wrapper .glse-search-btn:hover,
.glse-search-wrapper .glse-search-btn:focus,
.glse-search-wrapper .glse-search-btn:active {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.glse-search-btn {
    flex-shrink: 0 !important;
    width: 48px !important;
    height: calc(var(--glse-bar-height) - 12px) !important;
    margin: 6px 6px 6px 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    border-style: none !important;
    border-width: 0 !important;
    border-radius: var(--glse-btn-radius) !important;
    background: var(--glse-btn-bg) !important;
    color: var(--glse-btn-color) !important;
    cursor: pointer !important;
    transition: filter .15s, transform .1s !important;
    padding: 0 !important;
    font-size: inherit !important;
    font-family: inherit !important;
    font-weight: normal !important;
    line-height: 1 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    min-height: auto !important;
    min-width: auto !important;
    overflow: visible !important;
}

.glse-search-wrapper .glse-search-btn svg {
    width: 22px !important;
    height: 22px !important;
    stroke-width: 2.2 !important;
    fill: none !important;
    stroke: var(--glse-btn-color, #ffffff) !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    max-height: none !important;
    transform: none !important;
    transition: none !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    overflow: visible !important;
    position: static !important;
}
/* Protect SVG child elements from theme fill overrides */
.glse-search-wrapper .glse-search-btn svg * {
    fill: none !important;
    stroke: inherit !important;
}
.glse-search-wrapper .glse-search-btn:not(.glse-search-btn--text) svg {
    display: block !important;
}
.glse-search-wrapper .glse-search-btn.glse-search-btn--text svg {
    display: none !important;
}

.glse-search-wrapper .glse-search-btn:hover {
    background: var(--glse-btn-hover) !important;
    color: var(--glse-btn-color) !important;
    border: none !important;
    border-color: transparent !important;
}

.glse-search-wrapper .glse-search-btn:active {
    transform: scale(.95) !important;
}

/* ─── Bouton mode texte (desktop: text visible, icon hidden / mobile: icon only) ─── */
.glse-search-btn--text {
    width: auto !important;
    padding: 0 18px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    letter-spacing: .01em !important;
    white-space: nowrap !important;
}
.glse-search-btn--text .glse-btn-icon {
    display: none !important;
}
.glse-search-btn--text .glse-btn-label {
    display: inline !important;
}

/* Spinner offset when button is in text mode (wider) */
.glse-input-group:has(.glse-search-btn--text) .glse-search-spinner {
    right: 120px;
}

/* ─── Spinner ─── */
.glse-search-spinner {
    position: absolute;
    right: 62px;
    width: 16px;
    height: 16px;
    border: 2px solid #d4d4d8;
    border-top-color: var(--glse-primary);
    border-radius: 50%;
    display: none;
    animation: glse-spin .55s linear infinite;
    pointer-events: none;
}

.glse-search-spinner.active {
    display: block;
}

@keyframes glse-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ─── Hint message ─── */
.glse-hint-message {
    padding: 20px 16px;
    text-align: center;
    color: var(--glse-placeholder-color);
    font-size: 13px;
    line-height: 1.5;
}
.glse-hint-message--error {
    color: #dc2626;
}

/* ─── Highlight ─── */
.glse-highlight {
    background: rgba(var(--glse-primary-rgb), .12);
    color: inherit;
    border-radius: 3px;
    padding: 1px 2px;
}

/* ─── Results dropdown — "Clean Card" style ─── */
.glse-results-container {
    position: absolute;
    box-sizing: border-box;
    background: #ffffff;
    border: none;
    border-radius: 2px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .08);
    max-height: 70vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 999999;
    text-align: left;
    color-scheme: light;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .12s ease, visibility .12s;
    padding: 4px 0;
}

.glse-results-container.glse-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* When results are open, elevate the wrapper above other page elements */
.glse-has-results {
    position: relative;
    z-index: 99990;
}

/* ─── Item ─── */
.glse-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    min-height: 44px;
    text-decoration: none;
    color: inherit;
    border-radius: 0;
}

.glse-result-item:hover,
.glse-result-item.glse-active {
    background: #fafafa;
}

/* ─── Image ─── */
.glse-result-img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: #f5f5f5;
}

/* ─── Info ─── */
.glse-result-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.glse-result-title {
    font-weight: 600;
    font-size: 14px;
    color: #1a1a1a;
    line-height: 1.35;
}

/* ─── Meta (SKU + rating — sous le titre) ─── */
.glse-result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.glse-result-sku {
    font-size: 11px;
    color: #999;
    font-weight: 400;
    white-space: nowrap;
}

.glse-result-rating {
    font-size: 11px;
    color: #f59e0b;
    font-weight: 500;
    white-space: nowrap;
}

/* ─── Price block (right end) ─── */
.glse-result-price-block {
    flex-shrink: 0;
    display: flex;
    align-items: flex-end;
    text-align: right;
    margin-left: auto;
    padding-left: 12px;
}

.glse-result-price {
    text-align: right;
}

/* Prix unique */
.glse-result-price-block .glse-result-price {
    font-size: 13px;
    color: #555 !important;
    font-weight: 500;
}
.glse-result-price-block .glse-result-price * {
    font-size: inherit;
    color: inherit !important;
    font-weight: inherit;
}

/* Strikethrough price */
.glse-result-price-block .glse-result-price del {
    display: block;
    font-size: 11px;
    color: #bbb !important;
    font-weight: 400;
    text-decoration: line-through;
    line-height: 1.3;
}
.glse-result-price-block .glse-result-price del * {
    display: inline;
    font-size: inherit;
    color: inherit !important;
    font-weight: inherit;
    text-decoration: inherit;
}

/* Prix promo */
.glse-result-price-block .glse-result-price ins {
    display: block;
    text-decoration: none;
    font-size: 13px;
    color: #555 !important;
    font-weight: 500;
    line-height: 1.3;
}
.glse-result-price-block .glse-result-price ins * {
    display: inline;
    font-size: inherit;
    color: inherit !important;
    font-weight: inherit;
    text-decoration: none;
}

/* ─── No results ─── */
.glse-no-results {
    padding: 32px 16px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* ─── Sections ─── */
.glse-section+.glse-section {
    border-top: 1px solid #f0f0f0;
    margin-top: 4px;
    padding-top: 4px;
}

.glse-section-title {
    padding: 8px 16px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #999;
    pointer-events: none;
}

/* ─── Tags ─── */
.glse-tag-icon {
    flex-shrink: 0;
    color: #bbb;
}

.glse-result-tag .glse-result-info {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* ─── Categories ─── */
.glse-result-count {
    font-size: 11px;
    color: #bbb;
    font-weight: 400;
}

.glse-result-category .glse-result-info {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* ─── Mobile ─── */
@media (max-width: 768px) {

    .glse-search-form {
        border-radius: calc(var(--glse-radius) * .75);
    }

    .glse-search-input {
        padding: 0 12px;
        font-size: max(var(--glse-font-size), 16px); /* prevent iOS zoom on < 16px */
    }

    .glse-search-btn {
        width: 44px !important;
        min-height: 44px !important;
        margin: 2px 2px 2px 0 !important;
    }

    /* Text button → icon-only on mobile (text takes too much space) */
    .glse-search-wrapper .glse-search-btn.glse-search-btn--text .glse-btn-label {
        display: none !important;
    }
    .glse-search-wrapper .glse-search-btn.glse-search-btn--text svg {
        display: block !important;
    }
    .glse-search-wrapper .glse-search-btn.glse-search-btn--text {
        width: 44px !important;
        padding: 0 !important;
    }

    .glse-input-group:has(.glse-search-btn--text) .glse-search-spinner {
        right: 56px; /* same as icon button */
    }

    .glse-search-btn svg {
        width: 16px;
        height: 16px;
    }

    .glse-search-spinner {
        right: 56px;
    }

    /* Generic mobile results */
    .glse-results-container {
        max-height: 65vh;
    }

    /* Mobile dropdown: visual adjustments (position:fixed already default) */
    .glse-search-wrapper[data-glse-mode="dropdown"] .glse-results-container {
        border-radius: 0;
        max-height: 60vh;
    }

    /* Open bar on mobile: bottom corners → 0, same behavior as desktop */
    .glse-result-item {
        padding: 10px 14px;
        gap: 10px;
        min-height: 50px;
    }

    .glse-result-img {
        width: 40px;
        height: 40px;
    }

    .glse-result-title {
        font-size: 13px;
    }
}

/* ─── Petit mobile ─── */
@media (max-width: 380px) {

    .glse-search-input {
        padding: 0 10px;
    }

    .glse-search-btn {
        width: 38px;
    }
}

/* Prevent body scroll while mobile overlay open */
body.glse-body--overlay-open {
    overflow: hidden;
}

/* ══════════════════════
   HISTORIQUE DE RECHERCHE
   ══════════════════════ */

.glse-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px 4px;
}

.glse-history-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #71717a;
}

.glse-search-wrapper .glse-history-clear,
.glse-search-wrapper .glse-history-clear:hover,
.glse-search-wrapper .glse-history-clear:focus,
.glse-results-container .glse-history-clear,
.glse-results-container .glse-history-clear:hover,
.glse-results-container .glse-history-clear:focus {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.glse-history-clear {
    font-size: 11px;
    font-weight: 500;
    color: var(--glse-primary, #123375);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background .12s;
}

.glse-history-clear:hover {
    background: rgba(var(--glse-primary-rgb, 18, 51, 117), .08) !important;
}

.glse-history-item {
    cursor: pointer;
    gap: 10px;
}

.glse-history-icon {
    flex-shrink: 0;
    color: #a1a1aa;
}

.glse-history-term {
    font-size: 14px;
    font-weight: 400;
    color: var(--glse-text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ══════════════════════
   VOIR TOUS LES RÉSULTATS
   ══════════════════════ */

.glse-view-all {
    border-top: 1px solid #e4e4e7;
    padding: 0;
}

.glse-search-wrapper .glse-view-all-link,
.glse-search-wrapper .glse-view-all-link:hover,
.glse-search-wrapper .glse-view-all-link:visited,
.glse-search-wrapper .glse-view-all-link:focus,
.glse-results-container .glse-view-all-link,
.glse-results-container .glse-view-all-link:hover,
.glse-results-container .glse-view-all-link:visited,
.glse-results-container .glse-view-all-link:focus {
    color: #888 !important;
    text-decoration: none !important;
}

.glse-view-all-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 400;
}

.glse-view-all-link:hover {
    color: #1a1a1a !important;
    background: #fafafa;
}

.glse-view-all-link svg {
    flex-shrink: 0;
    opacity: .5;
    width: 14px;
    height: 14px;
}

.glse-view-all-link:hover svg {
    opacity: .8;
}

/* ══════════════════════
   RECOMMANDATIONS
   ══════════════════════ */

.glse-section-title--reco {
    color: var(--glse-primary);
}

.glse-result-reco {
    position: relative;
}


/* ══════════════════════
   BOUTON EXTÉRIEUR
   ══════════════════════ */

.glse-search-wrapper--btn-outside {
    display: flex;
    align-items: stretch;
    gap: 0;
    position: relative; /* ancre le dropdown sur toute la largeur (form + bouton) */
    height: var(--glse-bar-height); /* required: top:100% on absolute resolved against this height */
}

/* Inner takes flex so form and outside button align */
/* position:static delegates positioning context to wrapper */
.glse-search-wrapper--btn-outside .glse-search-inner {
    flex: 1;
    min-width: 0;
    position: static;
}

/* Le form perd ses coins droits et sa bordure droite pour fusionner avec le bouton */
.glse-search-wrapper--btn-outside .glse-search-form {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

/* Button takes same height as form, right corners aligned with form */
.glse-search-btn--outside {
    flex-shrink: 0 !important;
    height: auto !important;
    align-self: stretch !important;
    width: auto !important;
    padding: 0 22px !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border-top-right-radius: var(--glse-radius) !important;
    border-bottom-right-radius: var(--glse-radius) !important;
    transition: border-color .25s, box-shadow .25s !important;
}

/* Spinner : pas de bouton dans le form → coller au bord droit */
.glse-search-wrapper--btn-outside .glse-search-spinner {
    right: 16px;
}

@media (max-width: 768px) {
    .glse-search-btn--outside {
        padding: 0 16px !important;
    }
}

/* ══════════════════════════════════════════════════════
   MOBILE OVERLAY (full-screen on small screens)
   ══════════════════════════════════════════════════════ */

.glse-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    background: #ffffff;
    flex-direction: column;
}

.glse-mobile-overlay.glse-mobile-overlay--open {
    display: flex;
    animation: glse-mo-in .2s ease-out;
}

@keyframes glse-mo-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.glse-mobile-overlay-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Header: search bar + close */
.glse-mobile-overlay-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #e4e4e7;
    flex-shrink: 0;
    background: #ffffff;
}

.glse-mobile-overlay-header .glse-search-form {
    flex: 1;
    border: none;
    box-shadow: none;
    background: #f4f4f5;
    height: 44px;
    border-radius: 10px;
}

.glse-mobile-overlay-header .glse-search-form:focus-within {
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(var(--glse-primary-rgb, 18, 51, 117), .25);
}

.glse-mobile-overlay-header .glse-search-input {
    font-size: 16px !important;
}

.glse-mobile-overlay-header .glse-search-spinner {
    right: 12px;
}

.glse-mobile-overlay-close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #f4f4f5;
    color: #71717a;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .12s, color .12s;
    -webkit-appearance: none;
    appearance: none;
}

.glse-mobile-overlay-close:hover {
    background: #e4e4e7;
    color: #18181b;
}

/* Category select in mobile overlay */
.glse-mobile-overlay-cat {
    display: block;
    width: calc(100% - 24px);
    margin: 8px 12px;
    padding: 8px 28px 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--glse-text-color, #18181b);
    background: #f4f4f5;
    border: 1px solid #e4e4e7;
    border-radius: 8px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    flex-shrink: 0;
}

/* Results: fill remaining space */
.glse-mobile-overlay-results {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    max-height: none !important;
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    animation: none !important;
}

.glse-mobile-overlay-results.glse-visible {
    display: block;
}

/* Safe area for notched phones */
@supports (padding-top: env(safe-area-inset-top)) {
    .glse-mobile-overlay-header {
        padding-top: calc(8px + env(safe-area-inset-top));
    }
    .glse-mobile-overlay-results {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .glse-results-container,
    .glse-result-item,
    .glse-search-input,
    .glse-search-btn,
    .glse-cat-select,
    .glse-view-all,
    .glse-mobile-overlay,
    .glse-search-spinner {
        transition-duration: 0s !important;
        animation-duration: 0s !important;
    }
}

