/* Catálogo de productos: tarjetas y ritmo de la referencia suministrada. */
body.in-provider-store { background: #f6f8fb; }
body.in-provider-store .main-header { background: rgba(255,255,255,.94); }
.catalog-breadcrumb { display: none; }
body.in-provider-store #distributor-indicator { background: #f8fafc; }
body.in-provider-store #distributor-indicator::after { content: 'Cambiar ⌄'; margin-left: 4px; padding-left: 10px; border-left: 1px solid #e2e8f0; font-size: 11px; white-space: nowrap; }
body.in-provider-store #distributor-indicator .distributor-copy { align-items: flex-start !important; text-align: left !important; }
body.in-provider-store #distributor-indicator .viewing-label { color: #64748b; }
body.in-provider-store #provider-logo-header { flex-shrink: 0; }
body.in-provider-store .sn-header-btn { flex-direction: row-reverse; padding: 4px 0 4px 8px; border-color: transparent; background: transparent; }
body.in-provider-store .sn-header-txt { text-align: right; }
body.in-provider-store .sn-header-txt strong { order: -1; font-size: 12px; }
body.in-provider-store .sn-header-txt small { font-size: 10px; }
body.in-provider-store .sn-header-btn > .sn-avatar-mini { border-radius: 50%; }
body.in-provider-store .sn-header-caret { display: none; }
body.in-provider-store .storefront-header { display: none; }
body.in-provider-store .storefront-header-inner { max-width: 1920px; padding-inline: 32px; }
body:not(.exploring-providers) #view-tienda > .storefront-filters {
    position: sticky;
    top: 80px;
    z-index: 900;
    width: fit-content;
    max-width: min(1856px, calc(100% - 64px));
    margin: 16px auto 0;
    padding: 8px 12px;
    border: 1px solid rgba(226,232,240,.8);
    border-radius: 999px;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px -10px rgba(15,23,42,.12), 0 0 1px 1px rgba(255,255,255,.9) inset;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 12px;
}
body.in-provider-store .storefront-filters #category-scroll { flex: 1 1 auto; width: auto; min-width: 0; gap: 4px; }
body.in-provider-store .storefront-filters .chip {
    position: relative;
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    min-height: 44px;
    padding: 8px 14px 12px;
    border-radius: 999px;
    line-height: 18px;
}
body.in-provider-store .storefront-filters .chip.active { background: #eff6ff; color: #0066ff; }
body.in-provider-store .storefront-filters .chip.active::after { content: ''; position: absolute; bottom: 5px; left: calc(50% - 2px); width: 4px; height: 4px; border-radius: 50%; background: #0066ff; }
body.in-provider-store .storefront-filters .chip:hover { background: #f1f5f9; color: #0066ff; }
body.in-provider-store .storefront-filters #sort-select { min-height: 44px; padding-block: 8px; background: #f1f5f9; border-color: transparent; }
body.in-provider-store .storefront-filters .sort-filter-bar { flex: 0 0 auto; width: auto; flex-wrap: nowrap; }
body.in-provider-store .storefront-filters .chip-new-cat { color: #0052cc; background: #eff6ff; }

@media (min-width: 768px) {
    body.in-provider-store #view-tienda > .storefront-filters { flex-direction: row; flex-wrap: nowrap; }
    body.in-provider-store .storefront-filters #category-scroll { flex: 1 1 auto; width: auto; gap: 4px; }
    body.in-provider-store .storefront-filters .sort-filter-bar { flex: 0 0 auto; width: auto; flex-wrap: nowrap; gap: 12px; }
}
@media (min-width: 1280px) {
    body.in-provider-store .main-header .logo { flex-shrink: 0; }
    body.in-provider-store .catalog-breadcrumb { display: flex; align-items: center; min-width: 0; max-width: calc(50% - 320px); margin-right: auto; padding-left: 24px; border-left: 1px solid #e2e8f0; gap: 10px; font-size: 12px; font-weight: 600; }
    .catalog-breadcrumb button { padding: 0; border: 0; background: none; color: #64748b; font: inherit; cursor: pointer; }
    .catalog-breadcrumb button:hover { color: #0052cc; }
    .catalog-breadcrumb svg { width: 14px; height: 14px; flex-shrink: 0; color: #94a3b8; }
    #catalog-breadcrumb-provider { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #334155; }
}

.catalog-meta { display: none; }
body:not(.exploring-providers) #view-tienda.active .catalog-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    padding: 22px 32px 14px;
    font-size: 12px;
    line-height: 18px;
    color: #64748b;
}
.catalog-meta p { margin: 0; }
.catalog-meta strong { color: #334155; font-weight: 700; }
.catalog-meta-context { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px 16px; }
.catalog-meta #storefront-conditions { min-height: 32px; padding: 4px 10px; background: #fff; color: #475569; font-size: 11px; }
#catalog-price-context { display: flex; align-items: center; gap: 6px; }
#catalog-price-context::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #059669; flex-shrink: 0; }
#catalog-price-context[hidden] { display: none; }
body:not(.exploring-providers) #view-tienda #grid {
    display: grid;
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 32px calc(220px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    height: 100%;
    padding: 12px;
    border: 1px solid rgba(226,232,240,.8);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(15,23,42,.04);
    transition: transform 220ms cubic-bezier(.16,1,.3,1), box-shadow 220ms ease, border-color 220ms ease;
}
.catalog-product .card-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 32px;
    margin-bottom: 8px;
    gap: 6px;
}
.catalog-product,
.catalog-product button,
.catalog-product input { font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif; }
.catalog-product .card-toolbar-leading,
.catalog-product .card-toolbar-actions { display: flex; align-items: center; gap: 2px; }
body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card :is(.fav-btn-card, .edit-btn-card, .drag-btn-card) {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 6px;
    border: 0;
    border-radius: 8px;
    box-shadow: none;
    background: transparent;
    color: #64748b;
    opacity: 1;
}
body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card .fav-btn-card.active { color: #0066ff; }
body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card .fav-btn-card:hover { background: #eff4ff; color: #0066ff; }
body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card .edit-btn-card:hover { background: #eff6ff; color: #0066ff; }
.catalog-product .card-toolbar button svg { width: 16px; height: 16px; }
body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card.in-cart::after { top: 18px; left: 16px; }
body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card.in-cart.card-ordenable::after { top: 60px; }
body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card .card-img-wrapper {
    width: 100%;
    height: 176px;
    flex-shrink: 0;
    padding: 8px;
    margin: 0 0 8px;
    border: 0;
    border-radius: 12px;
    background: #f8fafc;
    box-shadow: none;
}
body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card .card-img-wrapper img { object-fit: contain; }
body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card .card-img-wrapper:has(img.loaded) { background: #f8fafc; }
body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card .card-data { gap: 0; }
body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card .card-brand {
    margin: 0 0 4px;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    line-height: 14px;
    letter-spacing: .5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card .card-name {
    display: -webkit-box;
    min-height: 34px;
    height: 34px;
    margin: 0 0 4px;
    color: #0f172a;
    font-size: 12px;
    font-weight: 700;
    line-height: 17px;
    overflow: hidden;
    overflow-wrap: anywhere;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card .card-desc {
    display: block;
    min-height: 16px;
    height: 16px;
    margin: 0 0 12px;
    font-size: 11px;
    line-height: 16px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card .card-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
    gap: 8px;
}
.catalog-product .card-price-row { min-height: 24px; justify-content: space-between; gap: 6px; align-items: baseline; }
body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card .card-price { color: #0f172a; font-size: 16px; font-weight: 800; }
.catalog-product .card-price-unit { margin-left: 2px; font-size: 10px; font-weight: 500; color: #64748b; }
.catalog-product .card-price-old .card-price-unit { font-size: inherit; }
.catalog-product .card-units { margin: 0; padding: 2px 6px; font-size: 10px; font-weight: 500; color: #475569; background: #f1f5f9; border-radius: 4px; }
.catalog-product .card-precio-compra { margin: 0; font-size: 11px; font-weight: 600; line-height: 16px; color: #0052cc; }
.catalog-product .card-precio-orientativo { color: #a16207; }
.catalog-product .card-precio-fecha { margin: 0; font-size: 11px; line-height: 16px; color: #64748b; }
body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card .card-actions { flex-direction: column; align-items: stretch; gap: 6px; }
body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card .qty-control { width: 100%; height: 32px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; box-shadow: none; overflow: hidden; }
body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card .qty-btn { width: 32px; min-width: 32px; height: 32px; min-height: 32px; border-radius: 0; background: transparent; color: #0052cc; font-size: 16px; font-weight: 700; }
body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card .qty-btn:hover { background: #f1f5f9; }
body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card .qty-input { flex: 1; min-width: 0; font-size: 12px; font-weight: 700; color: #1e293b; }
body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card .btn-add-card { width: 100%; height: 32px; min-height: 32px; padding: 6px 8px; border-radius: 12px; border-color: #0066ff; background: #0066ff; color: #fff; font-size: 12px; font-weight: 700; }
body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card .btn-add-card:hover { background: #0052cc; }
body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card .btn-added { background: #dcfce7; border-color: #bbf7d0; color: #166534; }
body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card .btn-agotado { background: #f1f5f9; border-color: #e2e8f0; color: #64748b; }

@media (hover: hover) and (pointer: fine) {
    body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card:hover { transform: translateY(-4px); border-color: #0066ff66; box-shadow: 0 12px 24px -6px #0066ff14, 0 4px 12px -2px #0f172a0d; }
}
@media (max-width: 1535px) { body:not(.exploring-providers) #view-tienda #grid { grid-template-columns: repeat(5, minmax(0,1fr)); } }
@media (max-width: 1279px) { body:not(.exploring-providers) #view-tienda #grid { grid-template-columns: repeat(4, minmax(0,1fr)); } }
@media (max-width: 1023px) { body:not(.exploring-providers) #view-tienda #grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 767px) {
    body:not(.exploring-providers) #view-tienda #grid { grid-template-columns: repeat(2, minmax(0,1fr)); padding-inline: 16px; }
    body.in-provider-store #view-tienda > .storefront-filters { width: calc(100% - 24px); max-width: none; padding: 8px; gap: 8px; flex-direction: row; }
    body.in-provider-store .storefront-filters #category-scroll { flex: 1 1 auto; width: auto; }
    body.in-provider-store .storefront-filters .sort-filter-bar { width: auto; flex: 0 0 auto; }
    body:not(.exploring-providers) #view-tienda.active .catalog-meta { padding-inline: 16px; flex-wrap: wrap; gap: 4px; }
    body.in-provider-store .storefront-header-inner { padding-inline: 16px; }
    body.in-provider-store #distributor-indicator::after { content: '⌄'; font-size: 16px; }
}
@media (max-width: 639px) {
    body:not(.exploring-providers) #view-tienda #grid { grid-template-columns: minmax(0,1fr); }
    body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card .card-img-wrapper { height: 128px; }
    body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card :is(.fav-btn-card, .edit-btn-card, .drag-btn-card) { width: 44px; height: 44px; min-width: 44px; }
    body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card .card-toolbar { min-height: 44px; }
    body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card .card-name { font-size: 14px; }
    body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card .qty-control,
    body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card .qty-btn,
    body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card .btn-add-card { height: 44px; min-height: 44px; }
    body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card .qty-btn { min-width: 44px; }
    body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card .qty-input { font-size: 16px; }
    body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card.in-cart::after { top: 24px; }
    body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card.in-cart.card-ordenable::after { top: 72px; }
    body.in-provider-store:not(:has(.bottom-nav [data-nav="panel"]:not([hidden]))) #pila-flotantes {
        right: 12px;
        bottom: calc(var(--pila-base) + env(safe-area-inset-bottom));
    }
    body.in-provider-store #pila-flotantes .as-boton { width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card { transition: none; }
    body :is(#grid .catalog-product, #search-grid .catalog-product, .catalog-product.fantasma-arrastre).product-card:hover { transform: none; }
}

body .catalog-product.fantasma-arrastre { transition: none; box-shadow: 0 18px 40px #0004; }

/* Sin el círculo azul de «añadido» en ninguna cuadrícula: basta el botón verde. */
body .product-card.in-cart::after { display: none; }
