/* 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; }
