/* Общие поля форм: цена, город, карта (incs/fields.php, js/fields.js) */

/* цена */
.fp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fp .fp-num { flex: 0 0 auto; width: 150px !important; max-width: 42vw; box-sizing: border-box; height: 40px; padding: 0 12px; margin: 0; border: 1px solid #ccd3d8; border-radius: 8px; font-family: inherit; font-size: 17px; text-align: right; }
.fp-num:focus { outline: none; border-color: #3b8fd0; box-shadow: 0 0 0 3px rgba(59,143,208,.15); }
.fp-num:disabled { background: #f3f5f7; color: #aaa; }
.fp-lbl { color: #666; font-size: 14px; }
.fp-cur { display: inline-flex; border: 1px solid #ccd3d8; border-radius: 8px; overflow: hidden; height: 40px; }
.fp-cur label { display: flex; margin: 0; cursor: pointer; }
.fp-cur input { position: absolute; opacity: 0; pointer-events: none; }
.fp-cur span { display: flex; align-items: center; padding: 0 14px; font-size: 15px; color: #444; background: #fff; }
.fp-cur label + label span { border-left: 1px solid #ccd3d8; }
.fp-cur input:checked + span { background: #3b8fd0; color: #fff; }
.fp-cur input:focus-visible + span { box-shadow: inset 0 0 0 2px #1a5a96; }
.fp .fp-period { width: auto !important; height: 40px; padding: 0 8px; border: 1px solid #ccd3d8; border-radius: 8px; font-family: inherit; font-size: 14px; background: #fff; width: auto; }
.fp-other { min-height: 18px; margin-top: 4px; color: #7a8791; font-size: 13px; }
.fp-off .fp-cur, .fp-off .fp-period { opacity: .45; }
.fp-nego { display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 14px; cursor: pointer; }
.fp-warn { margin-top: 6px; padding: 7px 10px; border-radius: 8px; background: #fff6dd; color: #6b5212; font-size: 13px; }
.fp-warn[hidden] { display: none; }
.fp-hint { margin-top: 5px; font-size: 13px; font-style: italic; color: #666; }

/* город */
.fc { position: relative; max-width: 420px; }
.fc-on .fc-select { position: absolute; opacity: 0; pointer-events: none; height: 1px; width: 1px; }
.fc-btn { position: relative; box-sizing: border-box; height: 40px; line-height: 38px; padding: 0 34px 0 12px; border: 1px solid #ccd3d8; border-radius: 8px; background: #fff; font-size: 15px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-btn:after { content: ''; position: absolute; right: 13px; top: 15px; width: 7px; height: 7px; border-right: 2px solid #7a8791; border-bottom: 2px solid #7a8791; transform: rotate(45deg); }
.fc-btn:focus { outline: none; border-color: #3b8fd0; box-shadow: 0 0 0 3px rgba(59,143,208,.15); }
.fc-btn.fc-empty { color: #999; }
.fc-pop { position: absolute; left: 0; right: 0; top: 44px; z-index: 50; background: #fff; border: 1px solid #ccd3d8; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.15); overflow: hidden; }
.fc-pop[hidden] { display: none; }
.fc .fc-q { display: block; width: 100% !important; height: auto; box-sizing: border-box; margin: 0; padding: 9px 12px; border: 0; border-bottom: 1px solid #eef1f4; font-family: inherit; font-size: 16px; outline: none; }
.fc-list { max-height: 260px; overflow-y: auto; overscroll-behavior: contain; }
.fc-it { padding: 8px 12px; font-size: 15px; cursor: pointer; }
.fc-it:hover, .fc-it.fc-hi { background: #eef5fb; }
.fc-it.fc-cur { font-weight: bold; color: #1a6fb5; }
.fc-none { padding: 10px 12px; color: #888; font-size: 14px; }

/* карта */
.fm-open { display: inline-flex; align-items: center; gap: 6px; color: #1a6fb5; font-weight: bold; cursor: pointer; }
.fm-open img { height: 15px; }
.fm-box { display: none; }
.fm-on .fm-box { display: block; }
.fm-on .fm-open { display: none; }
.fm-hint { margin-bottom: 6px; font-size: 14px; color: #555; }
.fm-map { position: relative; height: 300px; border-radius: 10px; overflow: hidden; background: #eef1f4; }
.fm-pin { position: absolute; left: 50%; top: 50%; z-index: 1000; width: 26px; height: 38px; margin: -38px 0 0 -13px; pointer-events: none;
	background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 38'%3E%3Cpath d='M13 0C5.8 0 0 5.8 0 13c0 9.7 13 25 13 25s13-15.3 13-25C26 5.8 20.2 0 13 0z' fill='%23e0504a'/%3E%3Ccircle cx='13' cy='13' r='5' fill='%23fff'/%3E%3C/svg%3E"); }
.fm-del { display: inline-block; margin-top: 6px; color: #c00; font-size: 14px; cursor: pointer; }

/* цена на сайте: «15 000 дин ≈ 128 €» */
.money-other { color: #8a96a0; font-weight: normal; font-size: .85em; white-space: nowrap; }

/* ---- общие фильтры барахолки (market/filter_bar.php) ---- */
.mfb { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin: 0 0 16px; padding: 12px 14px; border: 1px solid #e3e8ec; border-radius: 12px; background: #f8fafb; font-size: 14px; }
.mfb-f { display: flex; flex-direction: column; gap: 4px; }
.mfb-l { font-size: 12px; color: #7a8791; }
.mfb input[type=text], .mfb input[type=search], .mfb select { box-sizing: border-box; height: 36px; margin: 0; padding: 0 10px; border: 1px solid #ccd3d8; border-radius: 8px; background: #fff; font-family: inherit; font-size: 14px; }
.mfb-pr { display: flex; align-items: center; gap: 6px; }
.mfb-pr input[type=text] { width: 92px !important; text-align: right; }
.mfb-pr i { color: #999; font-style: normal; }
.mfb .mfb-cur { height: 36px; }
.mfb .mfb-cur span { padding: 0 10px; font-size: 14px; }
.mfb-city select { width: 160px !important; }
.mfb-q input { width: 210px !important; }
.mfb-sort select { width: 160px !important; }
.mfb-checks { flex-direction: row; gap: 14px; padding-bottom: 8px; }
.mfb-checks label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; white-space: nowrap; }
.mfb-go { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.mfb-btn { height: 36px; padding: 0 16px; border: 0; border-radius: 8px; background: #3b8fd0; color: #fff; font-family: inherit; font-size: 14px; cursor: pointer; white-space: nowrap; }
.mfb-btn:hover { background: #2f7fbd; }
.mfb-reset { color: #c00; font-size: 13px; white-space: nowrap; }

/* телефон: кнопки над списком и шторка */
.mfb-mbtns { display: flex; gap: 8px; margin: 0 0 10px; }
.mfb-mbtn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid #ccd3d8; border-radius: 18px; background: #fff; font-size: 14px; cursor: pointer; }
.mfb-mbtn img { height: 14px; }
.mfb-mbtn.mfb-on { border-color: #3b8fd0; color: #1a6fb5; }
.mfb-mbtn b { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 9px; background: #3b8fd0; color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.mfb-sheet .mfb { flex-direction: column; align-items: stretch; gap: 14px; margin: 0; padding: 4px 4px 0; border: 0; background: none; font-size: 15px; }
.mfb-sheet .mfb-pr input[type=text] { flex: 1; width: auto !important; min-width: 0; height: 42px; font-size: 16px; }
.mfb-sheet .mfb-city select, .mfb-sheet .mfb-q input, .mfb-sheet .mfb-sort select { width: 100% !important; height: 42px; font-size: 16px; }
.mfb-sheet .mfb .mfb-cur { height: 42px; }
.mfb-sheet .mfb-checks { padding: 0; gap: 20px; }
.mfb-sheet .mfb-go { position: sticky; bottom: 0; margin: 4px -4px 0; padding: 10px 4px 0; background: #fff; flex-direction: column; align-items: stretch; gap: 10px; }
.mfb-sheet .mfb-btn { height: 46px; font-size: 16px; border-radius: 12px; }
.mfb-sheet .mfb-reset { text-align: center; }
.mfb-sheet .mfb-f, .mfb-sheet .mfb-pr { min-width: 0; max-width: 100%; }
.mfb-sheet .mfb select, .mfb-sheet .mfb input[type=search] { min-width: 0; max-width: 100%; }

/* цена: в списке объявлений пересчёт на 1px мельче, в объявлении — под ценой и на 3px мельче */
.ml-pr .money-other { font-size: calc(.85em - 2px); }
.market_offer_6b .money-other { display: block; margin-top: 2px; font-size: calc(.85em - 4px); line-height: 1.2; }

/* фильтр столбиком: колонка слева в подкатегории (компьютер) и шторка (телефон) — market/filter_bar.php */
.mfb-col { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 14px; }
.mfb-col .mfb-f { min-width: 0; }
.mfb-col .mfb-checks { padding: 0; }
.mfb-side { width: 218px; box-sizing: border-box; margin: 0; padding: 12px 12px 0; }
.mfb-side .mfb-pr input[type=text] { flex: 1; width: auto !important; min-width: 0; }
.mfb-side .mfb-pr .mfb-cur span { padding: 0 7px; }
.mfb-side .mfb-pr { flex-wrap: wrap; }
.mfb-side .mfb-pr .mfb-cur { flex: 1 0 100%; }
.mfb-side .mfb-pr .mfb-cur label { flex: 1; }
.mfb-side .mfb-pr .mfb-cur span { width: 100%; justify-content: center; }
.mfb-side .mfb-city select, .mfb-side .mfb-q input, .mfb-side .mfb-sort select, .mfb-side select.mfb-sel { width: 100% !important; }
.mfb-side .mfb-go { position: sticky; bottom: 0; z-index: 2; margin: 0 -12px; padding: 10px 12px 12px; background: #f8fafb; border-top: 1px solid #e3e8ec; border-radius: 0 0 12px 12px; flex-direction: column; align-items: stretch; gap: 8px; }
.mfb-side .mfb-reset { text-align: center; }
.mfb select.mfb-sel { width: 100%; }
.mfb select:disabled { color: #aaa; background: #f3f5f7; }
.mfb-group { display: flex; flex-direction: column; gap: 14px; }
details.mfb-group { gap: 0; border-top: 1px solid #e3e8ec; padding-top: 10px; }
details.mfb-group > summary { cursor: pointer; font-weight: bold; color: #333; list-style: none; position: relative; padding-right: 20px; }
details.mfb-group > summary::-webkit-details-marker { display: none; }
details.mfb-group > summary:after { content: ''; position: absolute; right: 4px; top: 4px; width: 7px; height: 7px; border-right: 2px solid #7a8791; border-bottom: 2px solid #7a8791; transform: rotate(45deg); transition: transform .15s; }
details.mfb-group[open] > summary:after { transform: rotate(-135deg); top: 8px; }
details.mfb-group > summary b { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 9px; background: #3b8fd0; color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
details.mfb-group[open] > .mfb-f { margin-top: 12px; }
.mfb-opts { display: flex; flex-direction: column; gap: 5px; }
.mfb-opts label { display: flex; align-items: flex-start; gap: 6px; cursor: pointer; line-height: 1.3; }
.mfb-opts input { margin: 2px 0 0; flex: 0 0 auto; }
.mfb-opts .mfb-x { display: none; }
.mfb-opts.mfb-open .mfb-x { display: flex; }
.mfb-showall { color: #1a6fb5; cursor: pointer; font-size: 13px; }
.mfb-sheet .mfb-opts { gap: 9px; }
.mfb-sheet .mfb-opts label { font-size: 15px; }
.mfb-sheet .mfb-opts input { width: 18px; height: 18px; margin-top: 0; }
.mfb-sheet select.mfb-sel { height: 42px; font-size: 16px; }
.mfb-sheet .mfb-sf .mfb-pr input[type=text] { flex: 1; width: auto !important; min-width: 0; height: 42px; font-size: 16px; }
.mfb-sheet details.mfb-group > summary { font-size: 16px; padding-top: 4px; padding-bottom: 4px; }

/* выбранные фильтры над списком */
.mfb-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 14px; }
.mfb-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 12px; border-radius: 15px; background: #e8f2fb; color: #1a5a96 !important; font-size: 13px; text-decoration: none !important; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.mfb-chip i { font-style: normal; font-size: 16px; color: #6b8cab; }
.mfb-chip:hover { background: #d8e9f8; }
.mfb-chip:hover i { color: #c00; }
.mfb-chips-reset { color: #c00; font-size: 13px; margin-left: 4px; }
.mfb-sheet .mfb-go { z-index: 3; padding-bottom: 6px; }
.mfb-side .mfb-btn { padding: 0 6px; font-size: 13px; }

/* сколько объявлений в разделе (плитки и списки разделов барахолки) */
.mcount { display: block; margin-top: 2px; color: #8a96a0; font-size: 13px; font-weight: normal; }
.market_filter_2 .mcount { display: inline; margin-left: 6px; }
.market_filter_2 .mcount:empty { display: none; }

/* окно выбора города (market/select_region.php) */
.mreg { position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 9100; background: rgba(0,0,0,.45); }
.mreg-box { position: relative; display: flex; flex-direction: column; width: 420px; max-width: calc(100% - 24px); max-height: calc(100% - 80px); margin: 40px auto 0; background: #fff; border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.25); overflow: hidden; }
.mreg-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; font-size: 18px; }
.mreg-x { font-size: 28px; line-height: 1; color: #888; cursor: pointer; }
.mreg-box .mreg-q { margin: 6px 16px 10px; width: auto !important; height: 42px; box-sizing: border-box; padding: 0 12px; border: 1px solid #ccd3d8; border-radius: 8px; font-family: inherit; font-size: 16px; outline: none; }
.mreg-q:focus { border-color: #3b8fd0; box-shadow: 0 0 0 3px rgba(59,143,208,.15); }
.mreg-list { overflow-y: auto; overscroll-behavior: contain; padding: 0 6px 10px; }
.mreg-it { display: flex; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 8px; color: #222 !important; font-size: 15px; text-decoration: none !important; }
.mreg-it[hidden] { display: none; }
.mreg-it span { color: #8a96a0; font-size: 13px; }
.mreg-it:hover { background: #eef5fb; }
.mreg-it.mreg-on { font-weight: bold; color: #1a6fb5 !important; background: #eef5fb; }
.mreg-it.mreg-0 { color: #999 !important; }
.mreg-none { padding: 10px; color: #888; font-size: 14px; }
@media (max-width: 700px) { .mreg-box { width: auto; margin-top: 20px; max-height: calc(100% - 40px); } }

/* город в фильтре — список с поиском (js/fields.js) */
.mfb .mfb-fc { max-width: none; }
.mfb:not(.mfb-col) .mfb-fc { width: 170px; }
.mfb .mfb-fc .fc-btn { height: 36px; line-height: 34px; font-size: 14px; }
.mfb .mfb-fc .fc-pop { top: 40px; min-width: 220px; }
.mfb-sheet .mfb-fc .fc-btn { height: 42px; line-height: 40px; font-size: 16px; }
.mfb-sheet .mfb-fc .fc-pop { top: 46px; }
.mfb-chip-city { background: #fff3e0; color: #8a5300 !important; } .mfb-chip-city i { color: #c08a4a; }
/* город в навигации барахолки — последним */
.mcrumb-city { white-space: nowrap; }
.mcrumb-city img { height: 12px; margin-right: 2px; vertical-align: -1px; }
.mcrumb-city a { border-bottom: 1px dotted; }
/* строка «цена ≈ пересчёт … продавец» в списке объявлений — по нижнему краю текста */
.ml-line { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: baseline; gap: 6px; }
.ml-line .ml-u { flex: 0 1 auto; min-width: 0; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-line .ml-pr { flex: 0 0 auto; }
.ml-line[style*="padding-left"] { margin: -3px 0 3px 0; }
.mreg-head, .mreg-box .mreg-q { flex-shrink: 0; } /* длинный список не сжимает поле поиска */
