/* Vita Shop — общие стили (дизайн: «аптечный минимализм») */
:root {
  --bg: #F6F5F0; --surface: #FFFFFF; --ink: #14201B; --muted: #5E6B64;
  --line: #ECEEE8; --line-2: #E1E4DD; --field: #FAFAF7;
  --accent: #0E5E3F; --accent-ink: #0A4730; --accent-soft: #E3EFE8;
  --amber: #F2B84B; --dark: #14201B; --dark-2: #22302A; --dark-3: #2C3A33;
  --danger: #B42318;
  --r-lg: 18px; --r-md: 13px; --r-sm: 11px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 500 15px/1.4 Manrope, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; min-height: 100vh; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--accent); }
[hidden] { display: none !important; }
svg { flex: none; }

.wrap { max-width: 560px; margin: 0 auto; }
.pad { padding: 0 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.b { font-weight: 700; }
.xb { font-weight: 800; }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
h2 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }

/* buttons */
.btn { height: 52px; padding: 0 18px; border-radius: 16px; background: var(--accent); color: #fff; font-weight: 700; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; transition: transform .08s, opacity .15s; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; }
.btn.dark { background: var(--dark); }
.btn.soft { background: var(--accent-soft); color: var(--accent-ink); }
.btn.line { background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); }
.btn.sm { height: 40px; border-radius: 12px; font-size: 13px; width: auto; padding: 0 14px; }
.icon-btn { width: 44px; height: 44px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; flex: none; }
.icon-btn.flat { border: 0; background: var(--bg); }
.icon-btn.green { border: 0; background: var(--accent-soft); }
.chip { flex: none; height: 36px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface);
  font-weight: 600; font-size: 13px; white-space: nowrap; }
.chip.on { background: var(--dark); color: #fff; border-color: var(--dark); }
.chip.green { background: var(--accent-soft); color: var(--accent-ink); border-color: #CFE3D7; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.badge { padding: 3px 8px; border-radius: 8px; font-size: 12px; font-weight: 700; background: var(--accent-soft); color: var(--accent-ink); }
.badge.amber { background: var(--amber); color: var(--ink); }
.dot-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; }

/* fields */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 600; }
.input, .textarea, .select { width: 100%; height: 46px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--field); font-size: 15px; outline: 0; }
.textarea { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); background: #fff; }
.search { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); }
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; font-size: 15px; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card.p { padding: 14px; }
.sep { height: 1px; background: var(--line); }
.list > * + * { border-top: 1px solid var(--line); }

/* product grid */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 520px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 8px 8px 12px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.tile { position: relative; aspect-ratio: 1 / 0.92; border-radius: 13px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile .badge { position: absolute; top: 8px; left: 8px; }
.pname { font-size: 13px; font-weight: 600; line-height: 1.3; height: 34px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.price { font-weight: 800; font-size: 15px; }
.old { color: var(--muted); text-decoration: line-through; font-size: 12px; font-weight: 500; }
.add { width: 36px; height: 36px; border-radius: 11px; background: var(--accent-soft); display: inline-flex; align-items: center; justify-content: center; }
.stepper { height: 36px; border-radius: 11px; background: var(--accent); color: #fff; display: inline-flex; align-items: center; font-weight: 700; font-size: 14px; }
.stepper button { width: 30px; height: 36px; color: #fff; font-size: 18px; font-weight: 700; }

/* floating bars */
.floatbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + var(--safe-b)); width: calc(100% - 32px); max-width: 528px;
  height: 60px; border-radius: 18px; background: var(--dark); color: #fff; display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px 0 18px; box-shadow: 0 12px 30px rgba(20, 32, 27, .25); z-index: 20; animation: up .2s ease-out; }
.floatbar .go { height: 44px; padding: 0 16px; border-radius: 13px; background: #fff; color: var(--ink); display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.bottombar { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(14px + var(--safe-b)); background: var(--bg); border-top: 1px solid #E8EAE4; z-index: 20; }
.bottombar > div { max-width: 528px; margin: 0 auto; }
@keyframes up { from { transform: translate(-50%, 16px); opacity: 0; } }

/* sheet */
.overlay { position: fixed; inset: 0; background: rgba(20, 32, 27, .55); z-index: 40; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 28px 28px 0 0;
  padding: 10px 20px calc(20px + var(--safe-b)); display: flex; flex-direction: column; gap: 16px; animation: sheet .22s ease-out; }
.grip { width: 40px; height: 5px; border-radius: 3px; background: #D6DAD3; align-self: center; }
@keyframes sheet { from { transform: translateY(40px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }

/* chat */
.chat { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.chat-head { padding: 12px 16px; display: flex; align-items: center; gap: 12px; background: #fff; border-bottom: 1px solid var(--line); }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; flex: none; position: relative; }
.avatar.lg { width: 48px; height: 48px; font-size: 18px; }
.online { position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border-radius: 50%; background: #22A06B; border: 2px solid #fff; }
.msgs { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.msg { display: flex; flex-direction: column; gap: 2px; max-width: 80%; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg .bubble { padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: #fff; border: 1px solid var(--line); font-size: 15px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.msg.me .bubble { border-radius: 18px 18px 6px 18px; background: var(--accent); border-color: var(--accent); color: #fff; }
.msg time { font-size: 11px; color: var(--muted); padding: 0 4px; }
.day { align-self: center; font-size: 12px; color: var(--muted); padding: 4px 10px; border-radius: 8px; background: #ECEDE7; }
.composer { padding: 10px 12px calc(12px + var(--safe-b)); background: #fff; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.composer textarea { flex: 1; min-width: 0; height: 44px; max-height: 120px; padding: 11px 14px; border-radius: 13px; border: 1px solid var(--line-2); background: var(--field); font-size: 15px; outline: 0; resize: none; }
.send { width: 44px; height: 44px; border-radius: 13px; background: var(--accent); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ordercard { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 10px; align-self: stretch; }
.ordercard.dark { background: var(--dark); border-color: var(--dark); color: #fff; }
.ordercard.dark .muted { color: #B9C4BE; }
.oline { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }

/* tabs (admin) */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; height: calc(64px + var(--safe-b)); padding-bottom: var(--safe-b); background: #fff; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); z-index: 20; }
.tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--muted); position: relative; }
.tabbar button.on { color: var(--accent); }
.tabbar .dot-count { position: absolute; top: 6px; left: calc(50% + 6px); height: 18px; min-width: 18px; font-size: 11px; }

.switch { width: 44px; height: 26px; border-radius: 13px; padding: 3px; background: #C9CEC6; display: flex; transition: background .15s; }
.switch i { width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch.on { background: var(--accent); }
.switch.on i { transform: translateX(18px); }

.toast { position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); transform: translateX(-50%); background: var(--dark); color: #fff;
  padding: 10px 16px; border-radius: 14px; font-size: 14px; font-weight: 600; z-index: 60; max-width: calc(100% - 32px); animation: fade .15s; }
.skeleton { background: linear-gradient(90deg, #ECEDE7 25%, #F3F3EE 50%, #ECEDE7 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 18px; }
@keyframes sk { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 64px 24px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* ---- v3: нижнее меню магазина, каталог, цели, язык, плавность ---- */
.view { animation: viewIn .18s ease-out; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }
.tabbar .tab-sum { font-size: 10px; font-weight: 800; color: var(--accent); margin-top: -2px; }
.tabbar .dot-count.bump { animation: bump .35s ease-out; }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }
.tabbar button { transition: color .15s; }
.tabbar button.on svg { transform: translateY(-1px); }

.lang-pill { height: 44px; padding: 0 12px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: #fff;
  display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; }

.goals { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 4px; }
.goals::-webkit-scrollbar { display: none; }
.goal { flex: none; width: 76px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; text-align: center; line-height: 1.2; }
.goal i { width: 56px; height: 56px; border-radius: 18px; background: #fff; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; transition: background .15s, border-color .15s, transform .1s; }
.goal.on i { background: var(--accent); border-color: var(--accent); }
.goal:active i { transform: scale(.94); }

.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 14px; background: #ECEDE7; }
.seg button { height: 38px; border-radius: 11px; font-weight: 700; font-size: 13px; color: var(--muted); transition: background .15s, color .15s; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20, 32, 27, .1); }

.trow { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 0; text-align: left; }
.trow .ic { width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; flex: none; font-weight: 800; color: var(--accent-ink); }
.section-h { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 10px; }
.section-h a, .section-h button { font-size: 13px; font-weight: 700; color: var(--accent); }
.cart-cta { position: fixed; left: 0; right: 0; bottom: calc(64px + var(--safe-b)); padding: 10px 16px; background: var(--bg); border-top: 1px solid #E8EAE4; z-index: 19; }
.cart-cta > div { max-width: 528px; margin: 0 auto; }
@media (prefers-reduced-motion: reduce) { .view, .overlay, .sheet, .tabbar .dot-count.bump { animation: none !important; } }

/* Описание товара */
.about-text { font-size: 14px; line-height: 1.55; color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; }
.about-text.clamp { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.about-more { align-self: flex-start; font-size: 14px; font-weight: 700; color: var(--accent); padding: 2px 0; }

/* Режим работы */
.status-chip { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; height: 34px; padding: 0 12px 0 10px; border-radius: 17px; background: var(--surface); border: 1px solid var(--line-2); font-size: 13px; font-weight: 700; color: var(--ink); }
.status-chip i { width: 8px; height: 8px; border-radius: 50%; background: #C2483D; flex: none; }
.status-chip.on i { background: #1B9E5F; box-shadow: 0 0 0 3px rgba(27,158,95,.16); }
.closed-note { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: #FDF3E1; color: #6B4A12; font-size: 13px; line-height: 1.45; }
.hours-row { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line-2); font-size: 15px; }
.hours-row:last-child { border-bottom: 0; }
.hours-row.today { font-weight: 800; }
.hours-row .off { color: var(--muted); }
.phone-big { font-size: 24px; font-weight: 800; letter-spacing: .01em; text-align: center; padding: 14px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-ink, var(--ink)); }

/* Варианты товара */
.variants { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.variants::-webkit-scrollbar { display: none; }
.variant { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 96px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); text-align: left; }
.variant b { font-size: 14px; }
.variant span { font-size: 12px; color: var(--muted); font-weight: 600; }
.variant.on { border: 2px solid var(--accent); background: var(--accent-soft); padding: 9px 11px; }
.variant.on span { color: var(--accent-ink, var(--ink)); }
/* Статусы заказа */
.badge.st-new { background: #FDF1D8; color: #7A4F00; }
.badge.st-courier { background: #E3EEFB; color: #1D4F91; }
.badge.st-delivered { background: var(--accent-soft); color: var(--accent-ink, var(--ink)); }
.badge.st-cancelled { background: #F6E3E1; color: #9A2A1F; }
.day.status-msg { background: var(--accent-soft); color: var(--accent-ink, var(--ink)); font-weight: 700; white-space: normal; text-align: center; }
/* Админка: статусы заказа и варианты товара */
.st-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.st-btn { height: 38px; border-radius: 10px; background: var(--dark-3); color: #D3DBD6; font-size: 13px; font-weight: 700; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-btn.on { background: #fff; color: var(--dark); }
.var-box { padding: 12px; border-radius: 16px; background: var(--bg); }
.var-item { gap: 10px; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); }
.var-photo { width: 64px; height: 64px; border-radius: 12px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; overflow: hidden; flex: none; border: 1px dashed var(--line-2); }

/* Чат: «по заказу №…» */
.ord-pick { display: flex; align-items: center; gap: 8px; margin: 0 16px 8px; padding: 8px 12px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink, var(--ink)); font-size: 13px; width: calc(100% - 32px); text-align: left; }
.ord-pick span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.otag { display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: 6px; background: rgba(0,0,0,.08); font-size: 11px; font-weight: 800; vertical-align: 1px; }
.msg.me .otag { background: rgba(255,255,255,.22); }
.client-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line); }
.search-in { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); }
.search-in input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; }
.opick { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.opick::-webkit-scrollbar { display: none; }
.opick button { flex: none; height: 30px; padding: 0 10px; border-radius: 9px; background: var(--dark-3); color: #D3DBD6; font-size: 12px; font-weight: 700; }
.opick button.on { background: #fff; color: var(--dark); }
