/*
 * Террикон — точная подгонка под утверждённый бренд-макет (allo-approved-brand-board.png).
 * Макет нарисован для ширины ~880 px; на больших экранах сохраняем его пропорции
 * за счёт контейнера 1200 px и пропорционально увеличенных размеров.
 */

:root {
	--container: 1200px;
	--page-gutter: 20px;
	--hero-title: #0B3A25;
	--nav-grad: linear-gradient(180deg, #2E9E6B 0%, #1F7A50 100%);
}
body { background: #fff; }
.page-content { padding-bottom: 8px; }

/* ---------- Шапка ---------- */
.site-header { background: #fff; box-shadow: 0 1px 0 #EDF3F0; }
.header-inner { min-height: 112px; grid-template-columns: 270px minmax(220px, 1fr) auto; gap: 28px; }
.brand-logo { width: 262px; }
.brand-logo img { max-height: none; }
.header-promise { font-size: 15px; line-height: 1.45; color: #1C1C1C; font-weight: 500; }
.header-actions { display: grid; justify-items: end; align-content: center; gap: 12px; }
.header-links { display: flex; align-items: center; gap: 26px; }
.header-link { font-size: 14px; font-weight: 600; color: #1C1C1C; }
.header-link .icon { width: 19px; height: 19px; color: var(--dark-green); }
.header-link .icon-solid { width: 18px; height: 18px; }
.header-publish { min-height: 48px; min-width: 280px; padding: 0 26px; border-radius: 10px; border: 1px solid #E8C437; font-size: 17px; font-weight: 800; box-shadow: 0 3px 8px rgba(201,162,39,.28); }
.header-publish .icon { width: 22px; height: 22px; }
.mobile-profile { display: none; }

/* ---------- Навигация ---------- */
.main-navigation { background: var(--nav-grad); box-shadow: inset 0 -1px 0 rgba(0,0,0,.08); }
.navigation-inner { height: 52px; }
.navigation-inner > a { height: 52px; padding: 0 22px; font-size: 16px; font-weight: 600; }
.navigation-inner .nav-all { gap: 12px; padding-left: 20px; padding-right: 26px; background: rgba(0,40,20,.22); border-radius: 0 26px 26px 0; }
.navigation-inner .nav-all .icon { width: 24px !important; height: 24px !important; stroke-width: 2.6; }

/* ---------- Главный баннер ---------- */
.hero { background-image: url('../img/donbass-hero-city-wide.jpg'); min-height: 356px; margin-top: 16px; padding: 34px 44px 26px; border-radius: 16px; background-position: right 62%; box-shadow: 0 4px 14px rgba(18,83,54,.14); }
.hero-shade { background: linear-gradient(90deg, rgba(255,255,255,.42) 0%, rgba(255,255,255,.18) 34%, rgba(255,255,255,0) 58%); }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 42%; background: linear-gradient(180deg, rgba(46,158,107,0) 0%, rgba(46,158,107,.55) 45%, rgba(31,122,80,.92) 100%); pointer-events: none; }
.hero h1 { color: var(--hero-title); font-size: clamp(36px, 5vw, 64px); line-height: .96; letter-spacing: -1.2px; transform: skewX(-4deg); transform-origin: left bottom; font-style: italic; }
.hero-tagline { margin-top: 18px; padding: 9px 28px 11px 24px; font-size: 26px; color: #0E1E15; border-radius: 3px 30px 4px 26px; transform: rotate(-3deg); box-shadow: 0 3px 8px rgba(90,70,0,.18); clip-path: polygon(0 12%, 4% 0, 100% 0, 97% 52%, 100% 100%, 3% 100%, 0 70%); }
.hero-search { z-index: 2; min-height: 62px; padding: 7px; grid-template-columns: minmax(0,1fr) 260px 118px; border: 0; border-radius: 16px; box-shadow: 0 0 0 4px rgba(46,158,107,.35), 0 8px 22px rgba(10,60,35,.28); }
.search-input-wrap { padding: 0 14px; gap: 12px; }
.search-input-wrap .icon { width: 23px; height: 23px; color: var(--dark-green); stroke-width: 2.6; }
.search-input-wrap input { height: 46px; font-size: 15px; }
.city-select-wrap { padding: 0 14px; }
.city-select-wrap select { font-size: 14px; color: #3E4C45; }
.hero-search button { height: 48px; border-radius: 10px; font-size: 18px; border-color: #E8C437; box-shadow: 0 2px 5px rgba(201,162,39,.3); }

/* ---------- Категории ---------- */
.categories { gap: 14px; margin: 26px 0 40px; }
.category-tile { min-height: 128px; gap: 6px; padding: 14px 6px 12px; border: 1px solid #D5ECDF; border-radius: 14px; background: linear-gradient(180deg, #F3FCF7 0%, #E2F5EA 100%); box-shadow: 0 2px 6px rgba(25,91,62,.07); }
.category-tile .category-icon { width: 42px; height: 42px; color: #1F7A50; margin-bottom: 4px; }
.category-tile .icon-solid { fill: currentColor; stroke: none; }
.category-name { font-size: 14px; font-weight: 700; color: #111C16; line-height: 1.2; }
.category-count { font-size: 13px; color: #4E6157; }

/* ---------- Иконки: залитые ---------- */
.icon-solid { fill: currentColor; stroke: none; }
.icon-bold { stroke-width: 2.7; }

/* ---------- Свежие объявления ---------- */
.section-heading-row { gap: 22px; margin-bottom: 18px; }
.section-heading-row h2 { gap: 10px; font-size: 30px; letter-spacing: -.5px; color: #111; }
.flame-emoji { font-size: 28px; line-height: 1; }
.listing-filters { padding: 4px; gap: 4px; background: #F0F4F2; border-radius: 999px; }
.listing-filters a, .listing-filters button { padding: 8px 18px; font-size: 14px; color: #3E4C45; border-radius: 999px; }
.listing-filters a.active, .listing-filters button.active { color: var(--dark-green); background: #fff; font-weight: 800; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; box-shadow: 0 1px 4px rgba(19,70,47,.12); }
.see-all { font-size: 15px; font-weight: 700; gap: 6px; }
.see-all .icon { width: 18px; height: 18px; }
.listing-grid { gap: 18px; }
.listing-card { border-radius: 14px; border-color: #E2ECE7; box-shadow: 0 3px 10px rgba(30,82,58,.08); }
.listing-photo { aspect-ratio: 1.5 / 1; }
.favorite-toggle { top: 10px; right: 10px; width: 36px; height: 36px; background: transparent; filter: drop-shadow(0 1px 3px rgba(0,0,0,.55)); }
.favorite-toggle .icon { width: 28px; height: 28px; stroke-width: 2.4; }
.favorite-toggle.is-saved { color: #fff; background: transparent; filter: drop-shadow(0 1px 3px rgba(0,0,0,.55)); }
.favorite-toggle.is-saved .icon { fill: #E5484D; stroke: #fff; }
.listing-badge { top: 10px; left: 10px; padding: 5px 13px; border-radius: 9px; font-size: 14px; font-weight: 800; }
.listing-body { padding: 12px 14px 14px; }
.listing-price { margin: 0; font-size: 21px; font-weight: 900; color: #111; letter-spacing: -.2px; }
.listing-name { margin-top: 3px; font-size: 15px; font-weight: 500; color: #1C1C1C; }
.listing-meta, .listing-date { gap: 6px; font-size: 13px; color: #3E4C45; margin-top: 6px; }
.listing-meta .icon { width: 15px; height: 15px; color: #1F9A57; }
.listing-date { margin-top: 4px; color: #55635C; }
.listing-date .icon { width: 14px; height: 14px; }

/* Доп. блоки — в тон макету */
.trust-strip { background: var(--soft-mint); border-radius: 14px; }
.archive-grid { gap: 16px; }
.filters-box, .panel, .all-cat { border-radius: 14px; }

/* ---------- Планшет ---------- */
@media (max-width: 1120px) and (min-width: 769px) {
	.header-inner { grid-template-columns: 210px 1fr auto; gap: 16px; }
	.brand-logo { width: 205px; }
	.header-promise { font-size: 13px; }
	.header-links { gap: 14px; }
	.header-publish { min-width: 0; font-size: 15px; }
	.navigation-inner > a { padding: 0 14px; font-size: 14px; }
	.hero-search { grid-template-columns: minmax(0,1fr) 200px 100px; }
	.categories { grid-template-columns: repeat(4, minmax(0,1fr)); }
	.listing-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

/* ---------- Телефон — по мобильному эталону ---------- */
@media (max-width: 768px) {
	:root { --page-gutter: 12px; }
	body { padding-bottom: 76px; }
	.header-inner { min-height: 70px; display: grid; grid-template-columns: 44px 1fr 44px; gap: 6px; }
	.mobile-menu-button { order: -1; width: 44px; height: 44px; background: transparent; color: #1C1C1C; }
	.mobile-menu-button .icon { width: 26px !important; height: 26px !important; stroke-width: 2.4; }
	.brand-logo { width: 168px; justify-self: center; }
	.mobile-profile { display: grid; place-items: center; width: 44px; height: 44px; color: var(--dark-green); }
	.mobile-profile .icon { width: 26px; height: 26px; }
	.header-actions, .header-promise, .main-navigation { display: none; }

	.hero { min-height: 232px; margin-top: 4px; padding: 18px 16px 14px; border-radius: 0 0 18px 18px; margin-left: calc(var(--page-gutter) * -1); margin-right: calc(var(--page-gutter) * -1); }
	.hero h1 { font-size: 32px; letter-spacing: -.6px; }
	.hero-tagline { margin-top: 10px; padding: 6px 16px 8px 14px; font-size: 15px; }
	.hero-search { grid-template-columns: minmax(0,1fr) 46px; min-height: 52px; padding: 5px; border-radius: 13px; }
	.hero-search button { height: 42px; width: 46px; border-radius: 9px; }
	.search-input-wrap input { font-size: 14px; height: 40px; }

	.categories { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin: 16px 0 20px; }
	.category-tile { min-height: 92px; padding: 10px 4px 8px; border-radius: 12px; gap: 4px; }
	.category-tile .category-icon { width: 34px; height: 34px; margin-bottom: 2px; }
	.category-name { font-size: 12px; }
	.category-count { display: none; }
	.mobile-publish { margin: 0 0 24px; min-height: 50px; border-radius: 12px; font-size: 17px; font-weight: 800; }

	.section-heading-row h2 { font-size: 22px; }
	.flame-emoji { display: none; }
	.listing-filters a { padding: 6px 13px; font-size: 13px; }
	.see-all { font-size: 13px; }

	/* Объявления списком: фото слева, как на эталоне */
	.listing-grid, .archive-grid { grid-template-columns: 1fr; gap: 10px; }
	.listing-card { display: grid; grid-template-columns: 124px minmax(0,1fr); align-items: stretch; border-radius: 14px; }
	.listing-photo-link { margin: 10px 0 10px 10px; border-radius: 10px; overflow: hidden; }
	.listing-photo { height: 100%; min-height: 92px; aspect-ratio: auto; }
	.listing-badge { top: 6px; left: 6px; padding: 3px 8px; font-size: 11px; }
	.favorite-toggle { top: 8px; right: 8px; width: 34px; height: 34px; color: #1C1C1C; filter: none; }
	.favorite-toggle .icon { width: 22px; height: 22px; stroke-width: 2.2; }
	.favorite-toggle.is-saved { color: #E5484D; filter: none; }
	.favorite-toggle.is-saved .icon { fill: #E5484D; stroke: #E5484D; }
	.listing-body { padding: 10px 44px 10px 12px; }
	.listing-price { font-size: 19px; }
	.listing-name { font-size: 14px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
	.listing-meta, .listing-date { font-size: 13px; margin-top: 4px; }

	/* Нижняя навигация — тёмно-зелёная */
	.mobile-bottom-nav { min-height: 66px; background: linear-gradient(180deg, #23874F 0%, #156B3E 100%); border-top: 0; box-shadow: 0 -4px 14px rgba(10,60,35,.22); }
	.mobile-bottom-nav a, .mobile-bottom-nav button { color: #fff; font-size: 11px; font-weight: 600; }
	.mobile-bottom-nav a[aria-current="page"] { color: #fff; font-weight: 800; }
	.mobile-bottom-nav .icon { width: 23px; height: 23px; }
	.bottom-publish-icon { width: 38px; height: 38px; margin-top: -16px; background: var(--yellow); color: var(--dark-green); border: 3px solid #fff; box-shadow: 0 3px 8px rgba(0,0,0,.25); }
	.bottom-publish-icon .icon { width: 22px; height: 22px; }
}

/* Короткие подписи категорий на телефоне */
.name-short { display: none; }
@media (max-width: 768px) {
	.name-full { display: none; }
	.name-short { display: inline; }
	.category-tile { min-height: 96px; }
	.category-tile .category-icon { width: 38px; height: 38px; }
	.category-name { font-size: 13px; }
}

/* Цветные иконки категорий: цвета заданы в самой иконке */
.icon-color { fill: none; stroke: none; overflow: visible; filter: none; }
.category-tile .icon-color, .category-tile .category-icon.icon-color { width: 64px; height: 64px; margin: -8px 0 -4px; }
.category-tile:hover .icon-color { transform: translateY(-1px) scale(1.04); transition: transform .15s ease; }
.all-cat-title .icon-color { width: 30px; height: 30px; }
@media (max-width: 768px) {
	.category-tile .icon-color, .category-tile .category-icon.icon-color { width: 52px; height: 52px; margin: -4px 0 -2px; }
}

/* ===== 1.1: фон-террикон, плашка «бесплатно», мега-меню категорий ===== */
.hero { background-image: url('../img/donbass-hero-terrikon.jpg'); background-size: cover; background-position: center 40%; }
.hero-shade { background: linear-gradient(90deg, rgba(255,255,255,.72) 0%, rgba(255,255,255,.45) 34%, rgba(255,255,255,0) 62%); }
.hero-free { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; margin-left: 6px; padding: 8px 16px; border-radius: 999px; background: #1F7A50; color: #fff; font-weight: 800; font-size: 18px; box-shadow: 0 3px 10px rgba(10,60,35,.3); }
.hero-free .icon { stroke: #FFD94A; stroke-width: 3.2; }
.hero-content { display: flex; flex-direction: column; align-items: flex-start; }

.navigation-inner { position: relative; }
.nav-cats { position: static; height: 52px; display: flex; }
.nav-cats > .nav-all { height: 52px; display: inline-flex; align-items: center; color: #fff; font-size: 16px; font-weight: 600; }
.mega { position: absolute; left: 0; top: 100%; z-index: 60; display: none; width: min(900px, 100%); min-height: 380px; background: #fff; color: #0E3B25; border-radius: 0 0 16px 16px; box-shadow: 0 18px 40px rgba(10,60,35,.25); overflow: hidden; grid-template-columns: 300px 1fr; }
.nav-cats.is-open .mega { display: grid; }
.mega-roots { list-style: none; margin: 0; padding: 8px 0; background: #F4FAF6; border-right: 1px solid #E2EFE7; }
.mega-root > a { display: flex; align-items: center; gap: 12px; padding: 7px 16px; font-size: 15px; font-weight: 600; color: #0E3B25; }
.mega-root .mega-icon { width: 32px; height: 32px; flex: none; }
.mega-root .mega-chev { margin-left: auto; opacity: .45; }
.mega-root.is-active > a { background: #fff; color: #1F7A50; box-shadow: inset 4px 0 0 #2E9E6B; }
.mega-panes { padding: 22px 28px; }
.mega-pane { display: none; }
.mega-pane.is-active { display: block; }
.mega-pane-title { display: inline-block; margin-bottom: 14px; font-size: 20px; font-weight: 800; color: #1F7A50; }
.mega-sub { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 24px; }
.mega-sub a { padding: 8px 10px; border-radius: 8px; font-size: 15px; color: #10251A; }
.mega-sub a:hover, .mega-sub a:focus { background: #EAF6EF; color: #1F7A50; }
.mega-empty { color: #5B6F63; margin: 0; }

.nav-drop { position: relative; height: 52px; display: flex; }
.nav-drop > a { height: 52px; display: inline-flex; align-items: center; gap: 6px; padding: 0 22px; color: #fff; font-size: 16px; font-weight: 600; }
.nav-drop-list { position: absolute; left: 0; top: 100%; z-index: 55; display: none; min-width: 240px; padding: 8px; background: #fff; border-radius: 0 0 12px 12px; box-shadow: 0 14px 30px rgba(10,60,35,.22); }
.nav-drop:hover .nav-drop-list, .nav-drop:focus-within .nav-drop-list { display: grid; }
.nav-drop-list a { padding: 9px 12px; border-radius: 8px; color: #10251A; font-size: 15px; }
.nav-drop-list a:hover { background: #EAF6EF; color: #1F7A50; }

.mobile-menu-panel details.m-cat { border-bottom: 1px solid #EEF5F1; }
.mobile-menu-panel details.m-cat summary { padding: 12px; color: var(--dark-green); font-size: 14px; font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.mobile-menu-panel details.m-cat summary::after { content: "›"; transform: rotate(90deg); transition: transform .15s; }
.mobile-menu-panel details.m-cat[open] summary::after { transform: rotate(270deg); }
.mobile-menu-panel details.m-cat a { display: block; padding: 10px 12px 10px 26px; font-weight: 500; border-bottom: 0; }
.mobile-menu-panel { max-height: 75vh; overflow-y: auto; }

@media (max-width: 1100px) { .nav-drop > a { padding: 0 14px; font-size: 14px; } }
@media (max-width: 760px) {
	.hero { background-position: 68% 40%; }
	.hero-shade { background: linear-gradient(90deg, rgba(255,255,255,.8) 0%, rgba(255,255,255,.5) 55%, rgba(255,255,255,.15) 100%); }
	.hero-free { margin-top: 10px; margin-left: 2px; padding: 6px 12px; font-size: 13px; }
	.hero-free .icon { width: 15px !important; height: 15px !important; }
}
.mobile-menu-panel .nav-drop { display: block; height: auto; border-bottom: 1px solid #EEF5F1; }
.mobile-menu-panel .nav-drop > a { height: auto; padding: 12px; color: var(--dark-green); font-size: 14px; font-weight: 700; }
.mobile-menu-panel .nav-drop-list, .mobile-menu-panel .nav-chev { display: none !important; }

/* ===== 1.2: баннер «закат над шахтой» ===== */
.hero { min-height: 400px; background-image: url('../img/donbass-hero-sunset.jpg'); background-size: cover; background-position: center 30%; }
.hero-shade { background: linear-gradient(90deg, rgba(8,34,20,.72) 0%, rgba(8,34,20,.5) 32%, rgba(8,34,20,.12) 58%, rgba(8,34,20,0) 72%); }
.hero::after { height: 34%; background: linear-gradient(180deg, rgba(14,59,37,0) 0%, rgba(14,59,37,.45) 55%, rgba(14,59,37,.85) 100%); }
.hero h1 { color: #fff; font-size: clamp(36px, 4.6vw, 60px); line-height: 1; text-shadow: 0 3px 18px rgba(0,0,0,.45); }
.hero-free { margin-top: 20px; margin-left: 4px; background: #FFD94A; color: #10251A; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.hero-free .icon { stroke: #1F7A50; }
.hero-sub { margin: 14px 0 0 6px; color: #fff; font-size: 18px; font-weight: 600; text-shadow: 0 2px 10px rgba(0,0,0,.55); max-width: 640px; }
@media (max-width: 760px) {
	.hero { min-height: 270px; background-position: 30% 35%; }
	.hero-shade { background: linear-gradient(180deg, rgba(8,34,20,.55) 0%, rgba(8,34,20,.25) 60%, rgba(8,34,20,0) 100%); }
	.hero h1 { font-size: 30px; }
	.hero-free { margin-top: 12px; background: #FFD94A; }
	.hero-sub { font-size: 13px; margin-top: 8px; max-width: 300px; }
}

/* ===== 1.4: аккаунт в форме подачи ===== */
.guest-hint { background: #EAF6EF; border: 1px solid #CDE8D8; color: #0E3B25; border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; }
.acc-switch { display: grid; grid-template-columns: auto auto 1fr; gap: 0 8px; align-items: center; }
.acc-switch > input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.acc-switch > label { padding: 9px 16px; border: 1.5px solid #CFE3D7; border-radius: 999px; font-weight: 700; font-size: 14px; color: #1F7A50; cursor: pointer; margin-bottom: 14px; background: #fff; }
.acc-switch > input:checked + label { background: #1F7A50; border-color: #1F7A50; color: #fff; }
.acc-switch > input:focus-visible + label { outline: 2px solid #2E9E6B; outline-offset: 2px; }
.acc-pane { grid-column: 1 / -1; display: none; }
#acc_new:checked ~ .acc-pane-new, #acc_login:checked ~ .acc-pane-login { display: grid; }
.check-row { grid-column: 1 / -1; display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: #22332A; line-height: 1.45; }
.check-row input { width: 18px; height: 18px; margin-top: 1px; accent-color: #1F7A50; flex: none; }
.check-row a { color: #1F7A50; }
@media (max-width: 560px) { .acc-switch { grid-template-columns: 1fr 1fr; } .acc-switch > label { text-align: center; padding: 9px 8px; font-size: 13px; } }
.acc-pane .field { align-content: start; }

/* ===== 1.5: профиль и восстановление доступа ===== */
.access-panel { display: grid; gap: 16px; }
.access-card h2 { margin: 0 0 12px; font-size: 18px; font-weight: 900; color: #0E3B25; }
.access-card .muted { color: #5B6F63; font-size: 14px; margin: 0 0 12px; }
.access-list { list-style: none; margin: 0; padding: 0; }
.access-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid #EEF5F1; font-size: 15px; }
.access-list li:first-child { border-top: 0; }
.access-list .st-on { color: #1F7A50; font-weight: 700; }
.access-list .st-off { color: #8A9A90; }
.access-list .link-howto { display: block; background: #FFF8D6; border: 1px solid #F3E39A; border-radius: 12px; padding: 12px 14px; line-height: 1.6; }
.big-code { display: inline-block; font-size: 18px; font-weight: 800; letter-spacing: 1px; background: #fff; border: 1px dashed #E5BE22; border-radius: 8px; padding: 2px 10px; margin: 0 4px; }
@media (max-width: 560px) { .access-list li { flex-direction: column; align-items: flex-start; } }
.access-card form .field:last-child { align-self: end; } .access-card form .publish-button { height: auto; min-height: 46px; padding: 12px 24px; justify-self: start; }

/* ===== 1.5.1: выбор города ===== */
.city-picker-list { width: 520px; max-width: 92vw; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; max-height: 70vh; overflow-y: auto; }
.city-picker-list .city-all { grid-column: 1 / -1; background: #F4FAF6; }
.city-picker-list a.is-current { background: #1F7A50; color: #fff; }
@media (max-width: 560px) { .city-picker-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
