/* =====================================================================================================================
   La tienda del cliente (encabezado, portada, productos, carrito, pedidos) y la pantalla de ingreso.
   Usa las variables y los controles de app.css.
   ===================================================================================================================== */

/* ---------- Estructura: encabezado índigo con buscador y carrito ---------- */

.store { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }

.store-header { position: sticky; top: 0; z-index: 90; padding-top: env(safe-area-inset-top, 0px); color: var(--on-ink); background: var(--ink); }
.store-header-inner {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand actions" "search search"; gap: 0.6rem 1rem; align-items: center;
    max-width: 80rem; margin: 0 auto; padding: 0.65rem 1rem 0.85rem;
}
.store-brand { grid-area: brand; display: flex; align-items: center; gap: 0.65rem; min-width: 0; color: var(--on-ink); text-decoration: none; font-weight: 800; }
.store-brand:hover { color: var(--on-ink); }
.brand-logo { flex: none; border-radius: 11px; }
.brand-name { overflow: hidden; font-size: 1.1rem; letter-spacing: -0.01em; text-overflow: ellipsis; white-space: nowrap; }

.store-search { grid-area: search; position: relative; }
.store-search > .icon { position: absolute; top: 50%; left: 1.05rem; font-size: 1.1rem; color: var(--text-muted); transform: translateY(-50%); pointer-events: none; }
.store-search .form-control {
    min-height: 3rem; padding-left: 2.85rem; padding-right: 1rem; color: var(--text); background: var(--surface); border: 2px solid transparent; border-radius: 999px;
}
.store-search .form-control:not(:placeholder-shown) { padding-right: 3rem; }
.store-search .form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(255 201 51 / 0.35); }
.store-search .clear { position: absolute; top: 50%; right: 0.3rem; min-width: 2.5rem; min-height: 2.5rem; padding: 0; transform: translateY(-50%); }

.store-links { display: none; }
.store-actions { grid-area: actions; display: flex; align-items: center; gap: 0.6rem; }
.store-header .account-trigger { color: var(--on-ink); background: rgb(255 255 255 / 0.14); }
.store-header .account-trigger:hover { background: rgb(255 255 255 / 0.22); filter: none; }

.cart-btn {
    position: relative; display: none; align-items: center; gap: 0.55rem; min-height: 2.75rem; padding: 0 1rem; font: inherit; font-weight: 800; color: var(--on-brand);
    background: var(--brand); border: 0; border-radius: 999px; cursor: pointer; transition: background-color 0.15s ease, transform 0.1s ease;
}
.cart-btn:hover { background: var(--brand-hover); }
.cart-btn:active { transform: translateY(1px); }
.cart-btn .icon { font-size: 1.3rem; }
.cart-count {
    display: grid; place-items: center; min-width: 1.45rem; height: 1.45rem; padding: 0 0.4rem; font-size: 0.75rem; font-weight: 800; color: var(--on-ink);
    background: var(--ink); border-radius: 999px;
}

@media (min-width: 640px) {
    .store-header-inner { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "brand search actions"; gap: 1rem 1.5rem; padding: 0.7rem 1rem; }
    .store-search { max-width: 38rem; width: 100%; margin-inline: auto; }
    .cart-btn { display: inline-flex; }
}
@media (min-width: 1024px) {
    .store-header-inner { grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "brand search links actions"; }
    .store-links { grid-area: links; display: flex; gap: 0.25rem; }
    .store-link {
        display: inline-flex; align-items: center; gap: 0.45rem; min-height: 2.5rem; padding: 0 0.95rem; font-weight: 700; color: var(--on-ink-muted); text-decoration: none; border-radius: 999px;
    }
    .store-link:hover { color: var(--on-ink); background: rgb(255 255 255 / 0.1); }
    .store-link.active { color: var(--on-ink); background: rgb(255 255 255 / 0.16); }
}

.store-main { flex: 1; width: 100%; max-width: 80rem; margin: 0 auto; padding: 1.1rem 1rem 1.5rem; }
.store-main .alert { margin-bottom: 1rem; }

/* Pie */
.store-footer { padding: 1.5rem 1rem calc(1.5rem + var(--nav-h) + var(--safe-bottom)); background: var(--surface); border-top: 1px solid var(--border); }
.store-footer-inner { display: flex; flex-direction: column; gap: 1rem; max-width: 78rem; margin: 0 auto; }
.footer-brand { display: flex; align-items: center; gap: 0.7rem; }
.footer-brand img { border-radius: 9px; }
.footer-brand strong { display: block; line-height: 1.2; }
.footer-brand span { font-size: 0.85rem; color: var(--text-muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }
.footer-links a { font-weight: 600; color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--link); text-decoration: underline; }
@media (min-width: 640px) { .store-footer-inner { flex-direction: row; align-items: center; justify-content: space-between; } }
@media (min-width: 1024px) { .store-footer { padding-bottom: 1.5rem; } .store-main { padding-bottom: 2rem; } }

/* ---------- Portada: banner de bienvenida ---------- */

.hero {
    position: relative; display: flex; flex-direction: column; gap: 1.1rem; overflow: hidden; padding: 1.4rem 1.25rem; margin-bottom: 1.5rem; color: var(--on-ink);
    background: linear-gradient(135deg, var(--ink) 0%, var(--ink-2) 100%); border-radius: var(--radius-lg);
}
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.hero::before { top: -3.2rem; right: -2.4rem; width: 9rem; height: 9rem; background: var(--brand); }
.hero::after { right: 4.2rem; bottom: -2.2rem; width: 4.5rem; height: 4.5rem; background: var(--accent); }
.hero > * { position: relative; z-index: 1; }
.hero-copy { max-width: calc(100% - 4.5rem); }
.hero-eyebrow { display: flex; align-items: center; gap: 0.4rem; margin: 0 0 0.35rem; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.hero h1 { margin: 0; font-size: 1.85rem; color: var(--on-ink); }
.hero .lead { margin: 0.15rem 0 0; font-size: 1.05rem; color: var(--on-ink-muted); }
.hero-chip {
    display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 0.8rem; padding: 0.3rem 0.85rem; font-size: 0.85rem; font-weight: 700; color: var(--on-ink);
    background: rgb(255 255 255 / 0.1); border: 1px solid var(--ink-line); border-radius: 999px;
}

.reorder-banner {
    display: flex; align-items: center; gap: 0.9rem; padding: 0.85rem 0.9rem 0.85rem 1rem; color: var(--text); background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.reorder-banner .icon-wrap { display: grid; place-items: center; flex: none; width: 2.75rem; height: 2.75rem; font-size: 1.3rem; color: var(--on-brand); background: var(--brand); border-radius: 50%; }
.reorder-banner .grow { flex: 1; min-width: 0; }
.reorder-banner strong { display: block; line-height: 1.25; }
.reorder-banner span:not(.icon-wrap) { font-size: 0.85rem; color: var(--text-muted); }
@media (max-width: 899.98px) {
    .reorder-banner { flex-wrap: wrap; }
    .reorder-banner .grow { flex: 1 1 10rem; }
    .reorder-banner .btn { flex: 1 1 100%; }
}

@media (min-width: 900px) {
    .hero { flex-direction: row; align-items: center; justify-content: space-between; gap: 2rem; padding: 2.1rem 2.5rem; }
    .hero::before { top: -5rem; right: -3rem; width: 15rem; height: 15rem; }
    .hero::after { right: 10rem; bottom: -3rem; width: 7rem; height: 7rem; }
    .hero h1 { font-size: 2.4rem; }
    .hero-copy { max-width: none; }
    .reorder-banner { flex: none; width: 27rem; padding: 1rem 1.1rem; }
}

/* ---------- Líneas de productos como categorías ---------- */

.section-title { margin: 0 0 0.75rem; font-size: 1.15rem; }
.lines { margin-bottom: 1.6rem; }
.lines-scroll { display: flex; gap: 0.75rem; overflow-x: auto; padding: 0.2rem 0.2rem 0.7rem; margin: 0 -0.2rem; scroll-snap-type: x proximity; scrollbar-width: thin; }
.line-tile {
    --h: 215; flex: none; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "mark name" "mark count"; column-gap: 0.8rem; align-items: center;
    min-width: 11.5rem; padding: 0.7rem 1.1rem 0.7rem 0.7rem; font: inherit; text-align: left; color: var(--text); background: var(--surface);
    border: 2px solid var(--border); border-radius: var(--radius); cursor: pointer; scroll-snap-align: start;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.line-tile:hover { transform: translateY(-2px); border-color: hsl(var(--h) 55% 70%); box-shadow: var(--shadow-lift); }
.line-tile[aria-pressed="true"] { border-color: var(--link); background: var(--link-soft); }
.line-mark {
    grid-area: mark; display: grid; place-items: center; width: 2.9rem; height: 2.9rem; font-weight: 800; letter-spacing: 0.02em;
    color: hsl(var(--h) 55% 28%); background: hsl(var(--h) 70% 91%); border-radius: 13px;
}
.line-mark.all { font-size: 1.3rem; color: var(--on-ink); background: var(--ink); }
.line-name { grid-area: name; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.line-count { grid-area: count; font-size: 0.8rem; color: var(--text-muted); }
[data-bs-theme="dark"] .line-mark { color: hsl(var(--h) 85% 82%); background: hsl(var(--h) 32% 24%); }
[data-bs-theme="dark"] .line-mark.all { color: var(--on-brand); background: var(--brand); }

.results-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; margin: 0 0 1rem; }
.result-count { margin: 0; color: var(--text-muted); }
.result-count strong { font-size: 1.2rem; color: var(--text); }

/* ---------- Productos: grilla de tarjetas ---------- */

.product-groups { padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 4.5rem); } /* lugar para la barra del pedido */
.line-title { --h: 215; display: flex; align-items: center; gap: 0.65rem; margin: 1.8rem 0 0.9rem; font-size: 1.3rem; }
.line-title::before { content: ""; flex: none; width: 0.5rem; height: 1.6rem; background: hsl(var(--h) 75% 52%); border-radius: 4px; }
.line-title-count { padding: 0.15rem 0.65rem; font-size: 0.8rem; font-weight: 700; color: var(--text-muted); background: var(--surface-2); border-radius: 999px; }
.product-groups > .line-title:first-child { margin-top: 0.5rem; }

.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin: 0; padding: 0; }
@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; } }
@media (min-width: 1024px) { .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .product-groups { padding-bottom: 2rem; } }

.product-card {
    position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
    content-visibility: auto; contain-intrinsic-size: auto 22rem; transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.product-card.in-cart { background: color-mix(in srgb, var(--brand-soft) 45%, var(--surface)); border-color: var(--brand); }

.pc-media { position: relative; padding: 0.6rem 0.6rem 0; }
.pc-media .product-thumb { aspect-ratio: 4 / 3; border-radius: 12px; font-size: 1.4rem; }
.product-card-out .pc-media .product-thumb { opacity: 0.55; filter: grayscale(0.7); }
.pc-qty {
    position: absolute; top: 1.05rem; right: 1.05rem; display: grid; place-items: center; min-width: 1.9rem; height: 1.9rem; padding: 0 0.5rem; font-size: 0.85rem; font-weight: 800;
    color: var(--on-brand); background: var(--brand); border-radius: 999px; box-shadow: 0 2px 6px rgb(0 0 0 / 0.25); animation: pop 0.25s ease-out;
}
.pc-flag {
    position: absolute; top: 1.05rem; left: 1.05rem; padding: 0.2rem 0.65rem; font-size: 0.72rem; font-weight: 800; color: #3b2a00; background: var(--accent);
    border-radius: 999px; box-shadow: 0 2px 6px rgb(0 0 0 / 0.18);
}

.pc-body { display: flex; flex: 1; flex-direction: column; gap: 0.25rem; padding: 0.7rem 0.85rem 0.9rem; }
.pc-line {
    --h: 215; align-self: flex-start; padding: 0.1rem 0.6rem; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
    color: hsl(var(--h) 55% 28%); background: hsl(var(--h) 70% 91%); border-radius: 999px;
}
[data-bs-theme="dark"] .pc-line { color: hsl(var(--h) 85% 82%); background: hsl(var(--h) 32% 24%); }
.product-name {
    display: -webkit-box; margin: 0.15rem 0 0; font-size: 0.98rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.005em;
    overflow: hidden; overflow-wrap: anywhere; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.product-description { display: none; margin: 0; font-size: 0.82rem; color: var(--text-muted); }
.product-sku { font-size: 0.75rem; color: var(--text-muted); }
.pc-price { display: flex; flex-direction: column; gap: 0.05rem; margin-top: auto; padding-top: 0.5rem; }
.product-price { font-size: 1.4rem; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; color: var(--text); }
.stock-left { font-size: 0.78rem; font-weight: 700; color: var(--success); }
.stock-low { font-size: 0.78rem; font-weight: 700; color: var(--warning); }
.stock-out { font-size: 0.8rem; font-weight: 800; color: var(--danger); }
.pc-action { display: flex; flex-direction: column; gap: 0.35rem; padding-top: 0.6rem; }
.add-btn:disabled { color: var(--text-muted); background: var(--surface-2); border-color: var(--border-strong); box-shadow: none; opacity: 1; }
.add-btn { width: 100%; }
.stepper-block { display: flex; width: 100%; }
.stepper-block .stepper-input { flex: 1; width: auto; min-width: 0; }
.product-subtotal { text-align: center; font-size: 0.8rem; font-weight: 800; color: var(--brand-text); }
.stepper-sm .stepper-btn { width: 2.25rem; height: 2.25rem; min-height: 2.25rem; font-size: 1rem; }
.stepper-sm .stepper-input { width: 2.7rem; height: 2.25rem; min-height: 2.25rem; }
@media (min-width: 640px) { .product-description { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } .pc-media .product-thumb { font-size: 1.8rem; } }

.skeleton-card { display: flex; flex-direction: column; gap: 0.55rem; padding: 0.6rem 0.6rem 0.9rem; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); }
.skeleton-media { aspect-ratio: 1; border-radius: 12px; }
.skeleton-button { height: 2.75rem; margin-top: 0.3rem; border-radius: 999px; }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } }

/* ---------- Barra flotante del pedido (celular y tablet) ---------- */

.cart-bar { position: fixed; right: 0; left: 0; bottom: calc(var(--nav-h) + var(--safe-bottom)); z-index: 85; padding: 0.5rem 0.75rem; pointer-events: none; animation: slide-up 0.2s ease-out; }
.cart-bar-inner {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; max-width: 40rem; margin: 0 auto; padding: 0.5rem 0.5rem 0.5rem 1.2rem;
    color: var(--on-ink); background: var(--ink); border-radius: 999px; box-shadow: var(--shadow); pointer-events: auto;
}
[data-bs-theme="dark"] .cart-bar-inner { background: var(--ink-2); border: 1px solid var(--ink-line); }
.cart-bar-label { font-size: 0.78rem; color: var(--on-ink-muted); }
.cart-bar-total { font-size: 1.2rem; font-weight: 800; line-height: 1.15; }
@keyframes slide-up { from { transform: translateY(100%); opacity: 0; } }
@media (min-width: 1024px) { .cart-bar { display: none; } }

/* ---------- Panel del carrito ---------- */

.drawer-backdrop { position: fixed; inset: 0; z-index: 200; background: rgb(12 10 25 / 0.55); animation: fade-in 0.2s ease-out; }
.drawer {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 210; display: flex; flex-direction: column; width: min(26rem, 100vw); background: var(--surface);
    box-shadow: var(--shadow); outline: none; animation: slide-in 0.22s ease-out;
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 0.9rem 0.8rem 0.9rem 1.25rem; border-bottom: 1px solid var(--border); }
.drawer-head h2 { margin: 0; font-size: 1.25rem; }
.drawer-close { min-width: 2.75rem; padding: 0; font-size: 1.1rem; }
.drawer-lines { flex: 1; margin: 0; padding: 0.25rem 1.25rem; overflow-y: auto; }
.drawer-line { display: grid; grid-template-columns: 3.75rem minmax(0, 1fr) auto; gap: 0.8rem; padding: 0.9rem 0; border-top: 1px solid var(--border); }
.drawer-line:first-child { border-top: 0; }
.drawer-thumb .product-thumb { font-size: 0.85rem; border-radius: 10px; }
.drawer-line-main { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; min-width: 0; }
.drawer-line-name { font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.drawer-line-unit { font-size: 0.8rem; color: var(--text-muted); }
.drawer-line-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.drawer-line-total { font-weight: 800; font-variant-numeric: tabular-nums; }
.drawer-line .remove, .panel-lines .remove { min-width: 2.25rem; min-height: 2.25rem; padding: 0; color: var(--danger); }
.drawer-foot { display: flex; flex-direction: column; gap: 0.5rem; padding: 1rem 1.25rem calc(1rem + var(--safe-bottom)); border-top: 1px solid var(--border); background: var(--surface); }
.drawer-total { display: flex; align-items: baseline; justify-content: space-between; font-size: 1.05rem; }
.drawer-total strong { font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.drawer-empty { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem; padding: 2rem; text-align: center; color: var(--text-muted); }
.drawer-empty .empty-icon { display: grid; place-items: center; width: 4.5rem; height: 4.5rem; font-size: 2rem; color: var(--brand-text); background: var(--brand-soft); border-radius: 50%; }
.drawer-empty h3 { margin: 0.4rem 0 0; font-size: 1.1rem; color: var(--text); }
.drawer-empty p { margin: 0 0 0.5rem; }
@keyframes slide-in { from { transform: translateX(100%); } }
@keyframes fade-in { from { opacity: 0; } }

/* ---------- Carrito (resumen del pedido) ---------- */

.checkout { display: grid; gap: 1.25rem; align-items: start; }
.checkout h1 { margin: 0 0 1rem; }
.checkout-count { margin-left: 0.4rem; font-size: 0.95rem; font-weight: 600; color: var(--text-muted); letter-spacing: 0; }
@media (min-width: 900px) {
    .checkout { grid-template-columns: minmax(0, 1fr) 24rem; gap: 1.75rem; }
    .checkout-side { position: sticky; top: 6rem; }
}

.order-lines { margin: 0 0 1rem; padding: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.order-line { display: flex; align-items: center; gap: 0.9rem; padding: 0.9rem 1rem; }
.order-lines .order-line + .order-line { border-top: 1px solid var(--border); }
.order-line-info { flex: 1; min-width: 0; }
.order-line-name { font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.order-line-total { font-weight: 800; white-space: nowrap; }
.ol-thumb { flex: none; width: 3.75rem; }
.ol-thumb .product-thumb { border-radius: 12px; font-size: 0.9rem; }
.order-line .stepper-btn { width: 2.5rem; height: 2.5rem; min-height: 2.5rem; }
.order-line .stepper-input { width: 2.9rem; height: 2.5rem; min-height: 2.5rem; }
.order-line .remove { min-width: 2.5rem; min-height: 2.5rem; padding: 0; color: var(--danger); }

/* Línea editable: foto, nombre y total arriba; cantidad y quitar abajo (en pantallas anchas, todo en una fila) */
.order-line-edit { display: grid; grid-template-columns: 3.75rem minmax(0, 1fr) auto; grid-template-areas: "thumb info total" "thumb actions actions"; gap: 0.35rem 0.9rem; align-items: start; }
.order-line-edit .ol-thumb { grid-area: thumb; }
.order-line-edit .order-line-info { grid-area: info; }
.order-line-edit .order-line-total { grid-area: total; }
.order-line-actions { grid-area: actions; display: flex; align-items: center; justify-content: flex-end; gap: 0.25rem; }
@media (min-width: 640px) {
    .order-line-edit { grid-template-columns: 4rem minmax(0, 1fr) auto minmax(7rem, max-content); grid-template-areas: "thumb info actions total"; align-items: center; }
    .order-line-edit .ol-thumb { width: 4rem; }
    .order-line-edit .order-line-total { text-align: right; }
}

.summary-card { display: flex; flex-direction: column; gap: 1rem; padding: 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.summary-card h2 { margin: 0; }
.summary-rows { display: flex; flex-direction: column; gap: 0.4rem; margin: 0; }
.summary-rows > div { display: flex; justify-content: space-between; }
.summary-rows dt { font-weight: 500; color: var(--text-muted); }
.summary-rows dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.order-total { display: flex; align-items: baseline; justify-content: space-between; padding-top: 0.9rem; border-top: 2px solid var(--border); font-size: 1.05rem; }
.order-total strong { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.02em; }
.min-progress p { margin: 0.45rem 0 0; font-size: 0.85rem; color: var(--text-muted); }
.min-progress p strong { color: var(--text); }
.min-bar { height: 0.55rem; overflow: hidden; background: var(--surface-2); border-radius: 999px; }
.min-bar span { display: block; height: 100%; background: var(--brand); border-radius: inherit; transition: width 0.3s ease; }
.min-progress.is-reached .min-bar span { background: var(--success); }
.min-progress.is-reached p { font-weight: 700; color: var(--success); }
.summary-help { margin: 0; text-align: center; font-size: 0.8rem; color: var(--text-muted); }
.summary-note { padding: 0.75rem 1rem; background: var(--surface-2); border-radius: var(--radius-sm); overflow-wrap: anywhere; }
.summary-notes .form-label { display: block; }
/* En el celular el envío acompaña el scroll, siempre a la vista y con el total */
.sa-total { display: none; }
@media (max-width: 899.98px) {
    .summary-action {
        position: sticky; bottom: calc(var(--nav-h) + var(--safe-bottom) + 0.5rem); z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
        margin: 0 -0.4rem; padding: 0.45rem 0.45rem 0.45rem 1.2rem; color: var(--on-ink); background: var(--ink); border-radius: 999px; box-shadow: var(--shadow);
    }
    [data-bs-theme="dark"] .summary-action { background: var(--ink-2); border: 1px solid var(--ink-line); }
    .sa-total { display: block; line-height: 1.15; }
    .sa-total span { display: block; font-size: 0.78rem; color: var(--on-ink-muted); }
    .sa-total strong { font-size: 1.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
    .summary-action .btn { flex: none; width: auto; }
}
@media (min-width: 900px) { .summary-action .btn { width: 100%; } }

/* ---------- Pedido enviado ---------- */

.confirm { max-width: 38rem; margin: 1rem auto 0; padding: 2rem 1.25rem; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.confirm-mark { display: inline-grid; place-items: center; width: 5rem; height: 5rem; margin-bottom: 1rem; font-size: 2.4rem; color: var(--surface); background: var(--success); border-radius: 50%; animation: pop 0.4s cubic-bezier(0.2, 1.4, 0.4, 1); }
.confirm h1 { margin: 0; font-size: 1.6rem; }
.confirm-lead { margin: 0.4rem 0 0; color: var(--text-muted); }
.confirm-steps { display: grid; gap: 1rem; margin: 1.75rem 0; padding: 1.1rem; list-style: none; text-align: left; background: var(--surface-2); border-radius: var(--radius); }
.confirm-steps li { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); grid-template-areas: "dot title" "dot text"; column-gap: 0.9rem; align-items: center; }
.step-dot { grid-area: dot; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; color: var(--text-muted); background: var(--surface); border: 2px solid var(--border-strong); border-radius: 50%; }
.confirm-steps li.done .step-dot { color: var(--surface); background: var(--success); border-color: var(--success); }
.confirm-steps strong { grid-area: title; line-height: 1.25; }
.confirm-steps li > span:not(.step-dot) { grid-area: text; font-size: 0.88rem; color: var(--text-muted); }
.confirm-actions { display: flex; flex-direction: column; gap: 0.6rem; }
@media (min-width: 640px) { .confirm { padding: 2.5rem 2.5rem; } .confirm-actions { flex-direction: row; justify-content: center; } }

/* ---------- Mis pedidos ---------- */

.orders-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(20rem, 100%), 1fr)); gap: 1rem; margin: 0; padding: 0; }
.order-card { display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--border-strong); border-radius: var(--radius-lg); transition: box-shadow 0.15s ease, transform 0.15s ease; }
.order-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.order-card.is-pendiente { border-top-color: var(--warning); }
.order-card.is-confirmado { border-top-color: var(--info); }
.order-card.is-facturado { border-top-color: var(--teal); }
.order-card.is-preparando { border-top-color: var(--link); }
.order-card.is-listo, .order-card.is-entregado { border-top-color: var(--success); }
.order-card.is-enviado { border-top-color: var(--violet); }
.order-card.is-cancelado { border-top-color: var(--danger); }
.order-card-main { display: flex; flex-direction: column; gap: 0.95rem; padding: 1.1rem 1.1rem 0.9rem; color: inherit; text-decoration: none; }
.order-card-main:hover { color: inherit; }
.oc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.oc-number { font-size: 1.05rem; font-weight: 800; }
.oc-meta { font-size: 0.85rem; color: var(--text-muted); }
.oc-bottom { display: flex; align-items: center; justify-content: space-between; }
.oc-total { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.oc-link { font-size: 0.9rem; font-weight: 700; color: var(--link); }
.order-card > .btn { align-self: flex-start; margin: 0 1.1rem 1.1rem; }

.progress-steps { display: flex; gap: 0.3rem; }
.progress-steps span { flex: 1; height: 0.4rem; background: var(--surface-2); border-radius: 999px; }
.progress-steps .done { background: var(--success); }
.progress-steps .current { background: var(--brand); }
.progress-steps.is-cancelled span { background: var(--danger); }

/* ---------- Detalle del pedido ---------- */

.status-hero {
    --c: var(--link); display: flex; align-items: center; gap: 1rem; padding: 1.25rem; margin: 0.25rem 0 1.25rem;
    background: color-mix(in srgb, var(--c) 10%, var(--surface)); border: 1.5px solid color-mix(in srgb, var(--c) 35%, transparent); border-radius: var(--radius-lg);
}
.status-hero.is-pendiente { --c: var(--warning); }
.status-hero.is-confirmado { --c: var(--info); }
.status-hero.is-facturado { --c: var(--teal); }
.status-hero.is-preparando { --c: var(--link); }
.status-hero.is-listo, .status-hero.is-entregado { --c: var(--success); }
.status-hero.is-enviado { --c: var(--violet); }
.status-hero.is-cancelado { --c: var(--danger); }
.sh-icon { display: grid; place-items: center; flex: none; width: 3.5rem; height: 3.5rem; font-size: 1.6rem; color: var(--surface); background: var(--c); border-radius: 50%; }
.sh-copy { flex: 1; min-width: 0; }
.sh-eyebrow { margin: 0; font-size: 0.85rem; color: var(--text-muted); }
.status-hero h1 { margin: 0.1rem 0; }
.sh-sub { margin: 0; color: var(--text-muted); }
.sh-ref { margin: 0.35rem 0 0; font-size: 0.85rem; font-weight: 700; }
.status-hero > .status { align-self: flex-start; }
@media (max-width: 639.98px) {
    .status-hero { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "icon badge" "copy copy"; gap: 0.9rem; align-items: center; }
    .status-hero .sh-icon { grid-area: icon; }
    .status-hero > .status { grid-area: badge; justify-self: end; }
    .status-hero .sh-copy { grid-area: copy; }
}

.detail-grid { display: grid; gap: 1.25rem; align-items: start; }
.detail-main > .form-panel { margin-bottom: 1.5rem; }
.detail-main .section-title { margin-top: 0; }
@media (min-width: 900px) { .detail-grid { grid-template-columns: minmax(0, 1fr) 24rem; gap: 1.75rem; } .detail-side { position: sticky; top: 6rem; } }

.tracker { margin: 0; padding: 0; list-style: none; }
.tracker li { position: relative; display: grid; grid-template-columns: 2rem 1fr; gap: 0.8rem; padding-bottom: 1.1rem; }
.tracker li:last-child { padding-bottom: 0; }
.tracker li::before { content: ""; position: absolute; top: 2rem; bottom: 0; left: calc(1rem - 1px); width: 2px; background: var(--border-strong); }
.tracker li:last-child::before { display: none; }
.tracker li.done::before { background: var(--success); }
.tracker .dot { display: grid; place-items: center; width: 2rem; height: 2rem; font-size: 0.9rem; color: var(--text-muted); background: var(--surface); border: 2px solid var(--border-strong); border-radius: 50%; }
.tracker li.done .dot { color: var(--surface); background: var(--success); border-color: var(--success); }
.tracker li.current .dot { color: var(--on-brand); background: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.tracker li.cancelled .dot { color: var(--surface); background: var(--danger); border-color: var(--danger); }
.tracker .step-label { font-weight: 700; line-height: 2rem; }
.tracker li.upcoming .step-label { font-weight: 500; color: var(--text-muted); }
.tracker .step-when { display: block; margin-top: -0.35rem; font-size: 0.85rem; font-weight: 400; color: var(--text-muted); }
.tracker .step-note { display: block; margin-top: 0.2rem; padding: 0.4rem 0.7rem; font-size: 0.9rem; font-weight: 400; color: var(--text); background: var(--surface-2); border-radius: var(--radius-sm); }
/* En pantallas anchas el seguimiento va en horizontal */
@media (min-width: 900px) {
    .detail-main .tracker { display: flex; align-items: flex-start; }
    .detail-main .tracker li { flex: 1; align-content: start; grid-template-columns: 1fr; justify-items: center; gap: 0.35rem; padding: 0 0.25rem; text-align: center; }
    .detail-main .tracker li::before { top: 1rem; bottom: auto; left: 50%; width: 100%; height: 2px; }
    .detail-main .tracker li > div { display: flex; flex-direction: column; align-items: center; }
    .detail-main .tracker .dot { position: relative; z-index: 1; }
    .detail-main .tracker .step-label { font-size: 0.85rem; line-height: 1.25; }
    .detail-main .tracker .step-when { margin-top: 0.1rem; font-size: 0.75rem; }
}

/* ---------- Ingreso y cambio de contraseña ---------- */

.auth-shell { display: grid; grid-template-rows: auto 1fr; min-height: 100vh; min-height: 100dvh; background: var(--bg); }
.auth-hero { position: relative; display: flex; flex-direction: column; gap: 1.1rem; overflow: hidden; padding: 1.25rem 1.25rem 1.6rem; color: var(--on-ink); background: linear-gradient(135deg, var(--ink) 0%, var(--ink-2) 100%); }
.auth-hero::before, .auth-hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.auth-hero::before { top: -3rem; right: -2.5rem; width: 9rem; height: 9rem; background: var(--brand); }
.auth-hero::after { right: 4.5rem; bottom: -2rem; width: 4.5rem; height: 4.5rem; background: var(--accent); }
.auth-hero > * { position: relative; z-index: 1; }
.auth-logo { display: inline-flex; align-items: center; gap: 0.7rem; align-self: flex-start; color: var(--on-ink); font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; text-decoration: none; }
.auth-logo:hover { color: var(--on-ink); }
.auth-logo img { border-radius: 12px; }
.auth-hero-copy h2 { max-width: 20rem; margin: 0; font-size: 1.3rem; line-height: 1.2; color: var(--on-ink); }
.auth-points { display: none; }
.auth-main { display: grid; place-items: start center; padding: 1.5rem 1rem 2.5rem; }
.auth-card { width: 100%; max-width: 26rem; padding: 1.6rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.auth-head h1 { margin: 0; font-size: 1.6rem; }
.auth-head p { margin: 0.25rem 0 1.4rem; color: var(--text-muted); }
.auth-help { margin: 1.1rem 0 0; font-size: 0.875rem; color: var(--text-muted); text-align: center; }
.store-main .auth-card, .admin-main .auth-card { margin: 1rem auto; }

@media (min-width: 900px) {
    .auth-shell { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); grid-template-rows: 1fr; }
    .auth-hero { justify-content: space-between; padding: 2.5rem 3.5rem; }
    .auth-hero::before { top: auto; right: -4rem; bottom: -5rem; width: 18rem; height: 18rem; }
    .auth-hero::after { right: 9rem; bottom: 8rem; width: 6rem; height: 6rem; }
    .auth-hero-copy h2 { max-width: 28rem; font-size: 2.5rem; line-height: 1.1; }
    .auth-points { display: flex; flex-direction: column; gap: 0.9rem; margin: 2rem 0 0; padding: 0; list-style: none; }
    .auth-points li { display: flex; align-items: center; gap: 0.85rem; font-weight: 600; color: var(--on-ink-muted); }
    .point-icon { display: grid; place-items: center; flex: none; width: 2.5rem; height: 2.5rem; font-size: 1.15rem; color: var(--accent); background: rgb(255 255 255 / 0.1); border-radius: 12px; }
    .auth-main { place-items: center; padding: 2rem; }
}

.access-user { padding: 0.65rem 0.9rem; font-weight: 700; overflow-wrap: anywhere; background: var(--surface-2); border-radius: 12px; }

/* =====================================================================================================================
   Ofertas y promociones: franja, menú de categorías, tarjetas de promoción, filas de productos y etiquetas de precio
   ===================================================================================================================== */

/* Franja bajo el encabezado (como «Ofertas exclusivas todos los días») */
.promo-strip { color: var(--on-brand); background: var(--brand); }
.promo-strip-inner { display: flex; align-items: center; justify-content: center; gap: 0.6rem; flex-wrap: wrap; max-width: 80rem; margin: 0 auto; padding: 0.45rem 1rem; font-size: 0.88rem; }
.promo-strip-inner .icon { font-size: 1.05rem; }
.promo-strip-link { padding: 0; font: inherit; font-weight: 800; color: inherit; text-decoration: underline; text-underline-offset: 0.18em; background: none; border: 0; cursor: pointer; }
.promo-strip-link:hover { text-decoration-thickness: 2px; }

/* Menú de categorías: Todos · Ofertas · una pestaña por línea */
.category-nav { display: flex; gap: 0.5rem; margin: 0 -1rem 1rem; padding: 0.1rem 1rem 0.5rem; overflow-x: auto; scrollbar-width: none; }
.category-nav::-webkit-scrollbar { display: none; }
.cat-chip {
    flex: none; display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.5rem; padding: 0 1.1rem; font: inherit; font-weight: 700; color: var(--text);
    background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: 999px; cursor: pointer; transition: background-color 0.15s ease, border-color 0.15s ease;
}
.cat-chip:hover { border-color: var(--ink); }
.cat-chip[aria-pressed="true"] { color: var(--on-ink); background: var(--ink); border-color: var(--ink); }
.cat-offers { color: var(--brand-text); border-color: var(--brand); }
.cat-offers:hover { border-color: var(--brand-hover); background: var(--brand-soft); }
.cat-offers[aria-pressed="true"] { color: var(--on-brand); background: var(--brand); border-color: var(--brand); }
.cat-count { display: grid; place-items: center; min-width: 1.4rem; height: 1.4rem; padding: 0 0.35rem; font-size: 0.75rem; color: var(--on-ink); background: var(--ink); border-radius: 999px; }
.cat-offers[aria-pressed="true"] .cat-count { color: var(--on-brand); background: rgb(255 255 255 / 0.55); }
[data-bs-theme="dark"] .cat-offers { color: var(--brand); }

/* Etiquetas de oferta (en las tarjetas y en las promociones). Colores propios y fijos: se leen igual en claro y en oscuro. */
.offer-badge {
    display: inline-flex; align-items: center; max-width: 100%; padding: 0.22rem 0.7rem; font-size: 0.74rem; font-weight: 800; line-height: 1.25; letter-spacing: 0.01em;
    color: #1d1a3d; background: #ff6b3d; border-radius: 999px; box-shadow: 0 2px 6px rgb(0 0 0 / 0.18);
}
.offer-quantityscale { color: #3b2a00; background: #ffc933; }
.offer-buyxpayy { color: #ffffff; background: #5b21b6; }
.offer-orderamount { color: #ffffff; background: #17703f; }

/* Tarjetas de promoción (portada) */
.promos { margin-bottom: 1.6rem; }
.promo-cards { display: flex; gap: 0.85rem; margin: 0 -1rem; padding: 0.2rem 1rem 0.7rem; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; }
.promo-card {
    flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 0.45rem; width: min(17rem, 78vw); padding: 1rem 1.1rem 1.05rem; scroll-snap-align: start;
    background: var(--surface); border: 1.5px solid var(--border); border-top: 5px solid #ff6b3d; border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.promo-card.offer-quantityscale { border-top-color: #ffc933; background: var(--surface); color: inherit; }
.promo-card.offer-buyxpayy { border-top-color: #5b21b6; background: var(--surface); color: inherit; }
.promo-card.offer-orderamount { border-top-color: #17703f; background: var(--surface); color: inherit; }
.promo-card .promo-badge { box-shadow: none; font-size: 0.85rem; padding: 0.3rem 0.85rem; }
.promo-card h3 { margin: 0.15rem 0 0; font-size: 1.05rem; line-height: 1.3; }
.promo-desc { margin: 0; font-size: 0.88rem; color: var(--text-muted); }
.promo-meta { margin: 0; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.promo-cta {
    margin-top: auto; padding: 0.3rem 0; font: inherit; font-weight: 800; color: var(--link); background: none; border: 0; cursor: pointer;
}
.promo-cta:hover { color: var(--link-hover); text-decoration: underline; }
[data-bs-theme="dark"] .promo-cta { color: var(--accent); }
@media (min-width: 640px) { .promo-cards, .category-nav { margin-inline: 0; padding-inline: 0; } }

/* Filas deslizables de productos (En oferta, Novedades) */
.product-row-section { margin-bottom: 1.6rem; }
.row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.65rem; }
.row-head .section-title { margin: 0; }
.row-all { display: inline-flex; align-items: center; gap: 0.2rem; padding: 0.2rem 0; font: inherit; font-size: 0.92rem; font-weight: 800; color: var(--link); background: none; border: 0; cursor: pointer; }
.row-all:hover { text-decoration: underline; }
[data-bs-theme="dark"] .row-all { color: var(--accent); }
.product-row { display: flex; gap: 0.75rem; margin: 0 -1rem; padding: 0.25rem 1rem 0.8rem; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; }
.product-row .product-card { flex: none; width: min(11.75rem, 46vw); scroll-snap-align: start; content-visibility: visible; }
@media (min-width: 640px) { .product-row { margin-inline: 0; padding-inline: 0.1rem; } .product-row .product-card { width: 13.25rem; } }
.all-title { margin: 0.4rem 0 0.2rem; }

/* Tarjeta de producto con oferta */
.product-card.has-offer { border-color: color-mix(in srgb, var(--brand) 55%, var(--border)); }
.pc-offer { position: absolute; top: 1.05rem; left: 1.05rem; z-index: 1; }
.pc-new {
    position: absolute; top: 1.05rem; left: 1.05rem; padding: 0.2rem 0.65rem; font-size: 0.72rem; font-weight: 800; color: #ffffff; background: #0f766e; border-radius: 999px;
    box-shadow: 0 2px 6px rgb(0 0 0 / 0.18);
}
.pc-flag { top: auto; bottom: 0.5rem; }
.product-price-was { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); text-decoration: line-through; }
.product-price.is-offer { color: var(--brand-text); }
[data-bs-theme="dark"] .product-price.is-offer { color: var(--brand); }
.product-saving { display: block; font-weight: 700; color: var(--success); }

/* Carrito y pedido: descuentos visibles */
.line-was { margin-right: 0.35rem; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.line-promo { font-weight: 700; color: var(--success); }
.summary-discount dd, .summary-discount dt { color: var(--success); }
.drawer-sub { display: flex; justify-content: space-between; font-size: 0.9rem; color: var(--text-muted); }
.drawer-discount { color: var(--success); font-weight: 700; }
.drawer-hint, .offer-hint {
    display: flex; align-items: flex-start; gap: 0.5rem; margin: 0; padding: 0.55rem 0.8rem; font-size: 0.85rem; font-weight: 600; color: var(--info);
    background: var(--info-soft); border-radius: var(--radius-sm);
}
.offer-hint .icon, .drawer-hint .icon { flex: none; margin-top: 0.1rem; }

/* Franja de ofertas compacta: una sola línea, y en el celular sin el detalle de cuántas promociones */
.promo-strip-inner { flex-wrap: nowrap; }
.promo-strip-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.promo-strip-link { flex: none; white-space: nowrap; }
.promo-strip-inner .icon { flex: none; }
@media (max-width: 479.98px) { .promo-strip-count { display: none; } }

/* =====================================================================================================================
   Vendedores: barra del cliente elegido, inicio con nivel y cartera, y pedidos
   ===================================================================================================================== */

.store-search-spacer { grid-area: search; }

/* Barra «Pedido para …» (bajo el encabezado, en la tienda y el resumen) */
.seller-bar { color: var(--on-ink); background: var(--ink-2); border-bottom: 1px solid var(--ink-line); }
.seller-bar-inner { display: flex; align-items: center; gap: 0.6rem; max-width: 80rem; margin: 0 auto; padding: 0.5rem 1rem; font-size: 0.9rem; }
.seller-bar-inner .icon { flex: none; color: var(--accent); }
.seller-bar-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seller-bar-link {
    flex: none; margin-left: auto; padding: 0.25rem 0; font: inherit; font-weight: 800; color: var(--accent); text-decoration: underline; text-underline-offset: 0.18em;
    background: none; border: 0; cursor: pointer;
}
.seller-bar-link:hover { color: #fff; }

/* Inicio del vendedor: saludo + tarjeta de nivel */
.seller-hero { display: grid; gap: 1.1rem; margin-bottom: 1.5rem; }
.seller-hello {
    position: relative; overflow: hidden; padding: 1.4rem 1.25rem; color: var(--on-ink); background: linear-gradient(135deg, var(--ink) 0%, var(--ink-2) 100%);
    border-radius: var(--radius-lg);
}
.seller-hello::before { content: ""; position: absolute; top: -3rem; right: -2.4rem; width: 8.5rem; height: 8.5rem; background: var(--brand); border-radius: 50%; }
.seller-hello > * { position: relative; z-index: 1; }
.seller-hello h1 { margin: 0; font-size: 1.85rem; color: var(--on-ink); }
.seller-hello .lead { margin: 0.2rem 0 0; font-size: 1.05rem; color: var(--on-ink-muted); max-width: calc(100% - 4rem); }
@media (min-width: 900px) { .seller-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: stretch; } .seller-hello { padding: 2rem 2.25rem; } .seller-hello h1 { font-size: 2.3rem; } }

.level-card { display: flex; flex-direction: column; gap: 0.9rem; padding: 1.1rem 1.25rem; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.level-head { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
.level-head strong { font-size: 1rem; line-height: 1.35; }
.level-badge {
    display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.9rem; font-size: 0.85rem; font-weight: 800; letter-spacing: 0.02em;
    color: var(--text); background: var(--surface-2); border-radius: 999px;
}
.level-1 { color: #ffffff; background: #8a4b1d; }
.level-2 { color: #ffffff; background: #4b5563; }
.level-3 { color: #3b2a00; background: #ffc933; }
.level-4, .level-5, .level-6 { color: #ffffff; background: #1d1a3d; }

.level-ladder { display: flex; gap: 0.5rem; margin: 0; padding: 0; overflow-x: auto; list-style: none; }
.level-ladder li { flex: 1 0 auto; display: flex; flex-direction: column; gap: 0.05rem; min-width: 5.6rem; padding: 0.5rem 0.8rem; background: var(--surface-2); border: 1.5px solid transparent; border-radius: var(--radius-sm); }
.level-ladder li.is-current { background: var(--brand-soft); border-color: var(--brand); }
.lv-name { font-weight: 800; }
.lv-cap { font-size: 0.78rem; color: var(--text-muted); }

.seller-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; margin: 0; }
.seller-stats > div { padding: 0.55rem 0.7rem; background: var(--surface-2); border-radius: var(--radius-sm); }
.seller-stats dt { font-size: 0.74rem; font-weight: 700; color: var(--text-muted); }
.seller-stats dd { margin: 0.1rem 0 0; font-size: 1.2rem; font-weight: 800; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Celular: los niveles entran los tres en una fila sin barra de desplazamiento y el monto del mes ocupa todo el ancho */
@media (max-width: 479.98px) {
    .level-ladder { gap: 0.35rem; scrollbar-width: none; }
    .level-ladder::-webkit-scrollbar { display: none; }
    .level-ladder li { flex: 1 1 0; min-width: 4.4rem; padding: 0.45rem 0.55rem; }
    .lv-name { font-size: 0.95rem; }
    .lv-cap { font-size: 0.7rem; line-height: 1.2; }
    .seller-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .seller-stats > div:nth-child(2) { grid-column: 1 / -1; order: 3; }
}

.resume-banner { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1.25rem; padding: 0.8rem 0.9rem 0.8rem 1rem; background: var(--brand-soft); border: 1.5px solid var(--brand); border-radius: var(--radius); }
.resume-banner .icon-wrap { display: grid; place-items: center; flex: none; width: 2.6rem; height: 2.6rem; font-size: 1.2rem; color: var(--on-brand); background: var(--brand); border-radius: 50%; }
.resume-banner .grow { flex: 1; min-width: 0; }
.resume-banner strong { display: block; line-height: 1.25; }
.resume-banner span:not(.icon-wrap) { font-size: 0.85rem; color: var(--text-muted); }
@media (max-width: 639.98px) { .resume-banner { flex-wrap: wrap; } .resume-banner .btn { flex: 1 1 100%; } }

.results-head { margin: 0 0 0.75rem; }

/* Cartera: una tarjeta por cliente */
.customer-list { display: grid; gap: 0.7rem; margin: 0 0 1rem; padding: 0; }
@media (min-width: 900px) { .customer-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.customer-card { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "mark info" "actions actions"; gap: 0.75rem 0.9rem; align-items: center; padding: 0.9rem 1rem; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); }
.customer-card.is-inactive { opacity: 0.7; }
.cc-mark {
    --h: 215; grid-area: mark; display: grid; place-items: center; width: 3rem; height: 3rem; font-weight: 800; color: hsl(var(--h) 55% 28%); background: hsl(var(--h) 70% 91%); border-radius: 14px;
}
[data-bs-theme="dark"] .cc-mark { color: hsl(var(--h) 85% 82%); background: hsl(var(--h) 32% 24%); }
.cc-info { grid-area: info; display: flex; flex-direction: column; min-width: 0; }
.cc-name { font-size: 1.05rem; line-height: 1.25; overflow-wrap: anywhere; }
.cc-sub { font-size: 0.88rem; color: var(--text-muted); }
.cc-meta { font-size: 0.8rem; color: var(--text-muted); }
.cc-actions { grid-area: actions; display: flex; }
.cc-actions .btn { flex: 1; }
@media (min-width: 640px) {
    .customer-card { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "mark info actions"; }
    .cc-actions .btn { flex: none; }
}

/* Pedidos del vendedor: de quién y quién lo cargó */
.loaded-chip { display: inline-block; padding: 0.05rem 0.55rem; font-size: 0.74rem; font-weight: 700; color: var(--text-muted); background: var(--surface-2); border-radius: 999px; white-space: nowrap; }
.loaded-chip.is-mine { color: var(--link); background: var(--link-soft); }
[data-bs-theme="dark"] .loaded-chip.is-mine { color: var(--accent); }

/* Descuento extra del vendedor, en el resumen del pedido */
.seller-extra { padding: 0.85rem 0.9rem; background: var(--surface-2); border-radius: var(--radius-sm); }
.seller-extra h3 { margin: 0 0 0.55rem; font-size: 0.95rem; }
.extra-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.5rem; }
.extra-chips .cat-chip { min-height: 2.25rem; padding: 0 0.85rem; font-size: 0.9rem; }
