/*
 * PCMarket — მობილური UX (v0.53)
 * მხოლოდ ტელეფონზე (≤768px) და დაყენებულ აპში. დესკტოპი უცვლელია.
 * იტვირთება pcm.css-ისა და pwa.css-ის შემდეგ.
 */

/* ცვლადები .pcm-wrap-ის გარეთაც (ქვედა მენიუ, ადმინის ზოლი) */
body.pcm-site { --pcm-primary: #E10208; --pcm-primary-dark: #B80006; --pcm-primary-soft: #FDECEC; --pcm-text: #010B14; --pcm-muted: #5B6470; --pcm-border: #E6E8EC; --pcm-font: 'Noto Sans Georgian', system-ui, -apple-system, 'Segoe UI', sans-serif; }

/* ---------- ყველგან (დესკტოპზე დამალული ელემენტები) ---------- */
.pcm-accsw, .pcm-sm-only, .pcm-hlink--srch, .pcm-astrip { display: none; }
.pcm-sheet[hidden] { display: none !important; }

/* ---------- ადმინის თხელი ზოლი — მხოლოდ დაყენებულ აპში ---------- */
html.pcm-app #wpadminbar { display: none !important; }
html.pcm-app { margin-top: 0 !important; }
html.pcm-app .pcm-astrip {
	display: flex; align-items: center; gap: 4px;
	height: 32px; padding: 0 8px 0 6px;
	background: #111827; color: #E5E7EB;
	font-family: var(--pcm-font); font-size: 12.5px; line-height: 1;
}
.pcm-astrip a { color: #E5E7EB !important; text-decoration: none; }
.pcm-astrip__i { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px; border-radius: 6px; }
.pcm-astrip__i:active { background: rgba(255,255,255,.08); }
.pcm-astrip__dot { width: 7px; height: 7px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 2px rgba(34,197,94,.25); }
.pcm-astrip__sq { width: 7px; height: 7px; border-radius: 2px; background: #F59E0B; }
.pcm-astrip__i b { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: rgba(255,255,255,.14); font-size: 11px; line-height: 18px; text-align: center; font-weight: 700; }
.pcm-astrip__i b.is-hot { background: #DC2626; color: #fff; }
.pcm-astrip__adm { margin-left: auto; padding: 0 6px; height: 32px; display: inline-flex; align-items: center; color: #93C5FD !important; }

@media (max-width: 768px) {

	/* ---------- შრიფტი: მთავრული მხოლოდ სათაურებსა და ფასებზე ---------- */
	.pcm-wrap button, .pcm-btn-red, .pcm-btn-line, .pcm-btn, .pcm-fpill, .pcm-pill, .pcm-chip,
	.pcm-tabs a, .pcm-hlink, .pcm-publish, .pcm-flbl, .pcm-field > span:first-child, .pcm-crumbs,
	.pcm-mini-act, .pcm-qfbar__btn, .pcm-htag, .pcm-catlink, .pcm-pg {
		font-family: var(--pcm-font) !important;
	}
	.pcm-lg-only { display: none !important; }
	.pcm-sm-only { display: inline; }
	.pcm-page { padding-top: 12px; }
	.pcm-container { padding-left: 14px; padding-right: 14px; }

	/* ---------- ჰედერი: ერთ ხაზად — ლოგო · ძიება · მესიჯები · მენიუ ---------- */
	.pcm-hdr__in { grid-template-columns: minmax(0, 1fr) auto auto !important; column-gap: 0 !important; padding: 6px 4px 6px 14px; min-height: 56px; }
	.pcm-hdr__logo { grid-column: 1; grid-row: 1; }
	.pcm-hdr__logo img { max-height: 26px; }
	.pcm-hdr__nav { grid-column: 2; grid-row: 1; gap: 0; }
	.pcm-catbtn { grid-column: 3; grid-row: 1; width: 44px; min-height: 44px; height: 44px; margin: 0; border-radius: 50%; }
	.pcm-hdr__mid, .pcm-hdr__mid.is-home { display: none; }
	.pcm-route-archive .pcm-hdr__mid { display: block; grid-column: 1 / -1; grid-row: 2; padding-right: 10px; }
	.pcm-hlink { width: 44px; height: 44px; }
	.pcm-hlink b { top: 4px; right: 3px; }
	.pcm-hlink--heart, .pcm-hlink--me, .pcm-publish, .pcm-hide-sm { display: none !important; }
	.pcm-hdr__nav > .pcm-hlink.pcm-hlink--srch, html.pcm-app .pcm-hdr__nav > .pcm-hlink.pcm-hlink--srch { display: inline-flex !important; }
	.pcm-route-home .pcm-hdr__nav > .pcm-hlink.pcm-hlink--srch, .pcm-route-archive .pcm-hdr__nav > .pcm-hlink.pcm-hlink--srch,
	html.pcm-app .pcm-route-home .pcm-hdr__nav > .pcm-hlink.pcm-hlink--srch, html.pcm-app .pcm-route-archive .pcm-hdr__nav > .pcm-hlink.pcm-hlink--srch { display: none !important; }

	/* ---------- ქვედა მენიუ ---------- */
	.pcm-bbar {
		display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: stretch;
		padding: 0 0 env(safe-area-inset-bottom, 0px);
		border-top: 1px solid #E6E8EC; box-shadow: 0 -2px 12px rgba(20, 30, 50, .06);
	}
	.pcm-bbar__i { justify-content: center; gap: 3px; padding: 9px 2px 8px; color: #5B6470; font-size: 11px; }
	.pcm-bbar__i svg { width: 24px; height: 24px; }
	.pcm-wrap .pcm-bbar__i.is-on, .pcm-bbar__i.is-on { color: #E10208 !important; font-weight: 600; box-shadow: inset 0 3px 0 #E10208; }
	.pcm-bbar__i--add { color: #15803D; font-weight: 600; }
	.pcm-bbar__fab { width: 44px; height: 30px; margin: 0; border: 0; border-radius: 10px; box-shadow: none; }
	.pcm-bbar__fab svg { width: 22px; height: 22px; }
	.pcm-bbar__b { top: 5px; transform: translateX(18px); }
	body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }

	/* ---------- ქვემოდან ამოსული პანელი (საერთო) ---------- */
	.pcm-sheet { position: fixed; inset: 0; z-index: 10000; display: flex; flex-direction: column; justify-content: flex-end; }
	.pcm-sheet__bd { flex: 1; border: 0; padding: 0; background: rgba(1, 11, 20, .45); cursor: pointer; animation: pcmFade .2s ease; }
	.pcm-sheet__panel {
		position: relative; max-height: 86vh; overflow-y: auto; overscroll-behavior: contain;
		background: #fff; border-radius: 16px 16px 0 0;
		padding: 8px 14px calc(18px + env(safe-area-inset-bottom, 0px));
		animation: pcmUp .24s cubic-bezier(.2, .8, .2, 1);
	}
	.pcm-sheet__grip { display: block; width: 40px; height: 4px; border-radius: 2px; background: #D5D9DF; margin: 2px auto 12px; }
	.pcm-sheet__x { margin-left: auto; width: 44px; height: 44px; border: 0; background: none; display: flex; align-items: center; justify-content: center; color: var(--pcm-muted); cursor: pointer; }
	@keyframes pcmUp { from { transform: translateY(100%); } to { transform: none; } }
	@keyframes pcmFade { from { opacity: 0; } to { opacity: 1; } }

	/* ---------- ჩემი ანგარიში ---------- */
	.pcm-acc { display: block; }
	.pcm-acc__side { display: none; }
	.pcm-accsw {
		display: flex; align-items: center; gap: 10px; width: 100%; height: 56px; margin: 0 0 12px;
		padding: 0 12px; border: 1px solid #E6E8EC; border-radius: 12px; background: #fff;
		font: inherit; text-align: left; color: var(--pcm-text); cursor: pointer;
	}
	.pcm-accsw__ico { width: 34px; height: 34px; border-radius: 9px; background: var(--pcm-primary-soft, #FDECEC); color: var(--pcm-primary); display: flex; align-items: center; justify-content: center; flex: none; }
	.pcm-accsw__t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
	.pcm-accsw__t small { font-size: 11px; color: var(--pcm-muted); line-height: 1.2; }
	.pcm-accsw__t strong { font-family: var(--pcm-font) !important; font-size: 15px; font-weight: 700; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.pcm-accsw__ch { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--pcm-muted); }
	.pcm-accsheet__user { display: flex; align-items: center; gap: 12px; padding: 0 2px 12px; }
	.pcm-accsheet__user > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
	.pcm-accsheet__user strong { font-size: 16px; font-family: var(--pcm-font) !important; }
	.pcm-accsheet__user small { font-size: 12.5px; color: var(--pcm-muted); }
	.pcm-accsheet__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
	.pcm-accsheet__t {
		position: relative; min-height: 88px; padding: 10px 6px; border: 1px solid #E6E8EC; border-radius: 12px; background: #fff;
		display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; text-align: center;
		font-size: 12.5px; line-height: 1.25; color: var(--pcm-text) !important;
	}
	.pcm-accsheet__t svg { color: #374151; }
	.pcm-accsheet__t.is-on { border: 1.5px solid var(--pcm-primary); background: #FFF5F5; color: var(--pcm-primary-dark, #B80006) !important; font-weight: 600; }
	.pcm-accsheet__t.is-on svg { color: var(--pcm-primary); }
	.pcm-accsheet__t b { position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #EEF0F3; color: #374151; font-size: 11px; line-height: 18px; }
	.pcm-accsheet__t.is-on b, .pcm-accsheet__t b.is-hot { background: var(--pcm-primary); color: #fff; }
	.pcm-accsheet__out { display: flex; align-items: center; justify-content: center; gap: 8px; height: 48px; margin-top: 10px; color: #B91C1C !important; font-size: 14px; }
	.pcm-acc__h { font-size: 20px; margin-bottom: 12px; }

	/* სტატისტიკა — ერთ ზოლში */
	.pcm-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; padding: 10px 0; background: #fff; border: 1px solid #E6E8EC; border-radius: 12px; margin-bottom: 8px; }
	.pcm-stat { display: flex; flex-direction: column-reverse; align-items: center; gap: 2px; padding: 0 4px; background: none !important; border: 0; border-right: 1px solid #EEF0F3; border-radius: 0; text-align: center; }
	.pcm-stat:last-child { border-right: 0; }
	.pcm-stat span { font-size: 11px; line-height: 1.25; }
	.pcm-stat strong { font-size: 18px; line-height: 1.2; font-family: var(--pcm-font) !important; }
	.pcm-stat small { font-size: 12px; }
	.pcm-acc__lim { font-size: 12px; margin: 0 2px 10px; }

	/* სტატუსის ფილტრი — ერთი ხაზი, გვერდზე სქროლით */
	.pcm-tabs { flex-wrap: nowrap; overflow-x: auto; gap: 8px; margin: 0 -14px 10px; padding: 2px 14px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
	.pcm-tabs::-webkit-scrollbar { display: none; }
	.pcm-tabs a { flex: none; display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 18px; border-color: #D5D9DF; font-size: 13px; font-weight: 500; white-space: nowrap; }
	.pcm-acc__filter { display: grid; grid-template-columns: minmax(0, 1fr) 128px; gap: 8px; margin-bottom: 10px; }
	.pcm-acc__filter .pcm-quick { min-width: 0; }
	.pcm-acc__filter .pcm-in--sm { width: 100% !important; min-height: 42px !important; }
	.pcm-acc__total { display: none; }

	/* განცხადების ბარათი */
	.pcm-myrow { grid-template-columns: 84px minmax(0, 1fr); gap: 10px; padding: 10px; border-radius: 12px; }
	.pcm-myrow__img { width: 84px; height: 70px; border-radius: 8px; }
	.pcm-myrow__title { font-size: 14px; line-height: 1.3; }
	.pcm-myrow__meta { gap: 4px 10px; font-size: 12px; margin-top: 4px; }
	.pcm-myrow__meta strong { flex: 1 0 100%; font-size: 16px; }
	.pcm-myrow__alert { margin-top: 8px; padding: 6px 8px; gap: 4px 6px; font-size: 12px; line-height: 1.35; }
	.pcm-myrow__alert > svg { display: none; }
	.pcm-myrow__acts { grid-column: 1 / -1; flex-direction: row; flex-wrap: nowrap; gap: 6px; min-width: 0; padding-top: 8px; border-top: 1px solid #EEF0F3; }
	.pcm-myrow__acts > form, .pcm-myrow__acts > a, .pcm-myrow__acts > span { flex: 1 1 0; min-width: 0; }
	.pcm-myrow__acts .pcm-mini-act { min-height: 42px; padding: 0 6px; border-radius: 8px; border-color: #D5D9DF; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
	.pcm-myrow__acts .pcm-mini-act--promo { background: #FFFBEB; border-color: #FCD34D; color: #92400E; }
	.pcm-myrow__acts .pcm-more { flex: none; }
	.pcm-myrow__acts .pcm-more summary { width: 46px; }

	/* „⋯“ მენიუ — ქვემოდან */
	.pcm-more[open]::before { content: ""; position: fixed; inset: 0; z-index: 10000; background: rgba(1, 11, 20, .45); animation: pcmFade .2s ease; }
	.pcm-more[open] > .pcm-more__menu {
		position: fixed; left: 0; right: 0; top: auto; bottom: 0; z-index: 10001; min-width: 0;
		padding: 18px 10px calc(16px + env(safe-area-inset-bottom, 0px)); border: 0; border-radius: 16px 16px 0 0;
		box-shadow: 0 -10px 30px rgba(0, 0, 0, .18); animation: pcmUp .24s cubic-bezier(.2, .8, .2, 1);
	}
	.pcm-more[open] > .pcm-more__menu::before { content: ""; position: absolute; left: 50%; top: 7px; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: #D5D9DF; }
	.pcm-more__menu a, .pcm-more__btn { min-height: 52px; padding: 0 12px; gap: 14px; font-size: 15px; }
	.pcm-more__menu .pcm-inline { display: block; }

	/* ---------- ძიება / კატეგორია ---------- */
	.pcm-route-archive .pcm-crumbs { display: none; }
	.pcm-results, .pcm-rhead, .pcm-rhead > div { min-width: 0; max-width: 100%; }
	.pcm-rhead { gap: 8px; margin-bottom: 8px; }
	.pcm-rhead__title { font-size: 18px !important; }
	.pcm-rhead__tools { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 2px 14px; }
	.pcm-rhead__tools::-webkit-scrollbar { display: none; }
	.pcm-rhead__tools > * { flex: none; }
	.pcm-rhead__tools .pcm-only-m[data-pcm-toggle="filters"] { order: -2; height: 38px; min-height: 38px; padding: 0 14px; border-radius: 19px; background: var(--pcm-text); border-color: var(--pcm-text); color: #fff !important; font-size: 13px; gap: 6px; }
	.pcm-sort { order: -1; flex: none; }
	.pcm-sort .pcm-in { height: 38px; min-height: 38px !important; width: auto !important; border-radius: 19px; padding: 0 30px 0 14px; font-size: 13px; background-color: #fff; }
	.pcm-savebtn { height: 38px; width: 38px; padding: 0; justify-content: center; border-radius: 50%; }
	.pcm-savebtn span { display: none; }
	.pcm-view { width: 38px; height: 38px; }
	.pcm-chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px 8px; padding: 0 14px 2px; scrollbar-width: none; }
	.pcm-chips::-webkit-scrollbar { display: none; }
	.pcm-chips > * { flex: none; }
	.pcm-chip { min-height: 32px; border-radius: 16px; }
	.pcm-lrow { border-radius: 10px; }

	/* ფილტრი — ქვემოდან ამოსული პანელი */
	.pcm-aside {
		top: auto; right: auto; bottom: 0; left: 0; width: 100% !important; max-width: none !important; min-width: 0 !important; box-sizing: border-box; max-height: 88vh; overflow-x: hidden;
		padding: 0 16px; border-radius: 16px 16px 0 0; background: #fff;
		transform: translateY(105%); transition: transform .26s cubic-bezier(.2, .8, .2, 1);
		box-shadow: 0 -10px 30px rgba(0, 0, 0, .18);
	}
	.pcm-aside.is-open { transform: none; }
	.pcm-aside__mhead { position: sticky; top: 0; z-index: 2; background: #fff; margin: 0 -16px 4px; padding: 14px 8px 10px 16px; border-bottom: 1px solid #EEF0F3; font-size: 17px; }
	.pcm-aside__mhead::before { content: ""; position: absolute; left: 50%; top: 5px; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: #D5D9DF; }
	.pcm-aside .pcm-fbox { border: 0; padding: 4px 0 0; box-shadow: none; }
	.pcm-aside .pcm-factions { position: sticky; bottom: 0; z-index: 2; display: flex; gap: 10px; margin: 12px -16px 0; padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px)); background: #fff; border-top: 1px solid #EEF0F3; }
	.pcm-aside .pcm-factions .pcm-btn-red { flex: 1; min-height: 50px; border-radius: 12px; font-size: 15px; }
	.pcm-aside .pcm-factions .pcm-btn-line { min-height: 50px; border-radius: 12px; }

	/* ---------- განცხადების გვერდი ---------- */
	.pcm-route-single .pcm-bbar { display: none; }
	.pcm-route-single .pcm-crumbs { display: none; }
	.pcm-mbar { gap: 8px; padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -6px 18px rgba(1, 11, 20, .1); }
	.pcm-mbar__info { flex: 0 1 auto; max-width: 32%; }
	.pcm-mbar__info strong { font-size: 16px; line-height: 1.15; overflow-wrap: anywhere; }
	.pcm-mbar__info span { display: none; }
	.pcm-mbar .pcm-btn-red, .pcm-mbar .pcm-btn-line { flex: 1 1 0; min-width: 0; min-height: 50px; border-radius: 12px; font-size: 15px; gap: 8px; white-space: nowrap; }
	.pcm-mbar .pcm-mbar__call { border: 1.5px solid var(--pcm-text); color: var(--pcm-text); background: #fff; }
	.pcm-mbar .pcm-mbar__call .pcm-phone-btn__label { overflow: hidden; text-overflow: ellipsis; }
	.pcm-route-single { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }

	/* ---------- მესიჯები ---------- */
	.pcm-thread { padding: 12px 14px; }
	.pcm-thread.is-unread { background: #FFF8F8; }
	body.pcm-chat-open { overflow: hidden; padding-bottom: 0; }
	body.pcm-chat-open .pcm-bbar, body.pcm-chat-open .pcm-astrip, body.pcm-chat-open #wpadminbar { display: none !important; }
	.pcm-chat.has-thread { position: fixed; inset: 0; z-index: 9500; height: auto; max-height: none; min-height: 0; border: 0; border-radius: 0; }
	.pcm-chat.has-thread .pcm-chat__main { display: flex; flex-direction: column; height: 100%; min-height: 0; }
	.pcm-chat.has-thread .pcm-chat__msgs { flex: 1; min-height: 0; background: #F4F5F7; }
	.pcm-chat__head { padding: 6px 8px; gap: 8px; min-height: 56px; }
	.pcm-chat__back { width: 44px; height: 44px; align-items: center; justify-content: center; }
	.pcm-chat__qr { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 8px 12px 0; background: #fff; border-top: 1px solid var(--pcm-border); }
	.pcm-chat__qr::-webkit-scrollbar { display: none; }
	.pcm-chat__qr .pcm-qr { flex: none; height: 34px; padding: 0 12px; border-radius: 17px; font-size: 13px; }
	.pcm-chat__qr + .pcm-chat__form { border-top: 0; }
	.pcm-chat__form { padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px)); flex-wrap: nowrap; }
	.pcm-chat__form textarea { border-radius: 22px !important; font-size: 16px !important; background: #F4F5F7 !important; border-color: transparent !important; }
	.pcm-chat__form .pcm-btn-red { border-radius: 50%; }
	.pcm-chat__safe { display: none; }

	/* ---------- დამატება — ნაბიჯებად ---------- */
	.pcm-steps-on .pcm-abox[id^="pcm-sec"], .pcm-steps-on .pcm-abox--quick { display: none; }
	.pcm-steps-on .pcm-abox.is-cur { display: block; animation: pcmFade .18s ease; }
	.pcm-steps-on .pcm-abox.pcm-locked.is-cur { opacity: 1; pointer-events: auto; }
	.pcm-route-add .pcm-addside, .pcm-route-edit .pcm-addside { display: none; }
	.pcm-route-add .pcm-bbar, .pcm-route-edit .pcm-bbar { display: none; }
	.pcm-route-add, .pcm-route-edit { padding-bottom: 0; }
	.pcm-steps-mode .pcm-steps {
		position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px;
		margin: 0 -14px 12px; padding: 10px 14px 8px; border: 0; border-bottom: 1px solid #EEF0F3; border-radius: 0; background: #fff; overflow: visible;
	}
	.pcm-steps-mode .pcm-step { display: block; height: 4px; padding: 0; border-radius: 2px; background: #E6E8EC; font-size: 0 !important; }
	.pcm-steps-mode .pcm-step i { display: none; }
	.pcm-steps-mode .pcm-step.is-done, .pcm-steps-mode .pcm-step.is-on { background: var(--pcm-primary); }
	.pcm-steps-mode .pcm-steps::after { content: attr(data-label); grid-column: 1 / -1; margin-top: 6px; font-size: 12.5px; color: var(--pcm-muted); }
	.pcm-steps-on .pcm-stickybar { position: sticky; bottom: 0; z-index: 20; display: flex; gap: 10px; margin: 12px -14px 0; padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px)); border-radius: 0; background: #fff; border-top: 1px solid #EEF0F3; box-shadow: 0 -6px 18px rgba(1, 11, 20, .06); }
	.pcm-steps-on .pcm-stickybar__prog { display: none; }
	.pcm-steps-on .pcm-stickybar .pcm-btn-xl, .pcm-stepbtn { flex: 1; min-height: 52px; border-radius: 12px; font-size: 16px; }
	.pcm-stepback { flex: none; width: 52px; min-height: 52px; border-radius: 12px; display: inline-flex !important; align-items: center; justify-content: center; padding: 0; }
	.pcm-steps-on .pcm-stickybar [data-pcm-submit][hidden], .pcm-stepbtn[hidden], .pcm-stepback[hidden] { display: none !important; }
	.pcm-steps-on .pcm-stickybar [data-pcm-submit] { background: #16A34A; border-color: #16A34A; }
	.pcm-steplock { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: #FEF3C7; color: #92400E; font-size: 13px; }
}
