/* Marketplace "Sell" panel and dialog. Extends garam_marketplace.css and the
   Auctions start panel / picker styles in garam_auctions.css. */

.marketplace-page .market-sell-panel { margin-bottom: 4px; }

/* Above the cart drawer, its FAB and the shared 3D modal of this page. */
body:has(#marketplacePage) .market-sell-modal { z-index: 1000005; }
body.market-sell-open .garam-multi-autocomplete { z-index: 1000006; }
body.market-sell-open .marketplace-notice { z-index: 1000008; }
body.market-sell-open { overflow: hidden; }
body .market-sell-dialog { display: flex; flex-direction: column; padding-bottom: 0; }
body .market-sell-dialog [hidden] { display: none !important; }

/* Step 1: selectable tiles */
.market-sell-tile { position: relative; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.market-sell-tile[aria-pressed="true"] {
    border-color: var(--market-accent); box-shadow: 0 0 0 2px var(--market-accent), 0 7px 24px rgba(30,62,83,.10);
}
.market-sell-check {
    position: absolute; right: 6px; top: 6px; z-index: 2; width: 28px; height: 28px; border-radius: 50%;
    display: grid; place-items: center; pointer-events: none;
    background: rgb(255 255 255 / 92%); border: 2px solid var(--market-border); color: transparent;
    font-size: 15px; font-weight: 900; line-height: 1; box-shadow: 0 2px 6px rgb(0 0 0 / 15%);
}
.market-sell-tile[aria-pressed="true"] .market-sell-check { background: var(--market-accent); border-color: var(--market-accent); color: #fff; }
.market-sell-tile:disabled { cursor: not-allowed; }
.market-sell-tile:disabled .marketplace-card-photo img { filter: grayscale(1); opacity: .6; }
.market-sell-tile .auction-pick-price small { color: var(--market-muted); }
.market-sell-page { min-width: 90px; text-align: center; font-size: 14px; font-weight: 700; color: var(--garam-c-155a8d,#155a8d); }

/* Step 2: one row per selected card, with an editable price */
.market-sell-rows { display: flex; flex-direction: column; gap: 10px; }
.market-sell-row {
    display: grid; grid-template-columns: 64px minmax(0,1fr) minmax(150px,210px) 34px; align-items: center; gap: 14px;
    padding: 11px 12px; border-radius: 16px; background: var(--market-raised); border: 1px solid var(--market-border);
}
.market-sell-row.has-tax { border-color: #eb9b32; box-shadow: inset 3px 0 0 #eb9b32; }
.market-sell-thumb { width: 64px; height: 90px; object-fit: contain; border-radius: 10px; background: var(--market-panel); display: block; }
.market-sell-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.market-sell-info strong { font-size: 14px; font-weight: 850; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.market-sell-info small { font-size: 11px; color: var(--market-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.market-sell-value { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--market-muted); font-weight: 700; }
.market-sell-value .marketplace-coin, .market-sell-summary .marketplace-coin, .market-sell-tax .marketplace-coin { width: 16px; height: 16px; }
.market-sell-price { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 750; color: var(--market-ink); }
.market-sell-input-wrap { position: relative; display: flex; align-items: center; }
.market-sell-input-wrap input {
    width: 100%; min-height: 42px; padding: 9px 38px 9px 12px; border-radius: 11px; border: 1px solid var(--market-border);
    background: var(--market-panel); color: var(--market-ink); font: inherit; font-size: 15px; font-weight: 800;
    font-variant-numeric: tabular-nums; outline: none;
}
.market-sell-input-wrap input:focus-visible { outline: 2px solid var(--market-accent); outline-offset: 1px; }
.market-sell-input-wrap img { position: absolute; right: 11px; width: 19px; height: 19px; pointer-events: none; }
.market-sell-reset {
    align-self: flex-start; padding: 0; border: 0; background: none; color: var(--market-accent);
    font: inherit; font-size: 11px; font-weight: 750; cursor: pointer; text-decoration: underline;
}
.market-sell-tax { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; color: #b86a0b; }
.market-sell-remove {
    width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; color: var(--market-muted);
    font-size: 23px; line-height: 1; cursor: pointer;
}
.market-sell-remove:hover { background: rgb(224 71 91 / 12%); color: #e0475b; }

/* Step 3 */
.market-sell-done { text-align: center; padding: 26px 10px 8px; }
.market-sell-done-icon { display: block; font-size: 46px; line-height: 1; margin-bottom: 10px; }
.market-sell-done p { margin: 0 auto; max-width: 520px; font-size: 15px; line-height: 1.55; }

/* Footer: stays at the bottom of the dialog while the cards scroll. */
.market-sell-footer {
    position: sticky; bottom: 0; z-index: 3; margin: 18px calc(-1 * clamp(17px,3vw,28px)) 0;
    padding: 14px clamp(17px,3vw,28px) max(16px, env(safe-area-inset-bottom));
    background: var(--market-panel); border-top: 1px solid var(--market-border);
    border-radius: 0 0 23px 23px;
}
.market-sell-footer-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.market-sell-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 13px; font-weight: 750; color: var(--market-muted); }
.market-sell-summary span { display: inline-flex; align-items: center; gap: 5px; }
.market-sell-summary strong { color: var(--market-ink); }
.market-sell-summary .is-tax strong { color: #b86a0b; }
.market-sell-summary .is-short strong { color: #e0475b; }
.market-sell-actions { display: flex; gap: 10px; margin-left: auto; }
.market-sell-secondary {
    min-height: 42px; padding: 9px 16px; border-radius: 13px; cursor: pointer;
    border: 1px solid var(--garam-c-a9cfea,#a9cfea); background: #fff; color: var(--garam-c-155a8d,#155a8d);
    font: inherit; font-size: 13px; font-weight: 750;
}
.market-sell-secondary:hover:not(:disabled) { background: var(--garam-c-e5f5ff,#e5f5ff); }
.market-sell-secondary:disabled { opacity: .45; cursor: default; }
.market-sell-secondary[hidden], .market-sell-actions .auction-primary-button[hidden] { display: none; }
.market-sell-status {
    margin: 0 0 12px; padding: 10px 12px; border-radius: 11px; font-size: 13px; line-height: 1.45;
    background: rgb(224 71 91 / 9%); color: #c22d45; border: 1px solid rgb(224 71 91 / 30%);
}
.market-sell-status.is-info { background: var(--market-raised); color: var(--market-ink); border-color: var(--market-border); }
.market-sell-status.is-success { background: rgb(47 181 127 / 10%); color: #14805f; border-color: rgb(47 181 127 / 35%); }

/* Tax warning: centered, above the sell dialog. */
body .market-tax-confirm {
    position: fixed; inset: 0; z-index: 1000007; display: grid; place-items: center; padding: 18px;
    background: rgb(10 10 10 / 35%);
}
body .market-tax-confirm[hidden] { display: none; }
.market-tax-panel {
    width: min(440px, 100%); box-sizing: border-box; padding: 26px 24px 22px; border-radius: 22px; text-align: center;
    background: #fff; color: var(--garam-c-123c5c,#123c5c); border: 2px solid #f1c27d;
    box-shadow: 0 24px 70px rgb(0 0 0 / 30%); animation: market-tax-pop .22s cubic-bezier(.2,.9,.3,1.3);
}
.market-tax-panel:focus { outline: none; }
@keyframes market-tax-pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.market-tax-icon { display: block; font-size: 40px; line-height: 1; margin-bottom: 8px; }
.market-tax-panel h2 { margin: 0 0 8px; font-size: 21px; font-weight: 850; color: #b86a0b; letter-spacing: -.02em; }
.market-tax-panel p { margin: 0; font-size: 14px; line-height: 1.55; }
.market-tax-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }

/* "Remove this listing?" uses the tax warning's dialog, in red. */
.market-unlist-confirm .market-tax-panel { border-color: #f3a6b1; }
.market-unlist-confirm .market-tax-panel h2 { color: #d3203a; }
.market-unlist-confirm .market-sell-status { margin: 12px 0 0; }
body .market-unlist-danger { background: #d3203a; border-color: #b8162e; box-shadow: 0 4px 0 #9c1027; }
html[data-garam-mode="dark"] body .market-unlist-confirm .market-tax-panel { border-color: rgb(239 68 88 / 55%); }
html[data-garam-mode="dark"] body .market-unlist-confirm .market-tax-panel h2 { color: #ff8a98; }
html[data-garam-mode="dark"] body .market-unlist-danger { background: rgb(239 68 88 / 30%); border-color: rgb(239 68 88 / 60%); }

/* Onix/Ash */
html[data-garam-mode="dark"] body .market-sell-row { background: var(--garam-dark-raised,#34353c); border-color: var(--garam-dark-border,#45464d); }
html[data-garam-mode="dark"] body .market-sell-row.has-tax { border-color: #c98a3a; }
html[data-garam-mode="dark"] body .market-sell-input-wrap input,
html[data-garam-mode="dark"] body .market-sell-thumb { background: var(--garam-dark-panel,#23242a); color: var(--garam-dark-text,#f3f4f7); border-color: var(--garam-dark-border,#45464d); }
html[data-garam-mode="dark"] body .market-sell-secondary {
    background: var(--garam-dark-raised,#34353c); color: var(--garam-dark-text,#f3f4f7); border-color: var(--garam-dark-border,#45464d);
}
html[data-garam-mode="dark"] body .market-sell-check { background: rgb(35 36 42 / 92%); border-color: var(--garam-dark-border,#45464d); }
html[data-garam-mode="dark"] body .market-sell-tax,
html[data-garam-mode="dark"] body .market-sell-summary .is-tax strong { color: #f1b86a; }
html[data-garam-mode="dark"] body .market-sell-page { color: var(--garam-dark-muted,#a5a8b2); }
html[data-garam-mode="dark"] body .market-sell-status.is-success { color: #5fd3a8; }
html[data-garam-mode="dark"] body .market-tax-panel { background: var(--garam-dark-panel,#23242a); color: var(--garam-dark-text,#f3f4f7); border-color: #9a6a2c; }
html[data-garam-mode="dark"] body .market-tax-panel h2 { color: #f1b86a; }

@media (max-width: 700px) {
    .market-sell-row { grid-template-columns: 54px minmax(0,1fr) 34px; gap: 10px; }
    .market-sell-thumb { width: 54px; height: 76px; }
    .market-sell-price { grid-column: 1 / -1; grid-row: 2; }
    .market-sell-remove { grid-column: 3; grid-row: 1; }
    .market-sell-actions { width: 100%; }
    .market-sell-actions > * { flex: 1; }
    .market-sell-footer { border-radius: 0 0 18px 18px; }
}
@media (prefers-reduced-motion: reduce) {
    .market-tax-panel { animation: none; }
}

/* The picker step's look (shared with the Auctions, Inventory and Shop pickers) is in garam_picker_look.css. */
