/* Favoritos: referencia visual conectada a productos y pedidos reales. */
body.in-favorites-view { background: #f8fafc; color: #0b1c30; }
body.in-favorites-view .app-container { padding: 0; }
#view-fav { width: min(1152px, calc(100% - 64px)); max-width: none; margin: 0 auto; padding: 28px 0 130px; }
#view-fav .cart-items-scroll { width: 100%; max-width: none; height: auto; max-height: none; overflow: visible; padding: 0; margin: 0; }
#view-fav .fav-lista { width: 100%; padding: 0; margin: 0; }
.favorites-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.favorites-title-row { display: flex; align-items: center; gap: 12px; }
.favorites-title-row h1 { margin: 0; font-size: 32px; line-height: 40px; font-weight: 800; letter-spacing: -.8px; }
#favorites-count { padding: 3px 10px; border-radius: 999px; background: #dae2fd; color: #0050cb; font-size: 14px; font-weight: 700; }
.favorites-heading p { margin: 6px 0 0; color: #64748b; font-size: 14px; line-height: 20px; }
#favorites-add-list { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; color: #0b1c30; font: inherit; font-size: 13px; font-weight: 600; box-shadow: 0 1px 2px #0f172a08; cursor: pointer; flex-shrink: 0; }
#favorites-add-list svg { width: 20px; height: 20px; color: #0066ff; flex-shrink: 0; }
#favorites-add-list:hover:not(:disabled) { background: #f1f5f9; border-color: #cbd5e1; }
#favorites-add-list:disabled { cursor: default; color: #64748b; background: #f1f5f9; box-shadow: none; }
#favorites-add-list:disabled svg { color: #64748b; }
.favorites-filters { display: flex; gap: 8px; overflow-x: auto; padding: 0 0 16px; margin: 0 0 28px; border-bottom: 1px solid #e2e8f0; scrollbar-width: thin; }
.favorites-filters[hidden] { display: none; }
.favorites-filters button { flex-shrink: 0; min-height: 40px; padding: 8px 16px; border: 1px solid #e2e8f0; border-radius: 999px; background: #fff; color: #64748b; font: inherit; font-size: 13px; cursor: pointer; }
.favorites-filters button:hover { background: #f1f5f9; color: #0b1c30; }
.favorites-filters button[aria-pressed="true"] { color: #fff; background: #0b1c30; border-color: #0b1c30; font-weight: 600; }
.favorites-list-status { margin: -8px 0 20px; color: #0050cb; font-size: 13px; line-height: 20px; }
.favorites-list-status:empty { display: none; }
#view-fav .fav-grupo { margin: 0 0 48px; }
#view-fav .fav-grupo-cab { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding-bottom: 16px; border-color: #e2e8f0; }
#view-fav .fav-grupo-cab > img { width: 40px; height: 40px; padding: 4px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; object-fit: contain; flex-shrink: 0; }
.fav-grupo-copy { flex: 1; min-width: 0; }
.fav-grupo-copy > div { display: flex; align-items: center; gap: 8px; }
.fav-grupo-copy h2 { margin: 0; font-size: 16px; line-height: 22px; letter-spacing: -.2px; font-weight: 700; }
#view-fav .fav-grupo-n { padding: 2px 6px; min-width: 22px; text-align: center; font-size: 11px; color: #64748b; background: #f1f5f9; }
.fav-grupo-copy p { margin: 3px 0 0; color: #64748b; font-size: 11px; line-height: 16px; }
.favorites-catalog-link { border: 0; background: none; color: #0066ff; font: inherit; font-size: 13px; font-weight: 600; padding: 10px 0 10px 12px; cursor: pointer; text-align: right; }
.favorites-catalog-link:hover { text-decoration: underline; }
#view-fav .fav-grupo-rejilla.product-grid { width: 100%; max-width: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
#view-fav .catalog-product.product-card { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 20px; border: 1px solid #e2e8f0; border-radius: 16px; background: #fff; box-shadow: 0 1px 2px #0f172a08; }
#view-fav .product-card.in-cart { border-color: #e2e8f0; background: #fff; }
#view-fav .product-card.in-cart::after { display: none; }
#view-fav .card-toolbar { display: flex; justify-content: space-between; align-items: center; min-height: 36px; margin-bottom: 10px; }
#view-fav .card-toolbar-leading { min-width: 0; }
#view-fav .fav-btn-card { position: static; width: 36px; height: 36px; padding: 8px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; box-shadow: none; background: #f8fafc; color: #0066ff; }
#view-fav .fav-btn-card svg { width: 20px; height: 20px; }
#view-fav .fav-btn-card:hover { background: #eff4ff; }
#view-fav .card-img-wrapper { height: 176px; min-height: 176px; width: 100%; margin: 0 0 16px; padding: 12px; border-radius: 12px; background: #f8fafc; }
#view-fav .card-img-wrapper img { width: 100%; height: 100%; object-fit: contain; }
#view-fav .card-data { display: flex; flex-direction: column; padding: 0; flex: 1; min-width: 0; }
#view-fav .card-brand { margin: 0 0 5px; color: #64748b; font-size: 11px; line-height: 14px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
#view-fav .card-name { height: auto; min-height: 44px; margin: 0 0 8px; color: #0b1c30; font-size: 16px; line-height: 22px; font-weight: 700; letter-spacing: -.2px; }
#view-fav .card-desc { height: auto; min-height: 18px; margin: 0 0 16px; color: #64748b; font-size: 13px; line-height: 18px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
#view-fav .card-desc:empty { display: none; }
#view-fav .search-card-conservation { display: inline-flex; max-width: 100%; padding: 5px 8px; border: 0; border-radius: 6px; background: #f1f5f9; color: #64748b; font-size: 11px; font-weight: 600; line-height: 14px; }
#view-fav .search-card-conservation.is-frozen { background: #f0f9ff; color: #0284c7; }
#view-fav .search-card-conservation:empty { display: none; }
#view-fav .card-footer { margin-top: auto; border-top: 1px solid #e2e8f0; padding-top: 14px; }
#view-fav .card-price-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 12px; }
#view-fav .card-price { color: #0b1c30; font-size: 20px; line-height: 28px; font-weight: 700; }
#view-fav .card-price-unit { margin-left: 2px; color: #64748b; font-size: 13px; font-weight: 400; }
#view-fav .card-units { position: static; border: 0; border-radius: 6px; padding: 3px 6px; background: #f1f5f9; color: #64748b; font-size: 10px; }
#view-fav .card-stock { display: inline-block; margin: 0 0 10px; border-radius: 5px; padding: 3px 6px; background: #e1ffec; color: #006645; font-size: 11px; }
#view-fav .card-actions { display: flex; flex-direction: row; align-items: stretch; gap: 8px; padding: 0; border: 0; }
#view-fav .qty-control { display: flex; align-items: center; justify-content: space-between; flex: 0 0 120px; width: 120px; height: 44px; padding: 4px; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 12px; }
#view-fav .qty-btn { display: flex; align-items: center; justify-content: center; width: 30px; min-width: 30px; height: 34px; min-height: 34px; padding: 0; border: 0; border-radius: 8px; background: #fff; color: #0b1c30; font-size: 18px; font-weight: 600; box-shadow: 0 1px 2px #0f172a08; }
#view-fav .qty-btn:hover { background: #e2e8f0; }
#view-fav .qty-input { width: 38px; padding: 0; background: transparent; border: 0; color: #0b1c30; font-family: inherit; font-size: 14px; font-weight: 700; text-align: center; }
#view-fav .btn-add-card { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: 1; width: auto; min-width: 0; min-height: 44px; padding: 8px; border: 0; border-radius: 12px; background: #0066ff; color: #fff; font-family: inherit; font-size: 13px; line-height: 18px; font-weight: 600; }
#view-fav .btn-add-card:hover { background: #0050cb; }
#view-fav .btn-add-card.btn-added { background: #e1ffec; color: #006645; }
#view-fav .btn-add-card.btn-agotado { background: #f1f5f9; color: #94a3b8; }
#view-fav .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'%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; }
.favorites-footer { display: flex; justify-content: space-between; gap: 16px; padding-top: 24px; border-top: 1px solid #e2e8f0; color: #64748b; font-size: 12px; }
.favorites-footer > div { display: flex; gap: 16px; }
.favorites-footer a { color: #64748b; text-decoration: none; }
.favorites-footer a:hover { color: #0066ff; }
body.in-favorites-view #distributor-indicator { display: inline-flex !important; position: absolute; left: 50%; transform: translateX(-50%); max-width: 42%; width: auto; margin: 0; padding: 6px 14px; border: 1px solid #e2e8f0; border-radius: 999px; background: #f1f5f9; }
body.in-favorites-view #provider-logo-header { display: block; width: 24px; height: 24px; padding: 2px; border-radius: 5px; border: 1px solid #e2e8f0; background: #fff; object-fit: contain; }
body.in-favorites-view .distributor-copy { gap: 2px; text-align: left; }
body.in-favorites-view .viewing-label { color: #64748b; font-size: 9px; line-height: 12px; }
body.in-favorites-view .distributor-name { color: #0b1c30; font-size: 12px; }
#view-fav :is(button, a):focus-visible { outline: 2px solid #0066ff; outline-offset: 3px; }
@media (max-width: 1023px) {
    #view-fav .fav-grupo-rejilla.product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .favorites-heading { align-items: flex-start; }
    .favorites-heading p { max-width: 370px; }
    #favorites-add-list { max-width: 260px; flex-shrink: 1; }
}
@media (max-width: 767px) {
    #view-fav { width: calc(100% - 24px); padding-top: 24px; }
    .favorites-heading { flex-direction: column; gap: 16px; margin-bottom: 24px; }
    .favorites-title-row h1 { font-size: 26px; line-height: 34px; }
    #favorites-add-list { width: 100%; max-width: none; }
    body.in-favorites-view #distributor-indicator { position: static; transform: none; max-width: none; flex: 1; padding: 5px 8px; gap: 6px; }
    body.in-favorites-view #distributor-indicator .viewing-label { display: none; }
    body.in-favorites-view #provider-logo-header { display: none; }
    #view-fav .fav-grupo-cab { flex-wrap: wrap; gap: 8px; }
    .favorites-catalog-link { width: 100%; text-align: left; padding: 6px 0; }
    .favorites-footer { flex-direction: column; }
}
@media (max-width: 639px) {
    #view-fav .fav-grupo-rejilla.product-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    #view-fav .card-name { min-height: 0; }
}
