/* MetaShop web · Metaweb Online SL
   Pensada primero para el móvil (las tiendas piden desde el teléfono) y ampliada para el ordenador. */
:root {
    --navy: #13294f;
    --navy-2: #1b3a6b;
    --blue: #1e5aa8;
    --blue-2: #2f6fc4;
    --blue-soft: #e8f0fb;
    --bg: #f3f5f9;
    --surface: #ffffff;
    --line: #e2e7ef;
    --line-2: #eef1f6;
    --text: #172033;
    --muted: #667189;
    --green: #1f8a3b;
    --red: #c0362c;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(16, 32, 64, .05), 0 6px 20px rgba(16, 32, 64, .06);
    --shadow-lg: 0 18px 50px rgba(16, 32, 64, .18);
    --tabbar-h: 64px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: env(safe-area-inset-top, 0px);
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.65rem; margin: 0 0 .2rem; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
h1:focus { outline: none; }
h2 { font-size: 1.08rem; margin: 0; font-weight: 650; }
p { margin: .25rem 0 .5rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.strong { font-weight: 600; }
.mono { font-family: "Cascadia Mono", ui-monospace, Consolas, monospace; font-size: .88rem; }
.pre { white-space: pre-wrap; }
.icon { flex: none; vertical-align: -0.2em; }
.show-mobile { display: none !important; }

/* ---------- Arranque */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 1.5rem; }
.boot img { width: 200px; }
.boot-bar { width: 160px; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.boot-bar span { display: block; width: 40%; height: 100%; background: var(--blue); animation: boot 1.1s ease-in-out infinite; }
@keyframes boot { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ---------- Acceso */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art {
    background: radial-gradient(circle at 20% 20%, #28528f 0%, var(--navy) 55%, #0b1a35 100%);
    color: #fff; padding: 4rem 4.5rem; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden;
}
.auth-art::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(255, 255, 255, .05); }
.auth-logo { width: 240px; margin-bottom: 2.5rem; }
.auth-art h1 { font-size: 2.2rem; line-height: 1.2; max-width: 16ch; color: #fff; }
.auth-art p { color: #c9d6ec; font-size: 1.05rem; max-width: 40ch; }
.auth-points { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: .8rem; }
.auth-points li { display: flex; align-items: center; gap: .8rem; color: #e3ebf8; }
.auth-points span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-content: center; background: rgba(255, 255, 255, .12); font-weight: 600; }
.auth-form { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 390px; padding: 2rem; }
.auth-card h2 { font-size: 1.4rem; margin-bottom: .25rem; }
.auth-card-logo { display: none; width: 170px; margin: 0 auto 1.25rem; }
.auth-footer { color: var(--muted); font-size: .8rem; margin-top: 1.5rem; }
.auth-single { grid-template-columns: 1fr; place-items: center; padding: 1rem; }
.auth-single .auth-card-logo { display: block; }
.auth-single .auth-card { max-width: 420px; }
.auth-single .button-block { margin-top: .5rem; }

/* ---------- Estructura */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 10px rgba(0, 0, 0, .15); padding-top: var(--safe-t); }
.topbar-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 2rem; padding: 0 1.5rem; height: 60px; }
.brand { display: flex; align-items: center; gap: .75rem; color: #fff; }
.brand:hover { text-decoration: none; }
.brand img { height: 30px; }
.brand-name { font-weight: 650; letter-spacing: .02em; padding-left: .75rem; border-left: 1px solid rgba(255, 255, 255, .25); }
.mainnav { display: flex; gap: .25rem; flex: 1; }
.mainnav-link { white-space: nowrap; color: #c9d6ec; padding: .5rem .9rem; border-radius: 8px; font-weight: 550; }
.mainnav-link:hover { color: #fff; background: rgba(255, 255, 255, .08); text-decoration: none; }
.mainnav-link.active { color: #fff; background: rgba(255, 255, 255, .14); }
.usermenu { margin-left: auto; display: flex; align-items: center; gap: .75rem; }
.usermenu-name { display: flex; align-items: center; gap: .5rem; color: #fff; }
.usermenu-name:hover { text-decoration: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--blue-2), var(--blue)); color: #fff; display: grid; place-content: center; font-size: .8rem; font-weight: 700; flex: none; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.3rem; }
.page { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 1.75rem 1.5rem 3rem; }
.footer { display: flex; align-items: center; justify-content: center; gap: .75rem; padding: 1.25rem; color: var(--muted); font-size: .8rem; border-top: 1px solid var(--line); background: var(--surface); }
.footer img { height: 18px; }
.tabbar { display: none; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.actions, .button-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: .2rem; margin-bottom: .5rem; font-size: .9rem; font-weight: 550; }
.subnav { display: flex; gap: .25rem; margin: -.5rem 0 1.25rem; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav-link { padding: .65rem 1rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 550; white-space: nowrap; }
.subnav-link:hover { color: var(--text); text-decoration: none; }
.subnav-link.active { color: var(--blue); border-color: var(--blue); }

/* ---------- Portada de pedidos */
.hero {
    position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 1.5rem;
    padding: 1.6rem 1.8rem; margin-bottom: 1.25rem; border-radius: 18px; color: #fff;
    background: radial-gradient(circle at 85% -20%, #2f6fc4 0%, transparent 55%), linear-gradient(135deg, #1b3a6b 0%, var(--navy) 70%);
    box-shadow: var(--shadow);
}
.hero::after { content: ""; position: absolute; right: -60px; bottom: -90px; width: 240px; height: 240px; border-radius: 50%; border: 36px solid rgba(255, 255, 255, .05); pointer-events: none; }
.hero h1 { color: #fff; font-size: 1.8rem; }
.hero p { color: #c9d6ec; margin: 0; }
.hero-kicker { font-weight: 600; color: #9fc0ec !important; margin-bottom: .1rem !important; }
.hero-stats { display: flex; gap: .75rem; position: relative; z-index: 1; }
.hero-stat { border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .08); color: #fff; border-radius: 12px; padding: .6rem 1rem; min-width: 104px; text-align: left; cursor: pointer; font: inherit; display: grid; }
.hero-stat:hover { background: rgba(255, 255, 255, .14); }
.hero-stat strong { font-size: 1.5rem; line-height: 1.1; }
.hero-stat span { font-size: .8rem; color: #c9d6ec; }
.hero-cta { position: relative; z-index: 1; }

/* ---------- Tarjetas */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1rem; }
.card-flush { padding: 0; overflow: hidden; }
.card-title { margin-bottom: .9rem; display: flex; align-items: center; gap: .45rem; }
.card-title-pad { padding: 1rem 1.25rem 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.4rem; display: grid; gap: .35rem; color: var(--text); transition: transform .12s, box-shadow .12s; }
.tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(16, 32, 64, .12); }
.tile-icon { color: var(--blue); width: 48px; height: 48px; border-radius: 12px; background: var(--blue-soft); display: grid; place-content: center; margin-bottom: .4rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1rem; margin: 0 0 .75rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 550; min-width: 0; overflow-wrap: anywhere; }
.stack { display: grid; gap: .5rem; }
.empty { text-align: center; padding: 3rem 1rem; }
.empty h1, .empty h2 { justify-content: center; margin-bottom: .5rem; }
.empty-icon { width: 60px; height: 60px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); display: inline-grid; place-content: center; margin-bottom: .75rem; }
.loading { padding: 2.5rem; text-align: center; color: var(--muted); }
.profile-card { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.profile-card h1 { font-size: 1.35rem; }
.push-right { margin-left: auto; }
.push-left { margin-right: auto; }

/* ---------- Botones y formularios */
.button {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border: 1px solid transparent; border-radius: var(--radius-sm);
    padding: .6rem 1.05rem; min-height: 42px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background .12s, border-color .12s, transform .06s;
}
.button:hover { text-decoration: none; }
.button:active:not(:disabled) { transform: scale(.98); }
.button:disabled { opacity: .5; cursor: default; }
.button-primary { background: var(--blue); color: #fff; box-shadow: 0 2px 6px rgba(30, 90, 168, .25); }
.button-primary:hover:not(:disabled) { background: #174a8c; }
.button-light { background: #fff; color: var(--navy); }
.button-light:hover { background: #eef4fd; }
.button-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.button-ghost:hover:not(:disabled) { border-color: #c5cfdd; background: #f8fafc; }
.button-ghost-light { background: transparent; color: #c9d6ec; border-color: rgba(255, 255, 255, .25); padding: .4rem .8rem; min-height: 36px; }
.button-ghost-light:hover { color: #fff; border-color: rgba(255, 255, 255, .5); }
.button-danger { background: var(--red); color: #fff; }
.button-danger-ghost { background: var(--surface); color: var(--red); border-color: #f0c9c5; }
.button-danger-ghost:hover:not(:disabled) { background: #fdf2f1; }
.button-block { width: 100%; }
.button-lg { padding: .75rem 1.3rem; min-height: 48px; font-size: 1rem; }
.button-small { padding: .3rem .7rem; min-height: 32px; font-size: .85rem; }
.icon-button { border: 0; background: transparent; cursor: pointer; color: var(--muted); width: 40px; height: 40px; border-radius: 10px; display: inline-grid; place-content: center; }
.icon-button:hover { background: var(--line-2); color: var(--text); }

input, select, textarea {
    font: inherit; color: var(--text); background: var(--surface); border: 1px solid #cfd7e3; border-radius: var(--radius-sm); padding: .6rem .75rem; width: 100%;
    min-height: 42px; transition: border-color .12s, box-shadow .12s;
}
textarea { min-height: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(30, 90, 168, .15); }
input[readonly] { background: #f5f7fa; color: var(--muted); }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--blue); }
.field { display: grid; gap: .35rem; margin-bottom: .9rem; }
.field > span { font-size: .85rem; font-weight: 600; color: #3b4658; }
.field-wide { grid-column: 1 / -1; }
.check { display: flex; align-items: flex-start; gap: .55rem; cursor: pointer; margin-bottom: .6rem; }
.check input { margin-top: .15rem; }
.check-list { display: grid; gap: .3rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 1rem; align-items: end; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .75rem 1rem; }
.form-row .field { margin-bottom: 0; }
.form-actions { display: flex; justify-content: flex-end; }
.section-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1.2rem 0 .6rem; }

.alert { border-radius: var(--radius-sm); padding: .75rem 1rem; margin: .5rem 0 1rem; border: 1px solid; }
.alert-error { background: #fdf2f1; border-color: #f0c9c5; color: #8e2a22; }
.alert-ok { background: #effaf2; border-color: #bfe5ca; color: #17652c; }

/* ---------- Filtros */
.toolbar { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar .search { flex: 1; min-width: 220px; max-width: 460px; }
.toolbar select { width: auto; min-width: 180px; }
.toolbar .check { margin: 0; }
.search-box { flex: 1; min-width: 220px; max-width: 480px; position: relative; display: flex; align-items: center; }
.search-box .icon { position: absolute; left: .8rem; color: var(--muted); pointer-events: none; }
.search-box input { padding-left: 2.4rem; }
.status-strip { display: flex; gap: .5rem; margin-bottom: 1rem; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.status-strip::-webkit-scrollbar { display: none; }
.chip {
    --chip: var(--blue); flex: none; display: inline-flex; align-items: center; gap: .45rem; border: 1px solid var(--line); background: var(--surface);
    border-radius: 999px; padding: .4rem .9rem; min-height: 38px; font: inherit; font-size: .88rem; cursor: pointer; color: var(--text); white-space: nowrap;
}
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--chip); }
.chip b { font-size: .75rem; background: var(--line-2); border-radius: 999px; padding: .05rem .45rem; }
.chip:hover { border-color: #c5cfdd; }
.chip-on { border-color: var(--chip); background: color-mix(in srgb, var(--chip) 12%, white); font-weight: 650; }
.chip-on b { background: color-mix(in srgb, var(--chip) 25%, white); }

/* ---------- Tablas */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; padding: .75rem 1rem; background: #f8fafc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .75rem 1rem; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table-click tbody tr { cursor: pointer; }
.table-click tbody tr:hover td { background: #f6f9fe; }
.row-off td { color: var(--muted); }
.row-note td { font-size: .82rem; color: var(--blue); padding-top: 0; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: .75rem; padding: .75rem 1rem; border-top: 1px solid var(--line-2); color: var(--muted); font-size: .88rem; }
.badge {
    --badge: #6b7280; display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 650;
    color: color-mix(in srgb, var(--badge) 55%, black); background: color-mix(in srgb, var(--badge) 16%, white); white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--badge); }

/* ---------- Tarjetas de pedido (móvil) */
.order-cards { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .65rem; }
.order-card {
    --status: var(--blue); display: grid; gap: .35rem; padding: .95rem 1rem .9rem 1.15rem; background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); position: relative; overflow: hidden;
}
.order-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--status); }
.order-card:hover { text-decoration: none; }
.order-card:active { background: #f7faff; }
.order-card-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.order-card-top strong { font-size: 1.02rem; }
.order-card-meta { color: var(--muted); font-size: .88rem; }
.order-card-bottom { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; font-size: .88rem; }
.order-card-bottom strong { font-size: 1.05rem; color: var(--navy); }
.order-cards li:has(.order-card-tracking) .order-card { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.order-card-tracking {
    display: flex; align-items: center; justify-content: center; gap: .4rem; margin-top: -1px; padding: .6rem; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, #0f7a45, #13985a); border-radius: 0 0 var(--radius) var(--radius);
}
.order-card-tracking:hover { text-decoration: none; }
.tracking-chip { display: inline-flex; align-items: center; gap: .25rem; margin-left: .4rem; padding: .2rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 650; color: #0f7a45; background: #e3f6ec; }
.tracking-chip:hover { text-decoration: none; background: #d2f0e0; }

/* ---------- Pestañas */
.tabs { display: flex; gap: .4rem; margin-bottom: 1rem; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; border: 1px solid var(--line); background: var(--surface); padding: .6rem 1.2rem; min-height: 44px; border-radius: 12px; font: inherit; font-weight: 600; cursor: pointer; color: var(--muted); display: inline-flex; gap: .5rem; align-items: center; }
.tab:hover { color: var(--text); }
.tab-on { background: var(--navy); border-color: var(--navy); color: #fff; }
.tab-on:hover { color: #fff; }
.tab-count { background: var(--blue-2); color: #fff; border-radius: 999px; font-size: .75rem; padding: 0 .5rem; min-width: 1.4rem; text-align: center; }

/* ---------- Pedido */
.order-head { align-items: center; }
.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.25rem; align-items: start; }
.order-side { position: sticky; top: 76px; }
.action-bar { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; margin: -.25rem 0 1rem; }
.totals dl, .totals-mini { display: grid; grid-template-columns: 1fr auto; gap: .4rem; margin: 0 0 .5rem; }
.totals dd, .totals-mini dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.totals .total, .totals-mini .total { font-size: 1.2rem; font-weight: 750; padding-top: .5rem; border-top: 1px solid var(--line); color: var(--navy); }
.progress { list-style: none; display: flex; padding: 1.25rem 1rem; margin: 0 0 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.progress li { --step: var(--blue); flex: 1; min-width: 100px; display: grid; justify-items: center; gap: .45rem; position: relative; text-align: center; color: var(--muted); font-size: .85rem; }
.progress li::before { content: ""; position: absolute; top: 16px; left: -50%; right: 50%; height: 3px; background: var(--line); z-index: 0; }
.progress li:first-child::before { display: none; }
.progress li.done::before, .progress li.current::before { background: var(--step); }
.progress .dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-content: center; background: var(--surface); border: 2px solid var(--line); font-weight: 700; position: relative; z-index: 1; }
.progress li.done .dot { background: var(--step); border-color: var(--step); color: #fff; }
.progress li.current .dot { border-color: var(--step); color: color-mix(in srgb, var(--step) 60%, black); box-shadow: 0 0 0 5px color-mix(in srgb, var(--step) 20%, white); }
.progress li.current .label { color: var(--text); font-weight: 650; }
.progress-mini { --step: var(--blue); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: .9rem 1rem; margin-bottom: 1rem; gap: .5rem; }
.progress-mini-head { display: flex; justify-content: space-between; align-items: baseline; }
.progress-mini-bar { display: flex; gap: 4px; }
.progress-mini-bar i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.progress-mini-bar i.on { background: var(--step); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 .5rem; }
.timeline li { --dot: var(--blue); position: relative; padding: 0 0 1rem 1.4rem; border-left: 2px solid var(--line); }
.timeline li:last-child { border-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--dot); border: 2px solid var(--surface); }
.timeline-head { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.line-list { list-style: none; margin: .5rem 0 0; padding: 0; }
.line-list li { display: flex; justify-content: space-between; gap: .75rem; padding: .7rem 1rem; border-top: 1px solid var(--line-2); }
.line-list-main { display: grid; gap: .1rem; min-width: 0; }
.line-list-side { display: grid; justify-items: end; gap: .1rem; white-space: nowrap; }

/* Seguimiento del envío */
.tracking {
    display: flex; align-items: center; gap: 1rem; padding: 1rem 1.2rem; margin-bottom: 1rem; border-radius: var(--radius); color: #fff;
    background: linear-gradient(135deg, #0f7a45, #13985a); box-shadow: 0 6px 20px rgba(19, 152, 90, .25);
}
.tracking:hover { text-decoration: none; filter: brightness(1.05); }
.tracking-icon { width: 48px; height: 48px; border-radius: 12px; background: rgba(255, 255, 255, .16); display: grid; place-content: center; flex: none; }
.tracking-text { display: grid; gap: .1rem; flex: 1; min-width: 0; }
.tracking-text strong { font-size: 1.05rem; }
.tracking-text span { color: #d5f3e2; font-size: .88rem; }
.tracking-go { display: inline-flex; align-items: center; gap: .3rem; background: #fff; color: #0f7a45; font-weight: 700; padding: .55rem .95rem; border-radius: 999px; white-space: nowrap; }

/* ---------- Nuevo pedido: catálogo en cuadrícula */
.catalog-notice { background: #fdf6e3; border-bottom: 1px solid #f1e3b8; color: #8a6212; font-weight: 650; font-size: .9rem; padding: .65rem 1.1rem; }
.catalog-row { padding: .85rem 1.1rem .95rem; border-bottom: 1px dashed var(--line); }
.catalog-row:last-child { border-bottom: 0; }
.catalog-row-title { font-size: .98rem; font-weight: 750; margin: 0 0 .55rem; color: var(--text); }
.catalog-row-price { font-weight: 500; color: var(--muted); font-size: .85rem; margin-left: .35rem; }
.catalog-cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: .55rem; }
.catalog-cell { display: grid; gap: .25rem; cursor: text; min-width: 0; }
.catalog-cell-label { display: flex; align-items: center; gap: .35rem; font-size: .84rem; font-weight: 600; color: #4b5563; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.catalog-cell-label .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.catalog-cell input { text-align: center; padding: .5rem .3rem; min-height: 44px; font-weight: 600; -moz-appearance: textfield; }
.catalog-cell input::placeholder { color: #b8c0cc; font-weight: 400; }
.catalog-cell input::-webkit-outer-spin-button, .catalog-cell input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.catalog-cell-price { font-size: .75rem; color: var(--muted); text-align: center; }
.catalog-cell-on input { border-color: var(--blue); background: #eef5ff; font-weight: 750; color: var(--navy); }
.catalog-cell-empty { visibility: hidden; }
.cart-head { display: flex; justify-content: space-between; align-items: flex-start; }
.cart-lines { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .5rem; max-height: 300px; overflow-y: auto; }
.cart-lines li { display: grid; grid-template-columns: 1fr auto; gap: .5rem; font-size: .9rem; }
.cart-name { display: grid; }
.cart-qty { color: var(--blue); font-weight: 700; font-size: .8rem; }
.cart-amount { font-variant-numeric: tabular-nums; }
.cart .field:first-of-type { margin-top: .5rem; }
.cartbar, .sheet-backdrop { display: none; }

/* ---------- Tarifas */
.price-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.price-lists { display: grid; }
.price-list { text-align: left; border: 0; border-bottom: 1px solid var(--line-2); background: transparent; padding: .85rem 1rem; font: inherit; cursor: pointer; display: grid; gap: .15rem; }
.price-list:hover { background: #f6f9fe; }
.price-list-on { background: var(--blue-soft); box-shadow: inset 3px 0 0 var(--blue); }
.input-price { width: 110px; text-align: right; padding: .35rem .5rem; min-height: 36px; }
.price-items input[type=date] { width: 150px; padding: .35rem .5rem; min-height: 36px; }

/* ---------- Ventanas */
.modal-backdrop { position: fixed; inset: 0; background: rgba(12, 22, 42, .45); z-index: 40; animation: fade .15s; }
.modal {
    position: fixed; z-index: 41; left: 50%; top: 6vh; transform: translateX(-50%); width: min(560px, calc(100vw - 2rem)); max-height: 88vh;
    display: flex; flex-direction: column; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); animation: pop .15s;
}
.modal-wide { width: min(880px, calc(100vw - 2rem)); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.modal-body { padding: 1.25rem; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; padding: .9rem 1.25rem; border-top: 1px solid var(--line); background: #fafbfd; border-radius: 0 0 16px 16px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 8px); } }
@keyframes rise { from { transform: translateY(100%); } }

/* ---------- Error de Blazor */
#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000; background: #fff4d6; padding: .75rem 1.25rem calc(.75rem + var(--safe-b)); box-shadow: 0 -2px 8px rgba(0, 0, 0, .15); }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 1rem; top: .6rem; }

/* =====================================================================
   Tableta
   ===================================================================== */
@media (max-width: 1000px) {
    .order-layout, .price-layout { grid-template-columns: minmax(0, 1fr); }
    .order-side { position: static; }
    .auth { grid-template-columns: 1fr; }
    .auth-art { display: none; }
    .auth-card-logo { display: block; }
    .hero { grid-template-columns: 1fr auto; }
    .hero-stats { grid-column: 1 / -1; grid-row: 2; }
}

/* =====================================================================
   Móvil
   ===================================================================== */
@media (max-width: 720px) {
    .show-mobile { display: block !important; }
    .order-cards.show-mobile, .line-list.show-mobile, .progress-mini.show-mobile { display: grid !important; }
    .hide-mobile { display: none !important; }

    /* Sin zoom automático de iOS al tocar un campo: 16 px mínimo. */
    input, select, textarea { font-size: 16px; min-height: 46px; }
    input[type=checkbox] { min-height: 0; }

    .topbar-inner { height: 54px; padding: 0 1rem; gap: .75rem; }
    .brand img { height: 26px; }
    .mainnav, .usermenu-text { display: none; }
    .avatar { width: 32px; height: 32px; }

    .page { padding: 1rem .9rem calc(var(--tabbar-h) + 1.25rem + var(--safe-b)); }
    .footer { display: none; }
    h1 { font-size: 1.35rem; }
    .page-head { margin-bottom: 1rem; align-items: flex-start; }
    .card { padding: 1rem; border-radius: 12px; }
    .card-flush { padding: 0; }
    .card-title-pad { padding: .9rem 1rem 0; }

    /* Barra inferior */
    .tabbar {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--tabbar-h) + var(--safe-b));
        padding-bottom: var(--safe-b); background: rgba(255, 255, 255, .97); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
        box-shadow: 0 -4px 16px rgba(16, 32, 64, .06);
    }
    .tabbar-link { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; color: var(--muted); font-size: .72rem; font-weight: 600; }
    .tabbar-link:hover { text-decoration: none; }
    .tabbar-link.active { color: var(--blue); }
    .tabbar-plus { width: 46px; height: 46px; margin-top: -20px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-content: center; box-shadow: 0 6px 16px rgba(30, 90, 168, .35); border: 3px solid #fff; }
    .shell-focus .tabbar { display: none; }
    .shell-focus .page { padding-bottom: calc(96px + var(--safe-b)); }

    /* Portada */
    .hero { grid-template-columns: 1fr; gap: 1rem; padding: 1.2rem; border-radius: 16px; }
    .hero h1 { font-size: 1.45rem; }
    .hero-stats { grid-row: auto; }
    .hero-stat { flex: 1; min-width: 0; }
    .hero-cta { width: 100%; }
    .toolbar { gap: .5rem; }
    .toolbar select, .search-box { width: 100%; max-width: none; min-width: 0; flex: 1 1 100%; }
    .toolbar .search { max-width: none; min-width: 0; flex: 1 1 100%; }
    .status-strip { margin: 0 -.9rem 1rem; padding: 0 .9rem 2px; }
    .pager { justify-content: center; border-top: 0; }

    /* Pedido */
    .order-head { flex-wrap: nowrap; }
    .action-bar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin-top: 0; }
    .action-bar .button { padding: .6rem .5rem; }
    .tracking { flex-wrap: wrap; padding: 1rem; gap: .8rem; }
    .tracking-go { width: 100%; justify-content: center; padding: .7rem; }
    .facts { grid-template-columns: 1fr 1.3fr; }

    /* Nuevo pedido: pestañas fijas arriba y carrito abajo */
    .tabs { position: sticky; top: calc(54px + var(--safe-t)); z-index: 10; background: var(--bg); margin: 0 -.9rem .75rem; padding: .5rem .9rem; }
    .tab { flex: 1; justify-content: center; padding: .55rem .6rem; }
    .catalog-row { padding: .8rem .9rem .9rem; }
    .catalog-cells { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem; }
    .catalog-cell-label { font-size: .76rem; gap: .25rem; }
    .catalog-cell-label .dot { width: 8px; height: 8px; }
    .catalog-cell-empty { display: none; }
    .cartbar {
        display: flex; align-items: center; justify-content: space-between; gap: 1rem; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
        padding: .7rem .9rem calc(.7rem + var(--safe-b)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(16, 32, 64, .1);
    }
    .cartbar-info { display: grid; }
    .cartbar-count { color: var(--muted); font-size: .82rem; display: inline-flex; align-items: center; gap: .3rem; }
    .cartbar-info strong { font-size: 1.25rem; color: var(--navy); }
    .order-side:not(.sheet-open) .cart { display: none; }
    .sheet-backdrop { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(12, 22, 42, .45); animation: fade .15s; }
    .order-side.sheet-open {
        position: fixed; left: 0; right: 0; top: auto; bottom: 0; z-index: 45; max-height: 88vh; overflow-y: auto; animation: rise .2s ease-out;
        border-radius: 18px 18px 0 0; background: var(--surface); padding-bottom: var(--safe-b);
    }
    .order-side.sheet-open .cart { margin: 0; border: 0; box-shadow: none; border-radius: 18px 18px 0 0; }
    .order-side.sheet-open .cart::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: -.25rem auto .75rem; }
    .cart-lines { max-height: 34vh; }

    /* Ventanas como hoja desde abajo */
    .modal, .modal-wide { left: 0; right: 0; top: auto; bottom: 0; transform: none; width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; animation: rise .2s ease-out; }
    .modal-footer { border-radius: 0; padding-bottom: calc(.9rem + var(--safe-b)); }
    .modal-footer .button { flex: 1; }
    .form-grid { grid-template-columns: 1fr; }

    /* Listas de la administración: cada fila, una tarjeta con sus etiquetas */
    .table-cards thead { display: none; }
    .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
    .table-cards tr { padding: .8rem 1rem; border-bottom: 1px solid var(--line-2); }
    .table-cards tbody tr:last-child { border-bottom: 0; }
    .table-cards td { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .18rem 0; border: 0 !important; text-align: right; }
    .table-cards td::before { content: attr(data-label); flex: none; color: var(--muted); font-size: .8rem; font-weight: 500; text-align: left; }
    .table-cards td:first-child { justify-content: flex-start; font-size: 1rem; font-weight: 700; padding-bottom: .3rem; }
    .table-cards td:first-child::before, .table-cards td[data-label=""]::before { display: none; }
    .table-cards td { border: 0 !important; }
    .table-cards td[data-label=""] { justify-content: flex-end; padding-top: .4rem; }
    .table-cards td > div { text-align: right; }
    .table-cards tr.row-note td { display: block; text-align: left; padding: 0 1rem .6rem; }
    .table-click.table-cards tbody tr:active { background: #f6f9fe; }

    /* Administración */
    .subnav { margin: -.25rem -.9rem 1rem; padding: 0 .9rem; }
    .tiles { grid-template-columns: 1fr 1fr; gap: .75rem; }
    .tile { padding: 1rem; }
    .price-items input[type=date] { width: 140px; }
    .profile-card .push-right { margin-left: 0; width: 100%; }
}

@media (max-width: 370px) {
    .catalog-cells { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Catálogo por secciones (Copistería Low Cost, 2026-10) */
.catalog { margin-bottom: 1rem; overflow: hidden; }
.catalog-head { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: .9rem 1.1rem; background: linear-gradient(180deg, #f7f9fd, #eef3fb); border-bottom: 1px solid var(--line); }
.catalog-head h2 { font-size: 1.05rem; font-weight: 750; color: var(--navy); display: flex; align-items: center; gap: .5rem; }
.catalog-head h2::before { content: ""; width: 4px; height: 1.1em; border-radius: 2px; background: var(--blue); }
.catalog-head-meta { color: var(--muted); font-size: .82rem; font-weight: 500; }
.catalog-search-note { margin: -.25rem 0 .75rem; color: var(--muted); font-size: .9rem; }
.catalog-row { transition: background .15s; }
.catalog-row-on { background: #f5f9ff; }
.catalog-row-head { display: flex; align-items: baseline; gap: .2rem .6rem; flex-wrap: wrap; margin: 0 0 .55rem; }
.catalog-row-title { margin: 0; font-weight: 700; font-size: .95rem; }
.catalog-row-price { margin-left: 0; }
.catalog-row-price strong { color: var(--navy); font-weight: 700; }
.catalog-row-single { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.catalog-row-single .catalog-row-head { margin: 0; display: grid; gap: .15rem; min-width: 0; }
.catalog-row-single .catalog-cells { display: block; flex: none; width: 120px; }
.catalog-row-single .catalog-cell-label { display: none; }
.catalog-matrix .catalog-cells { grid-template-columns: repeat(8, minmax(0, 1fr)); }
@media (max-width: 1280px) { .catalog-matrix .catalog-cells { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.catalog-cell-label .dot { width: 12px; height: 12px; }
.catalog-cell input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 111, 196, .18); outline: none; }

@media (max-width: 720px) {
    .catalog { margin-bottom: .75rem; }
    .catalog-head { padding: .75rem .9rem; }
    .tab { flex: 1 0 auto; }
    .catalog-cells { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .catalog-matrix .catalog-cells { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; }
    .catalog-matrix .catalog-cell-label { font-size: .7rem; }
    .catalog-row-single { gap: .75rem; }
    .catalog-row-single .catalog-cells { width: 96px; }
    .catalog-row-title { font-size: .9rem; }
}
/* ---------- Catálogo v2: tarjetas de color compactas */
.size-pill { display: inline-flex; align-items: center; padding: .2rem .65rem; border-radius: 999px; background: var(--navy); color: #fff; font-weight: 750; font-size: .88rem; letter-spacing: .01em; }
.row-sub { color: var(--muted); font-weight: 600; font-size: .85rem; }
.catalog-row-title { display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.catalog-matrix .catalog-row { padding: 1rem 1.1rem 1.1rem; }
.catalog-matrix .catalog-row-head { margin-bottom: .75rem; }
.catalog-matrix .catalog-cells { display: flex; flex-wrap: wrap; gap: .6rem; }
.catalog-matrix .catalog-cell {
    position: relative; overflow: hidden; width: 116px; padding: .7rem .6rem .55rem; gap: .4rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16, 32, 64, .05); transition: border-color .15s, box-shadow .15s, transform .15s;
}
.catalog-matrix .catalog-cell::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--c, var(--line)); }
.catalog-matrix .catalog-cell:hover { border-color: #bcd0ee; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(16, 32, 64, .08); }
.catalog-matrix .catalog-cell-on { border-color: var(--blue); background: #f2f7ff; box-shadow: 0 0 0 3px rgba(47, 111, 196, .14); }
.catalog-matrix .catalog-cell-label { font-size: .8rem; color: var(--text); }
.catalog-matrix .catalog-cell-label .dot { width: 14px; height: 14px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15), 0 0 0 2px #fff, 0 0 0 3px var(--line); }
.catalog-matrix .catalog-cell input { min-height: 40px; border-radius: 9px; background: #f8fafc; }
.catalog-matrix .catalog-cell-on input { background: #fff; }
.catalog-matrix .catalog-cell-price { font-weight: 650; color: var(--navy); font-size: .78rem; }
.catalog-row-single .catalog-row-title { gap: .45rem; }

@media (max-width: 720px) {
    .catalog-matrix .catalog-row { padding: .85rem .9rem .95rem; }
    .catalog-matrix .catalog-cells { gap: .45rem; }
    .catalog-matrix .catalog-cell { width: calc((100% - .9rem) / 3); padding: .6rem .45rem .45rem; }
    .catalog-matrix .catalog-cell-label { font-size: .74rem; }
    .size-pill { font-size: .82rem; padding: .15rem .55rem; }
}
.catalog-matrix .catalog-cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .55rem; }
.catalog-matrix .catalog-cell { width: auto; min-width: 0; }
@media (max-width: 720px) {
    .catalog-matrix .catalog-cells { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; }
    .catalog-matrix .catalog-cell { width: auto; padding: .55rem .35rem .4rem; }
    .catalog-matrix .catalog-cell-label { font-size: .68rem; gap: .25rem; }
    .catalog-matrix .catalog-cell-label .dot { width: 11px; height: 11px; }
    .catalog-matrix .catalog-cell input { min-height: 40px; padding: .4rem .2rem; }
}
.catalog-matrix .catalog-cells { grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); }
.catalog-matrix .catalog-cell-label { white-space: normal; overflow: visible; line-height: 1.15; min-height: 2.3em; align-items: flex-start; }
.catalog-matrix .catalog-cell-label .dot { margin-top: .05em; }
@media (min-width: 1100px) { .catalog-matrix .catalog-cells { grid-template-columns: repeat(auto-fit, minmax(104px, 128px)); } }
@media (max-width: 720px) { .catalog-matrix .catalog-cells { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .catalog-matrix .catalog-cells { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .5rem; } .catalog-matrix .catalog-cell { padding: .7rem .45rem .5rem; } }
@media (max-width: 720px) {
    .catalog-matrix .catalog-cell { padding: .55rem .3rem .4rem; }
    .catalog-matrix .catalog-cell-label { font-size: .64rem; gap: .2rem; }
    .catalog-matrix .catalog-cell-label .dot { width: 9px; height: 9px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
}
/* ---------- Tarifas: la tabla cabe en su tarjeta */
.price-layout { grid-template-columns: 220px minmax(0, 1fr); }
.card:has(> .price-items), .card:has(.price-items) { overflow-x: auto; }
.price-items th, .price-items td { padding: .6rem .55rem; }
.price-items th:first-child, .price-items td:first-child { padding-left: 1rem; }
.price-items th:last-child, .price-items td:last-child { padding-right: 1rem; }
.price-items .input-price { width: 92px; }
.price-items input[type=date] { width: 136px; }
.price-items td.strong { min-width: 150px; }
/* ---------- Descuento por producto */
.price-was { color: var(--muted); font-size: .8rem; margin-left: .4rem; }
.disc-badge { display: inline-block; margin-left: .35rem; padding: .05rem .45rem; border-radius: 999px; background: #e7f6ec; color: #1f8a3b; font-weight: 750; font-size: .75rem; }

/* ---------- Productos exclusivos de algunas empresas (ficha de producto) */
.tag-exclusive { display: inline-block; margin-left: .4rem; padding: .08rem .5rem; border-radius: 999px; background: #f3ecff; color: #5b34b4; font-weight: 650; font-size: .72rem; vertical-align: middle; white-space: nowrap; }
.choice-row { display: flex; gap: .25rem 1.5rem; flex-wrap: wrap; }
.pick-filter { width: 100%; margin-bottom: .5rem; }
.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .35rem .75rem; max-height: 240px; overflow-y: auto; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fafbfd; margin-bottom: .4rem; }
.pick-list .check { margin: 0; padding: .3rem .45rem; border-radius: 8px; }
.pick-list .check-on { background: var(--blue-soft); }

/* ---------- Administración › Actualizaciones (publicar versiones del programa de escritorio) */
.release-grid { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 1rem; align-items: start; }
.release-version { font-size: 2.6rem; font-weight: 750; letter-spacing: -.02em; color: var(--navy); line-height: 1.1; }
.release-now .button { margin: .6rem 0 .9rem; }
.release-files summary { cursor: pointer; color: var(--muted); font-size: .88rem; }
.release-files ul, .release-pending { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .3rem; }
.release-files li, .release-pending li { display: flex; justify-content: space-between; gap: 1rem; font-size: .88rem; overflow-wrap: anywhere; }
.release-steps { margin: 0 0 1rem; padding-left: 1.2rem; display: grid; gap: .35rem; color: #3b4658; }
.release-actions { display: flex; justify-content: flex-end; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }
.dropzone { position: relative; display: grid; justify-items: center; gap: .3rem; padding: 1.6rem 1rem; border: 2px dashed #c5d3e8; border-radius: var(--radius); background: #f7faff; color: var(--blue); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover { border-color: var(--blue-2); background: var(--blue-soft); }
.dropzone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone-busy { opacity: .6; pointer-events: none; }
.upload-list { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .6rem; }
.upload-head { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .25rem; overflow-wrap: anywhere; }
.bar { height: 6px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--blue-2); transition: width .2s; }
.upload-done .bar i { background: var(--green); }
.upload-error .bar i { background: var(--red); }
.upload-error .upload-head .muted { color: var(--red); }
.alert-warn { background: #fff8eb; border-color: #f3d9a4; color: #7a4d06; }
.alert-warn ul { margin: .35rem 0 0; padding-left: 1.2rem; }
@media (max-width: 860px) { .release-grid { grid-template-columns: 1fr; } }

/* =====================================================================
   MetaShop como app (rediseño 2026-11): móvil y tableta primero.
   - Móvil (≤ 720 px): cabecera clara, barra de navegación flotante abajo, hojas desde abajo.
   - Tableta (721–1200 px): barra lateral con la misma navegación, tarjetas táctiles, carrito en hoja.
   - Ordenador (> 1200 px): la cabecera de siempre.
   Va al final del fichero: afina o sustituye las reglas anteriores sin tocarlas.
   ===================================================================== */
:root { --rail-w: 0px; --radius: 16px; --radius-sm: 12px; --bg: #f4f6fa; --ease: cubic-bezier(.2, .8, .2, 1); }
.brand-light, .rail-only, .show-touch { display: none !important; }
button, a, label, summary, .tab, .chip { touch-action: manipulation; }
/* Solo opacidad: un transform aquí encerraría dentro de la página las hojas y barras fijas (carrito, ventanas). */
.page > * { animation: page-in .25s ease-out; }
@keyframes page-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.card { border-color: #e7ebf2; }
.button { border-radius: 12px; }
.modal { border-radius: 20px; }
.order-cards.show-touch { margin-bottom: 1rem; }

/* ---------- Táctil (móvil y tableta) */
@media (max-width: 1200px) {
    .show-touch { display: block !important; }
    .order-cards.show-touch { display: grid !important; }
    .hide-touch { display: none !important; }
    .mainnav { display: none; }
    .footer { display: none; }

    /* Sin zoom automático de iOS al tocar un campo y dedos antes que ratón. */
    input, select, textarea { font-size: 16px; min-height: 46px; border-radius: 12px; }
    input[type=checkbox], input[type=radio] { min-height: 0; width: 20px; height: 20px; }
    .button { min-height: 46px; }
    .button-small { min-height: 38px; }
    .icon-button { width: 44px; height: 44px; }
    .table td { padding: .9rem 1rem; }

    /* Buscadores y filtros con aspecto de app */
    .search-box input, .toolbar .search, .pick-filter { background: #e9edf4; border-color: transparent; }
    .search-box input:focus, .toolbar .search:focus, .pick-filter:focus { background: var(--surface); border-color: var(--blue); }
    .chip { min-height: 42px; box-shadow: 0 1px 2px rgba(16, 32, 64, .04); }
    .tab { border-radius: 999px; }
    .subnav { border-bottom: 0; gap: .4rem; margin-bottom: 1rem; }
    .subnav-link { border: 1px solid var(--line); border-radius: 999px; margin: 0; padding: .5rem 1rem; background: var(--surface); }
    .subnav-link.active { background: var(--navy); border-color: var(--navy); color: #fff; }

    /* Pedidos como tarjetas */
    .order-cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .75rem; }
    .order-card { border: 0; border-radius: 16px; padding: 1rem 1.1rem 1rem 1.3rem; box-shadow: 0 1px 2px rgba(16, 32, 64, .06), 0 8px 24px rgba(16, 32, 64, .06); transition: transform .12s var(--ease); }
    .order-card::before { top: 12px; bottom: 12px; left: 6px; width: 4px; border-radius: 4px; }
    .order-card:active { transform: scale(.985); }
    .order-card-top strong { font-size: 1.08rem; letter-spacing: -.01em; }
    .order-card-bottom { margin-top: .15rem; padding-top: .55rem; border-top: 1px solid var(--line-2); }
    .hero { border-radius: 22px; }
    .tile { border: 0; border-radius: 18px; }
    .tile:active { transform: scale(.98); }
}

/* ---------- Carrito en hoja inferior mientras el pedido va en una sola columna (móvil y tableta en vertical) */
@media (min-width: 721px) and (max-width: 1000px) {
    .show-mobile.icon-button { display: inline-grid !important; }
    .cartbar {
        display: flex; align-items: center; justify-content: space-between; gap: 1rem; position: fixed; left: var(--rail-w); right: 0; bottom: 0; z-index: 30;
        padding: .8rem 1.5rem calc(.8rem + var(--safe-b)); background: rgba(255, 255, 255, .94); backdrop-filter: saturate(180%) blur(16px);
        border-top: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(16, 32, 64, .1);
    }
    .cartbar-info { display: flex; align-items: baseline; gap: 1rem; }
    .cartbar-count { color: var(--muted); display: inline-flex; align-items: center; gap: .35rem; }
    .cartbar-info strong { font-size: 1.4rem; color: var(--navy); }
    .cartbar .button { min-width: 220px; }
    .shell .page:has(.cartbar) { padding-bottom: calc(110px + var(--safe-b)); }
    .order-side:not(.sheet-open) .cart { display: none; }
    .sheet-backdrop { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(12, 22, 42, .45); animation: fade .15s; }
    .order-side.sheet-open {
        position: fixed; left: var(--rail-w); right: 0; top: auto; bottom: 0; z-index: 45; margin: 0 auto; width: min(620px, calc(100vw - var(--rail-w) - 2rem));
        max-height: 86vh; overflow-y: auto; animation: rise .25s var(--ease); border-radius: 22px 22px 0 0; background: var(--surface); padding-bottom: var(--safe-b);
        box-shadow: var(--shadow-lg);
    }
    .order-side.sheet-open .cart { margin: 0; border: 0; box-shadow: none; border-radius: 22px 22px 0 0; padding: 1.4rem 1.5rem; }
    .order-side.sheet-open .cart::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: #d5dbe6; margin: -.5rem auto .9rem; }
    .cart-lines { max-height: 40vh; }
}

/* ---------- Tableta: barra lateral */
@media (min-width: 721px) and (max-width: 1200px) {
    :root { --rail-w: 92px; }
    .rail-only { display: flex !important; }
    .topbar { display: none; }
    .shell { padding-left: var(--rail-w); }
    .page { max-width: none; padding: calc(1.6rem + var(--safe-t)) 1.75rem 2.5rem; }
    .tabbar {
        display: flex; flex-direction: column; align-items: stretch; gap: .35rem; position: fixed; left: 0; top: 0; bottom: 0; width: var(--rail-w); z-index: 30;
        padding: calc(1rem + var(--safe-t)) .55rem calc(1rem + var(--safe-b)); overflow-y: auto; scrollbar-width: none;
        background: linear-gradient(180deg, #1b3a6b 0%, var(--navy) 55%, #0e2040 100%); box-shadow: 2px 0 16px rgba(16, 32, 64, .18);
    }
    .rail-brand { justify-content: center; padding: .15rem 0 .9rem; }
    .rail-brand img { width: 52px; height: 52px; object-fit: contain; padding: 7px; border-radius: 16px; background: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
    .rail-space { flex: 1; }
    .tabbar-link {
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; min-height: 66px; padding: .5rem .2rem; border: 0; border-radius: 16px;
        background: transparent; font: inherit; font-size: .74rem; font-weight: 600; color: #b9c8e2; cursor: pointer; transition: background .15s, color .15s;
    }
    .tabbar-link:hover { text-decoration: none; color: #fff; }
    .tabbar-link.active { color: #fff; background: rgba(255, 255, 255, .16); }
    .tabbar-link:active { background: rgba(255, 255, 255, .22); }
    .tabbar-plus { width: 46px; height: 46px; border-radius: 50%; background: #fff; color: var(--blue); display: grid; place-content: center; box-shadow: 0 6px 16px rgba(0, 0, 0, .25); }
    .tabbar-main.active { background: transparent; }

    h1 { font-size: 1.75rem; letter-spacing: -.02em; }
    .hero { padding: 1.8rem 2rem; }
    .hero h1 { font-size: 2rem; }
    .tiles { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
    .catalog-matrix .catalog-cells { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .5rem; }
    .catalog-matrix .catalog-cell { padding: .65rem .45rem .5rem; }
    .catalog-matrix .catalog-cell-label { font-size: .76rem; }
    .catalog-matrix .catalog-cell { width: auto; }
    .catalog-cell input { min-height: 48px; font-size: 17px; }
    .tabs { position: sticky; top: 0; z-index: 10; margin: 0 -1.75rem 1rem; padding: .6rem 1.75rem; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); }
    .action-bar .button { min-width: 130px; }
    .modal, .modal-wide { top: 5vh; max-height: 90vh; }
    .modal-wide { width: min(880px, calc(100vw - var(--rail-w) - 2rem)); left: calc(50% + var(--rail-w) / 2); }
    .modal { left: calc(50% + var(--rail-w) / 2); }
}

/* ---------- Móvil */
@media (max-width: 720px) {
    :root { --tabbar-h: 66px; }

    /* Cabecera clara y translúcida */
    .topbar { background: rgba(244, 246, 250, .86); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px); color: var(--text); box-shadow: none; border-bottom: 1px solid rgba(16, 32, 64, .07); }
    .topbar-inner { height: 52px; }
    .brand { color: var(--navy); gap: .6rem; }
    .brand-dark { display: none !important; }
    .brand-light { display: block !important; height: 26px; }
    .brand-name { border-left-color: rgba(16, 32, 64, .18); padding-left: .6rem; font-weight: 700; }
    .usermenu-name { color: var(--text); }
    .avatar { box-shadow: 0 2px 8px rgba(30, 90, 168, .3); }

    .page { padding: .9rem .9rem calc(var(--tabbar-h) + 2.2rem + var(--safe-b)); }
    h1 { font-size: 1.6rem; letter-spacing: -.02em; }
    .page-head { margin-bottom: .9rem; }
    .page-head .button { width: 100%; }
    .card { border-radius: 16px; border: 0; box-shadow: 0 1px 2px rgba(16, 32, 64, .06), 0 8px 24px rgba(16, 32, 64, .05); }
    .back { min-height: 36px; margin-bottom: .2rem; }

    /* Barra de navegación flotante */
    .tabbar {
        left: .75rem; right: .75rem; bottom: calc(.6rem + var(--safe-b)); height: var(--tabbar-h); padding: 0 .35rem; border: 1px solid rgba(255, 255, 255, .7); border-radius: 24px;
        background: rgba(255, 255, 255, .88); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
        box-shadow: 0 10px 34px rgba(16, 32, 64, .2), 0 1px 3px rgba(16, 32, 64, .1);
    }
    .tabbar-link { position: relative; border-radius: 18px; margin: .4rem .1rem; gap: .1rem; transition: color .15s, background .15s; }
    .tabbar-link .icon { transition: transform .2s var(--ease); }
    .tabbar-link.active { background: var(--blue-soft); }
    .tabbar-link.active .icon { transform: translateY(-1px) scale(1.06); }
    .tabbar-link:active { background: #dfe8f6; }
    .tabbar-main, .tabbar-main.active, .tabbar-main:active { background: transparent; }
    .tabbar-plus { width: 52px; height: 52px; margin-top: -26px; border: 4px solid #fff; background: linear-gradient(135deg, var(--blue-2), var(--blue)); box-shadow: 0 8px 20px rgba(30, 90, 168, .4); }
    .tabbar-main:active .tabbar-plus { transform: scale(.94); }

    /* Portada */
    .hero { padding: 1.15rem 1.2rem 1.2rem; gap: .9rem; border-radius: 22px; }
    .hero h1 { font-size: 1.7rem; }
    .hero-text p:last-child { display: none; }
    .hero-cta { display: none; }
    .hero-stat { padding: .7rem .9rem; border-radius: 14px; }
    .hero-stat strong { font-size: 1.7rem; }
    .order-cards { grid-template-columns: 1fr; gap: .7rem; }

    /* Pedido y catálogo */
    .tabs { top: calc(52px + var(--safe-t)); background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px); }
    .tab { flex: none; padding: .55rem 1rem; }
    .catalog-cell input { min-height: 46px; border-radius: 10px; font-size: 17px; }
    .catalog-matrix .catalog-cell { border-radius: 14px; }
    .cartbar { left: .75rem; right: .75rem; bottom: calc(.6rem + var(--safe-b)); padding: .6rem .6rem .6rem 1.1rem; border: 1px solid rgba(255, 255, 255, .7); border-radius: 22px; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 10px 34px rgba(16, 32, 64, .22); }
    .cartbar .button { border-radius: 16px; }
    .shell-focus .page { padding-bottom: calc(112px + var(--safe-b)); }
    .action-bar .button { min-height: 48px; }
    .line-list li { padding: .85rem 1rem; }

    /* Hojas desde abajo con tirador */
    .modal, .modal-wide { border-radius: 24px 24px 0 0; animation: rise .28s var(--ease); }
    .modal-header { position: relative; padding-top: 1.35rem; }
    .modal-header::before { content: ""; position: absolute; top: .55rem; left: 50%; width: 44px; height: 5px; margin-left: -22px; border-radius: 3px; background: #d5dbe6; }
    .order-side.sheet-open { border-radius: 24px 24px 0 0; animation: rise .28s var(--ease); }
    .order-side.sheet-open .cart { border-radius: 24px 24px 0 0; }
    .order-side.sheet-open .cart::before { width: 44px; height: 5px; background: #d5dbe6; }
    .modal-footer .button-danger-ghost { flex: 0 0 auto; }

    .pager { background: transparent; }

    .subnav { margin: 0 -.9rem .9rem; padding: .1rem .9rem .3rem; }
    .tiles { gap: .7rem; }
    .tile { padding: 1.05rem; }
    .release-version { font-size: 2.2rem; }
    .profile-card { justify-content: center; text-align: center; flex-direction: column; padding: 1.5rem 1rem; }
    .profile-card h1 { justify-content: center; }
}

/* ---------- Listas de la administración como tarjetas (móvil y tableta en vertical) */
@media (max-width: 1000px) {
    .table-cards thead { display: none; }
    .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
    .table-cards td::before { content: attr(data-label); color: var(--muted); font-weight: 500; }
    .table-cards td:first-child::before, .table-cards td[data-label=""]::before { display: none; }
    .table-cards td { border: 0 !important; }
    /* Listas de la administración: tarjeta compacta (título arriba, datos en dos columnas) */
    .card:has(> .table-wrap > .table-cards), .card:has(> .table-cards) { background: transparent; box-shadow: none; overflow: visible; }
    .table-cards tbody { display: grid; gap: .65rem; }
    .table-cards tr { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem 1rem; padding: .9rem 1rem; border: 0 !important; border-radius: 16px; background: var(--surface); box-shadow: 0 1px 2px rgba(16, 32, 64, .06), 0 6px 18px rgba(16, 32, 64, .05); }
    .table-cards td { display: grid; justify-content: stretch; gap: .05rem; padding: 0; text-align: left; font-weight: 550; min-width: 0; overflow-wrap: anywhere; }
    .table-cards td::before { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
    .table-cards td.num { text-align: left; white-space: normal; }
    .table-cards td:first-child { grid-column: 1 / -1; padding: 0; font-size: .8rem; font-weight: 600; color: var(--muted); }
    .table-cards td:nth-child(2) { grid-column: 1 / -1; font-size: 1.05rem; font-weight: 700; margin-top: -.35rem; }
    .table-cards td:nth-child(2)::before { display: none; }
    .table-cards td > div { text-align: left; }
    .table-cards td[data-label=""] { grid-column: 1 / -1; justify-content: stretch; padding-top: .2rem; }
    .table-cards tr.row-off { opacity: .6; }
    .table-cards tr.row-note { display: block; }
    .table-click.table-cards tbody tr:active { background: var(--surface); transform: scale(.985); }
}
@media (min-width: 721px) and (max-width: 1000px) {
    .table-cards tbody { grid-template-columns: 1fr 1fr; gap: .75rem; }
    .table-cards tr { grid-template-columns: 1fr 1fr 1fr; align-content: start; }
}
/* App instalada (pantalla de inicio): sin rebote al llegar arriba ni selección accidental en la navegación. */
@media (display-mode: standalone) {
    html, body { overscroll-behavior-y: none; }
    .tabbar, .topbar { -webkit-user-select: none; user-select: none; }
}

/* ---------- Avisos de pedidos (Mi cuenta) */
.alert-row { display: flex; align-items: center; gap: .9rem; padding: .9rem 0; border-top: 1px solid var(--line-2); }
.alert-row-icon { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--blue-soft); color: var(--blue); display: grid; place-content: center; }
.alert-row-text { flex: 1; min-width: 0; display: grid; gap: .1rem; }
.alerts-devices { margin: .2rem 0 .8rem; }
.alerts .button-block { margin-top: .4rem; }
.switch { position: relative; flex: none; width: 52px; height: 32px; cursor: pointer; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; opacity: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #cfd7e3; transition: background .2s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--ease); }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:disabled + i { opacity: .5; }
@media (max-width: 720px) { .alert-row { flex-wrap: wrap; } .alert-row .button { flex: 1 1 100%; } }
