/* =========================================================
   MandiKhata Market — buy/sell listings (view-only) + app popup
   Uses the theme variables, so it works in light and dark.
   ========================================================= */
.mk-lhero-cta { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.2rem; }
.mk-ldemo-note {
    display: flex; align-items: center; gap: .6rem; margin: 0 0 1.2rem; padding: .75rem 1rem; border-radius: 12px;
    background: rgba(139,92,246,.1); border: 1px dashed rgba(139,92,246,.45); color: var(--text); font-size: .9rem;
}
.mk-ldemo-note i { color: #8b5cf6; flex: none; }
.mk-ldemo-note span { flex: 1; min-width: 0; }

/* Filters */
.mk-lfilters {
    display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; margin-bottom: 1.2rem;
    padding: .8rem; border-radius: 18px; background: var(--glass); border: 1px solid var(--glass-border);
}
.mk-ltabs { display: flex; gap: .3rem; padding: .25rem; border-radius: 12px; background: rgba(148,163,184,.12); }
.mk-ltabs a {
    padding: .55rem .95rem; border-radius: 9px; font-weight: 700; font-size: .9rem; color: var(--text-muted);
    text-decoration: none; white-space: nowrap; transition: background .2s ease, color .2s ease;
}
.mk-ltabs a small { opacity: .7; font-weight: 600; margin-left: .15rem; }
.mk-ltabs a.on { background: var(--gradient-1); color: #fff; box-shadow: 0 6px 16px -8px rgba(16,185,129,.7); }
.mk-lfilters .mk-select { flex: 0 1 200px; min-width: 150px; }
.mk-lsearch { flex: 1 1 220px; position: relative; }
.mk-lsearch i { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--text-dim); font-size: .85rem; }
.mk-lsearch .mk-input { padding-left: 2.3rem; }
.mk-lgo { padding: .7rem 1.3rem; border-radius: 12px; }
html[data-theme="light"] .mk-lfilters .mk-select, html[data-theme="light"] .mk-lsearch .mk-input { background-color: #fff; }
.mk-lcount { color: var(--text-muted); font-size: .88rem; margin-bottom: .9rem; }
.mk-lcount a { color: var(--primary-light); }

/* Cards */
.mk-lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.2rem; perspective: 1400px; }
.mk-lgrid-full { grid-column: 1 / -1; }
.mk-lcard {
    position: relative; display: flex; flex-direction: column; border-radius: 20px; overflow: hidden;
    background: var(--glass); border: 1px solid var(--glass-border);
    box-shadow: 0 18px 40px -28px rgba(15,23,42,.45); transition: box-shadow .3s ease, border-color .3s ease;
}
.mk-lcard:hover { border-color: rgba(16,185,129,.45); box-shadow: 0 26px 50px -26px rgba(16,185,129,.45); }
.mk-lcard-link { display: block; text-decoration: none; }
.mk-lmedia {
    position: relative; aspect-ratio: 16 / 10; display: grid; place-items: center; overflow: hidden;
    background: radial-gradient(circle at 30% 25%, rgba(52,211,153,.28), transparent 60%), radial-gradient(circle at 80% 90%, rgba(245,158,11,.22), transparent 55%), rgba(148,163,184,.1);
}
.mk-lmedia.big { aspect-ratio: 4 / 3; border-radius: 22px; }
.mk-lmedia img { width: 100%; height: 100%; object-fit: cover; }
.mk-lemoji { font-size: 4.2rem; filter: drop-shadow(0 12px 18px rgba(15,23,42,.25)); transition: transform .4s ease; }
.mk-lmedia.big .mk-lemoji { font-size: 7rem; }
.mk-lcard:hover .mk-lemoji { transform: translateY(-4px) scale(1.06) rotate(-4deg); }
.mk-ltype {
    position: absolute; top: .7rem; left: .7rem; display: inline-flex; align-items: center; gap: .35rem;
    font-size: .74rem; font-weight: 800; letter-spacing: .02em; padding: .3rem .65rem; border-radius: 999px; color: #fff;
}
.mk-ltype.static { position: static; margin-bottom: .7rem; }
.mk-ltype-sell { background: linear-gradient(135deg, #10b981, #047857); }
.mk-ltype-buy { background: linear-gradient(135deg, #f59e0b, #b45309); }
.mk-ldemo { position: absolute; top: .7rem; right: .7rem; font-size: .68rem; font-weight: 800; padding: .25rem .55rem; border-radius: 999px; background: #8b5cf6; color: #fff; }
.mk-lbody { padding: 1rem 1.1rem .6rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.mk-lbody h3 { font-size: 1.12rem; font-weight: 800; line-height: 1.25; }
.mk-lbody h3 a { color: var(--text); text-decoration: none; }
.mk-lbody h3 a:hover { color: var(--primary-light); }
.mk-lbody h3 .hindi { font-size: .8rem; font-weight: 600; color: var(--text-muted); }
.mk-lvar { font-size: .82rem; color: var(--text-muted); }
.mk-lfacts { display: flex; flex-wrap: wrap; gap: .45rem; }
.mk-lfacts span {
    display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; font-weight: 700; color: var(--text);
    padding: .3rem .6rem; border-radius: 8px; background: rgba(148,163,184,.13);
}
.mk-lfacts i { color: var(--text-dim); font-size: .75rem; }
.mk-lfacts .mk-lprice { background: rgba(16,185,129,.12); color: #047857; }
html:not([data-theme="light"]) .mk-lfacts .mk-lprice { color: #6ee7b7; }
.mk-lfacts .mk-lprice i { color: inherit; }
.mk-lfacts .mk-lprice { white-space: nowrap; }
.mk-lfacts .mk-lnego { background: rgba(245,158,11,.14); color: #b45309; font-weight: 700; }
html:not([data-theme="light"]) .mk-lfacts .mk-lnego { color: #fcd34d; }
.mk-lfacts .mk-lnego i { color: inherit; }
.mk-lfacts .mk-lprice.muted { background: rgba(148,163,184,.13); color: var(--text-muted); font-weight: 600; }
/* time, then the seller on its own line; a long business name is cut with … instead of widening the card */
.mk-lmeta { font-size: .82rem; color: var(--text-muted); display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; min-width: 0; }
.mk-lmeta span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-lgrid > * { min-width: 0; }
.mk-lbody h3, .mk-lvar, .mk-lplace { overflow-wrap: anywhere; }
/* icon + text in one flow, so the pin stays on the first line when the place wraps */
.mk-lplace { font-size: .82rem; color: var(--text-muted); line-height: 1.45; padding-left: 1.15rem; text-indent: -1.15rem; }
.mk-lplace i { width: .95rem; text-indent: 0; text-align: center; }
.mk-lplace i, .mk-lmeta i { color: var(--text-dim); margin-right: .2rem; }
.mk-lfoot { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .8rem 1.1rem 1.1rem; }
.mk-lcta {
    display: inline-flex; align-items: center; gap: .45rem; border: none; cursor: pointer; font: inherit; font-weight: 800; font-size: .88rem;
    color: #fff; background: var(--gradient-1); padding: .6rem .9rem; border-radius: 12px;
    box-shadow: 0 10px 22px -12px rgba(16,185,129,.8); transition: transform .2s ease, box-shadow .2s ease;
}
.mk-lcta:hover { transform: translateY(-2px); box-shadow: 0 14px 26px -12px rgba(16,185,129,.9); }
.mk-lcta-app { font-size: .66rem; font-weight: 800; background: rgba(255,255,255,.22); padding: .12rem .4rem; border-radius: 6px; display: inline-flex; align-items: center; gap: .25rem; }
.mk-lcta.big { font-size: 1.02rem; padding: .9rem 1.3rem; border-radius: 14px; }
.mk-ldetails { font-size: .84rem; font-weight: 700; color: var(--text-muted); text-decoration: none; white-space: nowrap; }
.mk-ldetails:hover { color: var(--primary-light); }
.mk-lpager { display: flex; justify-content: center; gap: .4rem; margin-top: 1.6rem; flex-wrap: wrap; }
.mk-lpager a { min-width: 40px; text-align: center; padding: .5rem .7rem; border-radius: 10px; border: 1px solid var(--glass-border); background: var(--glass); color: var(--text); text-decoration: none; font-weight: 700; }
.mk-lpager a.on { background: var(--gradient-1); color: #fff; border-color: transparent; }

.mk-lempty {
    text-align: center; padding: 2.6rem 1.5rem; border-radius: 22px; border: 1px dashed var(--glass-border); background: var(--glass);
    display: flex; flex-direction: column; align-items: center; gap: .8rem;
}
.mk-lempty > span { font-size: 3rem; }
.mk-lempty h3 { font-size: 1.35rem; font-weight: 800; }
.mk-lempty p { color: var(--text-muted); max-width: 560px; }

/* "Sauda sirf app par" strip */
.mk-lstrip {
    display: grid; grid-template-columns: 1fr auto; gap: 1.5rem 2.5rem; align-items: center;
    padding: 1.8rem 2rem; border-radius: 24px; border: 1px solid rgba(16,185,129,.3);
    background: radial-gradient(ellipse at 0% 0%, rgba(16,185,129,.16), transparent 55%), radial-gradient(ellipse at 100% 100%, rgba(245,158,11,.12), transparent 55%), var(--glass);
}
.mk-lstrip-tag { display: inline-flex; align-items: center; gap: .4rem; font-size: .76rem; font-weight: 800; color: #047857; background: rgba(16,185,129,.14); padding: .3rem .7rem; border-radius: 999px; margin-bottom: .6rem; }
html:not([data-theme="light"]) .mk-lstrip-tag { color: #6ee7b7; }
.mk-lstrip h3 { font-size: clamp(1.3rem, 2.4vw, 1.75rem); font-weight: 800; line-height: 1.2; margin-bottom: .45rem; }
.mk-lstrip h3 .grad { background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.mk-lstrip p { color: var(--text-muted); max-width: 640px; }
.mk-lsteps { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; margin-top: .9rem; font-size: .88rem; font-weight: 700; color: var(--text); }
.mk-lsteps b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--gradient-1); color: #fff; font-size: .72rem; margin-right: .35rem; }
.mk-lstrip-cta { display: flex; flex-direction: column; align-items: center; gap: .7rem; }
.mk-lpost { border: 1px dashed rgba(16,185,129,.6); background: transparent; color: var(--text); font: inherit; font-weight: 700; padding: .55rem 1rem; border-radius: 12px; cursor: pointer; }
.mk-lpost:hover { background: rgba(16,185,129,.1); }

/* Detail page */
.mk-ldetail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 2.4rem; align-items: start; margin-top: 1.2rem; }
.mk-ldetail-media .mk-ltype { display: none; }
.mk-lthumbs { display: flex; gap: .5rem; margin-top: .7rem; flex-wrap: wrap; }
.mk-lthumbs button { width: 64px; height: 64px; padding: 0; border-radius: 12px; overflow: hidden; border: 2px solid transparent; cursor: pointer; background: none; }
.mk-lthumbs button.on { border-color: var(--primary-light); }
.mk-lthumbs img { width: 100%; height: 100%; object-fit: cover; }
.mk-ldetail-info h1 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 900; line-height: 1.1; letter-spacing: -.5px; }
.mk-ldetail-info h1 .hindi { font-size: .5em; color: var(--text-muted); font-weight: 600; }
.mk-lprice-big { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 900; margin: .8rem 0 1rem; background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.mk-lkv { display: grid; grid-template-columns: auto 1fr; gap: .55rem 1.2rem; padding: 1rem 1.1rem; border-radius: 16px; background: var(--glass); border: 1px solid var(--glass-border); }
.mk-lkv dt { color: var(--text-muted); font-size: .86rem; font-weight: 600; white-space: nowrap; }
.mk-lkv dt i { width: 18px; color: var(--text-dim); }
.mk-lkv dd { font-weight: 700; color: var(--text); }
.mk-lhidden { color: var(--text-muted) !important; font-weight: 600 !important; }
.mk-llink { border: none; background: none; color: var(--primary-light); font: inherit; font-weight: 800; cursor: pointer; padding: 0; margin-left: .3rem; text-decoration: underline; }
.mk-ldesc { margin-top: 1rem; color: var(--text); line-height: 1.6; }
.mk-ldetail-cta { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.3rem; }
.mk-lapp-note { margin-top: .9rem; font-size: .84rem; color: var(--text-muted); }
.mk-lapp-note i { color: var(--primary-light); }
.mk-lshare { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; margin-top: 1rem; font-size: .88rem; }
.mk-lshare a { color: var(--text-muted); text-decoration: none; font-weight: 700; }
.mk-lshare a:hover { color: var(--primary-light); }
.mk-lshare .fa-whatsapp { color: #25d366; }

/* Crop landing text */
.mk-lintro { color: var(--text-muted); max-width: 900px; line-height: 1.7; margin-top: 1.2rem; }
.mk-lintro a { color: var(--primary-light); font-weight: 700; }
.mk-lcrops { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.mk-lcrops a { padding: .45rem .8rem; border-radius: 999px; border: 1px solid var(--glass-border); background: var(--glass); color: var(--text); text-decoration: none; font-weight: 700; font-size: .86rem; }
.mk-lcrops a:hover, .mk-lcrops a.on { border-color: var(--primary-light); color: var(--primary-light); }
.mk-lcrops a small { color: var(--text-dim); font-weight: 600; margin-left: .2rem; }

/* App popup */
.mk-gate { position: fixed; inset: 0; z-index: 2500; display: none; align-items: center; justify-content: center; padding: 1rem; background: rgba(2,6,23,.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.mk-gate.open { display: flex; }
.mk-gate-box {
    position: relative; width: 100%; max-width: 760px; max-height: 92vh; overflow-y: auto; border-radius: 26px;
    background: var(--dark-light, #fff); color: var(--text); border: 1px solid var(--glass-border);
    box-shadow: 0 40px 100px -20px rgba(2,6,23,.6); display: grid; grid-template-columns: 1.15fr .85fr; animation: mk-gate-in .45s cubic-bezier(.16,1,.3,1);
}
html[data-theme="light"] .mk-gate-box { background: #fff; }
@keyframes mk-gate-in { from { opacity: 0; transform: perspective(900px) rotateX(-14deg) translateY(30px) scale(.94); } to { opacity: 1; transform: none; } }
.mk-gate-close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--glass-border); background: rgba(148,163,184,.12); color: var(--text); cursor: pointer; z-index: 2; }
.mk-gate-main { padding: 2rem 1.8rem; }
.mk-gate-tag { display: inline-flex; gap: .4rem; align-items: center; font-size: .76rem; font-weight: 800; color: #fff; background: var(--gradient-1); padding: .3rem .75rem; border-radius: 999px; }
.mk-gate h3 { font-size: 1.55rem; font-weight: 900; line-height: 1.2; margin: .8rem 0 .4rem; padding-right: 1.5rem; }
.mk-gate-sum { font-size: .9rem; font-weight: 700; padding: .6rem .8rem; border-radius: 12px; background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.25); margin: .7rem 0; }
.mk-gate-sum:empty { display: none; }
.mk-gate p { color: var(--text-muted); font-size: .94rem; }
.mk-gate ul { list-style: none; margin: 1rem 0 1.3rem; display: grid; gap: .45rem; }
.mk-gate li { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; }
.mk-gate li i { color: var(--primary-light); margin-top: .2rem; }
.mk-gate-actions { display: flex; flex-direction: column; gap: .6rem; }
.mk-gate-open { justify-content: center; font-size: 1.02rem; }
.mk-gate-wa { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font-weight: 700; color: var(--text); text-decoration: none; padding: .7rem; border-radius: 12px; border: 1px solid var(--glass-border); }
.mk-gate-wa i { color: #25d366; font-size: 1.15rem; }
.mk-gate-free { font-size: .78rem; color: var(--text-dim); text-align: center; }
.mk-gate-side {
    padding: 2rem 1.5rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8rem; text-align: center;
    background: radial-gradient(circle at 50% 0%, rgba(16,185,129,.2), transparent 60%), rgba(148,163,184,.08); border-left: 1px solid var(--glass-border);
}
.mk-gate-qr { width: 172px; height: 172px; padding: 10px; border-radius: 18px; background: #fff; box-shadow: 0 14px 30px -14px rgba(2,6,23,.45); display: grid; place-items: center; }
.mk-gate-qr img, .mk-gate-qr svg { width: 100%; height: 100%; display: block; }
.mk-gate-side b { font-size: 1rem; }
.mk-gate-side small { color: var(--text-muted); font-size: .8rem; }
.mk-gate-phone { font-size: 3.6rem; line-height: 1; animation: mk-gate-bob 2.6s ease-in-out infinite; }
@keyframes mk-gate-bob { 50% { transform: translateY(-8px) rotate(-6deg); } }
.mk-gate.mobile .mk-gate-qr, .mk-gate.mobile .mk-gate-qr-text { display: none; }
.mk-gate:not(.mobile) .mk-gate-phone, .mk-gate:not(.mobile) .mk-gate-phone-note { display: none; }

@media (max-width: 900px) {
    .mk-ldetail { grid-template-columns: 1fr; gap: 1.4rem; }
    .mk-lstrip { grid-template-columns: 1fr; text-align: left; }
    .mk-lstrip-cta { align-items: flex-start; }
}
@media (max-width: 680px) {
    .mk-gate { align-items: flex-end; padding: 0; }
    .mk-gate-box { grid-template-columns: 1fr; border-radius: 24px 24px 0 0; max-height: 94vh; }
    .mk-gate-side { order: -1; border-left: none; border-bottom: 1px solid var(--glass-border); padding: 1.4rem 1rem 1rem; }
    .mk-gate-main { padding: 1.4rem 1.3rem 1.6rem; }
    .mk-gate h3 { font-size: 1.3rem; }
    .mk-lfilters { padding: .7rem; }
    .mk-ltabs { width: 100%; }
    .mk-ltabs a { flex: 1; text-align: center; padding: .55rem .4rem; font-size: .84rem; }
    .mk-lfilters .mk-select { flex: 1 1 45%; min-width: 0; }
    .mk-lgo { flex: 1 1 100%; }
    .mk-lgrid { grid-template-columns: 1fr 1fr; gap: .7rem; }
    /* a lone listing (or the last odd one) uses the full row instead of leaving half empty */
    .mk-lgrid > article.mk-lcard:last-of-type:nth-of-type(odd) { grid-column: 1 / -1; }
    .mk-lgrid > article.mk-lcard:last-of-type:nth-of-type(odd) .mk-lmedia { aspect-ratio: 16 / 9; }
    .mk-lgrid > article.mk-lcard:last-of-type:nth-of-type(odd) .mk-lfoot { flex-direction: row; align-items: center; }
    .mk-lgrid > article.mk-lcard:last-of-type:nth-of-type(odd) .mk-lcta { flex: 1; }
    .mk-lbody { padding: .8rem .8rem .4rem; }
    .mk-lbody h3 { font-size: .98rem; }
    .mk-lemoji { font-size: 3rem; }
    .mk-lfoot { flex-direction: column; align-items: stretch; padding: .6rem .8rem .9rem; gap: .4rem; }
    .mk-lcta { justify-content: center; font-size: .82rem; padding: .55rem .5rem; }
    .mk-lcta-app { display: none; }
    .mk-ldetails { text-align: center; }
    /* hero + detail buttons: full width, same size, stacked */
    .mk-lhero-cta, .mk-ldetail-cta { flex-direction: column; align-items: stretch; gap: .6rem; }
    .mk-lhero-cta .btn, .mk-ldetail-cta > * { width: 100%; justify-content: center; text-align: center; margin: 0; }
    .mk-ldetail-cta .mk-lcta-app { display: inline-flex; }
    /* type + Demo badges: Demo goes to the bottom corner so they never overlap */
    .mk-lcard .mk-ldemo { top: auto; bottom: .5rem; right: .5rem; }
    .mk-ltype { font-size: .7rem; padding: .28rem .55rem; top: .5rem; left: .5rem; }
    .mk-lkv { grid-template-columns: auto minmax(0, 1fr); gap: .5rem .9rem; padding: .9rem; }
    .mk-lkv dd { overflow-wrap: anywhere; }
    .mk-lshare { gap: .6rem 1rem; }
    .mk-lstrip { padding: 1.4rem 1.2rem; }
}
@media (max-width: 380px) { .mk-lgrid { grid-template-columns: 1fr; } }
