/* NS Distribuidora — base compartilhada (tokens, primitivos, Portal do Cliente).
   A tela do vendedor usa os componentes novos em assets/central-vendas.css. */

:root {
    /* Marca — extraída da logo NS Distribuidora (azul-marinho + estrela dourada) */
    --navy: #0d2138;
    --navy-2: #16304f;
    --navy-3: #1e4c82;
    --ink: #151d26;
    --muted: #5b6672;
    --muted-2: #838e99;
    --line: #dce1e6;
    --line-soft: #eaedef;
    --soft: #f2f4f6;
    --app-bg: #eef1f3;
    --white: #fff;

    --gold: #e8a317;
    --gold-strong: #c98a0e;
    --gold-ink: #96620a;
    --gold-soft: #fbf1da;
    /* aliases mantidos por compatibilidade — mesmo valor de --gold* */
    --orange: var(--gold);
    --orange-dark: var(--gold-ink);
    --orange-soft: var(--gold-soft);

    --green: #1f7d5c;
    --green-soft: #e8f5ef;
    --red: #b23b3b;
    --red-soft: #faeaea;

    /* Elevação */
    --shadow-xs: 0 1px 2px rgba(15, 33, 51, .08);
    --shadow-sm: 0 6px 16px rgba(15, 33, 51, .08);
    --shadow-md: 0 12px 30px rgba(15, 33, 51, .10);
    --shadow-lg: 0 26px 64px rgba(11, 26, 41, .16);

    /* Forma */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
    --ease: cubic-bezier(.2, .7, .3, 1);
    --fast: .15s ease;
}

/* ---------- Reset & base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.45;
    color: var(--ink);
    background: var(--app-bg);
    overflow-x: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
a { color: var(--gold-ink); }
[hidden] { display: none !important; }
::selection { background: rgba(232, 163, 23, .25); }

:focus { outline: none; }
:focus-visible {
    outline: 2.5px solid var(--gold-ink);
    outline-offset: 2px;
    border-radius: 4px;
}
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- Texto utilitário ---------- */
.eyebrow { margin: 0 0 8px; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: #ffc38a; }
.eyebrow.dark { color: var(--gold-ink); }
.muted { color: var(--muted); }

/* ---------- Botões ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    color: var(--navy);
    background: var(--soft);
    font-weight: 750;
    font-size: 14px;
    line-height: 1.15;
    white-space: nowrap;
    transition: transform var(--fast), box-shadow var(--fast), background-color var(--fast), border-color var(--fast), opacity var(--fast);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.primary { color: var(--navy); background: var(--gold); border-color: var(--gold); font-weight: 800; box-shadow: 0 10px 22px rgba(232, 163, 23, .32); }
.btn.primary:hover { background: var(--gold-strong); border-color: var(--gold-strong); }
.btn.secondary { color: #fff; background: var(--navy); border-color: var(--navy); }
.btn.secondary:hover { background: var(--navy-2); }
.btn.ghost { color: var(--navy); background: #eef2f5; border-color: #e3e8ec; }
.btn.ghost:hover { background: #e4eaee; }
.btn.danger-soft { color: #8f3232; background: var(--red-soft); border-color: #f2d3d3; }
.btn.danger-soft:hover { background: #f6dede; }
.btn.wide { width: 100%; padding: 13px 18px; font-size: 15px; }
.small-btn { min-height: 36px; padding: 7px 13px; font-size: 12.5px; }

/* ---------- Marca ---------- */
.brand-mark {
    display: flex; align-items: center; justify-content: center;
    width: 64px; height: 64px;
    color: #fff; font-weight: 900; font-size: 24px; letter-spacing: -7px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-radius: 20px 7px 20px 7px;
    transform: rotate(-4deg);
    flex: 0 0 auto;
}
.brand-mark span:last-child { color: var(--gold); transform: translate(2px, 7px); }
.brand-mark.small { width: 38px; height: 38px; font-size: 16px; letter-spacing: -5px; border-color: #c9d2da; }

/* ---------- Login (base compartilhada) ---------- */
.login-card {
    align-self: center; width: min(460px, calc(100% - 48px)); margin: auto;
    padding: 40px; background: var(--white); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
}
.login-card h2 { margin: 0; font-size: 29px; letter-spacing: -.03em; }
.login-card form { display: grid; gap: 17px; margin: 28px 0 22px; }
.login-card small { color: var(--muted-2); line-height: 1.5; }
.login-card .field-hint { margin-top: -3px; color: var(--muted-2); font-size: 11px; font-weight: 500; }

label { display: grid; gap: 7px; font-size: 13px; font-weight: 700; color: #34404b; }
input, textarea, select {
    width: 100%; border: 1.5px solid #d5dce2; border-radius: var(--radius-sm);
    padding: 11px 13px; min-height: 44px;
    color: var(--ink); background: var(--white);
    transition: border-color var(--fast), box-shadow var(--fast);
}
textarea { min-height: 0; }
input:focus, textarea:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3.5px rgba(232, 163, 23, .18); }
.form-error { margin: 0; display: flex; align-items: flex-start; gap: 6px; color: var(--red); font-size: 13px; font-weight: 600; line-height: 1.4; }
.form-error::before { content: "!"; flex: 0 0 auto; display: grid; place-items: center; width: 17px; height: 17px; margin-top: 1px; border-radius: 50%; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; }

/* ---------- Topbar (Portal do Cliente) ---------- */
.topbar {
    position: sticky; top: 0; z-index: 15; height: 64px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; color: #fff; background: var(--navy);
    box-shadow: 0 4px 18px rgba(10, 24, 38, .2);
}
.brand-inline, .seller-menu { display: flex; align-items: center; gap: 11px; }
.brand-inline strong, .brand-inline small, .seller-menu strong, .seller-menu small { display: block; }
.brand-inline small, .seller-menu small { color: #93a7b7; font-size: 11px; font-weight: 500; }
.seller-menu { gap: 8px; }
.seller-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 13px; background: var(--gold); flex: 0 0 auto; }
.seller-menu .btn.ghost { margin-left: 8px; color: #d9e3ea; background: rgba(255, 255, 255, .09); border-color: rgba(255, 255, 255, .1); }
.seller-menu .btn.ghost:hover { background: rgba(255, 255, 255, .16); }
.topbar-action { margin-left: 8px; color: var(--navy); background: var(--gold); border-color: var(--gold); }
.topbar-action:hover { background: var(--gold-strong); border-color: var(--gold-strong); }

/* ---------- Cabeçalho de página (Portal do Cliente) ---------- */
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.page-heading h1 { margin: 0; font-size: 32px; letter-spacing: -.035em; }

/* ---------- Aviso de edição ---------- */
.edit-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 18px;
    margin-bottom: 18px; padding: 13px 17px;
    color: #164739; background: var(--green-soft); border: 1px solid #bce0d1; border-radius: var(--radius-md);
}
.edit-banner strong, .edit-banner span { display: block; }
.edit-banner > div > span { margin-top: 3px; color: #4c7768; font-size: 12px; }

/* ---------- Catálogo (Portal do Cliente) ---------- */
.catalog-panel { background: var(--white); border: 1px solid #e3e8eb; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.catalog-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 19px 22px; border-bottom: 1px solid var(--line); }
.catalog-head h2, .cart-head h2 { margin: 0; font-size: 19px; letter-spacing: -.01em; }
.catalog-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.search-box { position: relative; display: block; width: min(430px, 48%); }
.search-box span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #8894a0; font-size: 20px; pointer-events: none; }
.search-box input { padding-left: 39px; background: var(--soft); }
.search-box input:focus { background: var(--white); }

.table-wrap { max-height: calc(100vh - 330px); min-height: 340px; overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th { position: sticky; top: 0; z-index: 1; padding: 11px 16px; color: #78848f; background: #f8fafb; border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; vertical-align: middle; }
td strong, td small { display: block; }
td small { margin-top: 3px; color: var(--muted-2); }
tr:hover td { background: #fafbfc; }
.right { text-align: right; }
.stock { color: var(--green); font-weight: 800; }
.price { font-size: 14px; font-weight: 800; }

.product-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.product-info > div { min-width: 0; }
.product-info strong { line-height: 1.35; }
.product-thumb {
    position: relative; flex: 0 0 50px; width: 50px; height: 50px;
    display: grid; place-items: center; overflow: hidden; padding: 0;
    border: 1px solid var(--line); border-radius: 11px; color: #8895a1;
    background: linear-gradient(150deg, #f4f7f9, #e7edf1);
}
.product-thumb span { font-size: 10.5px; font-weight: 900; letter-spacing: -.05em; }
.product-thumb.is-loading::after {
    position: absolute; inset: 0; content: "";
    background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .85) 48%, transparent 76%);
    transform: translateX(-100%); animation: image-loading 1.2s infinite;
}
.product-thumb.has-image { cursor: zoom-in; background: #fff; }
.product-thumb.has-image:hover { border-color: var(--gold); box-shadow: var(--shadow-xs); transform: translateY(-1px); }
.product-thumb img { width: 100%; height: 100%; display: block; object-fit: contain; }
.product-thumb.no-image { opacity: .6; }
@keyframes image-loading { to { transform: translateX(100%); } }

.code-chip { padding: 4px 7px; color: #425261; background: var(--soft); border-radius: 6px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; font-weight: 700; }
.add-btn { width: 34px; height: 34px; flex: 0 0 auto; border: 0; border-radius: 9px; color: #fff; background: var(--navy); font-size: 19px; line-height: 1; transition: background-color var(--fast), transform var(--fast); }
.add-btn:hover:not(:disabled) { background: var(--navy-2); transform: translateY(-1px); }
.add-btn:disabled { color: #a3adb5; background: #e4e9ec; cursor: not-allowed; }
.empty-row { height: 170px; color: var(--muted); text-align: center; font-size: 13.5px; }
.empty-row.error, .modal-empty.error { color: var(--red); font-weight: 600; }
.table-foot { margin: 0; padding: 10px 18px; color: var(--muted-2); background: #fafbfc; font-size: 11px; }

/* ---------- Carrinho (Portal do Cliente) ---------- */
.cart-panel { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--white); border-left: 1px solid #e3e8eb; box-shadow: -12px 0 32px rgba(20, 35, 50, .05); }
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 22px 17px; border-bottom: 1px solid var(--line); }
.count-badge { padding: 6px 10px; color: var(--navy); background: var(--soft); border-radius: 99px; font-size: 11px; font-weight: 800; }
.cart-empty { flex: 1; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 30px; color: var(--muted); text-align: center; }
.cart-empty div { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 13px; border: 1.5px dashed #bfc9d1; border-radius: var(--radius-lg); font-size: 26px; color: #96a2ac; }
.cart-empty strong { color: #45525e; }
.cart-empty span { margin-top: 5px; font-size: 13px; }
.cart-list { flex: 1; min-height: 0; overflow: auto; padding: 2px 18px; }

.cart-item { padding: 15px 0; border-bottom: 1px solid var(--line-soft); }
.cart-item-top, .cart-item-bottom { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cart-item-top span, .cart-item-top strong { display: block; }
.cart-item-top span { color: var(--gold-ink); font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.cart-item-top strong { margin-top: 3px; font-size: 13.5px; line-height: 1.35; }
.remove-btn { flex: 0 0 auto; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: var(--radius-sm); color: #9a5a5a; background: transparent; font-size: 19px; transition: background-color var(--fast); }
.remove-btn:hover { background: var(--red-soft); }
.cart-item-bottom { align-items: center; margin-top: 12px; }
.qty-control { display: flex; align-items: center; height: 34px; border: 1.5px solid #d8dfe4; border-radius: 9px; overflow: hidden; flex: 0 0 auto; }
.qty-control button { width: 32px; height: 100%; border: 0; color: var(--navy); background: var(--soft); font-size: 15px; transition: background-color var(--fast); }
.qty-control button:hover { background: #e6ecf0; }
.qty-control input { width: 46px; height: 100%; padding: 0; border: 0; border-radius: 0; text-align: center; box-shadow: none; min-height: 0; }
.cart-item-price { text-align: right; }
.cart-item-price small, .cart-item-price strong { display: block; }
.cart-item-price small { color: var(--muted); font-size: 10.5px; }
.cart-item-price strong { margin-top: 3px; font-size: 14.5px; }
.cart-item-price .old-price { color: var(--muted-2); text-decoration: line-through; font-size: 10.5px; }

.cart-bottom { padding: 16px 22px 20px; border-top: 1px solid var(--line); background: #fbfcfd; }
.observation-label { margin-bottom: 14px; font-size: 11px; }
.observation-label textarea { resize: vertical; min-height: 62px; font-size: 12.5px; }
.totals { display: grid; gap: 8px; margin: 12px 0 16px; }
.totals div { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.totals div strong { color: var(--ink); }
.totals .discount-total, .totals .discount-total strong { color: var(--green); }
.totals .grand { align-items: baseline; padding-top: 10px; border-top: 1px dashed #ccd4da; }
.totals .grand strong { font-size: 22px; color: var(--navy); }
.draft-note { margin: 10px 0 0; color: #7b8791; font-size: 10.5px; text-align: center; line-height: 1.4; }
.mobile-cart-bar { display: none; }

/* ---------- Modais (base compartilhada) ---------- */
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(9, 21, 33, .62); backdrop-filter: blur(3px); }
.modal-card { position: relative; z-index: 1; width: min(680px, 100%); max-height: min(720px, 90vh); overflow: hidden; background: var(--white); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); animation: modal-in .18s var(--ease); }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-card > header { display: flex; justify-content: space-between; gap: 16px; padding: 22px 26px 16px; }
.modal-card h2 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.modal-close { flex: 0 0 auto; display: grid; place-items: center; width: 40px; height: 40px; margin: -6px -6px 0 0; border: 0; border-radius: 50%; color: #64717d; background: transparent; font-size: 26px; line-height: 1; transition: background-color var(--fast); }
.modal-close:hover { background: var(--soft); }
.modal-search { width: auto; margin: 0 26px 16px; }
.modal-helper { margin: -6px 26px 15px; color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.modal-empty { padding: 78px 25px; color: var(--muted); text-align: center; font-size: 13.5px; }

.order-results { max-height: 480px; overflow: auto; border-top: 1px solid var(--line); }
.order-result { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 26px; border: 0; border-bottom: 1px solid var(--line-soft); color: var(--ink); background: var(--white); text-align: left; transition: background-color var(--fast); }
.order-result:hover { background: #f8fafb; }
.order-result-main { min-width: 0; }
.order-result-main span, .order-result-main strong, .order-result-side span, .order-result-side strong { display: block; }
.order-result-main strong { margin: 5px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-result-main > span:last-child { color: var(--muted); font-size: 11px; }
.order-number { color: var(--gold-ink); font-size: 11px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.order-result-side { flex: 0 0 auto; text-align: right; }
.order-result-side > strong { color: var(--navy); font-size: 16px; }
.order-result-side > span:last-child { margin-top: 7px; color: var(--gold-ink); font-size: 11px; font-weight: 800; }
.order-result-side .order-discount { margin-top: 3px; color: var(--green); font-size: 10px; }

/* Imagem ampliada (Portal do Cliente) */
.image-card { width: min(840px, 100%); display: flex; flex-direction: column; }
.image-card > header { border-bottom: 1px solid var(--line); }
.image-card > header > div { min-width: 0; }
.image-card h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-stage { flex: 1; min-height: 420px; display: grid; place-items: center; padding: 22px; overflow: auto; background: radial-gradient(circle at center, #fff 0, var(--soft) 72%); }
.image-stage img { max-width: 100%; max-height: 62vh; display: block; object-fit: contain; border-radius: 10px; filter: drop-shadow(0 15px 22px rgba(15, 33, 51, .16)); }
.image-source { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; color: var(--muted); background: var(--white); border-top: 1px solid var(--line); font-size: 11.5px; }
.image-source a { flex: 0 0 auto; color: var(--gold-ink); font-weight: 800; text-decoration: none; }
.image-source a:hover { text-decoration: underline; }

/* Sucesso (Portal do Cliente) */
.success-card { width: min(430px, 100%); padding: 42px; text-align: center; }
.success-check { display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto 20px; color: #fff; background: var(--green); border-radius: 50%; font-size: 32px; }
.success-card h2 { font-size: 30px; letter-spacing: -.02em; }
.success-card .btn { margin-top: 20px; }

/* Toast (compartilhado) */
.toast {
    position: fixed; top: 80px; left: 50%; z-index: 50; max-width: 520px;
    display: flex; align-items: center; gap: 10px;
    padding: 12px 18px; color: #fff; background: var(--navy);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
    font-size: 13.5px; font-weight: 600;
    opacity: 0; pointer-events: none; transform: translate(-50%, -12px); transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
.modal-open { overflow: hidden; }

/* ===========================================================
   Responsivo — Portal do Cliente
   =========================================================== */
@media (max-width: 760px) {
    body { font-size: 14.5px; }
    input, textarea, select { font-size: 16px; }

    .login-card { width: calc(100% - 24px); margin: -36px auto 20px; padding: 26px 20px; border-radius: var(--radius-lg); }
    .login-card h2 { font-size: 26px; }
    .login-card form { margin: 22px 0 18px; }

    .topbar { height: 58px; padding: 0 10px; }
    .seller-menu { gap: 6px; }
    .seller-avatar { display: none; }
    .seller-menu > div:nth-child(2) { display: none; }
    .seller-menu .btn.ghost, .topbar-action { margin-left: 2px; }
    .brand-inline > div:last-child, .seller-menu small { display: none; }

    .page-heading { margin: 0 3px 15px; align-items: stretch; flex-direction: column; }
    .page-heading h1 { font-size: 27px; }
    .edit-banner { align-items: stretch; flex-direction: column; }

    .search-box { width: 100%; }
    .catalog-head { align-items: stretch; flex-direction: column; gap: 13px; padding: 16px 15px; }

    .table-wrap { min-height: 250px; max-height: none; padding: 8px; overflow: visible; background: #f2f5f7; }
    .product-table, .product-table tbody { display: block; }
    .product-table thead { display: none; }
    .product-table tr {
        display: grid; grid-template-columns: minmax(0, 1fr) auto 52px;
        grid-template-areas: "code price add" "name name add" "stock stock add";
        gap: 4px 10px; margin-bottom: 9px; padding: 13px;
        background: var(--white); border: 1px solid #e2e7eb; border-radius: var(--radius-md); box-shadow: var(--shadow-xs);
    }
    .product-table tr:hover td { background: transparent; }
    .product-table td { display: block; padding: 0; border: 0; text-align: left; }
    .product-table td:nth-child(1) { grid-area: code; }
    .product-table td:nth-child(2) { grid-area: name; }
    .product-table td:nth-child(3) { grid-area: stock; font-size: 12px; }
    .product-table td:nth-child(3)::before { content: "Estoque: "; color: #75818c; font-weight: 600; }
    .product-table td:nth-child(4) { grid-area: price; align-self: center; text-align: right; }
    .product-table td:nth-child(5) { grid-area: add; align-self: stretch; display: flex; align-items: center; justify-content: flex-end; }
    .product-table td:nth-child(2) strong { font-size: 14px; line-height: 1.35; }
    .product-info { gap: 10px; }
    .product-thumb { flex-basis: 56px; width: 56px; height: 56px; }
    .product-table .add-btn { width: 46px; height: 100%; min-height: 48px; border-radius: var(--radius-md); }
    .product-table .empty-row { grid-column: 1 / -1; grid-area: auto; min-height: 150px; padding: 60px 15px; }
    .table-foot { padding: 10px 14px; }

    .cart-panel { min-height: 0; box-shadow: none; }
    .cart-head { padding: 19px 16px 14px; }
    .cart-list { max-height: none; padding: 2px 16px; }
    .cart-bottom { position: static; padding: 15px 16px max(16px, env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px rgba(20, 35, 50, .08); }
    .remove-btn { width: 44px; height: 44px; }
    .qty-control, .qty-control input, .qty-control button { height: 44px; }
    .qty-control button { width: 44px; }
    .qty-control input { width: 54px; font-size: 15px; }

    .modal { display: flex; align-items: flex-end; padding: 0; }
    .modal-card { width: 100%; height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; display: flex; flex-direction: column; border-radius: 0; animation: modal-in-mobile .2s var(--ease); }
    @keyframes modal-in-mobile { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
    .modal-card > header { padding: max(18px, env(safe-area-inset-top)) 16px 14px; }
    .modal-search { margin: 0 16px 14px; }
    .order-results { flex: 1; max-height: none; }
    .order-result { min-height: 70px; padding: 14px 17px; }
    .order-result-main { max-width: 68%; }
    .modal-helper { margin: -4px 16px 13px; }

    .image-card > header { flex: 0 0 auto; }
    .image-card h2 { max-width: calc(100vw - 80px); font-size: 20px; }
    .image-stage { min-height: 0; padding: 16px; }
    .image-stage img { max-height: 70vh; }
    .image-source { align-items: flex-start; flex-direction: column; padding: 13px 17px max(15px, env(safe-area-inset-bottom)); }

    .success-card { width: 100%; height: auto; min-height: 360px; padding: 36px 22px max(28px, env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; }
    .toast { top: 68px; width: calc(100% - 24px); justify-content: center; text-align: center; }

    .mobile-cart-bar {
        position: fixed; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); left: 10px; z-index: 14;
        display: flex; align-items: center; justify-content: space-between; min-height: 60px;
        padding: 10px 16px; border: 0; border-radius: var(--radius-lg); color: #fff;
        background: linear-gradient(130deg, var(--navy), #204a6b);
        box-shadow: 0 12px 30px rgba(10, 24, 38, .38); text-align: left;
    }
    .mobile-cart-bar span, .mobile-cart-bar small, .mobile-cart-bar strong { display: block; }
    .mobile-cart-bar small { margin-bottom: 2px; color: #b9cbd9; font-size: 10px; font-weight: 700; }
    .mobile-cart-bar > strong { color: #ffcd9c; font-size: 17px; }
}

@media (max-width: 560px) {
    .topbar .small-btn { min-height: 40px; padding-right: 8px; padding-left: 8px; font-size: 10.5px; }
    .topbar-action, .seller-menu .btn.ghost { margin-left: 0; }
}
