/* =========================================================
   Public marketplace page — scoped to .mkt-page
   Bootstrap 5 + Inter are already loaded by _Layout.cshtml.
   Namespace all classes with .mkt-* to avoid collisions.
   ========================================================= */

.mkt-page {
    /* ESG:ONE palette */
    --pri: #103755; --pri-dk: #022845;
    --acc: #54C3C3; --acc-mid: #44A3BD;
    --fg: #1e293b; --muted: #64748b;
    --bdr: #e5e7eb;
    --bg-s: #f8fafc; --bg-sec: #f1f5f9;
    --sf: #fff; --tx3: #94a3b8;
    --r: 8px; --rl: 10px;
    /* category colours (mirror the app) */
    --t50:#E1F5EE; --t6:#0F6E56; --t4:#1D9E75;
    --b50:#E6F1FB; --b6:#185FA5; --b4:#378ADD;
    --a50:#FAEEDA; --a6:#854F0B; --a4:#BA7517;
    --r50:#FCEBEB; --r6:#A32D2D; --r4:#E24B4A;
    --co50:#FAECE7; --co6:#993C1D; --co4:#D85A30;
    --p50:#EEEDFE; --p6:#534AB7; --p4:#7F77DD;
    --g200:#B4B2A9;

    font-family: 'Inter', system-ui, sans-serif;
    color: var(--fg);
    background: var(--bg-s);
}

/* ── HERO ── */
.mkt-hero {
    background: linear-gradient(135deg, var(--bg-sec) 0%, #fff 50%, #e0f5f5 100%);
    padding: 120px 0 40px;
    border-bottom: 1px solid var(--bdr);
}
.mkt-hero h1 { font-size: 32px; font-weight: 700; color: var(--pri-dk); letter-spacing: -.03em; margin-bottom: 8px; }
.mkt-hero p  { font-size: 14px; color: var(--muted); line-height: 1.65; max-width: 720px; margin-bottom: 18px; }
.mkt-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mkt-hero-btn {
    font-size: 13px; font-weight: 600; padding: 9px 18px; border-radius: 6px;
    border: 1px solid transparent; cursor: pointer; transition: all .15s;
    display: inline-flex; align-items: center; gap: 6px;
}
.mkt-hero-btn.is-claim { background: var(--pri); color: #fff; border-color: var(--pri); }
.mkt-hero-btn.is-claim:hover { background: var(--pri-dk); transform: translateY(-1px); box-shadow: 0 4px 10px rgba(16,55,85,.3); }
.mkt-hero-btn.is-add { background: rgba(84,195,195,.12); color: #1a7a7a; border-color: rgba(84,195,195,.4); }
.mkt-hero-btn.is-add:hover { background: rgba(84,195,195,.25); }

/* ── CONTENT WRAP ── */
.mkt-wrap { max-width: 1280px; margin: 0 auto; padding: 24px clamp(16px, 4vw, 48px) 56px; }

/* ── STATS ROW ── */
.mkt-sr { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 18px; }
.mkt-sc { background: var(--sf); border: 1px solid var(--bdr); border-radius: var(--r); padding: 10px 12px; }
.mkt-sl { font-size: 10px; color: var(--tx3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.mkt-sv { font-size: 15px; font-weight: 700; color: var(--pri); }
@media (max-width: 720px) { .mkt-sr { grid-template-columns: repeat(2, 1fr); } }

/* ── FILTER BAR ── */
.mkt-fb { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.mkt-fc {
    font-size: 12px; font-weight: 500; padding: 5px 12px; border-radius: 20px;
    border: 1px solid var(--bdr); background: var(--sf); color: var(--muted);
    cursor: pointer; transition: all .12s; white-space: nowrap;
}
.mkt-fc:hover { border-color: var(--acc); color: var(--pri); }
.mkt-fc.is-active { background: rgba(84,195,195,.1); border-color: var(--acc); color: #1a7a7a; font-weight: 600; }
.mkt-spacer { flex: 1; }
.mkt-search {
    display: flex; align-items: center; gap: 6px; background: var(--sf);
    border: 1px solid var(--bdr); border-radius: 6px; padding: 5px 10px;
}
.mkt-search input { border: 0; outline: 0; background: transparent; font-size: 12px; width: 180px; color: var(--fg); font-family: inherit; }
.mkt-sel {
    appearance: none;
    background: var(--sf) url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
    border: 1px solid var(--bdr); border-radius: 6px; padding: 5px 28px 5px 10px;
    font-size: 12px; color: var(--fg); cursor: pointer; font-family: inherit;
}

/* ── CARD GRID ── */
.mkt-pg { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.mkt-pc {
    background: var(--sf); border: 1px solid var(--bdr); border-radius: var(--rl);
    padding: 15px; cursor: pointer; transition: border-color .2s, transform .15s, box-shadow .15s;
    position: relative; overflow: hidden; animation: mktFu .25s both;
}
.mkt-pc:hover { border-color: var(--acc); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(16,55,85,.08); }
.mkt-ch { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; gap: 8px; }
.mkt-logo {
    width: 40px; height: 40px; border-radius: var(--r);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; color: #fff; flex-shrink: 0; letter-spacing: -.02em;
}
.mkt-logo.lg { width: 50px; height: 50px; font-size: 17px; }
.mkt-name { font-size: 14px; font-weight: 600; line-height: 1.3; margin-bottom: 3px; color: var(--pri-dk); }
.mkt-pl   { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 20px; display: inline-block; }
.mkt-cd2  { font-size: 12px; color: var(--muted); line-height: 1.45; margin-bottom: 10px;
            display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mkt-ct   { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 6px; }
.mkt-cd3  { font-size: 9px; font-weight: 600; padding: 2px 7px; border-radius: 10px; }
.mkt-cd3.tg{ background: var(--t50); color: var(--t6); }
.mkt-cd3.bg{ background: var(--b50); color: var(--b6); }

.mkt-claimed   { font-size: 9px; font-weight: 700; padding: 2px 8px; border-radius: 10px;
                 background: rgba(84,195,195,.15); color: #1a7a7a;
                 display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.mkt-unclaimed { font-size: 9px; font-weight: 500; padding: 2px 8px; border-radius: 10px;
                 background: var(--bg-s); color: var(--tx3);
                 display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }

.mkt-cov  { display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--tx3); margin-top: 6px; }
.mkt-meta { display: flex; align-items: center; gap: 12px; font-size: 10px; color: var(--tx3);
            margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--bdr); }
.mkt-meta svg, .mkt-cov svg { flex-shrink: 0; opacity: .5; }

.mkt-empty { text-align: center; padding: 60px 0; color: var(--muted); font-size: 13px; }

/* ── DETAIL PANEL ── */
.mkt-panel-wrap {
    position: fixed; inset: 0; z-index: 1100; display: none;
    --mkt-pane-w: min(680px, 92vw);        /* single-pane width */
    --mkt-pane-half: min(680px, 46vw);     /* each half when split */
}
.mkt-panel-wrap.is-open { display: block; }
.mkt-po { position: absolute; inset: 0; background: rgba(2,40,69,.3); backdrop-filter: blur(2px); }
.mkt-dp, .mkt-dp-right {
    position: absolute; top: 0; bottom: 0;
    background: var(--sf); border-left: 1px solid var(--bdr);
    display: flex; flex-direction: column; overflow: hidden;
    box-shadow: -8px 0 30px rgba(0,0,0,.1);
    transition: transform .25s ease, right .25s ease, width .25s ease;
}
.mkt-dp {
    right: 0; width: var(--mkt-pane-w);
    transform: translateX(100%);
}
.mkt-panel-wrap.is-open .mkt-dp { transform: translateX(0); }

/* Split mode: shift detail panel left, reveal claim form on the right. */
.mkt-dp-right {
    right: 0; width: var(--mkt-pane-half);
    transform: translateX(100%);
    visibility: hidden;
    /* The right pane holds the claim form inline (no nested .mkt-db wrapper), so
       scroll lives on the pane itself. */
    overflow-y: auto;
    padding: 18px 22px 40px;
}
.mkt-panel-wrap.is-split .mkt-dp {
    right: var(--mkt-pane-half);
    width: var(--mkt-pane-half);
}
.mkt-panel-wrap.is-split .mkt-dp-right {
    transform: translateX(0);
    visibility: visible;
}
/* In split mode the panes are narrow — collapse the claim form's 2-col grid to 1-col. */
.mkt-dp-right .mkt-f2 { grid-template-columns: 1fr; }

/* Scroll lock when any panel/overlay is open. */
body.mkt-scroll-lock { overflow: hidden; }
.mkt-dh { padding: 18px 24px 14px; border-bottom: 1px solid var(--bdr); flex-shrink: 0; }
.mkt-dt { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.mkt-dti { font-size: 16px; font-weight: 700; line-height: 1.3; margin-bottom: 3px; color: var(--pri-dk); }
.mkt-dsu { font-size: 12px; color: var(--muted); margin-bottom: 10px; line-height: 1.5; }
.mkt-dm  { display: flex; gap: 6px; flex-wrap: wrap; }
.mkt-dts { display: flex; gap: 0; padding: 0 24px; border-bottom: 1px solid var(--bdr); flex-shrink: 0; overflow-x: auto; }
.mkt-dta {
    font-size: 12px; font-weight: 500; padding: 10px 14px; color: var(--tx3);
    cursor: pointer; border: 0; border-bottom: 2px solid transparent;
    background: none; font-family: inherit; transition: color .12s; white-space: nowrap;
}
.mkt-dta:hover { color: var(--muted); }
.mkt-dta.is-active { color: var(--pri); border-bottom-color: var(--acc); }
.mkt-db { flex: 1; overflow-y: auto; padding: 20px 24px; }
.mkt-df { padding: 12px 24px; border-top: 1px solid var(--bdr); display: flex; gap: 8px; flex-shrink: 0; }

.mkt-se  { font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: var(--tx3);
           font-weight: 600; margin-bottom: 8px; margin-top: 16px; }
.mkt-se:first-child { margin-top: 0; }
.mkt-dpf { display: grid; grid-template-columns: 140px 1fr; gap: 8px; padding: 6px 0;
           border-top: 1px solid var(--bdr); font-size: 12px; }
.mkt-dpl { color: var(--tx3); font-weight: 500; }
.mkt-dpv { font-weight: 500; word-break: break-word; }
.mkt-close-x { width: 28px; height: 26px; display: flex; align-items: center; justify-content: center;
               border-radius: 6px; border: 1px solid var(--bdr); background: transparent;
               color: var(--muted); cursor: pointer; font-size: 20px; line-height: 1; padding: 0; }
.mkt-close-x:hover { background: var(--bg-s); }

/* ── BUTTONS ── */
.mkt-bt { font-size: 12px; font-weight: 600; padding: 8px 14px; border-radius: 6px;
          border: 1px solid var(--bdr); background: transparent; color: var(--fg);
          cursor: pointer; transition: all .15s; display: inline-flex; align-items: center; gap: 5px;
          font-family: inherit; text-decoration: none; }
.mkt-bt:hover { background: var(--bg-s); border-color: var(--muted); color: var(--fg); }
.mkt-bt.is-primary { background: var(--pri); color: #fff; border-color: var(--pri); }
.mkt-bt.is-primary:hover { background: var(--pri-dk); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 8px rgba(16,55,85,.25); }
.mkt-bt.is-accent { background: rgba(84,195,195,.12); color: #1a7a7a; border-color: rgba(84,195,195,.4); }
.mkt-bt.is-accent:hover { background: var(--acc); color: #fff; border-color: var(--acc); }
.mkt-bt.is-sm { font-size: 11px; padding: 6px 12px; }

/* Claim Profile — the headline CTA, visually distinct from Contact/secondary buttons. */
.mkt-bt.is-claim {
    background: linear-gradient(135deg, var(--acc) 0%, var(--acc-mid) 100%);
    color: #fff; border-color: var(--acc-mid); font-weight: 700;
    padding: 9px 18px; letter-spacing: .01em;
    box-shadow: 0 4px 14px rgba(84,195,195,.38);
    position: relative;
}
.mkt-bt.is-claim:hover {
    background: linear-gradient(135deg, var(--acc-mid) 0%, var(--pri) 100%);
    color: #fff; border-color: var(--pri);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(16,55,85,.35);
}
.mkt-bt.is-claim.is-sm { padding: 7px 16px; font-size: 12px; }
.mkt-claim-dot {
    width: 7px; height: 7px; border-radius: 50%; background: #fff;
    display: inline-block; box-shadow: 0 0 0 0 rgba(255,255,255,.7);
    animation: mktClaimPulse 1.8s infinite;
}
@keyframes mktClaimPulse {
    0%   { box-shadow: 0 0 0 0 rgba(255,255,255,.7); }
    70%  { box-shadow: 0 0 0 8px rgba(255,255,255,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}


/* ── FORMS ── */
.mkt-fl { font-size: 11px; font-weight: 500; color: var(--muted); margin-bottom: 5px; display: flex; gap: 4px; }
.mkt-fl .mkt-rq { color: var(--r4); }
.mkt-fi { width: 100%; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--bdr);
          background: var(--sf); font-size: 13px; color: var(--fg); outline: none;
          transition: border-color .12s; font-family: inherit; }
.mkt-fi:focus { border-color: var(--acc); box-shadow: 0 0 0 3px rgba(84,195,195,.15); }
.mkt-fta { resize: vertical; min-height: 120px; }
.mkt-fr  { margin-bottom: 12px; }
.mkt-f2  { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .mkt-f2 { grid-template-columns: 1fr; } }

/* ── INFO BANNERS ── */
.mkt-ib   { padding: 10px 14px; border-radius: 6px; font-size: 12px; margin-bottom: 14px; line-height: 1.5; }
.mkt-ib.bl { background: var(--b50); border: 1px solid rgba(55,138,221,.25); color: var(--b6); }
.mkt-ib.tl { background: var(--t50); border: 1px solid rgba(29,158,117,.25); color: var(--t6); }
.mkt-ib.al { background: var(--a50); border: 1px solid rgba(186,117,23,.25); color: var(--a6); }

.mkt-blur { filter: blur(3px); user-select: none; pointer-events: none; }

/* ── CTA BOX ── */
.mkt-cta { background: linear-gradient(135deg, rgba(84,195,195,.08) 0%, rgba(16,55,85,.04) 100%);
           border: 1px solid rgba(84,195,195,.3); border-radius: var(--rl); padding: 16px; margin-top: 16px; }
.mkt-cta h4 { font-size: 13px; font-weight: 700; color: var(--pri); margin: 0 0 4px 0; }
.mkt-cta p  { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 0 0 10px 0; }

/* ── CLAIM / ADD OVERLAY (right-side panel) ── */
.mkt-claim-ov {
    position: fixed; inset: 0; z-index: 1100; display: none;
    background: rgba(2,40,69,.4); backdrop-filter: blur(3px);
}
.mkt-claim-ov.is-open { display: block; }
.mkt-claim-inner {
    position: absolute; top: 0; right: 0; bottom: 0;
    width: min(680px, 92vw);
    background: var(--bg-s);
    overflow-y: auto;
    padding: 20px 24px 40px;
    box-shadow: -8px 0 30px rgba(0,0,0,.15);
    transform: translateX(100%);
    transition: transform .25s ease;
}
.mkt-claim-ov.is-open .mkt-claim-inner { transform: translateX(0); }

.mkt-claim-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.mkt-claim-head-title { font-size: 16px; font-weight: 600; color: var(--pri-dk); }
.mkt-section { background: var(--sf); border: 1px solid var(--bdr); border-radius: var(--rl);
               padding: 20px; margin-bottom: 16px; }
.mkt-section-title { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
                     color: var(--tx3); margin: 0 0 12px 0; }
/* Forms inside the side-panel overlay are narrow — collapse 2-col to 1-col. */
.mkt-claim-inner .mkt-f2 { grid-template-columns: 1fr; }

.mkt-success { background: rgba(84,195,195,.08); border: 1px solid rgba(84,195,195,.3);
               border-radius: var(--rl); padding: 32px; text-align: center; max-width: 500px; margin: 40px auto; }
.mkt-success h3 { font-size: 16px; font-weight: 700; color: var(--pri); margin: 12px 0 6px; }
.mkt-success p  { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 16px; }
.mkt-success .mkt-tick { font-size: 36px; color: var(--t4); }

/* animations */
@keyframes mktFu { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* chip pill colour mapping is applied inline from the JS using CSS variables above */
