/* ── Bazar Search Widget ───────────────────────────────────────────── */
.bazar-search-wrapper {
    position: relative;
    flex-grow: 1;
    width: 100%;
    max-width: 640px;
}

.bazar-search-inner {
    position: relative;
    display: flex;
    align-items: center;
}

.bazar-search-input {
    width: 100%;
    height: 42px;
    padding: 0 72px 0 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    color: #1a1a1a;
    line-height: 1.4;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none;
    appearance: none;
}
.bazar-search-input::-webkit-search-cancel-button { display: none; }
.bazar-search-input::placeholder { color: #999; }
.bazar-search-input:focus {
    border-color: #f0a500;
    box-shadow: 0 0 0 3px rgba(240,165,0,.15);
}

/* Icono lupa */
.bazar-search-icon {
    position: absolute;
    right: 36px;
    color: #999;
    display: flex;
    align-items: center;
    pointer-events: none;
}
.bazar-search-input:focus ~ .bazar-search-icon { color: #f0a500; }

/* Botón clear */
.bazar-search-clear {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #aaa;
    display: flex;
    align-items: center;
    border-radius: 50%;
    transition: color .15s, background .15s;
}
.bazar-search-clear:hover { color: #333; background: #f5f5f5; }

/* ── Dropdown ──────────────────────────────────────────────────────── */
.bazar-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,.12);
    z-index: 99999;
    overflow: hidden;
    max-height: 480px;
    overflow-y: auto;
    scroll-behavior: smooth;
}
.bazar-search-results[hidden] { display: none; }

/* Resultado individual */
.bazar-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f5f5f5;
    transition: background .12s;
}
.bazar-result-item:last-of-type { border-bottom: none; }
.bazar-result-item:hover,
.bazar-result-item.is-active {
    background: #fdf6e3;
}

/* Thumbnail */
.bazar-result-thumb {
    flex-shrink: 0;
    width: 46px;
    height: 62px;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bazar-result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.bazar-result-thumb-placeholder {
    width: 100%;
    height: 100%;
    background: #ececec;
}

/* Info */
.bazar-result-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.bazar-result-title {
    font-size: 13px;
    font-weight: 500;
    color: #1a1a1a;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bazar-result-title mark {
    background: none;
    color: #f0a500;
    font-weight: 700;
}
.bazar-result-price {
    font-size: 13px;
    font-weight: 700;
    color: #f0a500;
}

/* Ver todos */
.bazar-result-all {
    display: block;
    padding: 11px 14px;
    font-size: 13px;
    color: #555;
    text-decoration: none;
    text-align: center;
    background: #fafafa;
    border-top: 1px solid #efefef;
    transition: background .12s;
}
.bazar-result-all:hover { background: #f0f0f0; color: #111; }
.bazar-result-all strong { color: #1a1a1a; }

/* Sin resultados */
.bazar-no-results {
    padding: 16px 14px;
    font-size: 13px;
    color: #777;
    text-align: center;
}
.bazar-no-results strong { color: #1a1a1a; }

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .bazar-search-results {
        position: fixed;
        top: auto;
        left: 8px;
        right: 8px;
        bottom: auto;
        max-height: 60vh;
    }
}

/* Elevar el nav contenedor para que el dropdown supere el menú */
nav.st-extra-menu {
    z-index: 99999 !important;
    position: relative;
    flex-grow: 1;
}

/* Centrar y dimensionar el trigger de búsqueda */
#menu-extras {
    width: 100% !important;
}
#menu-item-75447 {
    width: 100% !important;
}
.bazar-search-trigger-wrap {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}
.bazar-search-trigger {
    width: 100%;
    max-width: 600px;
}

/* Asegurar que el dropdown siempre gane al submenú */
#bazar-search-results {
    z-index: 9999999 !important;
}
