/* ===== Шкаф — Telegram Mini App (прототип) ===== */

:root {
  --green: #22392B;
  --green-deep: #1B2E22;
  --bg: #F5F2E9;
  --card: #FFFFFF;
  --line: #E8E3D5;
  --text: #24281E;
  --muted: #807D6E;
  --moss: #6E9455;
  --moss-deep: #4C7A34;
  --moss-soft: #E7F0DC;
  --orange: #EE8A2E;
  --orange-deep: #D9741B;
  --yellow-soft: #FBF0CF;
  /* семантические поверхности (для тёмной темы) */
  --surf: #FFFFFF;
  --surf-2: #FBFAF4;
  --surf-3: #F1EEE2;
  --ph: #EEEAE0;
  --ph2: #DDD8C8;
  --page: #E8E4D6;
  --free: #9DBB85;
  --un: #C9C5B6;
  --range-bg: #EAF2DE;
  --warn-bg: #FFF8EC;
  --danger-bg: #FBEDE8;
  --nav-active: #EFF4E4;
  --shadow: 0 6px 20px rgba(35, 45, 30, .08);
  --font-display: 'Unbounded', 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; }
img { display: block; }
h1, h2, h3, h4, p { margin: 0; }

/* ---------- Каркас ---------- */

#app {
  max-width: 480px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0, 0, 0, .18);
}

#hdr {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px;
  padding-top: calc(12px + env(safe-area-inset-top));
  background: linear-gradient(120deg, #1D3224 0%, #2A4632 55%, #35573E 100%);
  color: #fff;
  z-index: 10;
  box-shadow: 0 2px 16px rgba(20, 35, 20, .28);
}

.hdr-btn {
  position: relative;
  width: 38px; height: 38px;
  flex: none;
  display: grid; place-items: center;
  border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .09); color: #fff;
  transition: background .15s;
}
.hdr-btn:active { background: rgba(255, 255, 255, .2); }

.hdr-title { flex: 1; text-align: center; line-height: 1.2; min-width: 0; }
.hdr-title b { display: block; font-family: var(--font-display); font-size: 13.5px; font-weight: 600; letter-spacing: .4px; }
.hdr-title small { display: block; font-size: 11px; opacity: .72; margin-top: 1px; }

.cnt {
  position: absolute; top: 1px; right: 0;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  display: grid; place-items: center;
  background: var(--orange);
  color: #fff;
  font-size: 10px; font-weight: 800;
  border-radius: 999px;
  border: 2px solid var(--green);
}

#screen {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 10px;
  scrollbar-width: none;
}
#screen::-webkit-scrollbar { display: none; }

#nav {
  flex: none;
  display: flex;
  background: var(--surf);
  border-top: 1px solid var(--line);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  z-index: 10;
}

.nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 5px 0 3px;
  border: none; background: none;
  color: #A5A190;
  font-size: 10.5px; font-weight: 600;
  border-radius: 12px;
  transition: color .15s;
}
.nav-item .ic { width: 21px; height: 21px; }
.nav-item.active { color: var(--green-deep); font-weight: 700; background: var(--nav-active); }
.nav-item.active .ic { color: var(--moss-deep); }

/* ---------- Иконки ---------- */

.ic { width: 20px; height: 20px; flex: none; }
.ic.sm { width: 16px; height: 16px; }
.ic.muted-i { color: #B9B5A4; }
.ic.st { width: 15px; height: 15px; color: #F2A93B; }

/* ---------- Каталог ---------- */

.hero {
  position: relative;
  margin: 14px 14px 12px;
  height: 212px;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(12, 22, 14, .58) 0%, rgba(12, 22, 14, .05) 62%);
}
.hero-txt {
  position: absolute; z-index: 2;
  top: 18px; left: 18px; right: 18px;
  color: #fff;
}
.hero-txt h1 { font-family: var(--font-display); font-size: 19px; font-weight: 600; line-height: 1.3; letter-spacing: 0; text-shadow: 0 2px 14px rgba(0, 0, 0, .4); }
.hero-txt p { margin-top: 8px; font-size: 12.5px; font-weight: 500; opacity: .92; }

.daterow {
  display: flex; align-items: center; gap: 10px;
  width: calc(100% - 28px);
  margin: 0 14px 12px;
  padding: 13px 14px;
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  font-size: 14px;
  text-align: left;
  transition: transform .12s;
}
.daterow:active { transform: scale(.985); }
.daterow .ic { width: 18px; height: 18px; color: var(--moss-deep); }
.daterow b { font-weight: 700; }
.grow { flex: 1; }
.daterow .muted { font-size: 12.5px; }

.chips {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 2px 14px 14px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  transition: all .15s;
}
.chip .ic { width: 16px; height: 16px; }
.chip.active { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 4px 12px rgba(34, 57, 43, .28); }
.chip:not(.active):active { transform: scale(.96); }

.section { margin-bottom: 16px; }
.section.pad-top { margin-top: 14px; }

.sec-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 0 16px 10px;
}
.sec-head h2 {
  font-family: var(--font-display); font-size: 13.5px; font-weight: 600; letter-spacing: .2px;
  position: relative; padding-left: 11px;
}
.sec-head h2::before {
  content: ''; position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3.5px; height: 14px; border-radius: 2px;
  background: linear-gradient(180deg, var(--moss) 0%, var(--moss-deep) 100%);
}
.sec-head .small { font-size: 12px; }

.link {
  border: none; background: none; padding: 0;
  color: var(--moss-deep);
  font-size: 13px; font-weight: 700;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 14px;
}
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 14px;
}

.hrow {
  display: flex; gap: 12px;
  overflow-x: auto;
  padding: 2px 14px 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.hrow::-webkit-scrollbar { display: none; }
.hrow .card { flex: 0 0 47%; scroll-snap-align: start; }

/* ---------- Карточка товара ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .12s;
}
.card:active { transform: scale(.98); }
@media (hover: hover) { .card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(35, 45, 30, .13); } }

.card-img { position: relative; aspect-ratio: 4 / 3; background: var(--ph); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
@media (hover: hover) { .card:hover .card-img img { transform: scale(1.05); } }
.card.g3 .card-img { aspect-ratio: 1 / 1; }

.fav-btn {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .93);
  color: #55524A;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.fav-btn .ic { width: 17px; height: 17px; }
.fav-btn.on { color: var(--orange); }

.card-body { padding: 10px 12px 12px; }
.card-body h3 { font-size: 13.5px; font-weight: 700; line-height: 1.25; margin-bottom: 2px; }
.card.g3 .card-body { padding: 8px 9px 10px; }
.card.g3 .card-body h3 { font-size: 12px; }
.card-body .sub { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.card.g3 .card-body .sub { display: none; }

.price { font-size: 14px; font-weight: 800; color: var(--orange-deep); }
.price span { font-size: 11px; font-weight: 500; color: var(--muted); }

/* ---------- Товар ---------- */

.p-hero { position: relative; height: 330px; background: var(--ph2); overflow: hidden; }
.p-track {
  display: flex; height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.p-track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; height: 100%; scroll-snap-align: start; overflow: hidden; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide img.zl { object-position: 25% center; transform: scale(1.35); transform-origin: 25% center; }
.slide img.zr { object-position: 75% center; transform: scale(1.35); transform-origin: 75% center; }

.p-dots {
  position: absolute; bottom: 12px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 5px;
}
.dot-i { width: 6px; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .55); transition: all .2s; }
.dot-i.on { width: 16px; background: #fff; }

.p-fav {
  position: absolute; top: 12px; right: 12px;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .93);
  color: #55524A;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
}
.p-fav.on { color: var(--orange); }

.p-body { padding: 16px 16px 4px; }

.p-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.p-title h1 { font-family: var(--font-display); font-size: 16px; font-weight: 600; letter-spacing: 0; line-height: 1.3; }
.p-price { flex: none; font-size: 18px; font-weight: 800; color: var(--orange-deep); text-align: right; }
.p-price span { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }

.p-meta { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; }
.p-meta b { font-size: 13px; }

.pill {
  margin-left: 4px;
  padding: 4px 10px;
  background: var(--moss-soft);
  color: var(--moss-deep);
  border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
}

.p-desc { margin-top: 12px; font-size: 13.5px; line-height: 1.5; color: #55534A; }

.p-specs {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 14px;
}
.spec {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 11px;
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 11.5px; font-weight: 600;
}
.spec .ic { width: 16px; height: 16px; color: var(--moss-deep); }

.avail {
  margin: 14px;
  padding: 16px 14px;
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.avail h3 { font-size: 15px; font-weight: 800; }
.hint { font-size: 12.5px; color: var(--muted); margin: 10px 0 12px; text-align: center; }
.hint.left { text-align: left; margin: 4px 0 12px; }

/* ---------- Календарь ---------- */

.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head b { font-size: 14.5px; font-weight: 800; }

.icbtn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surf);
}
.icbtn:disabled { opacity: .35; cursor: default; }
.icbtn:not(:disabled):active { background: var(--surf-3); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  justify-items: center;
}
.cal-grid.dow { margin-bottom: 6px; }
.cal-grid.dow span { font-size: 11px; font-weight: 700; color: var(--muted); padding: 4px 0; }

.day {
  position: relative;
  width: 100%; max-width: 42px;
  aspect-ratio: 1;
  display: grid; place-items: center;
  border: none; border-radius: 12px;
  background: transparent;
  font-size: 13.5px; font-weight: 600;
  padding: 0;
}
.day .dot {
  position: absolute; bottom: 5px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--free);
}
.day.off { visibility: hidden; }
.day.past, .day.un { color: #C4C0B2; cursor: default; }
.day.past .dot, .day.un .dot { display: none; }
.day.today:not(.sel) { box-shadow: inset 0 0 0 1.5px #B7CCA0; color: var(--moss-deep); font-weight: 800; }
.day.free:hover { background: var(--surf-3); }
.day.inrange { background: var(--range-bg); border-radius: 6px; }
.day.sel { background: var(--moss); color: #fff; }
.day.sel .dot { display: none; }

.cal-legend { display: flex; gap: 14px; margin-top: 12px; font-size: 11.5px; color: var(--muted); }
.lg { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.lg.free { background: var(--free); }
.lg.sel { background: var(--moss); }
.lg.un { background: var(--un); }

/* ---------- Кнопки и док-панели ---------- */

.btn-orange {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  flex: 1;
  padding: 14px 18px;
  border: none; border-radius: 16px;
  background: linear-gradient(135deg, #F79A3E 0%, var(--orange-deep) 100%);
  color: #fff;
  font-size: 14.5px; font-weight: 700;
  box-shadow: 0 8px 20px rgba(217, 116, 27, .35);
  transition: transform .12s, filter .15s;
}
.btn-orange:active { transform: scale(.97); filter: brightness(.96); }
.btn-orange:disabled { opacity: .45; filter: saturate(.35); box-shadow: none; cursor: default; }
.btn-orange .ic { width: 18px; height: 18px; }

.btn-ghost {
  width: 100%;
  margin-top: 8px;
  padding: 13px;
  border: none; border-radius: 14px;
  background: var(--surf-3);
  font-size: 14px; font-weight: 700;
}
.w100 { width: 100%; flex: none; }

.dock {
  position: sticky; bottom: 10px;
  z-index: 8;
  display: flex; align-items: center; gap: 12px;
  margin: 16px 12px 12px;
  padding: 12px;
  background: var(--green);
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(20, 35, 20, .35);
  color: #fff;
}
.dock-price { font-size: 18px; font-weight: 800; line-height: 1.1; padding-left: 4px; }
.dock-price span { display: block; font-size: 11px; font-weight: 500; opacity: .75; }
.dock-total span { display: block; font-size: 11px; opacity: .72; margin-bottom: 1px; }
.dock-total b { font-size: 18px; font-weight: 800; white-space: nowrap; }

/* ---------- Корзина ---------- */

.cart-list { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 0; }

.cart-item {
  display: flex; gap: 12px;
  padding: 10px;
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.ci-img { width: 76px; height: 76px; border-radius: 14px; object-fit: cover; flex: none; }
.ci-main { flex: 1; min-width: 0; }
.ci-main h3 { font-size: 13.5px; font-weight: 700; margin-bottom: 3px; }
.ci-dates { font-size: 12px; color: var(--muted); }

.stepper {
  display: inline-flex; align-items: center; gap: 2px;
  margin-top: 8px;
  padding: 2px;
  background: var(--surf-3);
  border-radius: 12px;
}
.step-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: none; border-radius: 10px;
  background: transparent;
}
.step-btn:active { background: var(--surf-3); }
.qty { min-width: 22px; text-align: center; font-size: 13.5px; font-weight: 800; }

.ci-right { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.ci-sum { font-size: 14.5px; font-weight: 800; }
.del-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: none; border-radius: 50%;
  background: var(--surf-3);
  color: #8A8778;
}
.del-btn:active { background: var(--surf-3); }

.sum-card {
  margin: 12px 14px 0;
  padding: 4px 14px;
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.sum-card.flat { margin: 0 0 4px; border: none; box-shadow: none; padding: 0; }

.sum-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #F1EDE1;
  font-size: 13.5px;
}
.sum-row:last-child { border-bottom: none; }
.sum-row.total { font-size: 15px; font-weight: 800; }
.sum-row.clickable { cursor: pointer; }
.sum-row.clickable:active { background: var(--surf-2); }

.row-label { display: flex; align-items: center; gap: 8px; color: #55534A; }
.row-label .ic { color: var(--moss-deep); }
.row-right { display: flex; align-items: center; gap: 10px; }
.mini { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.sub-green { color: var(--moss-deep); font-size: 12px; font-weight: 700; }
.green { color: var(--moss-deep); }

.switch {
  position: relative;
  width: 44px; height: 26px;
  border: none; border-radius: 999px;
  background: var(--ph2);
  transition: background .2s;
  flex: none;
}
.switch::after {
  content: '';
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--surf);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: left .2s;
}
.switch.on { background: var(--moss); }
.switch.on::after { left: 21px; }

.promo-row { display: flex; gap: 8px; flex: 1; margin-left: 10px; }
.promo-row input {
  flex: 1; min-width: 0;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--surf-2);
  font-size: 16px;
  outline: none;
}
.promo-row input:focus { border-color: var(--moss); }

.btn-mini {
  flex: none;
  padding: 10px 14px;
  border: none; border-radius: 12px;
  background: var(--green);
  color: #fff;
  font-size: 13px; font-weight: 700;
}

.applied { display: flex; align-items: center; gap: 8px; color: var(--moss-deep); font-size: 13px; font-weight: 700; }
.link-x {
  border: none; background: var(--surf-3);
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 10px; color: var(--muted);
}

/* ---------- Пустые состояния ---------- */

.empty { padding: 64px 34px; text-align: center; color: var(--muted); }
.empty.small { padding: 30px 10px; }
.empty .emo { font-size: 44px; margin-bottom: 12px; }
.empty h3 { font-size: 16px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.empty p { font-size: 13px; line-height: 1.45; }
.empty .btn-orange { margin: 18px auto 0; width: auto; padding: 13px 26px; }

/* ---------- Аккаунт / брони ---------- */

.profile {
  display: flex; align-items: center; gap: 12px;
  margin: 12px 14px;
  padding: 14px;
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; }
.pf-info { flex: 1; min-width: 0; }
.pf-info h3 { font-size: 15px; font-weight: 800; margin-bottom: 2px; }
.pf-info p { font-size: 12px; color: #55534A; margin-top: 1px; }
.pf-info p.muted { color: var(--muted); }

.acc-tabs { display: flex; gap: 4px; padding: 0 14px; }
.acc-tab {
  flex: 1;
  padding: 10px 2px 9px;
  border: none;
  border-bottom: 2.5px solid transparent;
  background: none;
  font-size: 12.5px; font-weight: 700;
  color: var(--muted);
}
.acc-tab.active { color: var(--text); border-bottom-color: var(--moss); }

.acc-section { padding: 10px 14px 14px; }
.acc-section .sec-head { padding: 0 2px 10px; }
.acc-section .grid2 { padding: 0; }

.bk-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px;
  margin-bottom: 10px;
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.bk-item:active { transform: scale(.99); }
@media (hover: hover) { .bk-item:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(35, 45, 30, .12); } }
.bk-img { width: 60px; height: 60px; border-radius: 12px; object-fit: cover; flex: none; }
.bk-main { flex: 1; min-width: 0; }
.bk-main h4 { font-size: 13.5px; font-weight: 700; margin-bottom: 2px; }
.bk-main p { font-size: 12px; color: var(--muted); }

.pill-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.badge-green { background: var(--moss-soft); color: #4C7A34; }
.badge-yellow { background: var(--yellow-soft); color: #96700F; }
.badge-gray { background: var(--ph); color: #8B8778; }

.demo-note {
  padding: 8px 24px 22px;
  text-align: center;
  font-size: 11.5px; line-height: 1.5;
  color: #A5A190;
}

/* ---------- Шторки (sheet) ---------- */

.sheet-overlay {
  position: fixed; inset: 0;
  z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(20, 25, 18, .52); /* без backdrop-filter: blur(2px) — он
     заметно «подтормаживает» прокрутку на слабых машинах */
  opacity: 0;
  transition: opacity .25s;
}
.sheet-overlay.open { opacity: 1; }

.sheet {
  width: 100%; max-width: 480px;
  max-height: 88dvh;
  overflow-y: auto;
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom));
  background: var(--surf-2);
  border-radius: 24px 24px 0 0;
  transform: translateY(40px);
  transition: transform .25s;
}
.sheet-overlay.open .sheet { transform: none; }

.sheet-handle { width: 40px; height: 4px; border-radius: 999px; background: var(--ph2); margin: 4px auto 12px; }
.sheet h3 { font-family: var(--font-display); font-size: 14.5px; font-weight: 600; margin-bottom: 4px; }
.sheet-hint { font-size: 12.5px; color: var(--muted); margin: 0 0 14px; }

.slot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%;
  margin-bottom: 8px;
  padding: 13px 14px;
  background: var(--surf);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  font-size: 14px; font-weight: 600;
  text-align: left;
}
.slot .ic { color: var(--moss-deep); }
.slot.on { border-color: var(--moss); background: var(--moss-soft); }
.slot.danger { color: #B3452E; }

/* ---------- Модалки и тосты ---------- */

.modal-overlay {
  position: fixed; inset: 0;
  z-index: 60;
  display: grid; place-items: center;
  padding: 22px;
  background: rgba(20, 25, 18, .5);
  opacity: 0;
  animation: fadeIn .18s ease forwards;
}
.modal {
  width: 100%; max-width: 340px;
  padding: 26px 20px 20px;
  background: var(--surf);
  border-radius: 22px;
  text-align: center;
  transform: scale(.94);
  animation: pop .22s ease forwards;
}
@keyframes fadeIn { to { opacity: 1; } }
@keyframes pop { to { transform: scale(1); } }

.modal h3 { font-size: 17px; font-weight: 800; margin-bottom: 8px; }
.modal p { font-size: 13px; line-height: 1.5; color: var(--muted); margin-bottom: 18px; }
.modal p b { color: var(--text); }
.modal .btn-orange { margin-top: 4px; }

.big-check {
  width: 64px; height: 64px;
  margin: 0 auto 14px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--moss-soft);
  color: var(--moss-deep);
}
.big-check .ic { width: 30px; height: 30px; stroke-width: 2.4; }

.how { text-align: left; padding-left: 18px; margin: 0 0 18px; font-size: 13.5px; line-height: 1.5; color: #55534A; }
.how li { margin-bottom: 8px; }

#toast {
  position: fixed;
  left: 50%; bottom: 92px;
  transform: translateX(-50%) translateY(12px);
  z-index: 80;
  max-width: 86vw;
  padding: 11px 18px;
  background: #22301E;
  color: #fff;
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
  opacity: 0;
  pointer-events: none;
  transition: all .25s;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Утилиты ---------- */

.muted { color: var(--muted); }
.small { font-size: 12px; }

:focus-visible { outline: 2px solid var(--moss); outline-offset: 2px; }

/* ---------- Форма доставки ---------- */

.f-label { display: block; margin: 12px 0 5px; font-size: 12.5px; font-weight: 700; color: #55534A; }

.f-input, .f-area {
  width: 100%;
  padding: 11px 12px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--surf-2);
  font: inherit;
  font-size: 16px; /* 16px — чтобы iOS не увеличивал страницу при фокусе */
  color: var(--text);
  outline: none;
}
.f-input:focus, .f-area:focus { border-color: var(--moss); }
.f-area { resize: vertical; min-height: 54px; }

.slot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.slot-grid .slot { margin-bottom: 0; justify-content: center; padding: 10px 4px; font-size: 12px; }
.slot.off { opacity: .4; text-decoration: line-through; cursor: default; }

/* Чипы дат доставки */
.date-row {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.date-row::-webkit-scrollbar { display: none; }
.date-chip {
  flex: none;
  padding: 8px 13px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--surf);
  font-size: 12.5px; font-weight: 700;
  white-space: nowrap;
  line-height: 1.25;
  text-align: center;
}
.date-chip small { display: block; font-size: 10px; font-weight: 600; color: var(--muted); }
.date-chip.on { border-color: var(--moss); background: var(--moss-soft); color: var(--moss-deep); }
.date-chip.on small { color: var(--moss-deep); }

/* Загрузочный экран */
.boot { padding: 90px 20px; text-align: center; color: var(--muted); }
.boot-emo { font-size: 42px; animation: bootPulse 1.2s ease-in-out infinite; }
@keyframes bootPulse {
  0%, 100% { transform: scale(1); opacity: .65; }
  50% { transform: scale(1.12); opacity: 1; }
}
.boot p { margin-top: 10px; font-size: 13px; }

/* Битые картинки */
.img-broken { opacity: .15; }
/* ---------- Заказ из карточки (корзины нет) ---------- */

.qty-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; padding: 9px 12px;
  background: var(--surf-2); border: 1px solid var(--line); border-radius: 14px;
}
.qty-label { font-size: 13px; font-weight: 700; }

.order-note {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 10px; font-size: 12px; color: var(--muted);
}
.order-note b { color: var(--moss-deep); font-weight: 700; }
.order-note .ic { width: 15px; height: 15px; color: var(--moss-deep); flex: none; }

.co-item {
  display: flex; align-items: center; gap: 11px;
  margin: 12px 0; padding: 10px;
  background: var(--surf); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 3px 10px rgba(35, 45, 30, .06);
}
.co-item img { width: 54px; height: 54px; border-radius: 12px; object-fit: cover; flex: none; }
.co-main { flex: 1; min-width: 0; }
.co-main b { display: block; font-size: 13.5px; line-height: 1.25; }
.co-main small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.co-sum { font-size: 14px; white-space: nowrap; }

/* ---------- Оформление заказа: единая шторка ---------- */

.co-block {
  margin: 12px 0;
  padding: 12px;
  background: var(--surf-2);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.co-block-head {
  display: flex; align-items: center; gap: 7px;
  font-size: 13.5px; font-weight: 800;
}
.co-block-head .ic { width: 17px; height: 17px; color: var(--moss-deep); }

/* Фиксированная дата — берётся из календаря доступности, изменению не подлежит */
.co-fixed {
  display: flex; align-items: center; gap: 7px;
  margin: 10px 0 2px; padding: 9px 11px;
  background: var(--moss-soft); border-radius: 12px;
  font-size: 12.5px; color: #46583A;
}
.co-fixed .ic { width: 15px; height: 15px; color: var(--moss-deep); flex: none; }
.co-fixed b { font-size: 13.5px; color: var(--green-deep); }
.co-fixed small { font-size: 11px; opacity: .75; }

.co-sums { margin-top: 6px; }
.hint.warn { color: #B3452E; }

/* ---------- Обеспечение: депозит / фото паспорта ---------- */

.dep-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 9px; }
.dep-opt {
  text-align: left;
  padding: 10px 11px;
  background: var(--surf);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  transition: border-color .15s, background .15s;
}
.dep-opt b { display: block; font-size: 12.5px; margin-bottom: 3px; }
.dep-opt small { display: block; font-size: 10.5px; color: var(--muted); line-height: 1.35; }
.dep-opt.on { border-color: var(--moss); background: var(--moss-soft); }
.dep-opt.on b { color: var(--moss-deep); }

/* ---------- Диалоговое окно брони ---------- */

.bk-tabs { display: flex; gap: 6px; margin: 12px 0 10px; }
.bk-tab {
  flex: 1;
  padding: 9px 4px;
  background: var(--surf-3);
  border: none; border-radius: 12px;
  font-size: 11.5px; font-weight: 700; color: #6B6858;
  transition: background .15s, color .15s;
}
.bk-tab.active { background: var(--green); color: #fff; }

.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.media-item {
  position: relative; aspect-ratio: 1 / 1;
  border-radius: 12px; overflow: hidden; background: var(--ph);
}
.media-item img, .media-item video { width: 100%; height: 100%; object-fit: cover; }
.media-del {
  position: absolute; top: 5px; right: 5px;
  width: 22px; height: 22px;
  border: none; border-radius: 50%;
  background: rgba(20, 25, 15, .65); color: #fff; font-size: 11px;
  display: grid; place-items: center;
}
.media-add {
  aspect-ratio: 1 / 1;
  border: 2px dashed #CFC9B6; border-radius: 12px;
  background: var(--surf-2); color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 20px;
}
.media-add span { font-size: 10.5px; font-weight: 700; }
.media-add:active { border-color: var(--moss); color: var(--moss-deep); }

/* Чат по брони */
.chat-wrap {
  display: flex; flex-direction: column; gap: 7px;
  max-height: 300px; overflow-y: auto;
  padding: 4px 2px;
}
.msg {
  max-width: 82%;
  padding: 8px 11px;
  border-radius: 14px;
  font-size: 12.5px; line-height: 1.4;
  background: var(--surf); border: 1px solid var(--line);
  align-self: flex-start;
}
.msg small { display: block; font-size: 9.5px; opacity: .6; margin-top: 3px; }
.msg.mgr { border-bottom-left-radius: 4px; }
.msg.me {
  align-self: flex-end;
  background: var(--green); border-color: var(--green); color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-form { display: flex; gap: 8px; margin-top: 10px; }
.chat-form input {
  flex: 1;
  padding: 11px 13px;
  font-size: 16px; /* не увеличивать при фокусе на iOS */
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surf); outline: none;
}
.chat-form input:focus { border-color: var(--moss); }
.chat-form .btn-mini { flex: none; padding: 0 16px; font-size: 15px; }
.demo-note-chat { margin-top: 7px; font-size: 10.5px; }
.link.left { display: inline-block; margin: 2px 0 4px; }

/* Блок «Обеспечение при получении» — чуть теплее фона, чтобы точно бросался в глаза */
.dep-block { background: var(--warn-bg); border-color: #EEDCBB; }

/* ---------- Аккаунт: лояльность, история заказов, отмена брони ---------- */

.loyalty {
  display: flex; align-items: center; gap: 12px;
  margin: 12px 14px 0;
  padding: 13px 14px;
  background: linear-gradient(135deg, #2A4632 0%, #35573E 100%);
  color: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.loy-stars { display: flex; gap: 3px; flex: none; }
.loy-stars span { display: flex; }
.loy-stars .ic { width: 19px; height: 19px; color: rgba(255, 255, 255, .3); }
.loy-stars span.on .ic { color: #FFC24B; }
.loy-txt { font-size: 11.5px; line-height: 1.4; opacity: .95; }
.loy-txt b { display: block; font-size: 13px; margin-bottom: 2px; }

.hist-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--surf); border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 12px; margin-bottom: 8px;
}
.hist-emo { font-size: 17px; flex: none; }
.hist-main { flex: 1; min-width: 0; }
.hist-main b { display: block; font-size: 12.5px; }
.hist-main small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.hist-sum { font-size: 13px; font-weight: 800; white-space: nowrap; }

.btn-danger-ghost {
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  border: none; border-radius: 14px;
  background: var(--danger-bg); color: #B3452E;
  font-size: 13.5px; font-weight: 700;
}
.btn-danger-ghost:active { filter: brightness(.97); }

/* ---------- Рейтинг на карточках и звёзды ---------- */

.card-rating {
  display: flex; align-items: center; gap: 4px;
  margin-bottom: 7px;
  font-size: 11.5px;
}
.card-rating .ic { width: 13px; height: 13px; color: #F2A93B; }
.card-rating b { font-weight: 800; color: #6B6858; }
.card-rating span { color: var(--muted); font-weight: 600; }

.stars { display: inline-flex; gap: 1px; align-items: center; }
.stars span { display: flex; }
.stars .ic { width: 14px; height: 14px; color: #DDD8C8; }
.stars span.on .ic { color: #F2A93B; }
.stars.sm .ic { width: 12px; height: 12px; }

/* ---------- Отзывы под товаром ---------- */

.p-reviews {
  margin: 14px;
  padding: 16px 14px;
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.pr-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.pr-head h3 { font-size: 15px; font-weight: 800; }
.pr-agg { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.pr-agg b { font-size: 14px; font-weight: 800; }
.pr-agg small { color: var(--muted); font-size: 11.5px; }

.pr-item {
  padding: 10px 0;
  border-bottom: 1px solid #F1EDE1;
}
.pr-item:last-of-type { border-bottom: none; }
.pr-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.pr-ava {
  width: 26px; height: 26px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--moss-soft);
  color: var(--moss-deep);
  font-size: 12px; font-weight: 800;
}
.pr-top b { font-size: 12.5px; font-weight: 700; }
.pr-top small { margin-left: auto; font-size: 11px; color: var(--muted); }
.pr-item p { margin-top: 6px; font-size: 12.5px; line-height: 1.45; color: #55534A; }
.pr-empty { margin: 4px 0 12px; font-size: 12.5px; color: var(--muted); text-align: center; }

.pr-form {
  margin-top: 14px;
  padding: 12px;
  background: var(--surf-2);
  border: 1px dashed #D8D2BE;
  border-radius: 14px;
}
.pr-form-title { font-size: 12.5px; font-weight: 800; margin-bottom: 8px; color: #55534A; }
.pr-stars { display: flex; gap: 4px; margin-bottom: 10px; }
.pr-star {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: none; border-radius: 10px;
  background: var(--surf);
  box-shadow: 0 1px 4px rgba(35, 45, 30, .08);
  transition: transform .12s;
}
.pr-star:active { transform: scale(.9); }
.pr-star .ic { width: 20px; height: 20px; color: #DDD8C8; }
.pr-star.on .ic { color: #F2A93B; }
.pr-form .f-area { background: var(--surf); }
.pr-row { display: flex; gap: 8px; margin-top: 8px; }
.pr-row .f-input { flex: 1; min-width: 0; background: var(--surf); }
.pr-row .btn-mini { flex: none; padding: 10px 18px; }

/* ---------- Уважение к настройкам системы ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ============================================================
   Бейджи на карточках (задаются в админке, поле «Бейдж на фото»)
   ============================================================ */

.card-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  max-width: 68%;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase;
  color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .25);
  backdrop-filter: saturate(1.2);
}
.card-badge.b-orange { background: linear-gradient(135deg, #F29B38, var(--orange-deep)); }
.card-badge.b-green  { background: linear-gradient(135deg, #7BA55F, var(--moss-deep)); }
.card-badge.b-red    { background: linear-gradient(135deg, #E0604D, #C2402F); }

/* ============================================================
   Скелетоны загрузки (показываются, пока каталог ещё не прибыл)
   ============================================================ */

.skel {
  position: relative; overflow: hidden;
  background: var(--ph);
  border-radius: 10px;
}
.skel::after {
  content: '';
  position: absolute; inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

.boot-sk { padding-top: 2px; }
.skel-hero { height: 212px; border-radius: 22px; margin: 14px 14px 12px; }
.skel-row { display: flex; gap: 8px; padding: 0 14px; margin-bottom: 14px; }
.skel-chip { height: 35px; width: 98px; border-radius: 999px; flex: none; }
.skel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 14px 14px; }
.skel-card { background: var(--card); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.skel-card .skel { border-radius: 0; }
.skel-img { aspect-ratio: 4 / 3; }
.skel-body { padding: 12px; display: grid; gap: 8px; }
.skel-line { height: 12px; }
.skel-line.w60 { width: 62%; }
.skel-line.w40 { width: 42%; }

/* ============================================================
   Появление карточек (staggered) — только при смене экрана
   ============================================================ */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
#screen.anim .card {
  animation: rise .45s cubic-bezier(.22, .68, .32, 1) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}

/* ============================================================
   Типографика
   ============================================================ */

.card-body h3 { font-size: 15px; }
.card.g3 .card-body h3 { font-size: 12.5px; }
.price { letter-spacing: -.2px; }
.ci-main h3 { letter-spacing: -.1px; }

/* ============================================================
   Иллюстрации пустых состояний
   ============================================================ */

.empty .art { width: 138px; height: auto; display: block; margin: 0 auto 16px; }
.art .a1 { fill: var(--moss-soft); }
.art .a2 { fill: var(--ph2); }
.art .a3 { fill: var(--moss); }
.art .a4 { fill: var(--orange); }
.art .a5 { fill: var(--line); }

/* ============================================================
   Тёмная тема (системная, prefers-color-scheme)
   ============================================================ */

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --green: #182719;
    --green-deep: #101B10;
    --bg: #171B10;
    --page: #0C0F08;
    --card: #20261A;
    --surf: #20261A;
    --surf-2: #1A1F14;
    --surf-3: #2B3222;
    --line: #343B28;
    --text: #ECEAE0;
    --muted: #9C998A;
    --moss: #7FA968;
    --moss-deep: #6E9C52;
    --moss-soft: #2C3A22;
    --orange: #F09544;
    --orange-deep: #E88A33;
    --yellow-soft: #3B341D;
    --shadow: 0 6px 20px rgba(0, 0, 0, .38);
    --ph: #2A3020;
    --ph2: #3A412C;
    --free: #4F7A38;
    --un: #3A3E2E;
    --range-bg: #2C3A22;
    --warn-bg: #322A15;
    --danger-bg: #3A211B;
    --nav-active: #2C3A22;
  }
  body { background: #070905; }
  #app { box-shadow: 0 0 60px rgba(0, 0, 0, .55); }

  .badge-green { color: #A9CE8F; }
  .badge-yellow { color: #E3C368; }
  .badge-gray { background: #2A2F20; color: #B4B1A1; }
  .btn-danger-ghost { color: #E8A390; }
  .dep-block { border-color: #4A3E22; }
  .card-rating b { color: #D9D6C7; }
  .day.past, .day.un { color: #6E6B5E; }
  .day.today:not(.sel) { color: #A9CE8F; box-shadow: inset 0 0 0 1.5px #4F6A3E; }
  .chip.active { box-shadow: 0 4px 12px rgba(0, 0, 0, .45); }
  .skel::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .09), transparent); }
  .pr-ava { background: #2C3A22; color: #A9CE8F; }
  input, textarea, select { color: var(--text); }
  input::placeholder, textarea::placeholder { color: #7C7A6C; }
}

/* компактный бейдж на SMALL-карточках (grid3), чтобы не обрезался и не задевал сердечко */
.card.g3 .card-badge { top: 7px; left: 7px; max-width: 82%; padding: 3px 7px; font-size: 9px; letter-spacing: .2px; }

/* явная ошибка в шторке оформления (постоянный баннер, а не вспышка тоста) */
.co-err {
  margin: 10px 0 0;
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--danger-bg);
  color: #B3452E;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
}
@media (prefers-color-scheme: dark) {
  .co-err { color: #E8A390; }
}

/* строка версии в аккаунте — видно, какой билд реально работает у пользователя */
.appver { margin-top: 10px; text-align: center; font-size: 11px; color: var(--muted); opacity: .75; }
