/*
 * KASUWA - Market price advisor (post-ad / edit-ad forms) and the buyer
 * price panel (partials/market-price-panel.php). Theme-neutral on purpose:
 * all four themes load this one file.
 */

.mpa {
    margin-top: 10px;
    border: 1px solid #e2e8f0;
    border-left-width: 4px;
    border-radius: 10px;
    padding: 12px 14px;
    background: #f8fafc;
    color: #1e293b;
    font-size: 13.5px;
    line-height: 1.45;
    transition: opacity .15s ease;
}
.mpa[hidden] { display: none; }
.mpa--loading { opacity: .6; }
.mpa--success { border-left-color: #16a34a; background: #f0fdf4; }
.mpa--info { border-left-color: #2563eb; background: #eff6ff; }
.mpa--warning { border-left-color: #d97706; background: #fffbeb; }
.mpa--danger { border-left-color: #dc2626; background: #fef2f2; }
.mpa--muted { border-left-color: #94a3b8; }

.mpa__head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.mpa__icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%; flex: 0 0 20px;
    font-size: 12px; font-weight: 700; color: #fff; background: #94a3b8;
}
.mpa--success .mpa__icon { background: #16a34a; }
.mpa--info .mpa__icon { background: #2563eb; }
.mpa--warning .mpa__icon { background: #d97706; }
.mpa--danger .mpa__icon { background: #dc2626; }
.mpa__msg { margin: 6px 0 0; }
.mpa__detail, .mpa__src { margin: 6px 0 0; font-size: 12.5px; color: #475569; }
.mpa__src { color: #64748b; }

.mpa__bar {
    position: relative; height: 8px; margin: 14px 4px 6px;
    border-radius: 8px; background: #e2e8f0;
}
.mpa__band { position: absolute; top: 0; bottom: 0; border-radius: 8px; background: #86efac; }
.mpa__pin {
    position: absolute; top: 50%; width: 14px; height: 14px; margin-left: -7px; margin-top: -7px;
    border-radius: 50%; background: #0f172a; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.mpa__scale { display: flex; justify-content: space-between; gap: 6px; font-size: 11.5px; color: #64748b; }

.mpa__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mpa__chip {
    display: inline-flex; flex-direction: column; align-items: flex-start;
    border: 1px solid #cbd5e1; background: #fff; border-radius: 8px;
    padding: 5px 10px; font-size: 13px; font-weight: 600; color: #0f172a; cursor: pointer;
}
.mpa__chip small { font-size: 10.5px; font-weight: 500; color: #64748b; }
.mpa__chip:hover, .mpa__chip:focus-visible { border-color: #16a34a; outline: none; box-shadow: 0 0 0 2px rgba(22,163,74,.15); }

.mpa__confirm {
    display: flex; gap: 8px; align-items: flex-start; margin-top: 10px;
    padding: 8px 10px; border-radius: 8px; background: #fff; border: 1px dashed #fca5a5;
    font-size: 13px; font-weight: 500; cursor: pointer;
}
.mpa__confirm input { margin-top: 3px; flex: 0 0 auto; }

.mpa-modal {
    position: fixed; inset: 0; z-index: 10050;
    display: flex; align-items: center; justify-content: center;
    padding: 16px; background: rgba(15, 23, 42, .55);
}
.mpa-modal[hidden] { display: none; }
.mpa-modal__card {
    width: 100%; max-width: 440px; border-radius: 14px; background: #fff; color: #0f172a;
    padding: 20px 20px 16px; box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.mpa-modal__card h3 { margin: 0 0 8px; font-size: 18px; }
.mpa-modal__card p { margin: 0 0 10px; font-size: 14px; color: #334155; line-height: 1.5; }
.mpa-modal__range strong { color: #0f172a; }
.mpa-modal__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.mpa-btn {
    flex: 1 1 160px; border-radius: 10px; padding: 10px 14px; font-size: 14px; font-weight: 600;
    border: 1px solid #cbd5e1; background: #fff; color: #0f172a; cursor: pointer;
}
.mpa-btn--primary { background: #16a34a; border-color: #16a34a; color: #fff; }
body.mpa-modal-open { overflow: hidden; }

/* ---- Buyer price panel (listing page) ------------------------------- */
.kmp-pill {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    border: 1px solid #e2e8f0; background: #f8fafc; border-radius: 8px;
    padding: 7px 12px; margin: 10px 0 14px; font-size: 13.5px; font-weight: 500; color: #1e293b;
    width: 100%; text-align: left; line-height: 1.3;
}
button.kmp-pill { cursor: pointer; font-family: inherit; }
button.kmp-pill:hover, button.kmp-pill:focus-visible { border-color: #16a34a; background: #f1f5f9; outline: none; }
.kmp-pill__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kmp-pill__sub { font-size: 11.5px; color: #64748b; font-weight: 400; }
.kmp-pill__icon { color: #16a34a; flex: 0 0 auto; }
.kmp-tag { display: inline-block; font-size: 11px; font-weight: 600; border-radius: 6px; padding: 1px 7px; margin-left: 4px; }
.kmp-tag--great { background: #ecfdf5; color: #065f46; }
.kmp-tag--fair { background: #eff6ff; color: #1e40af; }
.kmp-tag--high { background: #fffbeb; color: #b45309; }
.kmp-tag--check { background: #fef2f2; color: #b91c1c; }

.kmp-modal {
    position: fixed; inset: 0; z-index: 10040; display: flex; align-items: center; justify-content: center;
    padding: 16px; background: rgba(15, 23, 42, .55);
}
.kmp-modal[hidden] { display: none; }
.kmp-modal__card {
    width: 100%; max-width: 620px; max-height: 90vh; overflow-y: auto;
    border-radius: 14px; background: #fff; color: #0f172a; box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.kmp-modal__head { display: flex; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #f1f5f9; }
.kmp-modal__head h3 { margin: 0; font-size: 18px; }
.kmp-modal__head p { margin: 3px 0 0; font-size: 12.5px; color: #64748b; }
.kmp-close { border: 0; background: none; font-size: 26px; line-height: 1; color: #64748b; cursor: pointer; }
.kmp-modal__body { padding: 16px 20px 20px; }
.kmp-box { border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.kmp-hero { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; background: #f8fafc; }
.kmp-hero__k { font-size: 11.5px; font-weight: 600; text-transform: uppercase; color: #64748b; letter-spacing: .4px; }
.kmp-hero__v { font-size: 22px; font-weight: 800; }
.kmp-deal { border-radius: 8px; padding: 7px 12px; font-size: 13px; font-weight: 600; }
.kmp-deal--great { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.kmp-deal--fair { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.kmp-deal--high { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.kmp-deal--check { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.kmp-scale { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; color: #475569; }
.kmp-gauge {
    position: relative; height: 12px; margin: 16px 0 26px; border-radius: 10px;
    background: linear-gradient(to right, #10b981 0%, #3b82f6 50%, #f59e0b 100%);
}
.kmp-gauge__pin { position: absolute; top: -6px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.kmp-gauge__dot { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid #0f172a; }
.kmp-gauge__lbl { margin-top: 4px; font-size: 10.5px; font-weight: 700; white-space: nowrap; background: #fff; border: 1px solid #cbd5e1; border-radius: 4px; padding: 1px 6px; }
.kmp-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
@media (min-width: 540px) { .kmp-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kmp-stat { border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc; padding: 8px; text-align: center; }
.kmp-stat span { display: block; font-size: 10.5px; text-transform: uppercase; color: #64748b; }
.kmp-stat strong { font-size: 13.5px; }
.kmp-chart { width: 100%; height: auto; display: block; }
.kmp-empty { text-align: center; color: #64748b; font-size: 13px; padding: 16px 0; }
.kmp-refs { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; }
.kmp-refs li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid #f1f5f9; }
.kmp-refs a { color: #1d4ed8; overflow-wrap: anywhere; }
.kmp-note { font-size: 11.5px; color: #64748b; background: #f8fafc; border-radius: 8px; padding: 8px 12px; margin: 0; line-height: 1.5; }
.kmp-h { font-size: 13px; font-weight: 700; margin: 0 0 6px; }
