/* Террикон — стили страниц темы поверх базового макета (main.css). Палитра и шрифты — из бренд-гайда. */

[hidden] { display: none !important; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 200; background: var(--yellow); color: var(--text); padding: 10px 14px; border-radius: 8px; font-weight: 800; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Иконки */
.icon { width: 1em; height: 1em; display: inline-block; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.category-icon { width: 31px; height: 31px; stroke-width: 2.6; }
.search-input-wrap .icon { width: 21px; height: 21px; }
.city-select-wrap .icon { width: 17px; height: 17px; }
.header-link .icon { width: 18px; height: 18px; }
.publish-button .icon { width: 20px; height: 20px; stroke-width: 3; }
.favorite-toggle .icon { width: 19px; height: 19px; }
.favorite-toggle.is-saved .icon, .ghost-button.is-saved .icon { fill: currentColor; }
.listing-meta .icon { width: 13px; height: 13px; }
.see-all .icon { width: 15px; height: 15px; }
.section-heading-row h2 .flame { width: 23px; height: 23px; fill: #F36B35; stroke: #F36B35; }
.mobile-bottom-nav .icon { width: 21px; height: 21px; }
.bottom-publish-icon .icon { width: 22px; height: 22px; stroke-width: 3; }
.search-btn-icon { display: none; }

/* Шапка: логотип из WordPress, выбор города */
.brand-logo img { max-height: 86px; width: 100%; height: auto; }
.city-picker { position: relative; }
.city-picker summary { list-style: none; cursor: pointer; }
.city-picker summary::-webkit-details-marker { display: none; }
.city-picker-list { position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; min-width: 200px; display: grid; padding: 6px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 25px rgba(20,70,45,.16); }
.city-picker-list a { padding: 9px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--dark-green); }
.city-picker-list a:hover { background: var(--mint); }
.fav-count { color: var(--dark-green); }
a.publish-button { text-decoration: none; }
.mobile-menu-panel { display: none; }

/* Фильтры-«пилюли» на главной и в списках — ссылки */
.listing-filters a { border-radius: 18px; padding: 6px 13px; color: #40534A; font-size: 11px; }
.listing-filters a.active { color: var(--dark-green); background: #fff; box-shadow: 0 1px 4px rgba(19,70,47,.12); font-weight: 800; }
.listing-photo-empty { display: flex !important; align-items: center; justify-content: center; aspect-ratio: 1.42 / 1; background: #DDEFE6; color: var(--green); }
.listing-photo-empty .icon { width: 34px; height: 34px; }
.empty-note { grid-column: 1 / -1; display: grid; justify-items: center; gap: 12px; padding: 28px 20px; text-align: center; color: var(--muted); background: #fff; border: 1px solid #DFE9E4; border-radius: 11px; }
.empty-note p { margin: 0; }
.mobile-publish { display: none; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; }
.footer-links a { color: #fff; opacity: .9; }
.footer-links a:hover { opacity: 1; text-decoration: underline; }

/* Общие блоки */
.panel { background: #fff; border: 1px solid #DFE9E4; border-radius: 12px; padding: 22px; box-shadow: 0 2px 5px rgba(30,82,58,.05); }
.panel.narrow { max-width: 560px; margin: 10px auto 40px; }
.panel.center { text-align: center; }
.page-title { margin: 0; font-family: Montserrat, Inter, sans-serif; font-size: 28px; font-weight: 900; color: var(--dark-green); letter-spacing: -.3px; }
.archive-head { padding: 16px 0 6px; }
.breadcrumbs { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.breadcrumbs a { color: var(--dark-green); font-weight: 600; }
.breadcrumbs a:hover { text-decoration: underline; }
.archive-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 14px; }
.archive-title-row h1 { margin: 0; font-family: Montserrat, Inter, sans-serif; font-size: 28px; font-weight: 900; color: var(--dark-green); letter-spacing: -.3px; }
.archive-title-row .publish-button { margin-left: auto; }
.archive-count { color: var(--muted); font-size: 14px; }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; min-height: 34px; padding: 0 15px; border: 1px solid var(--green); border-radius: 999px; background: #fff; color: var(--dark-green); font-size: 13px; font-weight: 700; }
.chip:hover { background: var(--soft-mint); }
.chip.active { background: var(--dark-green); border-color: var(--dark-green); color: #fff; }
.ghost-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 43px; padding: 0 16px; border: 1px solid var(--green); border-radius: 9px; background: #fff; color: var(--dark-green); font-weight: 700; }
.ghost-button:hover { background: var(--soft-mint); }
.ghost-button.is-saved { color: #C93434; border-color: #E9B4B4; }
.publish-button.small, .ghost-button.small { min-height: 36px; padding: 0 12px; font-size: 13px; }
.publish-button.wide { width: 100%; }
.link-button { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 0; color: var(--muted); font-size: 13px; text-decoration: underline; }
.link-button.danger { color: #9B1C1C; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }
.hint { color: var(--muted); font-size: 12px; }
.notice { padding: 12px 16px; border-radius: 10px; margin: 0 0 14px; font-size: 14px; line-height: 1.5; border: 1px solid; }
.notice ul { margin: 6px 0 0; padding-left: 20px; }
.notice-ok { background: #E3F6EC; border-color: #9FD8BA; color: #155C3B; }
.notice-error { background: #FDECEC; border-color: #F0B3B3; color: #8A1C1C; }
.notice-warning { background: #FFF7D1; border-color: var(--gold); color: #5C4500; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: var(--dark-green); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 700; z-index: 120; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; }

/* Поля форм */
.field { display: grid; gap: 6px; margin: 0 0 14px; font-size: 13px; font-weight: 700; color: #22332A; border: 0; padding: 0; min-width: 0; }
.field legend { padding: 0; margin-bottom: 6px; }
.field input[type="text"], .field input[type="search"], .field input[type="number"], .field input[type="tel"], .field input[type="email"], .field input[type="password"], .field select, .field textarea, .login-username input, .login-password input {
	width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid #CFE3D9; border-radius: 9px; background: #fff; color: var(--text); font-size: 14px; font-weight: 400;
}
.field textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green); outline: 2px solid rgba(46,158,107,.25); outline-offset: 0; }
.range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px 16px; font-weight: 500; }
.radio-line { display: block; font-weight: 500; margin: 4px 0; }
.readonly-value { min-height: 42px; display: flex; align-items: center; padding: 0 12px; border-radius: 9px; background: var(--soft-mint); font-weight: 500; }

/* Список объявлений */
.archive-layout { display: grid; grid-template-columns: 270px minmax(0,1fr); gap: 20px; align-items: start; padding-bottom: 28px; }
.filters-box { background: #fff; border: 1px solid #DFE9E4; border-radius: 12px; padding: 16px; position: sticky; top: 12px; }
.filters-box summary { font-family: Montserrat, Inter, sans-serif; font-weight: 900; font-size: 17px; color: var(--dark-green); cursor: pointer; margin-bottom: 12px; list-style: none; }
.filters-box summary::-webkit-details-marker { display: none; }
.filters-box .publish-button { width: 100%; }
.reset-link { display: block; margin-top: 10px; text-align: center; font-size: 13px; color: var(--dark-green); text-decoration: underline; }
.results-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.sort-form label { font-size: 13px; color: var(--muted); }
.sort-form select { min-height: 36px; border: 1px solid #CFE3D9; border-radius: 8px; padding: 0 8px; background: #fff; }
.archive-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
.pagination { margin: 22px 0 6px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pagination .page-numbers { min-width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid #DFE9E4; border-radius: 9px; background: #fff; color: var(--dark-green); font-weight: 700; }
.pagination .page-numbers.current { background: var(--dark-green); border-color: var(--dark-green); color: #fff; }
.term-description { margin-top: 22px; color: #34463D; font-size: 14px; line-height: 1.6; }
.all-categories { padding: 6px 0 30px; }
.all-categories h2 { font-family: Montserrat, Inter, sans-serif; font-size: 23px; font-weight: 900; margin: 0 0 14px; }
.all-categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.all-cat { background: #fff; border: 1px solid #DFE9E4; border-radius: 12px; padding: 14px 16px; }
.all-cat-title { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--dark-green); }
.all-cat-title .category-icon { width: 24px; height: 24px; }
.all-cat ul { margin: 8px 0 0; padding: 0 0 0 34px; list-style: none; display: grid; gap: 4px; font-size: 13px; }
.all-cat ul a:hover { color: var(--dark-green); text-decoration: underline; }

/* Страница объявления */
.ad-layout { display: grid; grid-template-columns: minmax(0,1fr) 360px; gap: 20px; align-items: start; }
.ad-main { display: grid; gap: 16px; }
.ad-gallery { padding: 12px; }
.ad-gallery-main { border-radius: 10px; overflow: hidden; background: #DDEFE6; }
.ad-gallery-main img, .ad-gallery-main .ad-photo { display: block; width: 100%; max-height: 520px; aspect-ratio: 4 / 3; object-fit: contain; background: #DDEFE6; }
.ad-gallery-main .listing-photo-empty { aspect-ratio: 4 / 3; }
.ad-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.ad-thumb { flex: 0 0 auto; width: 92px; height: 70px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: none; }
.ad-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-thumb.active { border-color: var(--dark-green); }
.panel-title { margin: 0 0 12px; font-family: Montserrat, Inter, sans-serif; font-size: 19px; font-weight: 900; color: var(--dark-green); }
.panel-title + .ad-description { margin-bottom: 4px; }
.spec-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px 28px; margin: 0 0 22px; }
.spec-list div { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 7px; border-bottom: 1px dashed #D7EDE4; font-size: 14px; }
.spec-list dt { color: var(--muted); }
.spec-list dd { margin: 0; font-weight: 700; text-align: right; }
.ad-description { font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.ad-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 18px; color: var(--muted); font-size: 13px; }
.ad-meta-row .link-button { margin-left: auto; }
.ad-side { display: grid; gap: 14px; position: sticky; top: 12px; }
.ad-buy { display: grid; gap: 12px; }
.ad-title { margin: 0; font-family: Montserrat, Inter, sans-serif; font-size: 23px; font-weight: 900; line-height: 1.2; }
.ad-price { font-family: Montserrat, Inter, sans-serif; font-size: 28px; font-weight: 900; color: var(--dark-green); }
.ad-city { display: flex; align-items: center; gap: 6px; color: #42564A; font-size: 14px; }
.ad-city .icon { color: var(--green); }
.ad-city a { text-decoration: underline; }
.ad-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seller { display: flex; gap: 14px; align-items: center; font-size: 14px; }
.seller a { color: var(--dark-green); font-weight: 700; font-size: 13px; }
.seller-avatar { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--mint); color: var(--dark-green); font-family: Montserrat, Inter, sans-serif; font-weight: 900; font-size: 22px; }
.seller-name { font-weight: 800; }
.seller-meta { color: var(--muted); font-size: 13px; margin: 2px 0 4px; }
.safety { background: #FFF7D1; border-color: var(--gold); font-size: 13px; line-height: 1.5; }
.similar { margin-top: 26px; }
.allo-dialog { width: min(100% - 32px, 460px); border: 0; border-radius: 16px; padding: 24px; box-shadow: 0 18px 60px rgba(0,0,0,.2); }
.allo-dialog::backdrop { background: rgba(15,35,25,.48); }
.allo-dialog h2 { margin: 0 0 14px; font-family: Montserrat, Inter, sans-serif; color: var(--dark-green); font-size: 20px; }
.dialog-buttons { display: flex; justify-content: flex-end; gap: 8px; }

/* Форма подачи */
.ad-form { max-width: 860px; margin: 0 auto 36px; }
.form-step { padding: 4px 0 10px; border-bottom: 1px solid #EEF5F1; margin-bottom: 16px; }
.form-step:last-of-type { border-bottom: 0; }
.form-step h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-family: Montserrat, Inter, sans-serif; font-size: 18px; font-weight: 900; }
.form-step h2 span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--yellow); border: 1px solid var(--gold); font-size: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 16px; }
.photo-drop { position: relative; display: flex; align-items: center; gap: 14px; padding: 18px; border: 2px dashed #A9D6BF; border-radius: 12px; background: var(--soft-mint); color: var(--dark-green); font-size: 13px; font-weight: 600; cursor: pointer; }
.photo-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-drop:focus-within { outline: 3px solid var(--gold); }
.photo-preview, .photo-keep { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.photo-keep { margin: 0 0 12px; }
.photo-preview-item, .photo-keep-item { margin: 0; width: 104px; display: grid; gap: 4px; font-size: 11px; color: var(--muted); }
.photo-preview-item img, .photo-keep-item img { width: 104px; height: 78px; object-fit: cover; border-radius: 8px; }
.photo-preview-item.too-big { color: #9B1C1C; }
.photo-preview-item.too-big img { opacity: .4; }
.rules-note { font-size: 13px; color: var(--muted); text-align: center; }
.rules-note a { color: var(--dark-green); text-decoration: underline; }

/* Личный кабинет */
.cabinet-layout { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 20px; align-items: start; padding-bottom: 30px; }
.cabinet-nav { padding: 16px; }
.cabinet-user { display: flex; gap: 12px; align-items: center; padding-bottom: 14px; margin-bottom: 8px; border-bottom: 1px solid #EEF5F1; font-size: 14px; overflow-wrap: anywhere; }
.cabinet-user small { color: var(--muted); }
.cabinet-nav nav { display: grid; gap: 2px; }
.cabinet-nav nav a, .cabinet-nav nav .soon { display: flex; align-items: center; gap: 10px; padding: 11px 10px; border-radius: 9px; font-size: 14px; font-weight: 600; color: #22332A; }
.cabinet-nav nav a:hover { background: var(--soft-mint); }
.cabinet-nav nav a.active { background: var(--mint); color: var(--dark-green); font-weight: 800; }
.cabinet-nav .icon { width: 18px; height: 18px; color: var(--dark-green); }
.cabinet-nav .soon { color: #8A9A92; }
.cabinet-nav .soon small { margin-left: auto; font-size: 11px; }
.badge { margin-left: auto; padding: 0 8px; border-radius: 999px; background: var(--yellow); font-size: 12px; font-weight: 800; }
.my-ads { display: grid; gap: 10px; }
.my-ad { display: grid; grid-template-columns: 110px minmax(0,1fr) auto; grid-template-areas: "photo body status" "photo actions actions"; gap: 8px 14px; align-items: start; background: #fff; border: 1px solid #DFE9E4; border-radius: 12px; padding: 12px; }
.my-ad-photo { grid-area: photo; }
.my-ad-img, .my-ad-photo .listing-photo-empty { width: 110px; height: 82px; object-fit: cover; border-radius: 9px; display: block; aspect-ratio: auto; }
.my-ad-body { grid-area: body; min-width: 0; }
.my-ad-title { display: block; font-weight: 800; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.my-ad-title:hover { color: var(--dark-green); }
.my-ad-meta { margin-top: 4px; color: var(--muted); font-size: 12px; }
.reject-reason { margin-top: 6px; color: #9B1C1C; font-size: 13px; }
.status-badge { grid-area: status; padding: 4px 10px; border-radius: 7px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.status-active { background: #DDF3E8; color: var(--dark-green); }
.status-pending { background: #FFF7D1; color: #6B5200; }
.status-rejected { background: #FDE2E2; color: #9B1C1C; }
.status-archived, .status-draft { background: #EEEEEE; color: #444; }
.my-ad-actions { grid-area: actions; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.my-ad-actions .link-button { margin-left: auto; }

/* Вход в кабинете */
#loginform p { margin: 0 0 12px; display: grid; gap: 6px; font-size: 13px; font-weight: 700; }
#loginform .login-remember { display: block; font-weight: 500; }
#loginform .button-primary { width: 100%; min-height: 44px; border: 1px solid var(--gold); border-radius: 9px; background: var(--yellow); font-weight: 900; cursor: pointer; }
.login-links { text-align: center; font-size: 13px; }
.login-links a { color: var(--dark-green); text-decoration: underline; }

/* Текстовые страницы */
.prose { max-width: 860px; margin: 0 auto 30px; font-size: 15px; line-height: 1.65; }
.prose h2 { font-family: Montserrat, Inter, sans-serif; color: var(--dark-green); }
.prose a { color: var(--dark-green); text-decoration: underline; }

/* Планшет */
@media (max-width: 1120px) {
	.archive-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
	.ad-layout { grid-template-columns: minmax(0,1fr) 320px; }
}

/* Телефон */
@media (max-width: 768px) {
	.mobile-menu-panel { display: grid; }
	.category-icon { width: 26px; height: 26px; }
	.categories .category-tile:nth-child(n+7) { display: none; }
	.hero-search button .search-btn-text { display: none; }
	.hero-search button .search-btn-icon { display: inline-block; width: 19px; height: 19px; stroke-width: 2.8; }
	.mobile-publish { display: flex; width: 100%; margin: -10px 0 22px; min-height: 46px; font-size: 15px; }
	.listing-filters a { padding: 5px 11px; font-size: 10px; }
	.mobile-bottom-nav a[aria-current="page"] { color: var(--green); }
	.footer-links { width: 100%; font-size: 12px; }

	.page-title, .archive-title-row h1 { font-size: 22px; }
	.archive-layout, .ad-layout, .cabinet-layout { grid-template-columns: 1fr; }
	.filters-box { position: static; }
	.filters-box:not([open]) summary { margin-bottom: 0; }
	.archive-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
	.ad-side { position: static; }
	.ad-title { font-size: 20px; }
	.ad-price { font-size: 24px; }
	.spec-list, .form-grid { grid-template-columns: 1fr; }
	.panel { padding: 16px; }
	.my-ad { grid-template-columns: 84px minmax(0,1fr); grid-template-areas: "photo body" "status status" "actions actions"; }
	.my-ad-img, .my-ad-photo .listing-photo-empty { width: 84px; height: 64px; }
	.status-badge { justify-self: start; }
	.archive-title-row .publish-button { display: none; }
	.cabinet-nav nav { grid-template-columns: 1fr 1fr; }
	.toast { bottom: 80px; }
}

/* Доработки по скриншотам */
textarea { font: inherit; }
.ad-actions .ghost-button { padding: 0 10px; font-size: 14px; white-space: nowrap; }
.page-template-page-submit .archive-head { max-width: 860px; margin: 0 auto; }
@media (max-width: 768px) {
	.filters-box summary { display: flex; align-items: center; justify-content: space-between; margin: 0; }
	.filters-box summary::after { content: "Показать"; font-family: Inter, sans-serif; font-size: 13px; font-weight: 700; color: var(--dark-green); }
	.filters-box[open] summary { margin-bottom: 12px; }
	.filters-box[open] summary::after { content: "Скрыть"; }
	/* Объявление: сначала фото, затем цена и телефон, потом характеристики */
	.ad-main { display: contents; }
	.ad-gallery { order: 1; }
	.ad-side { order: 2; }
	.ad-main > .panel:not(.ad-gallery) { order: 3; }
}
