/* Selector y catálogo de proveedores. */
body.exploring-providers { background: #f8f9ff; }
body.exploring-providers #provider-modal.provider-explorer {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100svh - 64px);
    padding-bottom: 64px;
    position: relative;
}
body.exploring-providers .provider-explorer-content { width: 100%; }
body.exploring-providers .provider-heading { border: 0; padding-bottom: 0; }
body.exploring-providers .provider-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: calc(50% - 48px);
    width: 96px;
    height: 2px;
    border-radius: 2px;
    background: #dbeafe;
}
body.exploring-providers .provider-title { position: relative; margin-bottom: 12px; }
.provider-intro { margin: 0; color: #64748b; font-size: 12px; text-align: center; }
body.exploring-providers #provider-list { padding-top: 40px; padding-bottom: 40px; }
.provider-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 16px;
    border-top: 1px solid #e2e8f0;
    background: #ffffff80;
    color: #64748b;
    text-align: center;
    font-size: 11px;
}

body.in-provider-store { background: #fff; }
body.in-provider-store .main-header { padding-inline: 32px; gap: 20px; }
body.in-provider-store #distributor-indicator {
    display: flex !important;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: min(360px, 40vw);
    min-height: 44px;
    margin: 0;
    padding: 6px 14px;
    gap: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #f1f4f9;
    cursor: pointer;
}
body.in-provider-store #distributor-indicator::after { content: '‹'; font-size: 22px; color: #64748b; }
body.in-provider-store #distributor-indicator > div { min-width: 0; }
body.in-provider-store #distributor-indicator .viewing-label { font-size: 9px; letter-spacing: .5px; text-transform: uppercase; }
body.in-provider-store #distributor-indicator .distributor-name { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
body.in-provider-store .main-header .sn-header { margin-left: auto; }
body.in-provider-store .storefront-header { position: static; border: 0; box-shadow: none; }
body.in-provider-store .storefront-header-inner { max-width: 1280px; padding: 12px 24px 0; }
body.in-provider-store #storefront-logo,
body.in-provider-store #storefront-name { display: none; }
/* El título permanece disponible para lectores de pantalla y para el foco. */
body.in-provider-store .storefront-hero {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
body.in-provider-store #view-tienda > .storefront-filters {
    max-width: 1232px;
    width: calc(100% - 48px);
    margin-top: 16px;
    border-bottom: 0;
    flex-wrap: wrap;
}
body.in-provider-store .storefront-filters .sort-filter-bar { margin-left: auto; }
body.in-provider-store .storefront-filters .sort-dropdown { width: auto; flex: 0 0 auto; }
body.in-provider-store .storefront-search { width: 200px; }
body.in-provider-store #view-tienda #grid {
    max-width: 1232px;
    width: calc(100% - 48px);
    margin-top: 8px;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
    padding-bottom: calc(220px + env(safe-area-inset-bottom));
}
body.in-provider-store #grid .product-card { padding: 12px; }
body.in-provider-store #grid .card-img-wrapper { height: 128px; padding: 8px; margin-bottom: 10px; }
body.in-provider-store #grid .card-brand { font-size: 9px; margin-bottom: 2px; }
body.in-provider-store #grid .card-name { font-size: 12px; line-height: 17px; min-height: 34px; }
body.in-provider-store #grid .card-desc { font-size: 10px; line-height: 16px; margin-bottom: 10px; min-height: 32px; }
body.in-provider-store #grid .card-price { font-size: 13px; }
body.in-provider-store #grid .qty-btn { background: #0066ff; color: #fff; border-radius: 8px; }
body.in-provider-store #grid .qty-input { font-size: 13px; }
body.in-provider-store .bottom-nav { display: flex; }
body.in-provider-store #pila-flotantes { bottom: calc(24px + env(safe-area-inset-bottom)); }

@media (max-width: 1199px) {
    body.in-provider-store #view-tienda #grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    body.in-provider-store #pila-flotantes { bottom: calc(180px + env(safe-area-inset-bottom)); }
}
@media (max-width: 899px) {
    body.in-provider-store #view-tienda #grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 639px) {
    body.exploring-providers #provider-modal.provider-explorer { min-height: calc(100svh - 120px); }
    body.in-provider-store .main-header { padding-inline: 12px; gap: 8px; }
    body.in-provider-store .main-header .marketplace-brand { height: 36px; }
    body.in-provider-store #distributor-indicator { position: static; transform: none; max-width: none; flex: 1; padding-inline: 8px; gap: 6px; }
    body.in-provider-store #distributor-indicator .viewing-label { display: none; }
    body.in-provider-store #provider-logo-header { display: none; }
    body.in-provider-store .storefront-header-inner { padding-inline: 12px; }
    body.in-provider-store #view-tienda > .storefront-filters,
    body.in-provider-store #view-tienda #grid { width: calc(100% - 24px); }
    body.in-provider-store #view-tienda #grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.in-provider-store .storefront-filters .sort-filter-bar { width: 100%; justify-content: space-between; gap: 8px; flex-wrap: nowrap; }
    body.in-provider-store .storefront-search { flex: 1; width: auto; }
}
