/* ====== базовые ====== */
:root{
  --bg:#f6f7f9; --panel:#fff; --text:#111827; --muted:#6b7280;
  --brand:#0b6efd; --brand-hover:#0a58ca; --border:#e5e7eb;
}

html,body{margin:0;background:var(--bg);color:var(--text);font:16px/1.45 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,"Helvetica Neue",Arial}
img{max-width:100%;display:block}

/* ====== шапка (fixed) ====== */
.sm-header{position:sticky;top:0;z-index:50;background:var(--panel);box-shadow:0 2px 12px rgba(0,0,0,.06)}
.sm-header__inner{max-width:1200px;margin:0 auto;display:flex;align-items:center;gap:16px;padding:10px 16px}
.sm-logo{font-weight:800;color:var(--text);text-decoration:none}
.sm-search{margin-left:auto;display:flex;align-items:center;gap:8px;background:#f1f5f9;border:1px solid var(--border);border-radius:12px;padding:6px 8px}
.sm-search input{border:0;background:transparent;outline:none;min-width:260px}
.sm-search button{border:0;background:transparent;cursor:pointer}

/* ====== карточка объявления ====== */
.ad-wrapper{display:flex;justify-content:center;padding:28px 16px}
.ad-card{width:100%;max-width:1100px}
.ad-card--single{display:block}

/* ЛЕВЫЙ БЛОК — фон-герой */
.ad-image{position:relative;background:var(--panel);border:1px solid var(--border);border-radius:16px;overflow:hidden;box-shadow:0 10px 30px rgba(0,0,0,.08)}
.ad-image--hero{
  background-size:cover;
  background-position:center;
  min-height:620px;         /* высота секции с фото; подгони под макет */
}

/* карточка поверх */
.ad-overlay-card{
  position:absolute;left:24px;top:24px;width:min(420px, calc(100% - 48px));
  background:var(--panel);border:1px solid var(--border);border-radius:16px;
  box-shadow:0 14px 36px rgba(0,0,0,.18);padding:14px;
}
.ovr-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.ovr-title{font-weight:700}
.ovr-dots{color:var(--muted)}
.ovr-body{display:flex;gap:12px;align-items:center;margin-bottom:10px}
.ovr-thumb{width:54px;height:54px;border-radius:12px;border:1px solid var(--border);overflow:hidden;background:#f8fafc}
.ovr-name{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ovr-price{color:#1e7e34;font-weight:800}
.btn{appearance:none;border:0;border-radius:12px;padding:12px 16px;background:var(--brand);color:#fff;font-weight:700;cursor:pointer;box-shadow:0 8px 20px rgba(11,110,253,.18);transition:.15s background,.06s transform}
.btn:hover{background:var(--brand-hover)}
.ovr-note{margin-top:6px;font-size:12px;color:var(--muted);display:flex;align-items:center;gap:8px}

/* правая колонка */
.ad-info{display:flex;flex-direction:column;gap:10px}
.ad-title{margin:0;font-size:28px;line-height:1.25}
.ad-price{font-size:24px;font-weight:800;color:#1e7e34}
.ad-desc{color:#374151}

/* кнопка */
.btn{appearance:none;border:0;border-radius:12px;padding:12px 16px;background:var(--brand);color:#fff;font-weight:700;cursor:pointer;box-shadow:0 8px 20px rgba(11,110,253,.18);transition:.15s background, .06s transform}
.btn:hover{background:var(--brand-hover)}
.btn:active{transform:translateY(1px)}

/* ====== плавающая кнопка чата ====== */
.fab-chat{position:fixed;right:22px;bottom:22px;z-index:60;width:58px;height:58px;border-radius:50%;background:#fff;border:1px solid var(--border);display:flex;align-items:center;justify-content:center;box-shadow:0 12px 28px rgba(0,0,0,.15);cursor:pointer}
.fab-ico{font-size:22px}
.fab-dot{position:absolute;width:10px;height:10px;border-radius:50%;background:#16a34a;right:8px;top:8px;box-shadow:0 0 0 4px #eaffea}
.badge{position:absolute;right:-4px;bottom:-4px;min-width:20px;height:20px;padding:0 6px;border-radius:99px;background:#ff4757;color:#fff;font-size:12px;display:none;align-items:center;justify-content:center}
.fab-chat:hover{border-color:#d1d5db}
.fab-ico{font-size:22px}
.fab-dot{position:absolute;width:10px;height:10px;border-radius:50%;background:#16a34a;right:8px;top:8px;box-shadow:0 0 0 4px #eaffea}
.badge{position:absolute;right:-4px;bottom:-4px;min-width:20px;height:20px;padding:0 6px;border-radius:99px;background:#ff4757;color:#fff;font-size:12px;display:inline-flex;align-items:center;justify-content:center;box-shadow:0 6px 16px rgba(255,71,87,.25)}

/* ====== модалка чата ====== */
.modal{display:none;position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:1000}
.modal-content{
  position:relative;width:100%;max-width:420px;margin:4vh 22px 22px auto;
  background:var(--panel);border-radius:18px;box-shadow:0 30px 80px rgba(0,0,0,.35);
  display:flex;flex-direction:column;gap:10px;padding:12px;max-height:92vh;
}
.close{position:absolute;right:10px;top:10px;border:0;background:transparent;font-size:20px;cursor:pointer;color:var(--muted)}
.close:hover{color:#ef4444}

.tp-head{padding:8px 6px 2px;border-bottom:1px solid var(--border)}
.tp-agent{display:flex;align-items:center;gap:10px}
.tp-avatar{width:34px;height:34px;border-radius:50%;background:#f3f4f6;display:inline-flex;align-items:center;justify-content:center;font-weight:700}
.tp-meta{line-height:1.1}
.tp-name{font-weight:700}
.tp-status{font-size:12px;color:var(--muted)}
.tp-online{display:inline-block;width:8px;height:8px;border-radius:50%;background:#16a34a;margin-right:6px}

.chat-box{flex:1;min-height:260px;overflow:auto;border:1px solid var(--border);border-radius:12px;padding:10px;background:#f8fafc;display:flex;flex-direction:column;gap:8px}
.message{max-width:80%;padding:10px 12px;border-radius:12px;line-height:1.35;word-wrap:break-word}
.msg-user{margin-left:auto;background:#e8f0ff}
.msg-admin{margin-right:auto;background:#fff;border:1px solid var(--border)}
.message.unread{outline:2px dashed #ffd166}

.chat-input{display:flex;gap:8px}
#chatText{flex:1;border:1px solid var(--border);border-radius:12px;padding:12px 14px;outline:none;background:#fff}
#chatText:focus{border-color:var(--brand)}
/* адаптив */
@media (max-width: 980px){
  .ad-image--hero{min-height:420px;background-position:40% center}
  .ad-overlay-card{position:static;width:100%;margin:12px auto 0}
}

/* блок с фоновым изображением-героем */
.ad-image--hero{
  background-size: cover;
  background-position: center;
  min-height: 520px; /* можно 560+ по вкусу */
}

/* чуть усилим тень оверлей-карточки на ярком фоне */
.ad-overlay-card{
  box-shadow: 0 14px 36px rgba(0,0,0,.18);
}

/* правую колонку отодвинем чуть сверху, чтобы композиция была как в макете */
.ad-info{
  padding-top: 8px;
}

@media (max-width: 980px){
  .ad-image--hero{ min-height: 380px; background-position: 40% center; }
}

/* ====== НЕБЛОКИРУЮЩИЙ ЧАТ — перебивает стили витрины ====== */
#supportModal.modal {
  display: block !important;
  position: fixed !important;
  inset: auto 22px 92px auto !important;
  width: min(420px, calc(100vw - 44px)) !important;
  height: auto !important;
  background: transparent !important;
  z-index: 9999 !important;
  pointer-events: none !important;
  opacity: 0;
  transform: translateY(18px) scale(.92);
  transform-origin: bottom right;
  transition: opacity .22s ease, transform .22s ease;
}

#supportModal.modal.open {
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
  pointer-events: none !important;
}

#supportModal.modal.open .modal-content {
  pointer-events: auto !important;
}

#supportModal .modal-content {
  margin: 0 !important;
  width: 100% !important;
  max-width: none !important;
  max-height: 80vh !important;
  border-radius: 18px !important;
}

#supportModal[aria-hidden="true"] {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(18px) scale(.92) !important;
}


/* ====== STROYMARKET AD PAGE: leboncoin-like ====== */

.sm-lbc-page {
  min-height: 100vh;
  background: #fff;
  color: #000;
  font-family: 'Nunito Sans', Arial, Helvetica, sans-serif;
}

.sm-lbc-header {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  display: flex;
  align-items: center;
}

.sm-lbc-header__inner {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.sm-lbc-back {
  color: #ff6a00;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.sm-lbc-logo {
  color: #ff6a00;
  font-size: 23px;
  font-weight: 900;
  letter-spacing: 3px;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sm-lbc-secure {
  justify-self: end;
  color: #ff6a00;
  font-size: 15px;
  font-weight: 700;
}

.sm-lbc-secure__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-right: 7px;
  border-radius: 50%;
  background: #ff6a00;
  color: #fff;
  font-size: 13px;
}

.sm-lbc-main {
  width: min(1020px, calc(100% - 32px));
  margin: 46px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 326px;
  gap: 24px;
  align-items: start;
}

.sm-lbc-step {
  margin: 0 0 4px;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 800;
}

.sm-lbc-heading {
  margin: 0 0 18px;
  font-size: 21px;
  line-height: 1.2;
  font-weight: 800;
}

.sm-lbc-form-card {
  background: #fff;
  border-radius: 8px;
  padding: 34px 24px 28px;
  box-shadow: 0 2px 14px rgba(0,0,0,.15);
}

.sm-lbc-form-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 4px;
}

.sm-lbc-form-desc {
  font-size: 14px;
  margin-bottom: 18px;
}

.sm-lbc-field {
  width: 100%;
  height: 48px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  box-sizing: border-box;
  padding: 0 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  font-size: 14px;
  background: #fff;
}

.sm-lbc-note {
  color: #64748b;
  font-size: 12px;
  margin: 16px 0 18px;
}

.sm-lbc-btn {
  display: inline-block;
  background: #ff6a00;
  color: #fff;
  border: 0;
  border-radius: 4px;
  padding: 12px 17px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}

.sm-lbc-btn:hover {
  background: #ef5f00;
}

.sm-lbc-summary {
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 14px rgba(0,0,0,.16);
}

.sm-lbc-product {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 0 16px 0 0;
  border-bottom: 1px solid #e5e7eb;
}

.sm-lbc-product-img {
  width: 80px;
  height: 80px;
  background: #e5e7eb;
  overflow: hidden;
}

.sm-lbc-product-img img {
  width: 80px;
  height: 80px;
  object-fit: cover;
}

.sm-lbc-product-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e5e7eb, #cbd5e1);
}

.sm-lbc-product-name {
  min-width: 0;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sm-lbc-product-price {
  color: #ff6a00;
  font-weight: 800;
  font-size: 14px;
  white-space: nowrap;
}

.sm-lbc-summary-body {
  padding: 18px 16px;
}

.sm-lbc-summary-body h3 {
  margin: 0 0 18px;
  font-size: 17px;
  font-weight: 800;
}

.sm-lbc-paid {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  margin-bottom: 14px;
}

.sm-lbc-shield {
  width: 17px;
  height: 17px;
  border-radius: 5px;
  background: #ff6a00;
  color: #fff;
  font-size: 9px;
  line-height: 17px;
  text-align: center;
  transform: rotate(45deg);
  margin-top: 2px;
}

.sm-lbc-paid-title {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 4px;
}

.sm-lbc-paid p {
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
  margin: 0 0 14px;
}

.sm-lbc-protection-title {
  margin-top: 28px !important;
}

.sm-lbc-check {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.sm-lbc-check span {
  color: #22c55e;
  font-size: 19px;
  line-height: 1;
}

.sm-lbc-check p {
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
  margin: 0;
}

.sm-lbc-total {
  display: flex;
  justify-content: space-between;
  margin-top: 34px;
  font-size: 18px;
  font-weight: 800;
}

.sm-lbc-total span:last-child {
  color: #ff6a00;
}

@media (max-width: 900px) {
  .sm-lbc-header {
    height: auto;
    padding: 10px 0;
  }

  .sm-lbc-header__inner {
    grid-template-columns: 1fr;
    gap: 6px;
    text-align: center;
  }

  .sm-lbc-secure {
    justify-self: center;
    font-size: 13px;
  }

  .sm-lbc-main {
    grid-template-columns: 1fr;
    margin-top: 28px;
  }
}

/* ====== STROYMARKET AD PAGE: leboncoin-like v2 ====== */

.sm-lbc-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 72% 100%, rgba(241,245,249,.95) 0 12%, transparent 34%),
    linear-gradient(#fff 0%, #fff 76%, #f8fafc 100%);
  color: #1f2937;
  font-family: 'Nunito Sans', Arial, Helvetica, sans-serif;
}

.sm-lbc-header {
  height: 55px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 8px rgba(15,23,42,.10);
  display: flex;
  align-items: center;
}

.sm-lbc-header__inner {
  width: min(995px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.sm-lbc-back {
  font-size: 0;
  text-decoration: none;
}

.sm-lbc-back::before {
  content: "←";
  font-size: 26px;
  color: #64748b;
  font-weight: 400;
}

.sm-lbc-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.sm-lbc-logo img {
  height: 42px;
  width: auto;
  display: block;
}

.sm-lbc-secure {
  justify-self: end;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
}

.sm-lbc-secure__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 7px;
  border-radius: 50%;
  background: #334155;
  color: #fff;
  font-size: 11px;
}

.sm-lbc-main {
  width: min(995px, calc(100% - 32px));
  margin: 38px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 335px;
  gap: 22px;
  align-items: start;
}

.sm-lbc-step {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 800;
  color: #1f2937;
}

.sm-lbc-heading {
  margin: 0 0 12px;
  font-size: 19px;
  line-height: 1.2;
  font-weight: 800;
  color: #1f2937;
}

.sm-lbc-form-card {
  background: #fff;
  border-radius: 7px;
  padding: 24px 16px 20px;
  box-shadow: 0 3px 14px rgba(15,23,42,.18);
}

.sm-lbc-form-title {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 12px;
}

.sm-lbc-form-desc {
  color: #4b5563;
  font-size: 14px;
  margin-bottom: 20px;
}

.sm-lbc-label {
  display: block;
  color: #374151;
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 7px;
}

.sm-lbc-field {
  width: 100%;
  min-height: 42px;
  border: 1px solid #c8d0d8;
  border-radius: 16px;
  box-sizing: border-box;
  padding: 0 16px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  font-size: 14px;
  color: #374151;
  background: #fff;
}

.sm-lbc-note {
  margin: 14px 0 14px;
  color: #94a3b8;
  font-size: 11px;
}

.sm-lbc-btn {
  display: inline-block;
  border-radius: 13px;
  padding: 12px 18px;
  background: #f46a00;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 4px 8px rgba(244,106,0,.22);
}

.sm-lbc-btn:hover {
  background: #e85f00;
}

.sm-lbc-rating {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #1f2937;
  font-size: 13px;
}

.sm-lbc-rating span {
  color: #475569;
}

.sm-lbc-star {
  color: #00b67a !important;
  font-size: 18px;
  line-height: 1;
}

.sm-lbc-summary {
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 3px 16px rgba(15,23,42,.18);
  position: relative;
}

.sm-lbc-product {
  display: grid;
  grid-template-columns: 68px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 0 14px 0 0;
  border-bottom: 1px solid #e5e7eb;
}

.sm-lbc-product-img,
.sm-lbc-product-img img {
  width: 68px;
  height: 76px;
}

.sm-lbc-product-img {
  background: #e5e7eb;
  overflow: hidden;
}

.sm-lbc-product-img img {
  object-fit: cover;
}

.sm-lbc-product-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e5e7eb, #cbd5e1);
}

.sm-lbc-product-name {
  min-width: 0;
  font-size: 14px;
  font-weight: 800;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sm-lbc-product-price {
  color: #d65f00;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.sm-lbc-summary-body {
  padding: 18px 16px 0;
}

.sm-lbc-section-title {
  color: #1f2937;
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 12px;
}

.sm-lbc-check {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.sm-lbc-check span {
  color: #43b36a;
  font-size: 21px;
  line-height: 1;
}

.sm-lbc-check p {
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

.sm-lbc-protection-title {
  margin-top: 32px;
}

.sm-lbc-why {
  display: inline-block;
  color: #334155;
  font-size: 11px;
  font-weight: 800;
  text-decoration: underline;
  margin-top: -2px;
}

.sm-lbc-total {
  display: flex;
  justify-content: space-between;
  margin: 18px -16px 0;
  padding: 17px 16px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
  font-size: 18px;
  font-weight: 800;
}

.sm-lbc-total span:first-child {
  color: #1f2937;
}

.sm-lbc-total span:last-child {
  color: #d65f00;
}

@media (max-width: 900px) {
  .sm-lbc-main {
    grid-template-columns: 1fr;
    margin-top: 20px;
  }
}

@media (max-width: 600px) {
  .sm-lbc-page { background: #fff; padding-bottom: 40px; }
  .sm-lbc-header { height: auto; padding: 12px 0; }
  .sm-lbc-header__inner { grid-template-columns: 1fr; gap: 4px; text-align: center; padding: 0 16px; }
  .sm-lbc-back { display: none; }
  .sm-lbc-logo img { height: 28px; }
  .sm-lbc-secure { justify-self: center; font-size: 12px; }

  .sm-lbc-main { grid-template-columns: 1fr; width: 100%; padding: 0 16px; margin-top: 20px; gap: 20px; box-sizing: border-box; display: flex; flex-direction: column; }
  .sm-lbc-summary { order: -1; }
  .sm-lbc-step { font-size: 22px; margin-bottom: 4px; }
  .sm-lbc-heading { font-size: 18px; margin-bottom: 16px; }
  .sm-lbc-form-card { padding: 20px 16px; border-radius: 14px; }
  .sm-lbc-form-title { font-size: 16px; margin-bottom: 4px; }
  .sm-lbc-form-desc { font-size: 14px; margin-bottom: 16px; }
  .sm-lbc-label { font-size: 13px; margin-bottom: 6px; display: block; }
  .sm-lbc-field { border-radius: 10px; margin-bottom: 16px; padding: 12px 14px; font-size: 15px; }
  .sm-lbc-note { font-size: 13px; line-height: 1.5; margin: 16px 0; }
  .sm-lbc-btn { width: 100%; text-align: center; display: block; border-radius: 10px; padding: 13px 16px; font-size: 15px; font-weight: 700; box-sizing: border-box; }
  .sm-lbc-rating { font-size: 13px; margin-top: 20px; text-align: center; }

  .sm-lbc-summary { border-radius: 14px; overflow: hidden; }
  .sm-lbc-product { grid-template-columns: 56px 1fr auto; gap: 12px; padding: 14px; }
  .sm-lbc-product-img, .sm-lbc-product-img img { width: 56px; height: 62px; border-radius: 8px; }
  .sm-lbc-product-name { font-size: 14px; }
  .sm-lbc-product-price { font-size: 15px; font-weight: 700; }
  .sm-lbc-summary-body { padding: 16px 14px 0; }
  .sm-lbc-section-title { font-size: 14px; }
  .sm-lbc-check { font-size: 13px; line-height: 1.45; }
  .sm-lbc-check p { margin: 0; }
  .sm-lbc-total { font-size: 17px; padding: 16px 14px; }
}