/* TAIR Industrial Console - production visual layer.
   Visual-only overrides. Existing Mini App logic and API contracts are unchanged. */

:root {
  --premium-ink: #1c2430;
  --premium-soft: #66717e;
  --premium-muted: #7b8694;
  --premium-line: rgba(28, 36, 48, .105);
  --premium-blue: #174a83;
  --premium-blue-strong: #17477a;
  --premium-shadow: 0 4px 18px rgba(24, 35, 50, .045);
  --steel-1: #e7ebee;
  --steel-2: #c8d0d6;
  --steel-3: #f1f3f4;
  --steel-4: #bcc5cc;
  --bg: #d7dde2;
  --card: #ffffff;
  --text: #1c2430;
  --muted: #75808e;
  --border: rgba(28, 36, 48, .105);
  --accent: #174a83;
  --accent-strong: #17477a;
  --accent-soft: #eef4fa;
  --success: #18864b;
  --warning: #a96816;
}

html {
  color-scheme: light;
  background: #cbd2d8;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Inter, Arial, sans-serif;
  font-weight: 400;
  letter-spacing: -.005em;
  background:
    radial-gradient(circle at 12% -4%, rgba(255,255,255,.92) 0, rgba(255,255,255,0) 30%),
    radial-gradient(circle at 92% 18%, rgba(255,255,255,.42) 0, rgba(255,255,255,0) 25%),
    linear-gradient(118deg,
      var(--steel-1) 0%,
      var(--steel-2) 25%,
      var(--steel-3) 48%,
      var(--steel-4) 72%,
      #e5e9ec 100%);
  background-attachment: fixed;
  color: var(--premium-ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app-shell {
  padding-bottom: 88px;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.02));
}

.topbar {
  align-items: flex-start;
  justify-content: flex-start;
  padding: calc(22px + env(safe-area-inset-top)) 18px 18px;
}

.brand-block { min-width: 0; }
.wordmark {
  font-size: clamp(30px, 7.5vw, 39px);
  line-height: .96;
  font-weight: 760;
  letter-spacing: .075em;
  color: var(--premium-ink);
}
.wordmark::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 5px;
  border-radius: 2px;
  background: var(--premium-blue);
  transform: translateY(-15px);
}
.brand-subtitle {
  margin-top: 6px;
  color: var(--premium-soft);
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: .01em;
}

.price-updated-date {
  margin-top: 4px;
  color: var(--premium-muted);
  font-size: 10px;
  line-height: 1.25;
  font-weight: 400;
  letter-spacing: .005em;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

main { padding: 0 14px 24px; }

.search-block,
.contact-card,
.cart-summary {
  border: 1px solid var(--premium-line);
  background: rgba(255,255,255,.84);
  box-shadow: 0 6px 24px rgba(38,48,59,.055);
  backdrop-filter: blur(18px) saturate(112%);
}
.search-block {
  margin-bottom: 18px;
  padding: 13px;
  border-radius: 17px;
}
.search-label {
  display: block;
  margin-bottom: 7px;
  color: #697582;
  font-size: 10.5px;
  font-weight: 560;
  letter-spacing: .075em;
  text-transform: uppercase;
}
.search-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 8px;
}
.search-field-wrap { position: relative; min-width: 0; }
.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  border: 1.6px solid var(--premium-muted);
  border-radius: 50%;
  opacity: .76;
  pointer-events: none;
}
.search-icon::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 1.6px;
  right: -5px;
  bottom: -2px;
  background: var(--premium-muted);
  border-radius: 2px;
  transform: rotate(45deg);
  transform-origin: left center;
}
input[type="search"] {
  width: 100%;
  min-width: 0;
  padding: 12px 12px 12px 43px;
  border: 1px solid var(--premium-line);
  border-radius: 12px;
  background: rgba(250,252,253,.84);
  color: var(--premium-ink);
  font-size: 15px;
  font-weight: 420;
  outline: none;
  box-shadow: none;
}
input[type="search"]:focus {
  border-color: rgba(23,74,131,.48);
  box-shadow: 0 0 0 3px rgba(23,74,131,.075);
}
#clearSearch {
  padding: 9px 3px;
  border: 0;
  background: transparent;
  color: var(--premium-blue);
  font-size: 12px;
  font-weight: 560;
  box-shadow: none;
}
.search-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
}
.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 9px;
  border-radius: 999px;
  background: rgba(245,247,249,.90);
  color: #596575;
  font-size: 12px;
  font-weight: 520;
}
.check-row input { width: 15px; height: 15px; margin: 0; accent-color: var(--premium-blue); }
.search-hint { color: var(--premium-muted); font-size: 11px; font-weight: 400; }

.notice {
  border-color: var(--premium-line);
  background: rgba(255,255,255,.84);
  box-shadow: var(--premium-shadow);
  backdrop-filter: blur(14px);
}

.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 10px;
}
.section-kicker {
  color: var(--premium-blue);
  font-size: 9.5px;
  line-height: 1;
  font-weight: 620;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.results-count {
  min-width: 50px;
  padding: 5px 8px;
  border: 1px solid rgba(28,36,48,.09);
  border-radius: 999px;
  background: rgba(255,255,255,.70);
  color: #485462;
  text-align: center;
  font-size: 11px;
  font-weight: 560;
}

.product-list,
.cart-list,
.orders-list { display: grid; gap: 8px; }
.product-card,
.cart-item,
.order-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--premium-line);
  border-radius: 15px;
  background: rgba(255,255,255,.91);
  box-shadow: var(--premium-shadow);
}
.product-card { padding: 13px 14px 13px 16px; }
.product-card::before,
.order-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--premium-blue);
  opacity: .72;
}
.product-top,
.cart-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
/* В рабочем каталоге внутренний article скрыт. Название становится главным заголовком карточки. */
#productList .product-name {
  margin: 0;
  color: var(--premium-ink);
  font-size: 17.5px;
  line-height: 1.2;
  font-weight: 640;
  letter-spacing: -.018em;
}
.article {
  color: var(--premium-ink);
  font-size: 18px;
  line-height: 1.16;
  font-weight: 640;
  letter-spacing: -.018em;
}
.product-name {
  color: #737e8c;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 400;
}
.product-meta {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: end;
  gap: 10px 14px;
  margin: 12px 0 0;
}
.price {
  color: #202a36;
  font-size: 17px;
  line-height: 1.18;
  font-weight: 620;
  letter-spacing: -.014em;
}
.stock { color: #7f8997; font-size: 11.5px; font-weight: 400; }
.status-badge {
  padding: 5px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 560;
}
.status-in { background: #eaf7ef; color: #18864b; }
.status-order { background: #fff4e5; color: #a96816; }

.primary {
  background: linear-gradient(180deg,#245b91 0%,#17477a 100%);
  color: #fff;
  box-shadow: 0 3px 10px rgba(23,71,122,.13);
  font-weight: 580;
}
.secondary,
.text-button,
.qty-button { font-weight: 540; }
.product-action {
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 580;
}
.product-action::after { content: "  →"; opacity: .78; }

.page-head { margin: 0 2px 16px; }
.page-head h2,
#checkoutDialog h2,
#quoteDialog h2 { font-weight: 610; letter-spacing: -.018em; }
.catalog-lead { margin: 6px 0 0; color: var(--premium-muted); font-size: 13px; line-height: 1.45; }

.contact-card { display: grid; overflow: hidden; padding: 0; }
.contact-row {
  display: grid;
  grid-template-columns: 42px minmax(0,1fr);
  gap: 12px;
  align-items: center;
  padding: 15px;
}
.contact-row + .contact-row { border-top: 1px solid var(--premium-line); }
.contact-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background-color: #eef4fa;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 19px;
}
.contact-icon-phone { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23174a83' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6A19.79 19.79 0 0 1 2.12 4.18 2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.12.9.33 1.78.62 2.63a2 2 0 0 1-.45 2.11L8 9.73a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.85.29 1.73.5 2.63.62A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E"); }
.contact-icon-mail { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23174a83' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 7 9 6 9-6'/%3E%3C/svg%3E"); }
.contact-icon-clock { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23174a83' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
.contact-label { color: var(--premium-muted); font-size: 10px; font-weight: 560; letter-spacing: .06em; text-transform: uppercase; }
.contact-value { display:block; margin-top:3px; color:var(--premium-ink); font-size:15.5px; font-weight:620; text-decoration:none; overflow-wrap:anywhere; }

.advanced-filters {
  margin-top: 10px;
  border-top: 1px solid var(--premium-line);
  color: var(--premium-soft);
}
.advanced-filters > summary { padding-top: 11px; font-size: 12px; font-weight: 520; color: var(--premium-blue); }
.filter-control { border-color: var(--premium-line) !important; background: rgba(250,252,253,.82) !important; color: var(--premium-ink) !important; }

.tabbar {
  grid-template-columns: repeat(4,1fr) !important;
  gap: 1px;
  padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
  background: rgba(249,250,251,.94);
  border-top: 1px solid var(--premium-line);
  box-shadow: 0 -7px 20px rgba(24,35,50,.045);
  backdrop-filter: blur(18px);
  z-index: 15;
}
.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 55px;
  padding: 7px 4px 5px;
  border: 0;
  border-radius: 12px;
  background: transparent !important;
  color: #7a8593;
  font-size: 10.5px;
  font-weight: 520;
}
.tab::before {
  content: "";
  width: 21px;
  height: 21px;
  background: currentColor;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
}
.tab::after {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  width: 22px;
  height: 1.5px;
  border-radius: 2px;
  background: transparent;
  transform: translateX(-50%);
}
.tab.active { color: var(--premium-blue); font-weight: 590; }
.tab.active::after { background: var(--premium-blue); }
.tab[data-view="catalogView"]::before { mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 3h6a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Zm10 0h6a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1ZM4 13h6a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-6a1 1 0 0 1 1-1Zm10 0h6a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-6a1 1 0 0 1 1-1Z'/%3E%3C/svg%3E"); -webkit-mask-image:var(--x); }
.tab[data-view="cartView"]::before { mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 3h2.2l1.6 10.2A2.2 2.2 0 0 0 9 15h8.6a2.2 2.2 0 0 0 2.1-1.6L21 8H7.2l-.3-2H22l-1.9 8a4.2 4.2 0 0 1-4.1 3H9a4.2 4.2 0 0 1-4.1-3.5L3.5 5H3V3Zm6 16a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm11 0a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z'/%3E%3C/svg%3E"); }
.tab[data-view="contactsView"]::before { mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M6.6 2.5 9.2 2a2 2 0 0 1 2.2 1.2l1.2 2.9a2 2 0 0 1-.5 2.2l-1.4 1.3a14.8 14.8 0 0 0 3.7 3.7l1.3-1.4a2 2 0 0 1 2.2-.5l2.9 1.2a2 2 0 0 1 1.2 2.2l-.5 2.6a3 3 0 0 1-3 2.4C9.6 19.8 4.2 14.4 4.2 5.5a3 3 0 0 1 2.4-3Z'/%3E%3C/svg%3E"); }
.tab[data-view="ordersView"]::before { mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M6 2h9l5 5v13a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2Zm8 2v4h4l-4-4ZM8 12h8v2H8v-2Zm0 4h8v2H8v-2ZM8 8h3v2H8V8Z'/%3E%3C/svg%3E"); }
.tab[data-view="catalogView"]::before { -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 3h6a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Zm10 0h6a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1ZM4 13h6a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-6a1 1 0 0 1 1-1Zm10 0h6a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-6a1 1 0 0 1 1-1Z'/%3E%3C/svg%3E"); }
.tab[data-view="cartView"]::before { -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 3h2.2l1.6 10.2A2.2 2.2 0 0 0 9 15h8.6a2.2 2.2 0 0 0 2.1-1.6L21 8H7.2l-.3-2H22l-1.9 8a4.2 4.2 0 0 1-4.1 3H9a4.2 4.2 0 0 1-4.1-3.5L3.5 5H3V3Zm6 16a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm11 0a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z'/%3E%3C/svg%3E"); }
.tab[data-view="contactsView"]::before { -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M6.6 2.5 9.2 2a2 2 0 0 1 2.2 1.2l1.2 2.9a2 2 0 0 1-.5 2.2l-1.4 1.3a14.8 14.8 0 0 0 3.7 3.7l1.3-1.4a2 2 0 0 1 2.2-.5l2.9 1.2a2 2 0 0 1 1.2 2.2l-.5 2.6a3 3 0 0 1-3 2.4C9.6 19.8 4.2 14.4 4.2 5.5a3 3 0 0 1 2.4-3Z'/%3E%3C/svg%3E"); }
.tab[data-view="ordersView"]::before { -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M6 2h9l5 5v13a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2Zm8 2v4h4l-4-4ZM8 12h8v2H8v-2Zm0 4h8v2H8v-2ZM8 8h3v2H8V8Z'/%3E%3C/svg%3E"); }

#checkoutDialog,
#quoteDialog {
  border-color: var(--premium-line);
  border-radius: 22px;
  background: rgba(255,255,255,.96);
  color: var(--premium-ink);
  box-shadow: 0 28px 70px rgba(0,0,0,.22);
}
#checkoutDialog::backdrop,
#quoteDialog::backdrop { background: rgba(9,14,21,.58); backdrop-filter: blur(3px); }

.order-card { padding: 14px 15px; }
.order-card-head strong,
.order-footer strong { font-weight: 620; }

@media (max-width:520px) {
  .topbar { padding-left:16px; padding-right:16px; }
  main { padding-left:14px; padding-right:14px; }
  .search-row { grid-template-columns:minmax(0,1fr) auto !important; }
  #clearSearch { width:auto !important; min-width:auto !important; }
  .product-meta { grid-template-columns:minmax(0,1fr) auto; }
}

@media (prefers-color-scheme:dark) {
  :root {
    --bg:#d7dde2;
    --card:#ffffff;
    --text:#1c2430;
    --muted:#75808e;
    --border:rgba(28,36,48,.105);
    --accent:#174a83;
    --accent-strong:#17477a;
    --accent-soft:#eef4fa;
    --success:#18864b;
    --warning:#a96816;
  }
  body { color:var(--premium-ink); }
}


/* Optional developer link: intentionally quiet and secondary to company contacts. */
.developer-about {
  margin: 14px 2px 0;
  padding-top: 10px;
  border-top: 1px solid rgba(28,36,48,.08);
  color: var(--premium-muted);
}
.developer-about[hidden] { display: none !important; }
.developer-about > summary {
  width: fit-content;
  cursor: pointer;
  list-style: none;
  color: #7b8694;
  font-size: 11.5px;
  line-height: 1.4;
  font-weight: 500;
  user-select: none;
}
.developer-about > summary::-webkit-details-marker { display: none; }
.developer-about > summary::after {
  content: " ›";
  display: inline-block;
  margin-left: 2px;
  transition: transform .16s ease;
}
.developer-about[open] > summary::after { transform: rotate(90deg); }
.developer-max-link {
  display: inline-block;
  margin-top: 8px;
  color: #66717e;
  font-size: 11.5px;
  line-height: 1.45;
  font-weight: 560;
  text-decoration: none;
}
.developer-max-link:focus-visible,
.developer-max-link:hover {
  color: var(--premium-blue);
  text-decoration: underline;
}
