/* Placeo widget — namespaced styles (.plcw-*). Не ломает чужой сайт и не ломается от чужих стилей.
   Дизайн синхронизирован с обновлённым Placeo: зелёный бренд, плоские скруглённые карточки,
   Onest для цен/заголовков, Golos Text для текста, фирменный focus-ring. */
@import url('https://fonts.googleapis.com/css2?family=Golos+Text:wght@400;500;600;700&family=Onest:wght@600;700;800&display=swap');

.plcw-root, .plcw-root * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--plcw-font, 'Golos Text', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
    line-height: 1.45;
}

.plcw-root {
    display: block;
    width: 100%;
    color: var(--plcw-text, #0b1a26);
    background: var(--plcw-bg, transparent);
    font-size: var(--plcw-fs, 15px);
    padding: 8px 0;
    -webkit-font-smoothing: antialiased;
}

.plcw-grid {
    display: grid;
    /* по умолчанию = средние */
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 22px 20px;
}

/* Карточка объявления — плоская, скруглённая, с мягким подъёмом на ховере */
.plcw-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--plcw-card-bg, #fff);
    border: 1px solid rgba(11, 26, 38, .06);
    border-radius: var(--plcw-radius-card, 16px);
    overflow: hidden;
    transition: box-shadow .2s ease, transform .15s ease;
}
.plcw-card:hover { box-shadow: 0 8px 24px rgba(11, 26, 38, .10); transform: translateY(-2px); }

.plcw-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #eef3f7;
}
.plcw-thumb-empty {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #eef3f7;
    font-size: 30px;
    color: #9babbb;
}

.plcw-card-body { padding: 11px 13px 13px; }
.plcw-price { font-family: 'Onest', var(--plcw-font, sans-serif); font-weight: 800; font-size: 1.15em; letter-spacing: -.02em; }
.plcw-title {
    font-size: .92em;
    margin-top: 3px;
    opacity: .85;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.plcw-city { font-size: .8em; opacity: .55; margin-top: 3px; }
.plcw-desc { display: none; }   /* видно только в режиме «в строку» */

/* Пустая лента */
.plcw-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 44px 16px;
    font-size: 1em;
    font-weight: 400;
    opacity: .55;
}

/* ---------- Размер плиток ---------- */
.plcw-size-small .plcw-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px 16px; }
.plcw-size-large .plcw-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 26px 24px; }

/* ---------- Режим «по одному в строке» ---------- */
.plcw-layout-list .plcw-grid { grid-template-columns: 1fr; gap: 12px; }
.plcw-layout-list .plcw-card { display: flex; align-items: stretch; }
.plcw-layout-list .plcw-thumb,
.plcw-layout-list .plcw-thumb-empty { width: 240px; aspect-ratio: 4 / 3; flex: none; }
.plcw-layout-list.plcw-size-small .plcw-thumb,
.plcw-layout-list.plcw-size-small .plcw-thumb-empty { width: 180px; }
.plcw-layout-list.plcw-size-large .plcw-thumb,
.plcw-layout-list.plcw-size-large .plcw-thumb-empty { width: 320px; }
.plcw-layout-list .plcw-card-body { flex: 1; min-width: 0; padding: 14px 16px; align-self: center; }
.plcw-layout-list .plcw-title { -webkit-line-clamp: 1; font-size: 1em; }
.plcw-layout-list .plcw-desc {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    margin-top: 6px; font-size: .85em; opacity: .6; line-height: 1.45;
}
@media (max-width: 480px) {
    .plcw-layout-list .plcw-thumb,
    .plcw-layout-list .plcw-thumb-empty,
    .plcw-layout-list.plcw-size-small .plcw-thumb,
    .plcw-layout-list.plcw-size-small .plcw-thumb-empty,
    .plcw-layout-list.plcw-size-large .plcw-thumb,
    .plcw-layout-list.plcw-size-large .plcw-thumb-empty { width: 116px; }
    .plcw-layout-list .plcw-desc { display: none; }
}


.plcw-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 18px 0 6px;
}

/* ---------- Панель фильтров ---------- */
.plcw-filters { margin: 0 0 16px; }
.plcw-filters-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}
/* В строке фильтров поля компактные (в отличие от формы подачи, где они на всю ширину) */
.plcw-filters .plcw-input, .plcw-filters .plcw-select { width: auto; padding: 8px 11px; font-size: .92em; }
.plcw-filters .plcw-fprice { width: 108px; }
.plcw-filters .plcw-search { min-width: 160px; flex: 1 1 160px; max-width: 280px; }
.plcw-reset { padding: 8px 14px; font-size: .88em; box-shadow: none; }

/* Категории-фильтр — чипы (сверху). Отдельные классы (.plcw-cat*), чтобы не
   конфликтовать с вкладками входа/регистрации (.plcw-tab ниже по файлу). */
.plcw-catbar { display: flex; flex-wrap: wrap; gap: 8px; }
.plcw-catbtn {
    cursor: pointer;
    border: 1.5px solid rgba(11, 26, 38, .12);
    background: transparent;
    color: inherit;
    border-radius: 999px;
    padding: 7px 15px;
    font-size: .9em;
    font-weight: 600;
    line-height: 1.2;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
    white-space: nowrap;
}
.plcw-catbtn:hover { border-color: var(--plcw-btn, #87C540); }
.plcw-catbtn.is-active {
    background: var(--plcw-btn, #87C540);
    border-color: var(--plcw-btn, #87C540);
    color: var(--plcw-btn-text, #fff);
}

/* Категории-фильтр — вертикальные вкладки слева */
.plcw-two-col { display: flex; align-items: flex-start; gap: 20px; }
.plcw-two-col .plcw-main { flex: 1; min-width: 0; }
.plcw-cat-side { display: flex; flex-direction: column; gap: 6px; flex: none; width: 210px; }
.plcw-cat-side .plcw-catbtn { text-align: left; border-radius: 10px; white-space: normal; }
@media (max-width: 640px) {
    .plcw-two-col { flex-direction: column; }
    .plcw-cat-side { width: 100%; flex-direction: row; flex-wrap: wrap; }
    .plcw-cat-side .plcw-catbtn { border-radius: 999px; }
}

/* Список «Мои объявления» */
.plcw-myad { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #eef3f7; }
.plcw-myad:last-of-type { border-bottom: none; }
.plcw-myad-thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: #eef3f7; flex: none; }
.plcw-myad-noimg { display: grid; place-items: center; font-size: 22px; }
.plcw-myad-info { flex: 1; min-width: 0; }
.plcw-myad-title { font-weight: 600; font-size: .92em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plcw-myad-price { font-family: 'Onest', sans-serif; font-weight: 800; font-size: .95em; }
.plcw-myad-status { display: inline-block; font-size: .72em; padding: 1px 8px; border-radius: 999px; margin-top: 3px; }
.plcw-status-active { background: #e4f2cf; color: #436a1c; }
.plcw-status-blocked { background: #fdecec; color: #c0392b; }
.plcw-status-pending { background: #fff3cd; color: #8a6d00; }
.plcw-status-archived { background: #eef3f7; color: #56697a; }
.plcw-status-draft { background: #eef3f7; color: #56697a; }
.plcw-myad-reason { font-size: .76em; color: #c0392b; margin-top: 3px; }
.plcw-myad-edit { padding: 6px 14px; min-height: 0; font-size: .85em; flex: none; }

.plcw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    cursor: pointer;
    border-radius: var(--plcw-radius-btn, 12px);
    padding: 11px 22px;
    font-size: 1em;
    font-weight: 600;
    background: var(--plcw-btn, #87C540);
    color: var(--plcw-btn-text, #fff);
    box-shadow: 0 6px 16px rgba(110, 168, 48, .22);
    transition: filter .15s ease, transform .12s ease;
}
.plcw-btn:hover { filter: brightness(1.05); }
.plcw-btn:active { transform: translateY(1px); }
.plcw-btn[disabled] { opacity: .5; cursor: default; box-shadow: none; }

.plcw-btn-ghost {
    background: transparent;
    color: var(--plcw-btn, #87C540);
    border: 1.5px solid currentColor;
    box-shadow: none;
}
.plcw-btn-sm { padding: 8px 16px; font-size: .9em; border-radius: 10px; box-shadow: none; }

/* Компактная ссылка-действие (напр. «+ Добавить номер») */
.plcw-link {
    display: inline-flex; align-items: center; gap: 4px;
    background: none; border: none; padding: 2px 0; margin-top: 8px;
    color: var(--plcw-btn, #87C540); font-weight: 600; font-size: .86em; cursor: pointer;
}
.plcw-link:hover { text-decoration: underline; }
.plcw-link[disabled] { opacity: .5; cursor: default; }
.plcw-hint { font-size: .82em; opacity: .6; }

/* Под-панель добавления/подтверждения номера */
.plcw-subpanel { border: 1px solid #e6ebf0; border-radius: 12px; padding: 12px; margin-top: 4px; background: #fafbfc; }
.plcw-subpanel .plcw-input { margin-bottom: 8px; }

.plcw-foot { text-align: center; font-size: .74em; opacity: .5; margin-top: 12px; }
.plcw-foot a { color: inherit; }

/* Модалка */
.plcw-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483600;
    background: rgba(11, 26, 38, .55);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 12px;
    overflow-y: auto;
}
.plcw-modal {
    width: 100%;
    max-width: 460px;
    background: #fff;
    color: #0b1a26;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 18px 50px rgba(11, 26, 38, .28);
}
.plcw-modal h3 { font-family: 'Onest', sans-serif; font-size: 19px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 16px; }
.plcw-row { display: flex; align-items: center; justify-content: space-between; }
.plcw-close { background: none; border: none; font-size: 24px; cursor: pointer; opacity: .45; line-height: 1; color: inherit; }
.plcw-close:hover { opacity: .8; }

.plcw-field { margin-bottom: 13px; }
.plcw-label { display: block; font-size: .82em; font-weight: 500; opacity: .7; margin-bottom: 5px; }
.plcw-input, .plcw-select, .plcw-textarea {
    width: 100%;
    border: 1.5px solid #cdd8e2;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 1em;
    background: #fff;
    color: #0b1a26;
}
.plcw-textarea { resize: vertical; min-height: 84px; }
.plcw-input:focus, .plcw-select:focus, .plcw-textarea:focus {
    outline: none;
    border-color: var(--plcw-btn, #87C540);
    box-shadow: 0 0 0 3px rgba(135, 197, 64, .3);
}

.plcw-req { color: #ef4146; }
.plcw-cascade { display: flex; flex-direction: column; }

/* Загрузчик фото */
.plcw-upload {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 14px; cursor: pointer;
    border: 1.5px dashed #cdd8e2; border-radius: 10px;
    color: var(--plcw-btn, #87C540); font-weight: 600; font-size: .92em;
    transition: border-color .15s ease, background .15s ease;
}
.plcw-upload:hover { border-color: var(--plcw-btn, #87C540); background: rgba(135, 197, 64, .05); }
.plcw-upload-ic { font-size: 1.15em; }
.plcw-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; margin-top: 8px; }
.plcw-preview { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.plcw-preview-wrap { position: relative; }
.plcw-preview-x {
    position: absolute; top: 3px; right: 3px; width: 20px; height: 20px;
    border: none; border-radius: 50%; background: rgba(11, 26, 38, .6); color: #fff;
    font-size: 14px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
}

/* Read-only поле (категория при редактировании) */
.plcw-readonly { padding: 10px 12px; border: 1.5px solid #e1e9f0; border-radius: 10px; background: #f6f9fb; color: #0b1a26; font-size: 1em; }

/* Блок отклонения модерацией */
.plcw-reject { background: #fdecec; border: 1px solid #f5c2c2; border-radius: 12px; padding: 14px; margin: 2px 0; }
.plcw-reject-h { font-weight: 700; color: #c0392b; margin-bottom: 4px; }
.plcw-reject-r { font-size: .92em; color: #7a2e26; line-height: 1.45; }

.plcw-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid #e1e9f0; }
.plcw-tab { background: none; border: none; padding: 9px 14px; cursor: pointer; font-weight: 600; opacity: .5; border-bottom: 2px solid transparent; color: inherit; }
.plcw-tab.is-active { opacity: 1; border-bottom-color: var(--plcw-btn, #87C540); color: var(--plcw-btn, #87C540); }

.plcw-divider { display: flex; align-items: center; gap: 8px; margin: 16px 0; font-size: .76em; opacity: .45; }
.plcw-divider::before, .plcw-divider::after { content: ""; flex: 1; height: 1px; background: #e1e9f0; }

.plcw-error { color: #ef4146; font-size: .84em; margin: 6px 0; }
.plcw-success { text-align: center; padding: 14px; color: #16a34a; line-height: 1.5; }
.plcw-success a { color: var(--plcw-btn, #87C540); }
.plcw-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.plcw-grow { width: 100%; }
.plcw-muted { font-size: .76em; opacity: .55; text-align: center; margin-top: 12px; }
.plcw-yandex { background: #fc3f1d; color: #fff; box-shadow: none; }
.plcw-spin { opacity: .6; }

/* Согласия (чекбоксы) при регистрации */
.plcw-consents { display: flex; flex-direction: column; gap: 8px; margin: 2px 0 12px; }
.plcw-check { display: flex; align-items: flex-start; gap: 8px; font-size: .82em; line-height: 1.4; opacity: .9; cursor: pointer; }
.plcw-check input { margin-top: 2px; width: 15px; height: 15px; flex: none; accent-color: var(--plcw-btn, #87C540); }
.plcw-check a { color: var(--plcw-btn, #87C540); text-decoration: underline; }

/* Модалка просмотра объявления */
.plcw-modal-lg { max-width: 650px; }
.plcw-gallery-main {
    width: 100%;
    max-height: 320px;
    object-fit: contain;
    background: #eef3f7;
    border-radius: 12px;
}
.plcw-thumbs { display: flex; gap: 6px; overflow-x: auto; margin-top: 8px; }
.plcw-thumb-mini { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; cursor: pointer; border: 2px solid transparent; }
.plcw-thumb-mini:hover { border-color: var(--plcw-btn, #87C540); }
.plcw-detail-price { font-family: 'Onest', sans-serif; font-size: 1.6em; font-weight: 800; letter-spacing: -.02em; margin: 14px 0; }
.plcw-section-h { font-family: 'Onest', sans-serif; font-weight: 800; font-size: 1.05em; letter-spacing: -.01em; margin: 18px 0 8px; }
.plcw-attrs { margin: 6px 0 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 440px) { .plcw-attrs { grid-template-columns: 1fr; } }
.plcw-attr { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid #eef3f7; font-size: .9em; }
.plcw-attr-k { opacity: .6; }
.plcw-attr-v { font-weight: 600; text-align: right; }
.plcw-detail-desc { white-space: pre-line; line-height: 1.6; margin: 12px 0; }
.plcw-detail-loc { font-size: .9em; opacity: .8; margin: 8px 0 6px; }
.plcw-map { display: block; width: 100%; height: 200px; border: 0; border-radius: 12px; overflow: hidden; }
.plcw-pin { background: none; border: 0; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
.leaflet-control-attribution.leaflet-control { position: absolute; }
.plcw-detail-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; border-top: 1px solid #e1e9f0; padding-top: 12px; }
.plcw-seller { font-weight: 600; color: inherit; text-decoration: none; }
.plcw-seller:hover { color: var(--plcw-btn, #87C540); }
