:root {
  --blue: #2563eb;
  --blue-strong: #1d4ed8;
  --blue-dark: #172554;
  --sky: #7dd3fc;
  --yellow: #facc15;
  --yellow-strong: #eab308;
  --green: #16a34a;
  --background: #f5f9ff;
  --surface: #fff;
  --surface-soft: #eef6ff;
  --text: #172033;
  --muted: #667085;
  --border: #dfe7f2;
  --danger: #dc2626;
  --shadow: 0 18px 48px rgba(23, 37, 84, .14);
  --radius: 8px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--background);
}

* { box-sizing: border-box; }
html { background: #dfe7f2; scroll-behavior: smooth; }
body { margin: 0; background: var(--background); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--sky); outline-offset: 2px;
}
a { color: inherit; text-decoration: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
h1, h2, h3, p { margin-top: 0; overflow-wrap: anywhere; }
h1 { margin-bottom: 12px; font-size: 34px; line-height: 1.08; letter-spacing: 0; }
h2 { margin-bottom: 14px; font-size: 25px; line-height: 1.16; letter-spacing: 0; }
h3 { margin-bottom: 6px; font-size: 17px; line-height: 1.3; letter-spacing: 0; }
p { line-height: 1.55; }

.app-shell { min-height: 100dvh; padding-bottom: 88px; background: var(--background); }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between;
  min-height: 70px; padding: 10px 14px; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand-mark {
  display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto;
  color: white; background: var(--blue); border-radius: var(--radius); font-weight: 950; font-size: 20px;
}
.brand-copy { min-width: 0; }
.brand b, .brand small { display: block; letter-spacing: 0; }
.brand b { font-size: 15px; white-space: nowrap; }
.brand small { margin-top: 1px; color: var(--muted); font-size: 10px; }
.header-actions { display: flex; gap: 6px; }
.header-action {
  display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 999px; color: var(--blue); background: white;
  font-size: 12px; font-weight: 850; cursor: pointer;
}
.header-action-primary { color: var(--blue-strong); background: #fffbeb; }
.status-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 4px rgba(250,204,21,.18); }

main { min-width: 0; }
main:focus { outline: none; }
.page-section { padding: 26px 16px; min-width: 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-heading h2, .section-heading p { margin-bottom: 0; }
.section-heading > p { color: var(--muted); font-size: 12px; }
.eyebrow { margin-bottom: 7px; color: var(--blue); font-size: 11px; font-weight: 900; text-transform: uppercase; }

.hero-wrap { padding: 14px 14px 0; }
.hero {
  padding: 26px 22px 24px; border-radius: var(--radius); color: white; background: var(--blue);
  box-shadow: 0 12px 26px rgba(37,99,235,.2);
}
.hero .eyebrow { color: white; }
.hero p { margin-bottom: 16px; color: #eff6ff; font-size: 15px; }
.hero .availability { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; font-size: 12px; font-weight: 750; }
.hero .availability .status-dot { background: #4ade80; box-shadow: 0 0 0 4px rgba(74,222,128,.16); }
.hero-actions { display: grid; gap: 9px; margin-top: 18px; }

.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 12px 18px;
  border: 1px solid transparent; border-radius: var(--radius); font-weight: 850; cursor: pointer;
}
.button-primary { color: var(--blue-dark); background: var(--yellow); }
.button-primary:hover { background: var(--yellow-strong); }
.button-secondary { color: var(--blue-dark); background: white; border-color: var(--border); }
.hero .button-secondary { color: white; background: transparent; border-color: rgba(255,255,255,.55); }
.button-blue { color: white; background: var(--blue); }
.button-wide { width: 100%; }
.button:disabled { cursor: not-allowed; opacity: .5; }
.text-link { color: var(--blue); font-weight: 800; }

.benefit-list { display: grid; gap: 8px; padding: 14px; }
.benefit {
  display: grid; grid-template-columns: 42px minmax(0,1fr); align-items: center; gap: 10px;
  min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: white;
}
.benefit-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--radius); color: var(--blue-dark); background: var(--yellow); }
.benefit b, .benefit small { display: block; }
.benefit b { font-size: 14px; }
.benefit small { margin-top: 2px; color: var(--muted); font-size: 11px; }

.category-grid, .service-grid, .dashboard-grid { display: grid; grid-template-columns: 1fr; gap: 10px; min-width: 0; }
.category-card, .service-card, .panel {
  min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: white;
}
.category-card {
  display: grid; grid-template-columns: 46px minmax(0,1fr) auto; align-items: center; gap: 11px;
  padding: 13px; text-align: left; cursor: pointer;
}
.category-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: var(--radius); color: var(--blue); background: #e0f2fe; }
.category-card p { margin: 0; color: var(--muted); font-size: 12px; }
.category-arrow { color: var(--blue); font-size: 22px; }

.service-card { overflow: hidden; }
.product-carousel { position: relative; min-width: 0; overflow: hidden; border-bottom: 1px solid var(--border); background: var(--surface-soft); }
.carousel-track {
  display: flex; width: 100%; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; touch-action: pan-y; cursor: grab; overscroll-behavior-x: contain;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track.dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.carousel-slide { flex: 0 0 100%; scroll-snap-align: start; border-bottom: 0 !important; }
.product-placeholder {
  position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 16/8;
  padding: 18px; overflow: hidden; color: var(--blue-dark); background:
    linear-gradient(135deg, rgba(125,211,252,.33), transparent 55%),
    repeating-linear-gradient(45deg, #f5f9ff, #f5f9ff 12px, #edf5ff 12px, #edf5ff 24px);
  border-bottom: 1px solid var(--border); text-align: center;
}
.product-placeholder::before { content: ""; position: absolute; inset: 12px; border: 1px dashed #93c5fd; border-radius: 6px; }
.product-placeholder span { position: relative; max-width: 240px; font-size: 12px; font-weight: 800; }
.carousel-arrow {
  position: absolute; z-index: 2; top: 50%; display: grid; place-items: center;
  width: 36px; height: 44px; padding: 0; transform: translateY(-50%);
  border: 1px solid rgba(255,255,255,.8); border-radius: var(--radius);
  color: var(--blue-dark); background: rgba(255,255,255,.9); box-shadow: 0 4px 14px rgba(23,37,84,.12);
  font-size: 26px; line-height: 1; cursor: pointer;
}
.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }
.carousel-dots {
  position: absolute; z-index: 2; right: 0; bottom: 9px; left: 0;
  display: flex; justify-content: center; gap: 6px; pointer-events: none;
}
.carousel-dots button {
  width: 7px; height: 7px; padding: 0; border: 1px solid var(--blue);
  border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(23,37,84,.16);
  pointer-events: auto; cursor: pointer; transition: width .18s ease, background .18s ease;
}
.carousel-dots button.active { width: 20px; border-radius: 7px; background: var(--blue); }
.service-body { padding: 14px; }
.service-body p { min-height: 38px; margin-bottom: 9px; color: var(--muted); font-size: 12px; }
.service-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.service-tag { padding: 4px 7px; border-radius: 5px; color: var(--blue-dark); background: var(--surface-soft); font-size: 10px; font-weight: 750; }
.service-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.service-price { display: grid; gap: 1px; min-width: 0; color: var(--blue); }
.service-price small { color: var(--muted); font-size: 10px; font-weight: 650; }
.service-price b { font-size: 13px; }
.service-action { min-height: 42px; padding: 9px 12px; font-size: 12px; }

.process-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.process-item { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 10px; }
.process-number { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: white; background: var(--blue); font-size: 13px; font-weight: 900; }
.process-item p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }

.trust-panel { padding: 18px; color: white; background: var(--blue-dark); border-radius: var(--radius); }
.trust-panel p { margin-bottom: 14px; color: #dbeafe; font-size: 13px; }
.trust-list { display: grid; gap: 8px; }
.trust-item { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; }
.trust-check { display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%; color: var(--blue-dark); background: var(--yellow); font-size: 12px; font-weight: 900; }

.catalog-head { padding-bottom: 14px; }
.search-box { position: relative; margin-top: 16px; }
.search-box input { width: 100%; min-height: 50px; padding: 12px 42px 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: white; }
.search-box .icon-search { position: absolute; top: 50%; right: 14px; transform: translateY(-50%); color: var(--muted); }
.filter-tabs {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 7px;
  margin: 0 0 16px; padding: 0;
}
.filter-tab {
  min-width: 0; min-height: 54px; padding: 8px 6px; border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--muted); background: white;
  font-size: 11px; font-weight: 750; line-height: 1.2; overflow-wrap: anywhere; cursor: pointer;
}
.filter-tab:last-child:nth-child(3n + 1) { grid-column: 1 / -1; }
.filter-tab.active { color: white; background: var(--blue); border-color: var(--blue); }
.empty { padding: 30px 18px; text-align: center; color: var(--muted); }

.contacts-hero { padding-bottom: 18px; }
.contact-list, .contact-actions { display: grid; gap: 9px; }
.contact-link, .contact-action {
  display: grid; grid-template-columns: 44px minmax(0,1fr) auto; align-items: center; gap: 11px;
  padding: 13px; border: 1px solid var(--border); border-radius: var(--radius); background: white;
}
.contact-action { grid-template-columns: 44px minmax(0,1fr); }
.contact-link-icon, .contact-action-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius); color: var(--blue); background: var(--surface-soft); }
.contact-link b, .contact-link small, .contact-action b, .contact-action small { display: block; }
.contact-link small, .contact-action small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.contact-link > span:last-child { color: var(--blue); }
.location-card { margin-top: 14px; padding: 16px; border-radius: var(--radius); color: white; background: var(--blue-dark); }
.location-card p { margin-bottom: 12px; color: #dbeafe; font-size: 13px; }
.notice { padding: 13px; border-left: 4px solid var(--yellow); background: #fffbeb; font-size: 12px; overflow-wrap: anywhere; }
.panel { padding: 16px; }

.bottom-nav {
  position: fixed; z-index: 40; right: 0; bottom: 0; left: 0; display: grid;
  grid-template-columns: 1fr 1fr 1.18fr 1fr 1fr; align-items: end; min-height: 82px;
  padding: 9px max(10px, env(safe-area-inset-right)) max(9px, env(safe-area-inset-bottom));
  background: rgba(255,255,255,.97); border-top: 1px solid var(--border);
  box-shadow: 0 -10px 32px rgba(23,37,84,.13); backdrop-filter: blur(18px);
}
.bottom-nav a, .bottom-nav button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-width: 0; border: 0; color: var(--muted); background: transparent; cursor: pointer;
}
.bottom-nav small { max-width: 100%; font-size: 9px; font-weight: 750; overflow-wrap: anywhere; }
.bottom-nav a.active { color: var(--blue); }
.bottom-nav > a > svg { width: 23px; height: 23px; }
.order-button { transform: translateY(-18px); color: var(--blue-dark) !important; font-weight: 900; }
.order-icon {
  display: grid; place-items: center; width: 62px; height: 62px; border: 5px solid var(--background);
  border-radius: 21px; color: var(--blue-dark); background: var(--yellow);
  box-shadow: 0 8px 24px rgba(23,37,84,.22);
}
.order-icon svg { width: 28px; height: 28px; }

.sheet {
  width: 100%; max-width: none; max-height: 94dvh; margin: auto 0 0; padding: 0;
  border: 0; border-radius: 8px 8px 0 0; color: var(--text); background: white;
}
.sheet::backdrop { background: rgba(23,32,51,.58); backdrop-filter: blur(2px); }
.sheet-panel { display: flex; flex-direction: column; max-height: 94dvh; padding: 0 16px max(16px, env(safe-area-inset-bottom)); }
.sheet-handle { width: 44px; height: 4px; margin: 8px auto 12px; border-radius: 4px; background: var(--border); }
.sheet-header { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.icon-button { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; border: 1px solid var(--border); border-radius: 50%; color: var(--blue-dark); background: white; cursor: pointer; }
.progress-track { height: 4px; margin-bottom: 16px; overflow: hidden; border-radius: 4px; background: var(--border); }
.progress-track span { display: block; width: 16.66%; height: 100%; background: var(--blue); transition: width .2s ease; }
#orderContent { min-height: 260px; padding-bottom: 12px; overflow-y: auto; }
.sheet-actions { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 9px; padding-top: 13px; border-top: 1px solid var(--border); }
.choice-list { display: grid; gap: 8px; }
.choice {
  display: grid; grid-template-columns: auto minmax(0,1fr); gap: 10px; padding: 12px;
  border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
}
.choice:has(input:checked) { border-color: var(--blue); background: #eff6ff; }
.choice small { color: var(--muted); }
.field { display: grid; gap: 6px; margin-bottom: 13px; font-size: 13px; font-weight: 750; }
.field input, .field select, .field textarea {
  width: 100%; min-width: 0; min-height: 48px; padding: 11px 12px;
  border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); background: white;
}
.field textarea { min-height: 86px; resize: vertical; }
.field small { color: var(--muted); font-size: 11px; font-weight: 500; }
.field-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 9px; }
.summary-list { display: grid; gap: 8px; margin: 0 0 14px; }
.summary-row { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.summary-row span { color: var(--muted); font-size: 12px; }
.summary-row b { max-width: 62%; text-align: right; font-size: 12px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 16px; padding: 4px; background: #edf4fc; border-radius: var(--radius); }
.auth-tabs button { min-height: 42px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; }
.auth-tabs button.active { background: white; box-shadow: 0 2px 8px rgba(23,37,84,.08); font-weight: 800; }
.toast {
  position: fixed; z-index: 60; right: 16px; bottom: 92px; left: 16px; visibility: hidden;
  padding: 13px 16px; border-radius: var(--radius); color: white; background: var(--blue-dark);
  box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); transition: .2s;
}
.toast.show { visibility: visible; opacity: 1; transform: none; }

.icon, .contact-link-icon, .contact-action-icon, .benefit-icon, .category-icon { position: relative; }
.icon::before, .contact-link-icon::before, .contact-action-icon::before, .benefit-icon::before, .category-icon::before { display: block; font-size: 20px; line-height: 1; }
.icon-user::before { content: "○"; }
.icon-home::before { content: "⌂"; }
.icon-grid::before { content: "▦"; }
.icon-orders::before { content: "▤"; }
.icon-pin::before { content: "⌖"; }
.icon-message::before { content: "□"; }
.icon-clock::before { content: "◷"; }
.icon-check::before { content: "✓"; }
.icon-delivery::before { content: "▱"; }
.icon-wide::before { content: "▰"; }
.icon-sticker::before { content: "✦"; }
.icon-print::before { content: "▤"; }
.icon-structure::before { content: "▦"; }
.icon-textile::before { content: "T"; font-weight: 950; }
.icon-bag::before { content: "▱"; font-weight: 950; }
.icon-phone::before { content: "☎"; }
.icon-send::before { content: "➤"; }
.icon-search::before { content: "⌕"; }
.icon-max::before { content: "M"; font-weight: 950; }
.icon-mail::before { content: "@"; font-weight: 950; }

@media (min-width: 700px) {
  body { padding: 20px 0; background: #d7dde5; }
  .app-shell {
    width: 520px; max-width: calc(100% - 32px); min-height: calc(100dvh - 40px);
    margin-inline: auto; overflow-x: hidden; border-radius: 28px;
    box-shadow: 0 0 60px rgba(0,0,0,.12);
  }
  .topbar { border-radius: 28px 28px 0 0; }
  .bottom-nav {
    left: 50%; bottom: 20px; width: min(520px, calc(100% - 32px)); transform: translateX(-50%);
    border-radius: 0 0 28px 28px;
  }
  .sheet { width: min(520px, calc(100% - 32px)); margin: auto; border-radius: var(--radius); }
  .toast { right: calc(50% - 244px); left: calc(50% - 244px); }
}

@media (max-width: 370px) {
  .header-action span:not(.icon):not(.status-dot) { display: none; }
  .header-action { width: 40px; justify-content: center; padding-inline: 0; }
  .hero { padding-inline: 18px; }
  h1 { font-size: 30px; }
}

@media (max-width: 259px) {
  .page-section, .hero-wrap { padding-inline: 10px; }
  .topbar { padding-inline: 8px; }
  .brand small { display: none; }
  .category-card { grid-template-columns: 36px minmax(0,1fr); padding: 10px; gap: 8px; }
  .category-icon { width: 36px; height: 36px; }
  .category-arrow { display: none; }
  .bottom-nav small { font-size: 8px; }
  .order-icon { width: 50px; height: 50px; }
}
