/* Tienda y búsqueda: diseño suministrado, conectado al catálogo real. */
.store-controls, #store-filters-sidebar, .store-pagination { display: none; }
body.in-provider-store { background: #f8f9ff; }
body:is(.in-provider-store, .in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view, .exploring-providers) .main-header {
    top: 12px; width: min(1152px, calc(100% - 32px)); height: 60px;
    margin: 12px auto; padding: 10px 24px; gap: 16px;
    border: 1px solid #e2e8f0cc; border-radius: 999px;
    background: #fffffff2; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 6px -1px #0f172a12, 0 2px 4px -2px #0f172a12;
}
body:is(.in-provider-store, .in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view, .exploring-providers) .main-header .logo { padding: 0; }
body:is(.in-provider-store, .in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) .catalog-breadcrumb { display: none; }
body:is(.in-provider-store, .in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) #distributor-indicator {
    display: inline-flex !important; position: absolute; left: 50%; transform: translateX(-50%); margin: 0;
    width: auto; max-width: 48%; padding: 6px 12px; background: #f8fafc;
    border: 1px solid #e2e8f0; border-radius: 999px; gap: 8px;
}
body:is(.in-provider-store, .in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) #distributor-indicator::after { display: block; content: '⌄'; margin: 0; padding: 0; border: 0; font-size: 16px; color: #94a3b8; }
body:is(.in-provider-store, .in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) #distributor-indicator:hover { background: #f1f5f9; }
body:is(.in-provider-store, .in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) #provider-logo-header { display: none !important; }
body:is(.in-provider-store, .in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) #distributor-indicator .distributor-copy {
    flex-direction: row !important; align-items: center !important; gap: 8px; min-width: 0;
}
body:is(.in-provider-store, .in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) .viewing-label { font-size: 10px; color: #64748b; font-weight: 700; white-space: nowrap; letter-spacing: .5px; }
body:is(.in-provider-store, .in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) .distributor-name { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #0f172a; }
body:is(.in-provider-store, .in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) .distributor-name::before { content: ''; width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: #10b981; }
body:is(.in-provider-store, .in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) .sn-header-btn { flex-direction: row; background: transparent; border-color: transparent; padding: 4px 8px; }
body:is(.in-provider-store, .in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) .sn-header-txt { text-align: left; }
body:is(.in-provider-store, .in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) .sn-header-txt strong { order: 0; font-size: 13px; }
body:is(.in-provider-store, .in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) .sn-header-caret { display: block; }
body:is(.in-provider-store, .in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) .sn-header-btn > .sn-avatar-mini { border-radius: 50%; }
body:is(.in-provider-store, .in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) .sn-header { border-left: 1px solid #e2e8f0; padding-left: 12px; flex-shrink: 0; }
body.in-provider-store .marketplace-search { display: none; }
body.in-provider-store .store-controls, body.in-search-view .search-controls { top: 84px; }
/* Tienda (09/10): buscador arriba y chips de categoría debajo, sin panel
   lateral ni filtros de la pestaña Buscar. El orden lo da el HTML. */
body.in-provider-store .store-controls { display: block; position: static; width: calc(100% - 48px); max-width: 1232px; margin: 16px auto 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
body.in-provider-store .store-controls .search-controls-inner { padding: 0; }
body.in-provider-store .store-controls .search-controls-row { display: block; }
body.in-provider-store .store-controls :is(#store-toggle-filters, #store-result-count, .search-scope-row) { display: none; }
body.in-provider-store .storefront-filters .chip { min-height: 44px; padding: 10px 16px; font-size: 14px; }
body.in-provider-store .storefront-filters #sort-select { min-height: 44px; max-width: 160px; font-size: 14px; }
body.in-provider-store .catalog-meta :is(#catalog-product-count, #catalog-price-context, #storefront-conditions) { font-size: 14px; }
body.in-provider-store .store-layout { display: flex; align-items: flex-start; gap: 24px; max-width: 1280px; margin: auto; padding: 24px 32px 0; }
body.in-provider-store #store-filters-sidebar { display: none; }
body.in-provider-store #store-filters-sidebar[hidden] { display: none; }
.store-results { min-width: 0; }
body.in-provider-store .store-results { flex: 1; }
body.in-provider-store #view-tienda #grid {
    width: 100%; max-width: none; padding: 0; margin: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px;
}
body.in-provider-store .store-pagination { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid #e2e8f0; margin-top: 40px; padding: 24px 0 calc(150px + env(safe-area-inset-bottom)); }
#store-load-more { padding: 10px 18px; border: 1px solid #e2e8f0; border-radius: 999px; background: #fff; box-shadow: 0 1px 2px #0f172a05; color: #475569; font: inherit; font-size: 12px; cursor: pointer; }
#store-load-more::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: #0066ff; }
#store-load-more:hover { border-color: #0066ff; color: #0050cb; }
#store-search-input { width: 100%; min-width: 0; height: 48px; padding: 10px 44px; border: 1px solid #cbd5e1; border-radius: 14px; background: #fff; font: inherit; font-size: 16px; color: #0f172a; outline: none; }
#store-search-input:focus { background: #fff; border-color: #0066ff; box-shadow: 0 0 0 3px #0066ff18; }
#store-search-input::-webkit-search-cancel-button { display: none; }
#store-search-input::placeholder { color: #94a3b8; }
.store-controls button { font-family: inherit; }
.store-sort-label { display: flex; align-items: center; gap: 8px; color: #64748b; font-size: 11px; white-space: nowrap; }
#store-sort { max-width: 130px; border: 1px solid #e2e8f0; border-radius: 8px; padding: 6px; background: #fff; color: #334155; font: inherit; }
body:is(.in-provider-store, .in-search-view) .search-sidebar-title h2 { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }
body:is(.in-provider-store, .in-search-view) :is(#store-filter-count, #search-filter-count) { font-size: 10px; white-space: nowrap; padding: 3px 7px; background: #eff6ff; color: #0066ff; border: 1px solid #dbeafe; border-radius: 999px; }
body:is(.in-provider-store, .in-search-view) .search-sidebar > .search-reset { width: 100%; padding: 12px 8px; border: 1px solid #bfdbfe; border-radius: 12px; }
body:is(.in-provider-store, .in-search-view) .search-facet-options { gap: 10px; margin-top: 12px; }
body:is(.in-provider-store, .in-search-view) .search-facet-option { font-size: 12px; }
body:is(.in-provider-store, .in-search-view) .search-facet-option small { padding: 2px 5px; border: 1px solid #f1f5f9; border-radius: 4px; background: #f8fafc; }
body:is(.in-provider-store, .in-search-view) .search-filter-chip { background: #fff; font-size: 12px; }
body:is(.in-provider-store, .in-search-view) .search-provider-chip { background: #eff6ff; }
body:is(.in-provider-store, .in-search-view) :is(#grid, #search-grid) > .catalog-product.product-card { position: relative; padding: 16px; box-shadow: 0 2px 8px #0f172a05; }
body:is(.in-provider-store, .in-search-view) :is(#view-tienda, #view-buscar) :is(#grid, #search-grid) .catalog-product.product-card .card-toolbar { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 1; }
body:is(.in-provider-store, .in-search-view) :is(#view-tienda, #view-buscar) :is(#grid, #search-grid) .catalog-product.product-card .card-toolbar button svg { width: 20px; height: 20px; stroke-width: 1.7; }
body:is(.in-provider-store, .in-search-view) :is(#grid, #search-grid) .catalog-product.product-card .fav-btn-card { width: 36px; height: 36px; border-radius: 50%; background: #ffffffd9; box-shadow: 0 1px 2px #0f172a08; color: #94a3b8; }
body:is(.in-provider-store, .in-search-view) :is(#grid, #search-grid) .catalog-product.product-card .fav-btn-card.active { color: #0066ff; }
body:is(.in-provider-store, .in-search-view) :is(#view-tienda, #view-buscar) :is(#grid, #search-grid) .catalog-product.product-card .card-img-wrapper { height: 176px; background: #fff; margin-bottom: 12px; }
body:is(.in-provider-store, .in-search-view) :is(#view-tienda, #view-buscar) :is(#grid, #search-grid) .catalog-product.product-card .card-img-wrapper:has(img.loaded) { background: #fff; }
body:is(.in-provider-store, .in-search-view) :is(#view-tienda, #view-buscar) :is(#grid, #search-grid) .catalog-product.product-card .card-brand { font-size: 11px; color: #94a3b8; text-transform: uppercase; }
body:is(.in-provider-store, .in-search-view) :is(#view-tienda, #view-buscar) :is(#grid, #search-grid) .catalog-product.product-card .card-name { font-size: 14px; line-height: 20px; height: 40px; min-height: 40px; text-transform: uppercase; }
body:is(.in-provider-store, .in-search-view) :is(#view-tienda, #view-buscar) :is(#grid, #search-grid) .catalog-product.product-card .card-desc:empty { display: none; }
body:is(.in-provider-store, .in-search-view) .search-card-conservation { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; border-radius: 6px; font-size: 11px; font-weight: 700; margin-bottom: 12px; }
body:is(.in-provider-store, .in-search-view) .search-card-conservation.is-frozen { background: #f0f9ff; color: #0369a1; border-color: #bae6fd; }
body:is(.in-provider-store, .in-search-view) .search-card-conservation:empty { display: none; }
body:is(.in-provider-store, .in-search-view) :is(#view-tienda, #view-buscar) :is(#grid, #search-grid) .catalog-product.product-card .card-footer { border-top: 1px solid #f1f5f9; padding-top: 12px; }
body:is(.in-provider-store, .in-search-view) :is(#view-tienda, #view-buscar) :is(#grid, #search-grid) .catalog-product.product-card .card-price { font-size: 16px; }
body:is(.in-provider-store, .in-search-view) :is(#view-tienda, #view-buscar) :is(#grid, #search-grid) .catalog-product.product-card .card-actions { flex-direction: row; gap: 8px; border: 0; padding-top: 4px; }
body:is(.in-provider-store, .in-search-view) :is(#view-tienda, #view-buscar) :is(#grid, #search-grid) .catalog-product.product-card .qty-control { flex: 0 0 86px; width: 86px; height: 38px; background: #f1f5f9; border-radius: 12px; }
body:is(.in-provider-store, .in-search-view) :is(#view-tienda, #view-buscar) :is(#grid, #search-grid) .catalog-product.product-card .qty-btn { width: 26px; min-width: 26px; min-height: 38px; height: 38px; color: #475569; }
body:is(.in-provider-store, .in-search-view) :is(#view-tienda, #view-buscar) :is(#grid, #search-grid) .catalog-product.product-card .qty-input { width: 28px; }
body:is(.in-provider-store, .in-search-view) :is(#view-tienda, #view-buscar) :is(#grid, #search-grid) .catalog-product.product-card .btn-add-card { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: 1; min-width: 0; width: auto; height: auto; min-height: 38px; padding: 8px 6px; font-size: 12px; line-height: 16px; white-space: normal; }
body:is(.in-provider-store, .in-search-view) :is(#grid, #search-grid) .catalog-product .btn-add-card:not(.btn-added):not(.btn-agotado)::before {
    content: ''; width: 16px; height: 16px; flex-shrink: 0; background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3h2l3 12h10l3-9H6'/%3E%3Ccircle cx='10' cy='20' r='1'/%3E%3Ccircle cx='18' cy='20' r='1'/%3E%3C/svg%3E") center / contain no-repeat;
}
.bottom-nav :is(.cart-dot, .fav-badge) { top: -6px; right: -8px; width: auto; min-width: 17px; height: 17px; padding: 0 4px; border: 0; color: #fff; font-size: 10px; font-weight: 700; line-height: 17px; text-align: center; box-shadow: 0 1px 2px #0f172a12; }
body:is(.in-provider-store, .in-search-view) .bottom-nav .cart-dot { background: #0066ff; }
body:is(.in-provider-store, .in-search-view) .toast { bottom: calc(100px + env(safe-area-inset-bottom)); max-width: min(440px, calc(100% - 32px)); border: 1px solid #e2e8f0; border-radius: 999px; background: #fffffff2; color: #0f172a; box-shadow: 0 12px 30px #0f172a20; backdrop-filter: blur(16px); }
body:is(.in-provider-store, .in-search-view) .toast .toast-thumb { width: 38px; height: 38px; border-radius: 10px; object-fit: contain; background: #fff; }
body:is(.in-provider-store, .in-search-view) .toast .toast-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
body:is(.in-provider-store, .in-search-view) .toast .toast-action { white-space: nowrap; }
.toast:not(.show) { visibility: hidden; }
.toast.show { visibility: visible; }
.store-controls :is(button, input, select):focus-visible { outline: 2px solid #0066ff; outline-offset: 3px; }
@media (max-width: 1023px) {
    body.in-provider-store #view-tienda #grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.in-provider-store #store-filters-sidebar { width: 220px; }
}
@media (max-width: 767px) {
    body:is(.in-provider-store, .in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view, .exploring-providers) .main-header { width: calc(100% - 24px); padding-inline: 14px; gap: 8px; }
    body.exploring-providers .main-header { height: auto; min-height: 60px; border-radius: 24px; }
    body:is(.in-provider-store, .in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) #distributor-indicator { max-width: 42%; padding: 5px 8px; }
    body:is(.in-provider-store, .in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) .viewing-label { display: none; }
    body:is(.in-provider-store, .in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) .distributor-name { font-size: 10px; }
    body:is(.in-provider-store, .in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) .sn-header { margin-left: 0; }
    body:is(.in-provider-store, .in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) .sn-header-txt, body:is(.in-provider-store, .in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) .sn-header-caret { display: none; }
    body:is(.in-provider-store, .in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) .sn-header { padding-left: 8px; }
    body.in-provider-store .store-controls { top: 84px; }
    body.in-provider-store .store-layout { flex-direction: column; gap: 16px; padding: 16px; }
    body.in-provider-store #store-filters-sidebar { width: 100%; position: static; max-height: 360px; }
    body.in-provider-store .store-results { width: 100%; }
    body.in-provider-store #view-tienda #grid { gap: 12px; }
}
@media (max-width: 600px) {
    body.in-provider-store #view-tienda #grid { grid-template-columns: minmax(0, 1fr); }
    body:is(.in-provider-store, .in-search-view) :is(#view-tienda, #view-buscar) :is(#grid, #search-grid) .catalog-product.product-card .qty-control { flex-basis: 104px; width: 104px; height: 44px; }
    body:is(.in-provider-store, .in-search-view) :is(#view-tienda, #view-buscar) :is(#grid, #search-grid) .catalog-product.product-card .qty-btn { width: 34px; min-width: 34px; height: 44px; min-height: 44px; }
    body:is(.in-provider-store, .in-search-view) :is(#view-tienda, #view-buscar) :is(#grid, #search-grid) .catalog-product.product-card .btn-add-card { min-height: 44px; }
    body:is(.in-provider-store, .in-search-view) :is(#view-tienda, #view-buscar) :is(#grid, #search-grid) .catalog-product.product-card .qty-input { font-size: 16px; }
    body:is(.in-provider-store, .in-search-view) :is(#grid, #search-grid) .catalog-product.product-card .fav-btn-card { width: 44px; height: 44px; }
}

/* Hover de la imagen como en la propuesta; sin movimiento en pantallas táctiles. */
@media (hover: hover) and (pointer: fine) {
    body.in-provider-store #grid .catalog-product .card-img-wrapper img { transition: opacity .3s ease, transform .38s cubic-bezier(.2,.8,.2,1); }
    body.in-provider-store #grid .catalog-product:hover .card-img-wrapper img { transform: scale(1.045); }
}
@media (prefers-reduced-motion: reduce) {
    body.in-provider-store #grid .catalog-product:hover .card-img-wrapper img { transform: none; }
}

body:is(.in-provider-store, .in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) .main-header .logo { flex-shrink: 0; display: flex; align-items: center; gap: 2px; }
body.in-provider-store #store-conditions { border: 0; margin-top: 8px; padding: 8px; }
@media (max-width: 767px) {
    body:is(.in-provider-store, .in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) #distributor-indicator { position: static; transform: none; flex: 0 1 auto; margin-inline: auto; min-width: 0; }
    body:is(.in-provider-store, .in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) .distributor-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}


/* ── Tienda del proveedor, 09/10 (2): un solo ancho y zona fija ───────────────
   Cabecera, categorías, «Mostrando…» y la cuadrícula comparten el ancho de la
   píldora de la cabecera (el mismo que en Proveedores y Buscar), así que todo
   queda alineado por los mismos bordes. Solo con body.in-provider-store. */
body.in-provider-store { --tienda-ancho: min(1152px, calc(100% - 32px)); --tienda-cabecera-alto: 60px; }
@media (max-width: 767px) { body.in-provider-store { --tienda-ancho: calc(100% - 24px); } }

/* El buscador vive en la cabecera y solo se ve dentro de la tienda. */
.main-header .store-header-search { display: none; }
body.in-provider-store .store-controls { display: none; }
body.in-provider-store .main-header { width: var(--tienda-ancho); }
body.in-provider-store #distributor-indicator { position: static; transform: none; flex: 0 1 auto; max-width: 34%; margin: 0; }
body.in-provider-store .main-header .store-header-search {
    display: flex; position: relative; flex: 1 1 360px; min-width: 0; max-width: 448px; margin-inline: auto;
}
body.in-provider-store .main-header .store-header-search > svg { left: 14px; width: 16px; height: 16px; color: #64748b; }
body.in-provider-store .main-header #store-search-input {
    height: 40px; padding: 9px 40px 9px 38px; border: 1px solid #e2e8f0; border-radius: 999px;
    background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .05); font-size: 14px; font-weight: 500;
}
body.in-provider-store .main-header #store-search-input:focus { border-color: #0066ff; box-shadow: 0 0 0 3px #0066ff18; }
body.in-provider-store .main-header .store-header-search .search-clear-btn { right: 2px; height: 40px; width: 36px; }
body.in-provider-store .main-header .store-header-search:has(#store-search-input:placeholder-shown) .search-clear-btn { display: none; }

/* Zona fija: una franja blanca translúcida con desenfoque, a todo el ancho,
   desde arriba del todo hasta debajo de las categorías. La pinta ::before de
   las categorías (la cabecera queda por encima, z-index 1000); ::after
   repinta la píldora de las categorías encima de la franja. */
body.in-provider-store #view-tienda { overflow-x: clip; }
body.in-provider-store #view-tienda > .storefront-filters {
    position: sticky; top: calc(12px + var(--tienda-cabecera-alto) + 8px); z-index: 900;
    width: var(--tienda-ancho); max-width: none; margin: 16px auto 0; padding: 8px;
    flex-wrap: nowrap; border: 0; border-radius: 999px;
    background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
}
body.in-provider-store #view-tienda > .storefront-filters::before {
    content: ''; position: absolute; z-index: -1; pointer-events: none;
    top: -100vh; bottom: -8px; left: calc(50% - 50vw); width: 100vw;
    background: rgba(255, 255, 255, .78);
    backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border-bottom: 1px solid rgba(226, 232, 240, .8);
}
body.in-provider-store #view-tienda > .storefront-filters::after {
    content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    border: 1px solid #e2e8f0; border-radius: inherit; background: #fff;
    box-shadow: 0 4px 6px -1px #0f172a12, 0 2px 4px -2px #0f172a12;
}
body.in-provider-store #view-tienda > .storefront-filters #category-scroll { width: 100%; }

/* «Mostrando X productos» con el orden y las condiciones a la derecha. */
body:not(.exploring-providers).in-provider-store #view-tienda.active .catalog-meta {
    width: var(--tienda-ancho); max-width: none; margin: 0 auto; padding: 24px 0 12px; flex-wrap: wrap;
}
body.in-provider-store #view-tienda .catalog-meta .sort-filter-bar { display: flex; align-items: center; width: auto; margin: 0; padding: 0; }
body.in-provider-store #view-tienda .catalog-meta .sort-dropdown { width: auto; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
body.in-provider-store #view-tienda .catalog-meta #sort-select {
    min-height: 40px; max-width: 160px; padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 999px;
    background-color: #fff; color: #475569; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
body.in-provider-store #view-tienda .catalog-meta #storefront-conditions { min-height: 40px; border-radius: 999px; padding-inline: 14px; }

/* La cuadrícula, al mismo ancho, y 120 px libres al final para que el dock no
   tape la última fila. */
body.in-provider-store #view-tienda .store-layout {
    width: var(--tienda-ancho); max-width: none; margin: 0 auto; padding: 0 0 calc(120px + env(safe-area-inset-bottom));
}
body.in-provider-store #view-tienda .store-layout #grid { width: 100%; max-width: none; margin: 0; padding: 0; }
body.in-provider-store #view-tienda .store-pagination { margin-top: 24px; padding-bottom: 0; }



@media (max-width: 767px) {
    /* En móvil no cabe dentro de la píldora: va justo debajo, pegado a ella,
       como el buscador de la página de proveedores (compro-shell.css). */
    body.in-provider-store { --tienda-cabecera-alto: 112px; }
    body.in-provider-store .main-header.compro-topbar { margin-bottom: 64px; }
    body.in-provider-store #distributor-indicator { flex: 1 1 auto; max-width: none; }
    body.in-provider-store .main-header .store-header-search {
        position: absolute; top: calc(100% + 8px); left: 0; right: 0; max-width: none; margin: 0;
    }
    body.in-provider-store .main-header #store-search-input { height: 44px; font-size: 16px; box-shadow: 0 4px 6px -1px #0f172a12; }
    body.in-provider-store .main-header .store-header-search .search-clear-btn { height: 44px; }
    body.in-provider-store #view-tienda > .storefront-filters { margin-top: 0; padding: 6px; }
    body:not(.exploring-providers).in-provider-store #view-tienda.active .catalog-meta { padding: 16px 0 10px; gap: 8px; }
    body.in-provider-store #view-tienda .catalog-meta-context { width: 100%; justify-content: flex-start; }
    body.in-provider-store #view-tienda .catalog-meta-context #catalog-price-context { flex-basis: 100%; }
}

/* ── La misma cabecera en Buscar, Favoritos, Pedidos y Cuenta (09/10) ─────────
   Logo · selector de proveedor · buscador · usuario, con el ancho y la píldora
   de la tienda. El buscador de aquí busca productos en Buscar (script.js). */
.main-header .app-header-search { display: none; }
body:is(.in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) .main-header #distributor-indicator {
    position: static; transform: none; flex: 0 1 auto; max-width: 34%; margin: 0;
}
body:is(.in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) .main-header .app-header-search {
    display: flex; position: relative; flex: 1 1 360px; min-width: 0; max-width: 448px; margin-inline: auto;
}
body:is(.in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) .main-header .app-header-search > svg { left: 14px; width: 16px; height: 16px; color: #64748b; }
body:is(.in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) .main-header #header-search-input {
    width: 100%; min-width: 0; height: 40px; padding: 9px 16px 9px 38px; border: 1px solid #e2e8f0; border-radius: 999px;
    background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .05); color: #0f172a; font: inherit; font-size: 14px; font-weight: 500; outline: none;
}
body:is(.in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) .main-header #header-search-input:focus { border-color: #0066ff; box-shadow: 0 0 0 3px #0066ff18; }
.main-header #header-search-input::-webkit-search-cancel-button { display: none; }
body:is(.in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) .main-header #header-search-input { padding-right: 40px; }
body:is(.in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) .main-header .app-header-search .search-clear-btn { right: 2px; height: 40px; width: 36px; }
.main-header .app-header-search:has(#header-search-input:placeholder-shown) .search-clear-btn { display: none; }
@media (max-width: 767px) { body:is(.in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) .main-header .app-header-search .search-clear-btn { height: 44px; } }
/* En Buscar, el campo de la página lo sustituye el de la cabecera. */
body.in-search-view #view-buscar .search-controls .search-field { display: none; }
body.in-search-view #view-buscar .search-controls-row { justify-content: space-between; }

/* Franja de fondo a todo el ancho detrás de la cabecera, para que al hacer
   scroll no se vea el contenido por detrás. En la tienda la pinta la fila de
   categorías (llega más abajo). */
body:is(.in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view, .exploring-providers) { --franja-alto: 84px; }
body:is(.in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view, .exploring-providers)::before {
    content: ''; position: fixed; top: 0; left: 0; right: 0; z-index: 999; height: var(--franja-alto); pointer-events: none;
    background: rgba(255, 255, 255, .78);
    backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border-bottom: 1px solid rgba(226, 232, 240, .8);
}

@media (max-width: 767px) {
    /* En móvil el buscador va pegado debajo de la píldora, como en la tienda. */
    body:is(.in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) { --franja-alto: 132px; }
    body.exploring-providers { --franja-alto: 136px; }
    body:is(.in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) .main-header.compro-topbar { margin-bottom: 64px; }
    body:is(.in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) .main-header #distributor-indicator { flex: 1 1 auto; max-width: none; }
    body:is(.in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) .main-header .app-header-search {
        position: absolute; top: calc(100% + 8px); left: 0; right: 0; max-width: none; margin: 0;
    }
    body:is(.in-search-view, .in-favorites-view, .in-orders-view, .in-profile-view) .main-header #header-search-input { height: 44px; font-size: 16px; box-shadow: 0 4px 6px -1px #0f172a12; }
    body.in-search-view .search-controls { top: 132px; }
}

/* Tienda sin resultados (09/10): el aviso se lee y ofrece buscar en todos. */
body.in-provider-store #view-tienda .storefront-empty { padding: 56px 24px; }
.storefront-empty .storefront-empty-titulo { margin: 0 0 18px; color: #0f172a; font-size: 18px; line-height: 26px; font-weight: 700; }
.storefront-empty .storefront-empty-todos {
    min-height: 48px; max-width: 100%; padding: 12px 22px; border: 0; border-radius: 999px;
    background: #0066ff; color: #fff; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
}
.storefront-empty .storefront-empty-todos:hover { background: #0050cb; }
.storefront-empty .storefront-empty-todos:focus-visible { outline: 2px solid #0066ff; outline-offset: 3px; }
