/* BloomLoop — компоненты */

/* ---------- сегментный переключатель вида ---------- */
.viewseg {
  display: inline-flex; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px;
}
.vbtn {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 13.5px; font-weight: 700;
  padding: 8px 17px; border-radius: 999px;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.vbtn:hover { color: var(--fg); }
.vbtn.on { background: var(--pink); color: #fff; }

/* ---------- фильтры-чипы ---------- */
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 16px 0 4px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 16px;
  font-size: 13px; font-weight: 600; color: #cdc7d6;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: background .18s, color .18s, border-color .18s;
}
.chip:hover { border-color: var(--border-2); }
.chip.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip .cnt { opacity: .5; margin-left: 5px; }

/* ---------- карточка лота ---------- */
.list .card { animation: rise .5s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.card:hover { border-color: var(--border-2); transform: translateY(-4px); box-shadow: var(--shadow); }
.card-photo { position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--surface-2); }
.card-photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .5s var(--ease);
}
.card:hover .card-photo img { transform: scale(1.05); }
.card-photo::after { /* затемнение снизу для читабельности плашек */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.28) 0%, transparent 28%, transparent 62%, rgba(0,0,0,.34) 100%);
}
.badge {
  position: absolute; top: 11px; right: 11px; z-index: 2;
  border-radius: 999px; padding: 5px 11px;
  font-size: 11px; font-weight: 800; letter-spacing: .2px;
  backdrop-filter: blur(4px);
}
.tmr {
  position: absolute; top: 11px; left: 11px; z-index: 2;
  background: rgba(12,13,18,.66); color: #fff; backdrop-filter: blur(4px);
  border-radius: 999px; padding: 5px 11px; font-size: 11px; font-weight: 600;
}
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.card-title { font-family: var(--serif); font-weight: 600; font-size: 18px; letter-spacing: -.2px; }
.card-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* ---------- артикул + категория (вместо названия) ---------- */
.card-id { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.card-art {
  font-family: var(--mono); font-weight: 600; font-size: 15px;
  letter-spacing: 1.5px; color: var(--fg);
}
.art-cat {
  font-size: 11px; font-weight: 700; color: var(--pink);
  background: color-mix(in srgb, var(--pink) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--pink) 30%, transparent);
  border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}

/* ---------- адрес лота (район · метро · улица) ---------- */
.card-loc { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.card-loc > span { font-size: 12.5px; color: var(--muted); }
.card-loc .loc-2 { font-size: 12px; color: var(--muted-2); }

/* приватность точного адреса */
.addr-note {
  font-size: 11.5px; color: var(--muted); line-height: 1.5;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 9px 11px; margin-bottom: 14px;
}
.card-price { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 12px; }
.card-price .lab { font-size: 11px; color: var(--muted); }
.card-price .p { font-family: var(--serif); font-size: 24px; font-weight: 700; line-height: 1.1; }
.card-price .d { font-size: 11.5px; color: var(--muted); text-align: right; line-height: 1.4; }
.cbtn {
  width: 100%; border: none; border-radius: 12px;
  padding: 13px; font-size: 14.5px; font-weight: 700;
  cursor: pointer; margin-top: 14px; color: #fff;
  transition: filter .15s, transform .1s;
}
.cbtn:hover { filter: brightness(1.06); }
.cbtn:active { transform: scale(.99); }
.cbtn.up   { background: var(--green);  color: #06281a; }
.cbtn.down { background: var(--orange); color: #3a2400; }
.cbtn.buy  { background: var(--pink); }

/* ---------- карта (Яндекс) ---------- */
.map-fallback {
  display: flex; align-items: center; justify-content: center;
  height: 100%; padding: 30px; text-align: center;
  color: var(--muted); font-size: 14px; line-height: 1.6;
}

/* ---------- лот-шит ---------- */
.ov {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.66); display: none;
  align-items: flex-end; justify-content: center;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.ov.open { display: flex; }
.sheet {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  width: 100%; max-width: 560px; padding: 22px;
  max-height: 90vh; overflow-y: auto;
  animation: sheetup .32s var(--ease);
}
@keyframes sheetup { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet-photo { aspect-ratio: 16/10; border-radius: var(--r-md); overflow: hidden; position: relative; margin-bottom: 16px; }
.sheet-photo img { width: 100%; height: 100%; object-fit: cover; }
.sheet-title { font-family: var(--serif); font-weight: 600; font-size: 24px; }
.sheet-idrow { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.sheet-art { font-family: var(--mono); font-weight: 600; font-size: 21px; letter-spacing: 2px; }
.sheet-grab { width: 42px; height: 4px; background: var(--border-2); border-radius: 9px; margin: 0 auto 16px; }
@media (min-width: 900px) {
  .ov { align-items: center; }
  .sheet { border-radius: var(--r-xl); max-width: 460px; max-height: 92vh; }
  .sheet-grab { display: none; }
}

/* ---------- строки-параметры ---------- */
.aicard {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 6px 14px; margin-bottom: 14px;
}
.airow { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.airow:last-child { border: 0; }
.airow .k { color: var(--muted); }

/* ---------- sell-flow ---------- */
.sellwrap { padding: 22px 0; max-width: 460px; margin: 0 auto; }
.prog { display: flex; gap: 5px; margin-bottom: 22px; }
.seg { flex: 1; height: 4px; border-radius: 9px; background: var(--border); }
.seg.on { background: var(--pink); }
.sh { font-family: var(--serif); font-weight: 600; font-size: 23px; margin-bottom: 6px; }
.ss { color: var(--muted); font-size: 14px; margin-bottom: 18px; line-height: 1.55; }
.vf {
  aspect-ratio: 3/4; max-height: 300px;
  background: var(--surface); border: 2px dashed var(--border-2);
  border-radius: var(--r-lg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--muted-2); margin-bottom: 14px;
}
.vf.shot { border-style: solid; border-color: var(--green); font-size: 80px; }
.vf .ic { font-size: 46px; margin-bottom: 10px; }
.vf .hint { font-size: 13px; padding: 0 30px; text-align: center; }
.cam { width: 66px; height: 66px; border-radius: 50%; background: #fff; border: 5px solid var(--pink); margin: 0 auto 8px; display: block; cursor: pointer; transition: transform .1s; }
.cam:active { transform: scale(.92); }
.camnote { text-align: center; font-size: 12px; color: var(--muted-2); margin-bottom: 10px; }
.psug { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px; text-align: center; margin-bottom: 14px; }
.psug .big { font-family: var(--serif); font-size: 32px; font-weight: 700; color: var(--green); }
.psug .sub { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ---------- кнопки и поля ---------- */
.nbtn {
  width: 100%; background: var(--pink); color: #fff;
  border: none; border-radius: 13px; padding: 15px;
  font-size: 16px; font-weight: 700; cursor: pointer; margin-top: 6px;
  transition: filter .15s, transform .1s;
}
.nbtn:hover { filter: brightness(1.06); }
.nbtn:active { transform: scale(.99); }
.nbtn.ghost { background: var(--surface-2); color: var(--muted); }
.in {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 13px; color: var(--fg);
  font-size: 15px; margin-bottom: 12px;
}
.in:focus { outline: none; border-color: var(--pink); }

/* ---------- предпросмотр мобильной версии (телефонная рамка) ---------- */
.phone-shell { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.phone-frame {
  width: 390px; height: min(800px, 86vh);
  background: #000; border: 11px solid #15171f; border-radius: 42px;
  box-shadow: 0 30px 70px rgba(0,0,0,.6), 0 0 0 2px var(--border-2);
  overflow: hidden; position: relative;
}
.phone-frame::before { /* «чёлка» телефона */
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 130px; height: 22px; background: #15171f; border-radius: 0 0 14px 14px; z-index: 2;
}
.phone-frame iframe { width: 100%; height: 100%; border: 0; border-radius: 30px; background: var(--bg); display: block; }
.phone-close {
  background: var(--surface-2); color: var(--fg); border: 1px solid var(--border-2);
  border-radius: 999px; padding: 11px 20px; font-size: 14px; font-weight: 700; cursor: pointer;
}
.phone-close:hover { border-color: var(--pink); }
/* во встроенном (iframe) режиме прячем хром, чтобы виден был чистый телефон */
body.embed .banner,
body.embed .phone-toggle { display: none !important; }

/* ---------- экран аккаунта ---------- */
.acct { max-width: 460px; margin: 0 auto; padding: 22px 0; }
.acct-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.acct-ava {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: var(--pink);
}
.acct-name { font-family: var(--serif); font-weight: 600; font-size: 20px; }
.acct-tag { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.acct-note {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 14px 16px;
  font-size: 13.5px; color: var(--muted); line-height: 1.6; margin-bottom: 16px;
}
.acct-note b { color: var(--fg); }
.acct-actions { display: flex; gap: 10px; margin-bottom: 18px; }
.acct-actions .nbtn { margin-top: 0; }
.acct .sec { padding: 0 0 8px; margin-top: 8px; }

/* пояснение к оплате доставки в карточке лота */
.pay-note {
  font-size: 12px; color: var(--muted); line-height: 1.55;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 10px 12px; margin-bottom: 14px;
}

/* ---------- ИИ-консультант (демо-виджет) ---------- */
.cc-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 70;
  display: flex; align-items: center; gap: 8px;
  background: var(--pink); color: #fff; border: none;
  border-radius: 999px; padding: 13px 18px; cursor: pointer;
  font-size: 14px; font-weight: 700; box-shadow: 0 10px 26px rgba(255,61,127,.4);
  transition: transform .15s var(--ease), filter .15s;
}
.cc-fab:hover { filter: brightness(1.06); transform: translateY(-2px); }
.cc-fab.hidden { display: none; }
.cc-fab .cc-ic { font-size: 18px; }

.cc-panel {
  position: fixed; right: 22px; bottom: 22px; z-index: 71;
  width: 380px; max-width: calc(100vw - 32px); height: 560px; max-height: calc(100vh - 90px);
  display: none; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--shadow);
  animation: sheetup .28s var(--ease);
}
.cc-panel.open { display: flex; }
.cc-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,61,127,.14), transparent);
}
.cc-title { font-family: var(--serif); font-weight: 600; font-size: 16px; }
.cc-title .cc-sub { display: block; font-family: var(--sans); font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 1px; }
.cc-x { background: none; border: none; color: var(--muted); font-size: 16px; cursor: pointer; padding: 4px 8px; }
.cc-x:hover { color: var(--fg); }

.cc-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.cc-msg {
  max-width: 84%; padding: 10px 13px; border-radius: 14px;
  font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word;
}
.cc-msg.bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.cc-msg.user { align-self: flex-end; background: var(--pink); color: #fff; border-bottom-right-radius: 5px; }
.cc-typing { display: flex; gap: 4px; align-items: center; }
.cc-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: ccblink 1s infinite; }
.cc-typing span:nth-child(2) { animation-delay: .2s; }
.cc-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes ccblink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

.cc-quicks { display: flex; flex-wrap: wrap; gap: 7px; align-self: flex-start; max-width: 100%; }
.cc-chip {
  background: var(--surface-2); border: 1px solid var(--border-2); color: var(--fg);
  border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.cc-chip:hover { border-color: var(--pink); color: var(--pink); }

.cc-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.cc-input input {
  flex: 1; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 11px 15px; color: var(--fg); font-size: 14px;
}
.cc-input input:focus { outline: none; border-color: var(--pink); }
.cc-input button {
  background: var(--pink); color: #fff; border: none; border-radius: 50%;
  width: 42px; height: 42px; font-size: 15px; cursor: pointer; flex-shrink: 0;
}

@media (max-width: 899px) {
  .cc-fab { right: 16px; bottom: 80px; }              /* над нижней навигацией */
  .cc-panel { right: 8px; left: 8px; bottom: 8px; width: auto; max-width: none; height: calc(100vh - 80px); }
}

/* ---------- модалки ---------- */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.66); display: none; align-items: center; justify-content: center; padding: 20px; }
.modal.open { display: flex; }
.mbox {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 26px; width: 100%; max-width: 390px;
  animation: sheetup .3s var(--ease);
}
.mbox h3 { font-family: var(--serif); font-weight: 600; font-size: 21px; margin-bottom: 6px; }
.mbox p { color: var(--muted); font-size: 13.5px; margin-bottom: 16px; line-height: 1.55; }

/* ---------- список городов (модалка выбора города) ---------- */
.citylist {
  max-height: 240px; overflow-y: auto; margin-bottom: 12px;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface-2); padding: 5px;
}
.cityitem {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left; cursor: pointer;
  background: none; border: none; border-radius: 9px;
  padding: 10px 12px; color: var(--fg); font-size: 14px; font-weight: 600;
  transition: background .14s;
}
.cityitem:hover { background: var(--surface); }
.cityitem.on { background: var(--pink); color: #fff; }
.cityitem .cityn { font-size: 12px; font-weight: 600; color: var(--muted); flex-shrink: 0; }
.cityitem.on .cityn { color: rgba(255,255,255,.85); }
.citynone { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }

/* подпись о безопасности в модалках/формах */
.sec-note {
  font-size: 11.5px !important; color: var(--muted-2) !important; line-height: 1.5;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 9px 11px; margin: -4px 0 14px !important;
}
.sec-note a { color: var(--pink); }
