:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f6f7f9;
  --text: #161b23;
  --muted: #6b7280;
  --line: #e2e5ea;
  --accent: #ff4b16;
  --accent-dark: #d93809;
  --shadow: 0 14px 34px rgba(21, 28, 38, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

textarea[readonly] {
  color: var(--muted);
  background: var(--surface-soft);
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

.app {
  min-height: 100vh;
  border-top: 1px solid transparent;
}

.topbar,
main,
.footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  height: 130px;
  display: flex;
  align-items: center;
  gap: 40px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 94px;
  width: 94px;
  height: 94px;
  overflow: hidden;
}

.brand img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nav {
  display: flex;
  justify-content: flex-end;
  gap: 64px;
  width: 100%;
  color: var(--text);
  font-size: 18px;
  font-weight: 500;
}

.cart-button,
.icon-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.cart-button {
  position: relative;
  min-width: 78px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(21, 28, 38, 0.08);
}

.cart-glyph {
  position: relative;
  width: 25px;
  height: 20px;
  border: 2px solid currentColor;
  border-top: 0;
  transform: skewX(-8deg);
}

.cart-glyph::before {
  content: "";
  position: absolute;
  left: -6px;
  top: -7px;
  width: 9px;
  height: 2px;
  background: currentColor;
  transform: rotate(20deg);
}

.cart-glyph::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: -8px;
  height: 5px;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-left: 0;
  border-right: 0;
}

#cartCount {
  position: absolute;
  right: 15px;
  top: 11px;
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.hero {
  min-height: 235px;
  display: flex;
  align-items: end;
  padding: 54px 24px 38px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 860px;
  margin-bottom: 20px;
  font-size: clamp(40px, 5.2vw, 56px);
  line-height: 1.03;
  letter-spacing: 0;
}

.lead {
  max-width: 560px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 23px;
  line-height: 1.42;
}

.filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 24px;
  align-items: end;
  width: min(100%, 1400px);
  margin: 0 auto;
  padding: 31px 28px 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.filter-wide {
  grid-column: span 2;
}

.filters-actions {
  display: grid;
  gap: 12px;
  grid-column: span 2;
}

label {
  display: grid;
  gap: 12px;
  min-width: 0;
}

label span {
  color: var(--text);
  font-size: 17px;
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  min-height: 60px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 20px;
  outline: none;
  font-size: 17px;
}

textarea {
  min-height: 92px;
  padding-top: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 75, 22, 0.12);
}

select:disabled {
  color: #8d95a2;
  background: #fff;
}

button,
.secondary {
  min-height: 66px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 0 18px;
  font-weight: 800;
}

button:hover {
  background: var(--accent-dark);
}

.secondary {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.secondary:hover {
  background: var(--surface-soft);
}

.catalog-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 30px 0 18px;
}

.catalog-head h2 {
  margin-bottom: 6px;
  font-size: 24px;
}

.catalog-head p {
  margin-bottom: 0;
  color: var(--muted);
}

.catalog-head select {
  width: 220px;
}

.results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 66px;
  margin-top: 22px;
}

.pagination span {
  min-width: 150px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.pagination button {
  min-width: 118px;
}

.pagination button:disabled {
  cursor: default;
  opacity: 0.45;
}

.pagination button:disabled:hover {
  background: var(--accent);
}

.pagination .secondary:disabled:hover {
  background: var(--surface);
}

.card {
  min-height: 242px;
  display: grid;
  align-content: space-between;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.card h3 {
  margin: 0 0 7px;
  font-size: 20px;
  line-height: 1.2;
}

.card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.card-specs {
  min-height: 22px;
  font-size: 14px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.badge {
  display: inline-flex;
  min-height: 68px;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: #4f5865;
  padding: 0 14px 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.badge img {
  display: block;
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.badge-season img {
  width: 63px;
  height: 63px;
}

.badge-stock {
  color: #3f3a2c;
}

.badge-stock img {
  width: 63px;
  height: 63px;
}

.badge-icon-only {
  min-width: 72px;
  justify-content: center;
  padding: 0 5px;
}

.card-bottom {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.price {
  font-size: 24px;
  font-weight: 900;
}

.empty {
  grid-column: 1 / -1;
  min-height: 335px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 38px;
  font-size: 18px;
  line-height: 1.5;
}

.empty::before {
  content: "";
  display: block;
  width: 78px;
  height: 78px;
  margin: 0 auto 24px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: radial-gradient(circle, transparent 18px, #a2a9b3 19px, #a2a9b3 21px, transparent 22px), #f7f8fa;
  box-shadow: 0 12px 28px rgba(21, 28, 38, 0.08);
}

.info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  overflow: hidden;
  margin: 36px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.info div {
  display: grid;
  gap: 6px;
  padding: 20px;
  background: var(--surface);
}

.info span,
.footer {
  color: var(--muted);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 0 0 36px;
}

.footer a {
  color: var(--text);
  font-weight: 800;
}

.order-dialog {
  width: min(560px, calc(100% - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 28px 80px rgba(21, 28, 38, 0.28);
}

.order-dialog::backdrop {
  background: rgba(20, 24, 31, 0.38);
}

.dialog-shell {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.dialog-shell header,
.dialog-shell footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.dialog-shell h2 {
  margin-bottom: 4px;
}

.dialog-shell p {
  margin-bottom: 0;
  color: var(--muted);
}

.icon-button {
  width: 40px;
  min-height: 40px;
  padding: 0;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.cart-list,
.order-form {
  display: grid;
  gap: 12px;
}

.info a,
.order-note a {
  color: var(--accent-dark);
  font-weight: 800;
}

.order-options {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.order-options legend {
  padding: 0 6px;
  color: var(--text);
  font-size: 17px;
  font-weight: 500;
}

.radio-option {
  display: flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.radio-option input {
  width: 20px;
  min-height: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.radio-option span {
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.order-note {
  margin: 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  line-height: 1.45;
}

.cart-row {
  display: grid;
  grid-template-columns: 1fr 148px 34px;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cart-row b {
  display: block;
  margin-bottom: 4px;
}

.cart-row small {
  color: var(--muted);
}

.cart-row input {
  min-height: 38px;
  padding: 0 8px;
}

.cart-sets {
  display: grid;
  gap: 6px;
}

.cart-sets span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.cart-sets small {
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.quantity-stepper {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  gap: 4px;
}

.quantity-button,
.set-quantity-button {
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
  padding: 0;
}

.quantity-button {
  font-size: 22px;
  line-height: 1;
}

.quantity-button:hover,
.set-quantity-button:hover {
  background: #eceff3;
}

.quantity-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.quantity-button:disabled:hover {
  background: var(--surface-soft);
}

.quantity-input {
  text-align: center;
  -moz-appearance: textfield;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.set-quantity-button {
  width: 100%;
  min-height: 34px;
  padding: 0 8px;
  font-size: 12px;
  line-height: 1.1;
}

.remove {
  min-height: 34px;
  padding: 0;
  background: var(--surface-soft);
  color: var(--text);
}

.status {
  min-height: 20px;
  font-size: 14px;
}

.status.ok {
  color: #167a42;
}

.status.error {
  color: #b42318;
}

.admin-page {
  width: min(1060px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0;
}

.admin-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.admin-head h1 {
  margin-bottom: 8px;
  font-size: 44px;
}

.admin-head p {
  margin-bottom: 0;
  color: var(--muted);
}

.admin-head button {
  min-width: 150px;
}

.admin-top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-tabs {
  display: inline-flex;
  gap: 8px;
}

.admin-tabs button {
  min-width: 112px;
}

.admin-tabs button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.admin-tabs button.is-active:hover {
  background: var(--accent-dark);
}

.admin-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.admin-section-head h2 {
  margin-bottom: 6px;
  font-size: 28px;
}

.admin-section-head p {
  margin-bottom: 0;
  color: var(--muted);
}

.admin-section-actions {
  display: flex;
  gap: 10px;
}

.admin-pricing {
  display: grid;
  gap: 16px;
  margin-bottom: 34px;
}

.admin-stock {
  display: grid;
  gap: 16px;
  margin-bottom: 34px;
}

.admin-site {
  display: grid;
  gap: 16px;
  margin-bottom: 34px;
}

.admin-pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 16px;
  align-items: start;
}

.admin-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.admin-panel h3 {
  margin: 0;
  font-size: 20px;
}

.admin-stock-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.admin-stock-stats div {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.admin-stock-stats span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.admin-stock-stats b {
  font-size: 20px;
}

.admin-sync-log {
  display: grid;
  gap: 10px;
}

.admin-sync-entry {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: 8px;
}

.admin-sync-entry.is-ok {
  border-left-color: #157347;
}

.admin-sync-entry.is-error {
  border-left-color: #b42318;
}

.admin-sync-entry div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.admin-sync-entry span,
.admin-sync-entry p {
  margin: 0;
  color: var(--muted);
}

.admin-sync-error {
  color: #b42318 !important;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.admin-form-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.admin-form-row-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-inline-check {
  width: fit-content;
}

.admin-rules {
  display: grid;
  gap: 10px;
}

.admin-rule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.admin-rule div {
  display: grid;
  gap: 4px;
}

.admin-rule b {
  font-size: 15px;
}

.admin-rule span,
.admin-rule small {
  color: var(--muted);
}

.admin-rule.is-active {
  border-color: #b9dfca;
  background: #f3fbf6;
}

.admin-orders-head {
  margin-top: 4px;
}

.admin-order-tools {
  display: grid;
  grid-template-columns: minmax(240px, 1.6fr) repeat(3, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.admin-order-tools label {
  gap: 8px;
}

.admin-order-tools span {
  font-size: 14px;
  font-weight: 800;
}

.admin-order-tools input,
.admin-order-tools select {
  min-height: 46px;
  padding: 0 14px;
  font-size: 15px;
}

.admin-orders {
  display: grid;
  gap: 14px;
}

.admin-order {
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.admin-order header,
.admin-items div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.admin-order h2 {
  margin-bottom: 4px;
  font-size: 22px;
}

.admin-order header span,
.admin-customer p {
  color: var(--muted);
}

.admin-order strong {
  font-size: 22px;
}

.admin-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.admin-statuses {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.admin-check {
  display: inline-flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  cursor: pointer;
}

.admin-check input {
  width: 20px;
  min-height: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.admin-check span {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}

.admin-telegram {
  display: inline-grid;
  gap: 2px;
  min-width: min(100%, 260px);
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.admin-telegram b {
  color: var(--text);
  font-size: 15px;
}

.admin-telegram span {
  color: #b42318;
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.admin-telegram.is-ok b {
  color: #157347;
}

.admin-telegram.is-muted b {
  color: var(--muted);
}

.admin-delete {
  min-height: 42px;
  border: 1px solid #f3c3bd;
  background: #fff;
  color: #b42318;
  padding: 0 14px;
}

.admin-delete:hover {
  background: #fff4f2;
}

.admin-customer {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.admin-customer a {
  width: fit-content;
  color: var(--accent-dark);
  font-weight: 800;
}

.admin-customer p {
  margin-bottom: 0;
}

.admin-items {
  display: grid;
  gap: 10px;
}

.admin-items div {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

@media (max-width: 980px) {
  .nav {
    display: none;
  }

  .results,
  .info {
    grid-template-columns: 1fr 1fr;
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .filter-wide,
  .filters-actions {
    grid-column: 1 / -1;
  }

  .filters-actions button {
    width: 100%;
  }
}

@media (max-width: 680px) {
  .topbar,
  main,
  .footer {
    width: min(100% - 28px, 1180px);
  }

  .topbar {
    height: 92px;
  }

  .brand {
    flex-basis: 62px;
    width: 62px;
    height: 62px;
  }

  .hero {
    min-height: 0;
    padding: 42px 0 28px;
  }

  h1 {
    font-size: 40px;
  }

  .lead {
    font-size: 18px;
  }

  .filters,
  .results,
  .info {
    grid-template-columns: 1fr;
  }

  .filter-wide,
  .filters-actions {
    grid-column: auto;
  }

  .catalog-head {
    display: grid;
  }

  .catalog-head select {
    width: 100%;
  }

  .card-bottom {
    grid-template-columns: 1fr;
  }

  .card-bottom button {
    width: 100%;
  }

  .pagination {
    display: grid;
  }

  .pagination button,
  .pagination span {
    width: 100%;
  }

  .cart-row {
    grid-template-columns: 1fr 34px;
    align-items: start;
  }

  .cart-sets {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .dialog-shell footer {
    display: grid;
  }

  .admin-page {
    width: min(100% - 28px, 1060px);
  }

  .admin-head,
  .admin-top-actions,
  .admin-tabs,
  .admin-section-head,
  .admin-section-actions,
  .admin-pricing-grid,
  .admin-form-row,
  .admin-rule,
  .admin-order-tools,
  .admin-order header,
  .admin-actions,
  .admin-statuses,
  .admin-items div {
    display: grid;
  }

  .admin-pricing-grid,
  .admin-form-row,
  .admin-order-tools,
  .admin-stock-stats {
    grid-template-columns: 1fr;
  }

  .admin-sync-entry div {
    display: grid;
  }
}
