/* Buscador siempre visible (todas las tiendas). Computadora: en el encabezado, en lugar de la lupa.
   Celular (≤768px): fila de ancho completo debajo del encabezado. JS: shared/js/dp-store-search.js.
   Ver docs/BUSCADOR-TIENDAS.md. Colores neutros a propósito: se lee igual sobre encabezados claros u oscuros. */
.dp-hsearch { position: relative; margin: 0; padding: 0; min-width: 0; }
.dp-hsearch__box {
    display: flex; align-items: center; width: 100%; height: 40px; margin: 0;
    background: #fff; border: 1px solid rgba(15, 23, 42, .18); border-radius: 999px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06); overflow: hidden; box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
}
.dp-hsearch__box:focus-within { border-color: rgba(15, 23, 42, .45); box-shadow: 0 0 0 3px rgba(59, 130, 246, .18); }
html body .site-header .dp-hsearch input.dp-hsearch__input,
.dp-hsearch input.dp-hsearch__input {
    flex: 1 1 auto; min-width: 0; width: 100%; height: 100%; margin: 0; padding: 0 4px 0 16px;
    border: 0 !important; outline: 0 !important; box-shadow: none !important; background: transparent !important;
    color: #111827 !important; font: inherit; font-size: 16px !important; line-height: 1.2; letter-spacing: normal;
    text-transform: none; -webkit-appearance: none; appearance: none; border-radius: 0;
}
.dp-hsearch input.dp-hsearch__input::placeholder { color: #6b7280 !important; opacity: 1; }
.dp-hsearch input.dp-hsearch__input::-webkit-search-decoration,
.dp-hsearch input.dp-hsearch__input::-webkit-search-results-button { -webkit-appearance: none; }
html body .site-header .dp-hsearch button.dp-hsearch__btn,
.dp-hsearch button.dp-hsearch__btn {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 100%; min-width: 44px; margin: 0; padding: 0;
    border: 0 !important; border-left: 1px solid rgba(15, 23, 42, .12) !important; border-radius: 0 !important;
    background: transparent !important; color: #374151 !important; cursor: pointer; font-size: 15px; box-shadow: none !important;
}
.dp-hsearch button.dp-hsearch__btn:hover { background: #f3f4f6 !important; }
.dp-hsearch button.dp-hsearch__btn i { color: inherit !important; }

/* Computadora: en la barra del encabezado. */
.dp-hsearch--inline { flex: 0 1 auto; width: clamp(170px, 15vw, 260px); margin-right: 4px; }

/* Celular: fila debajo del encabezado (oculta en computadora). */
.dp-hsearch-band { display: none; }
@media (max-width: 768px) {
    /* themes/base.css fija .site-header { height: var(--header-height) } (80px): con la fila tiene que crecer. */
    html body header.site-header.store-header { height: auto !important; min-height: var(--header-height, 0px); padding-bottom: 10px !important; }
    html body .site-header .dp-hsearch--inline { display: none !important; }
    html body .site-header .dp-hsearch-band {
        display: block !important; width: 100%; box-sizing: border-box; padding: 8px 12px 0;
        background: transparent; position: relative; z-index: 5;
    }
    .dp-hsearch-band .dp-hsearch { max-width: 640px; margin: 0 auto; }
    .dp-hsearch-band .dp-hsearch__box { height: 44px; }
}

/* Sugerencias mientras se escribe. */
.dp-hsearch__list {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 3000; margin: 0; padding: 6px 0;
    list-style: none; background: #fff; color: #111827; border: 1px solid rgba(15, 23, 42, .12); border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .18); max-height: min(70vh, 460px); overflow-y: auto;
    -webkit-overflow-scrolling: touch; text-align: left;
}
.dp-hsearch--inline .dp-hsearch__list { left: auto; width: max(100%, 380px); max-width: calc(100vw - 24px); }
.dp-hsearch__list[hidden] { display: none !important; }
html body .dp-hsearch__list a.dp-hsearch__item {
    display: flex; align-items: center; gap: 10px; padding: 8px 14px; margin: 0; min-height: 44px; box-sizing: border-box;
    color: #111827 !important; text-decoration: none !important; font-size: 14px; line-height: 1.3; font-weight: 400;
    text-transform: none; letter-spacing: normal; background: transparent; border: 0;
}
html body .dp-hsearch__list a.dp-hsearch__item:hover,
html body .dp-hsearch__list a.dp-hsearch__item.is-active { background: #f3f4f6 !important; }
.dp-hsearch__thumb {
    flex: 0 0 40px; width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: #f3f4f6; display: block;
}
.dp-hsearch__thumb--empty { display: inline-flex; align-items: center; justify-content: center; color: #9ca3af; font-size: 14px; }
.dp-hsearch__text { flex: 1 1 auto; min-width: 0; }
.dp-hsearch__name { display: block; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dp-hsearch__name mark { background: transparent; color: inherit; font-weight: 700; padding: 0; }
.dp-hsearch__sku { display: block; margin-top: 2px; font-size: 12px; color: #6b7280; }
html body .dp-hsearch__list a.dp-hsearch__item--all { border-top: 1px solid #eef0f3; margin-top: 4px; padding-top: 10px; color: #1d4ed8 !important; font-weight: 600; }
.dp-hsearch__item--all i { width: 40px; text-align: center; color: #6b7280; }
.dp-hsearch__empty { padding: 10px 14px; color: #6b7280; font-size: 14px; }

/* Página de resultados: sin zoom automático en iPhone. */
.storefront-page form[action="buscar.php"] input[name="q"] { font-size: 16px; }
