/* core.css — Phase 3 fixes by the core fixer (app.js features). Loaded last. */

/* ---------- safety net: no sideways scrolling on phones ---------- */
html,body{overflow-x:clip}
html.menu-open,html.menu-open body{overflow:hidden;overscroll-behavior:none}

/* ---------- burger menu: current page ---------- */
.mnav a.on{color:var(--sky)}
.mnav a.on::before{content:"";display:inline-block;width:10px;height:10px;border-radius:50%;background:var(--sky);margin-right:14px;vertical-align:middle;transform:translateY(-4px)}

/* ---------- sheets: scroll inside, articles, messages ---------- */
.sheet .in{max-height:min(92vh,92dvh);overflow:auto;overscroll-behavior:contain;outline:none}
.sheet.wide .in{width:min(720px,100%);text-align:left;padding:14px 34px 34px}
.post-sheet .ntag{display:block;font-size:12.5px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--blue);margin-bottom:8px}
.post-sheet h3{font-family:var(--serif);font-weight:500;font-size:clamp(26px,3.2vw,34px);line-height:1.15;margin-bottom:16px}
.sheet .post-sheet p{color:var(--ink);font-size:16.5px;line-height:1.65;margin:0 0 14px}
.post-sheet .pcta{display:flex;flex-wrap:wrap;gap:10px;margin:22px 0 6px}
.post-sheet .pcta .btn{flex:1 1 220px;justify-content:center}
.post-sheet .pcta .btn.ghost{color:var(--blue);border-color:var(--blue)}
.sheet .post-sheet .pnote{font-size:13px;color:var(--grey);margin:12px 0 0}
.sheet .savewarn,.savewarn{background:#FFF4E5;color:#7A4A00;border-radius:12px;padding:10px 14px;font-size:14px;line-height:1.45;text-align:left;margin:8px 0 14px}
.savewarn a{color:inherit;font-weight:700;text-decoration:underline}
.sheet .pvnote,.pvnote{font-size:13px;color:var(--grey);margin:12px 0 0}
.pvnote a{color:var(--blue);font-weight:600;text-decoration:underline;text-underline-offset:3px}
.sheet .ifs .field.bad span::after{content:none}
.sheet .ifs .ferr{display:block;font-style:normal;font-size:13px;font-weight:600;color:#C62828;margin-top:2px}
.sheet .ifs .ferr:empty{display:none}

/* ---------- listing gallery: every photo opens the viewer ---------- */
.lgal [data-lb]{cursor:zoom-in;position:relative}
.lgal [data-lb]:focus-visible{outline:3px solid var(--sky);outline-offset:-3px}
.lgal-n{position:absolute;left:14px;bottom:14px;display:inline-flex;align-items:center;gap:6px;background:rgba(11,26,74,.72);color:#fff;font-size:13px;font-weight:700;padding:6px 11px;border-radius:99px;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);pointer-events:none}
@media (max-width:860px){
  .lgal,.lgal.n1,.lgal.n2,.lgal.n3,.lgal.n4,.lgal.n5{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;gap:8px;height:auto;border-radius:20px;scrollbar-width:none;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
  .lgal::-webkit-scrollbar{display:none}
  .lgal>div,.lgal>div:first-child,.lgal>div:nth-child(n+4){display:block;flex:0 0 86%;aspect-ratio:4/3;scroll-snap-align:center;border-radius:18px;grid-column:auto;grid-row:auto}
  .lgal>div:only-child{flex-basis:100%}
}

/* ---------- photo viewer ---------- */
.lbx{position:fixed;inset:0;z-index:120;background:rgba(5,12,38,.94);display:grid;grid-template-columns:72px 1fr 72px;grid-template-rows:auto 1fr auto;opacity:0;transition:opacity .25s;touch-action:pan-y}
.lbx.on{opacity:1}
.lbx[hidden]{display:none}
.lbx-top{grid-column:1/-1;display:flex;justify-content:space-between;align-items:center;padding:14px 18px;color:#fff}
.lbx-c{font-size:15px;font-weight:700;letter-spacing:.04em}
.lbx-x,.lbx-nav{width:48px;height:48px;border-radius:50%;display:grid;place-items:center;color:#fff;background:rgba(255,255,255,.12);transition:background .2s}
.lbx-x:hover,.lbx-nav:hover{background:rgba(255,255,255,.24)}
.lbx-x:focus-visible,.lbx-nav:focus-visible,.lbx-th button:focus-visible{outline:3px solid var(--sky);outline-offset:2px}
.lbx-nav{align-self:center;justify-self:center}
.lbx-nav[hidden]{visibility:hidden}
.lbx-f{margin:0;display:grid;place-items:center;min-height:0;min-width:0;gap:10px;padding:0 4px}
.lbx-f img{max-width:100%;max-height:calc(100vh - 210px);max-height:calc(100dvh - 210px);object-fit:contain;border-radius:12px;user-select:none;-webkit-user-drag:none}
.lbx-f figcaption{color:rgba(255,255,255,.78);font-size:14px;text-align:center;max-width:720px}
.lbx-th{grid-column:1/-1;display:flex;gap:8px;justify-content:center;padding:12px 16px 18px;overflow-x:auto}
.lbx-th button{flex:none;width:64px;height:48px;border-radius:8px;overflow:hidden;opacity:.5;border:2px solid transparent;transition:opacity .2s}
.lbx-th button.on{opacity:1;border-color:#fff}
.lbx-th img{width:100%;height:100%;object-fit:cover}
@media (max-width:640px){
  .lbx{grid-template-columns:1fr;grid-template-rows:auto 1fr auto auto}
  .lbx-f{grid-column:1;grid-row:2}
  .lbx-nav{display:none}
  .lbx-f img{max-height:calc(100dvh - 190px);border-radius:0}
}

/* ---------- key facts: long words never split letter by letter ---------- */
.kfacts b.tx{overflow-wrap:break-word;word-break:normal;hyphens:manual;text-wrap:balance}

/* ---------- filters ---------- */
.pop .phead{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding-right:46px}
.pop .phead h4{min-width:0}
.pop .phead .xreset{flex:none;font-weight:600;font-size:14px;color:var(--blue);text-decoration:underline;text-underline-offset:3px;padding:10px 4px;margin:-10px 0}
.pop .phead .xreset[hidden]{display:none}
.pop{scroll-padding-bottom:110px}
.pop .pbody{padding-bottom:8px}
.pop .fhint{font-size:13px;margin:10px 0 0}
.pop .lmh{grid-column:1/-1;margin:0 0 10px;font-weight:600;color:var(--blue)}
.fbar .seg b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media (max-width:560px){
  .rhead{align-items:center}
  .rhead .sort{width:100%;display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
  .sort button{min-height:44px;padding:0 6px;white-space:nowrap;font-size:13px}
  .ftag{min-height:44px}
}
@media (max-width:380px){.sort button{padding:0 3px;font-size:12.5px;letter-spacing:-.01em}}

/* ---------- listing cards: the "Դիտել" button never shrinks ---------- */
.card .foot2 small{min-width:0;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.card .foot2 .btn{flex:none}
.card .foot2 .btn .t{white-space:nowrap}

/* ---------- floating WhatsApp: out of the way of sheets, viewers, filters and forms ---------- */
.wa{transition:transform .3s var(--ease),opacity .25s}
body.sheet-open .wa,body.lb-open .wa,body.pop-open .wa,body.menu-open .wa,body.p-sell .wa,body.p-wiz .wa{opacity:0;pointer-events:none;transform:scale(.6)}
@media (max-width:560px){
  .wa{width:52px;height:52px;right:12px;bottom:calc(12px + env(safe-area-inset-bottom,0px))}
  .wa svg{width:26px;height:26px}
}

/* ---------- sell form ---------- */
.ios .sferr{font-size:13px;font-weight:600;color:#C62828;padding:4px 16px 8px;background:#fff}
.ios .grp>.sferr{background:none;padding:6px 16px 0}
.ios .cell.bad2 label,.ios .cell.bad2 .lb{color:#C62828}
.ios .cell-g.bad2{box-shadow:0 0 0 2px #E5484D inset}
.photos .ad{border:1.5px dashed var(--blue);background:rgba(2,43,165,.04);display:grid;place-items:center;align-content:center;gap:6px;padding:6px;line-height:1.25}
.photos .ad svg{color:var(--blue)}
.photos .ad:focus-visible{outline:3px solid var(--sky);outline-offset:2px}
@media (max-width:860px){
  .ios .seg-ios button{min-height:44px}
  .ios .cell select,.ios .cell input[type=text],.ios .cell input[type=tel],.ios .cell input[type=email],.ios .cell input[type=number]{min-height:44px}
  .ios .stp button{min-width:44px;min-height:44px}
}
@media (max-width:480px){.seg-ios button{font-size:12.5px;padding-left:2px;padding-right:2px}}

/* p4 integration */
body.p-admin .wa{opacity:0;pointer-events:none;transform:scale(.6)}
.hdr.solid .btn.white.hcall{--bg:var(--blue);--fg:#fff;border-color:var(--blue);box-shadow:0 4px 14px rgba(2,43,165,.22)}
@media (max-width:560px){.flink{padding:7px 0;min-height:36px}}

/* ---------- core fix round ---------- */
html[lang=en] .dtab .idn{display:none} /* EN: "Listing ID" + "A2" (no № sign) */
.post-sheet{position:relative}
.sheet-x{display:grid;place-items:center;position:sticky;top:8px;z-index:3;width:40px;height:40px;margin:-6px -12px -34px auto;border:0;border-radius:50%;background:rgba(11,26,74,.08);color:var(--ink,#0B1A4A);font-size:26px;line-height:1;cursor:pointer;transition:background .2s}
.sheet-x:hover{background:rgba(11,26,74,.16)}
.sheet-x:focus-visible{outline:3px solid var(--sky,#6EA8FF);outline-offset:2px}
.post-sheet .ntag{padding-right:44px}
@media (max-width:560px){.sheet-x{width:44px;height:44px;margin:-8px -8px -38px auto}}
