/* TEPLYTSYA — гуртівня квітів. Design system.
   Palette pulled from the client's brand reference: olive green + warm gold +
   cream + soft blush. Serif display (Playfair) paired with sans body (Manrope). */

:root {
  --olive: #4b5320;
  --olive-700: #3b4318;
  --olive-600: #5c6428;
  --olive-tint: #eaecdd;
  --gold: #b08d4f;
  --gold-deep: #97743a;
  --gold-tint: #f0e7d4;
  --brand: #c1502f;          /* terracotta-orange from the TEPLYTSYA logo */
  --brand-deep: #a8421f;
  --cream: #f6f1e7;
  --card: #ffffff;
  --blush: #ecd4cb;
  --blush-soft: #f7eae4;
  --terracotta: #9c4a2c;
  --ink: #2c2b25;
  --muted: #8e897c;
  --line: #ece6d8;
  --ok: #5c6428;

  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Manrope", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  --r: 24px;
  --r-sm: 16px;
  --r-pill: 999px;
  --shadow: 0 14px 36px rgba(60, 55, 25, 0.10);
  --shadow-sm: 0 6px 18px rgba(60, 55, 25, 0.08);
  --shell: 520px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(1200px 600px at 80% -10%, #eef0e2 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 110%, #f6e7e0 0%, transparent 55%),
    var(--cream);
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 15px; color: var(--ink); }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ----------------------------------------------------------------- shell */
#app { min-height: 100%; }

.shell {
  max-width: var(--shell);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--cream);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 60px rgba(60, 55, 25, 0.08);
}
@media (min-width: 560px) {
  .shell { margin: 18px auto; min-height: calc(100dvh - 36px); border-radius: 34px; overflow: hidden; }
}

.view {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 110px;
}
.view::-webkit-scrollbar { width: 0; }

/* ----------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px;
  background: linear-gradient(var(--cream) 78%, transparent);
  backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--olive); color: #f6f1e7;
  display: grid; place-items: center; font-size: 20px;
  box-shadow: var(--shadow-sm);
}
.brand-logo {
  width: 44px; height: 44px; border-radius: 12px; object-fit: cover;
  box-shadow: var(--shadow-sm); flex-shrink: 0;
}
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 20px; letter-spacing: .5px; line-height: 1; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm);
  display: grid; place-items: center; font-size: 17px; color: var(--olive);
}
.icon-btn.ghost { background: rgba(255,255,255,.6); }

/* ----------------------------------------------------------------- headings */
.section-head { padding: 8px 20px 12px; display: flex; align-items: baseline; justify-content: space-between; }
.h-title { font-family: var(--serif); font-size: 26px; font-weight: 600; }
.h-sub { color: var(--muted); font-size: 13px; }
.link { color: var(--gold-deep); font-weight: 600; font-size: 13px; }
.eyebrow { color: var(--gold-deep); font-weight: 700; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; }

/* ----------------------------------------------------------------- hero */
.hero { padding: 6px 20px 4px; }
.hero-card {
  position: relative; border-radius: var(--r); overflow: hidden;
  background: linear-gradient(150deg, var(--olive) 0%, var(--olive-700) 100%);
  color: #f4efe2; padding: 26px 22px 24px; box-shadow: var(--shadow);
}
.hero-card::after {
  content: "🌿"; position: absolute; right: -10px; bottom: -18px;
  font-size: 130px; opacity: .12; transform: rotate(-12deg);
}
/* Premium hero: crisp photo + bottom-weighted scrim so the image is shown off
   and the text stays readable. */
.hero-card.hero-pro {
  padding: 0; min-height: 440px; display: flex; align-items: flex-end;
}
.hero-card.hero-pro::after { display: none; }
.hero-bg { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-scrim {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top,
    rgba(34,39,14,.94) 0%, rgba(34,39,14,.72) 30%,
    rgba(34,39,14,.20) 58%, rgba(34,39,14,.05) 80%, rgba(34,39,14,.30) 100%);
}
.hero-content { position: relative; z-index: 2; padding: 26px 22px 24px; width: 100%; }
.hero-logo {
  width: 78px; height: 78px; border-radius: 18px; object-fit: cover;
  box-shadow: var(--shadow); margin-bottom: 14px; border: 2px solid rgba(255,255,255,.25);
}
.hero-card .eyebrow { color: var(--gold-tint); }
.hero-h { font-family: var(--serif); font-size: 32px; line-height: 1.05; margin: 8px 0 10px; font-weight: 700; }
.hero-p { font-size: 14px; opacity: .85; max-width: 90%; line-height: 1.5; }
.hero-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* ----------------------------------------------------------------- buttons */
.btn {
  border-radius: var(--r-pill); padding: 13px 22px; font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  transition: transform .08s ease, filter .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--olive); color: #f4efe2; box-shadow: var(--shadow-sm); }
.btn-gold { background: var(--brand); color: #fff; }
.btn-light { background: #fff; color: var(--olive); box-shadow: var(--shadow-sm); }
.btn-ghost { background: rgba(255,255,255,.15); color: #f4efe2; border: 1px solid rgba(255,255,255,.35); }
.btn-outline { background: transparent; color: var(--terracotta); border: 1.5px solid var(--terracotta); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; pointer-events: none; }

/* ----------------------------------------------------------------- cycle cards */
.cycles { display: flex; gap: 12px; overflow-x: auto; padding: 6px 20px 14px; scroll-snap-type: x mandatory; }
.cycles::-webkit-scrollbar { height: 0; }
.cycle {
  min-width: 240px; scroll-snap-align: start;
  background: #fff; border-radius: var(--r-sm); padding: 16px; box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}
.cycle.south { background: linear-gradient(150deg, #fff 0%, var(--blush-soft) 100%); }
.cycle-top { display: flex; align-items: center; justify-content: space-between; }
.cycle-flags { font-size: 18px; }
.cycle-badge { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: var(--r-pill); background: var(--olive-tint); color: var(--olive); }
.cycle-title { font-family: var(--serif); font-size: 18px; font-weight: 600; margin: 8px 0 2px; }
.cycle-note { font-size: 12px; color: var(--muted); line-height: 1.4; margin-bottom: 10px; min-height: 34px; }
.cycle-row { display: flex; justify-content: space-between; font-size: 12px; padding: 6px 0; border-top: 1px dashed var(--line); }
.cycle-row b { color: var(--ink); }
.countdown { color: var(--terracotta); font-weight: 700; }

/* ----------------------------------------------------------------- features */
.features { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 6px 20px 8px; }
.feature { background: #fff; border-radius: var(--r-sm); padding: 16px; box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.feature-ic { width: 38px; height: 38px; border-radius: 11px; background: var(--olive-tint); display: grid; place-items: center; font-size: 18px; margin-bottom: 10px; }
.feature-t { font-weight: 700; font-size: 14px; margin-bottom: 3px; }
.feature-d { font-size: 12px; color: var(--muted); line-height: 1.4; }

/* ----------------------------------------------------------------- filters */
.filters { padding: 6px 20px 4px; }
.search {
  display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 11px 16px; box-shadow: var(--shadow-sm); margin-bottom: 12px;
}
.search input { border: none; outline: none; flex: 1; background: transparent; }
.pills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.pills::-webkit-scrollbar { height: 0; }
.pill {
  white-space: nowrap; padding: 9px 16px; border-radius: var(--r-pill); font-size: 13px; font-weight: 600;
  background: #fff; border: 1px solid var(--line); color: var(--ink); transition: all .12s ease;
}
.pill.active { background: var(--olive); color: #f4efe2; border-color: var(--olive); }
.pill-row { margin-bottom: 8px; }

/* ----------------------------------------------------------------- grid */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 10px 20px; }
.fcard {
  background: #fff; border-radius: var(--r-sm); overflow: hidden; box-shadow: var(--shadow-sm);
  border: 1px solid var(--line); display: flex; flex-direction: column; transition: transform .1s ease;
}
.fcard:active { transform: scale(.98); }
.fcard-img { position: relative; aspect-ratio: 1/1; background: linear-gradient(150deg, var(--olive-tint), var(--blush-soft)); overflow: hidden; }
.fcard-img img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.fcard-emoji { position: absolute; inset: 0; z-index: 0; display: grid; place-items: center; font-size: 52px; }
.fcard-flag { position: absolute; z-index: 2; top: 8px; left: 8px; background: rgba(255,255,255,.92); border-radius: var(--r-pill); padding: 3px 9px; font-size: 12px; font-weight: 700; box-shadow: var(--shadow-sm); }
.fcard-tag { position: absolute; z-index: 2; top: 8px; right: 8px; font-size: 10px; font-weight: 700; padding: 4px 9px; border-radius: var(--r-pill); text-transform: uppercase; letter-spacing: .5px; }
.tag-stock { background: var(--olive); color: #f4efe2; }
.tag-pre { background: var(--gold); color: #fff; }
.tag-closed { background: #c9c4b6; color: #fff; }
.fcard-body { padding: 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.fcard-name { font-family: var(--serif); font-size: 16px; font-weight: 600; line-height: 1.1; }
.fcard-meta { font-size: 11px; color: var(--muted); }
.fcard-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; }
.price { font-weight: 800; font-size: 16px; color: var(--olive); }
.price small { font-size: 11px; color: var(--muted); font-weight: 600; }
.add-btn { width: 34px; height: 34px; border-radius: 50%; background: var(--olive); color: #f4efe2; display: grid; place-items: center; font-size: 20px; }

/* ----------------------------------------------------------------- bottom sheet */
.overlay { position: fixed; inset: 0; background: rgba(30,28,20,.45); z-index: 50; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.overlay.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 100%);
  width: 100%; max-width: var(--shell); background: var(--cream);
  border-radius: 28px 28px 0 0; z-index: 60; transition: transform .26s cubic-bezier(.2,.8,.2,1);
  max-height: 92dvh; overflow-y: auto; box-shadow: 0 -20px 60px rgba(0,0,0,.25);
}
.sheet.open { transform: translate(-50%, 0); }
.sheet-grip { width: 42px; height: 5px; border-radius: 3px; background: #d8d2c2; margin: 10px auto 4px; }
.sheet-img { aspect-ratio: 16/11; background: linear-gradient(150deg, var(--olive-tint), var(--blush-soft)); position: relative; overflow: hidden; }
.sheet-img img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.sheet-emoji { position: absolute; inset: 0; z-index: 0; display: grid; place-items: center; font-size: 90px; }
.sheet-body { padding: 18px 20px 24px; }
.sheet-title { font-family: var(--serif); font-size: 24px; font-weight: 600; }
.sheet-sub { color: var(--muted); font-size: 13px; margin: 4px 0 12px; }
.sheet-desc { font-size: 14px; line-height: 1.55; color: #5a564b; margin-bottom: 16px; }

.field-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin: 14px 0 8px; display: block; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 9px 15px; border-radius: var(--r-pill); border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 14px; }
.chip.active { background: var(--olive); color: #f4efe2; border-color: var(--olive); }

.stepper { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-pill); padding: 6px; width: fit-content; }
.stepper button { width: 38px; height: 38px; border-radius: 50%; background: var(--olive-tint); color: var(--olive); font-size: 22px; display: grid; place-items: center; }
.stepper b { min-width: 56px; text-align: center; font-size: 17px; }
.pack-note { font-size: 12px; color: var(--muted); margin-top: 6px; }
.sheet-total { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 14px; }
.sheet-total b { font-size: 22px; color: var(--olive); }

/* ----------------------------------------------------------------- cart */
.cart-item { display: flex; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; box-shadow: var(--shadow-sm); margin-bottom: 12px; }
.cart-thumb { width: 64px; height: 64px; border-radius: 12px; overflow: hidden; background: var(--olive-tint); flex-shrink: 0; position: relative; }
.cart-thumb img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.cart-thumb .emoji { position: absolute; inset: 0; z-index: 0; display: grid; place-items: center; font-size: 30px; }
.cart-info { flex: 1; min-width: 0; }
.cart-name { font-weight: 700; font-size: 15px; }
.cart-sub { font-size: 12px; color: var(--muted); margin: 2px 0 8px; }
.cart-foot { display: flex; align-items: center; justify-content: space-between; }
.mini-step { display: flex; align-items: center; gap: 10px; }
.mini-step button { width: 28px; height: 28px; border-radius: 50%; background: var(--olive-tint); color: var(--olive); font-size: 18px; display: grid; place-items: center; }
.cart-del { color: var(--muted); font-size: 13px; }
.summary { background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 16px; box-shadow: var(--shadow-sm); margin: 4px 0 16px; }
.summary-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.summary-row.total { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 12px; font-size: 18px; font-weight: 800; }
.summary-row.total b { color: var(--olive); }

/* ----------------------------------------------------------------- forms */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 16px; box-shadow: var(--shadow-sm); margin-bottom: 14px; }
.input { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; outline: none; background: #fcfbf7; margin-bottom: 10px; transition: border .15s; }
.input:focus { border-color: var(--olive); }
textarea.input { resize: vertical; min-height: 70px; }
.seg { display: flex; gap: 8px; margin-bottom: 12px; }
.seg button { flex: 1; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: #fcfbf7; font-weight: 600; font-size: 13px; }
.seg button.active { background: var(--olive); color: #f4efe2; border-color: var(--olive); }

/* ----------------------------------------------------------------- empty / success */
.empty { text-align: center; padding: 60px 30px; color: var(--muted); }
.empty .big { font-size: 64px; margin-bottom: 14px; }
.empty h3 { font-family: var(--serif); color: var(--ink); font-size: 22px; margin-bottom: 6px; }
.success { text-align: center; padding: 30px 24px; }
.success .ring { width: 92px; height: 92px; border-radius: 50%; background: var(--olive); color: #f4efe2; display: grid; place-items: center; font-size: 46px; margin: 10px auto 18px; box-shadow: var(--shadow); }
.success h2 { font-family: var(--serif); font-size: 26px; margin-bottom: 8px; }
.success p { color: var(--muted); font-size: 14px; line-height: 1.5; margin-bottom: 8px; }
.order-recap { background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 16px; box-shadow: var(--shadow-sm); margin: 16px 0; text-align: left; }

/* ----------------------------------------------------------------- contacts */
.contact-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px; box-shadow: var(--shadow-sm); margin: 4px 0 14px; }
.contact-row { display: flex; align-items: center; gap: 14px; padding: 14px; border-bottom: 1px solid var(--line); }
.contact-row:last-child { border-bottom: none; }
.contact-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 20px; flex-shrink: 0; }
.ic-tg { background: #e7f1f9; } .ic-ig { background: #fbe9f0; } .ic-ph { background: var(--olive-tint); } .ic-loc { background: var(--gold-tint); }
.contact-t { font-weight: 700; font-size: 15px; }
.contact-d { font-size: 13px; color: var(--muted); }
.contact-go { margin-left: auto; color: var(--gold-deep); font-size: 18px; }

/* ----------------------------------------------------------------- info banner */
.note-banner { display: flex; gap: 12px; align-items: flex-start; background: var(--blush-soft); border: 1px solid var(--blush); border-radius: var(--r-sm); padding: 14px; margin: 8px 20px; font-size: 13px; color: #6b5248; line-height: 1.45; }
.note-banner .nb-ic { font-size: 18px; }

/* ----------------------------------------------------------------- bottom nav */
.tabbar {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: var(--shell); z-index: 40;
  display: flex; align-items: flex-end; justify-content: space-around;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--cream) 30%);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1; color: var(--muted); font-size: 10px; font-weight: 600; padding: 6px 0; }
.tab .ti { font-size: 21px; line-height: 1; }
.tab.active { color: var(--olive); }
.tab-center { flex: 0 0 auto; margin: 0 4px; }
.tab-center .fab {
  width: 62px; height: 62px; border-radius: 50%; background: var(--olive); color: #f4efe2;
  display: grid; place-items: center; font-size: 26px; box-shadow: 0 10px 24px rgba(75,83,32,.45);
  transform: translateY(-14px); border: 5px solid var(--cream); position: relative;
}
.cart-badge { position: absolute; top: -2px; right: -2px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 800; min-width: 22px; height: 22px; border-radius: 11px; display: grid; place-items: center; border: 2px solid var(--cream); padding: 0 5px; }

/* ----------------------------------------------------------------- toast */
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px); background: var(--olive-700); color: #f4efe2; padding: 12px 20px; border-radius: var(--r-pill); font-size: 14px; font-weight: 600; z-index: 80; opacity: 0; transition: all .25s ease; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ----------------------------------------------------------------- admin */
.admin-tabs { display: flex; gap: 8px; padding: 0 20px 12px; overflow-x: auto; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 6px 20px 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 16px; box-shadow: var(--shadow-sm); }
.stat .num { font-family: var(--serif); font-size: 28px; font-weight: 700; color: var(--olive); }
.stat .lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }
.admin-row { background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px; box-shadow: var(--shadow-sm); margin-bottom: 10px; }
.admin-row .ar-top { display: flex; justify-content: space-between; align-items: center; }
.status-pill { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: var(--r-pill); }
.s-new { background: var(--gold-tint); color: var(--gold-deep); }
.s-confirmed { background: var(--olive-tint); color: var(--olive); }
.s-shipped { background: #e7f1f9; color: #2c6c9e; }
.s-done { background: #e3efe0; color: var(--olive); }
.s-cancelled { background: var(--blush-soft); color: var(--terracotta); }
.login-wrap { padding: 40px 24px; }

/* ----------------------------------------------------------------- misc */
.center { text-align: center; }
.muted { color: var(--muted); }
.spacer { height: 8px; }
.loading { text-align: center; padding: 50px; color: var(--muted); }
.pulse { animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
.fade-in { animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
