:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --surface: #ffffff;
  --surface-soft: #eef3eb;
  --text: #172018;
  --muted: #6b756d;
  --line: #dfe7dc;
  --accent: #0f7c61;
  --accent-dark: #095f4a;
  --warning: #b35c1e;
  --shadow: 0 18px 50px rgba(18, 31, 24, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.app-shell {
  max-width: 1040px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 96px 20px 20px;
}

.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 247, 244, 0.94);
  padding: 12px max(20px, calc((100vw - 1040px) / 2 + 20px));
  backdrop-filter: blur(14px);
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 900;
}

.site-logo img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.site-nav button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font-weight: 800;
}

.site-nav button:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.compact-btn {
  min-height: 42px;
  padding: 0 14px;
}

.public-view {
  display: grid;
  gap: 18px;
}

.public-section {
  scroll-margin-top: 94px;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(260px, 0.75fr);
  align-items: center;
  gap: 28px;
  min-height: calc(100vh - 130px);
}

.hero-copy {
  display: grid;
  gap: 14px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-actions .primary-btn,
.hero-actions .ghost-btn {
  padding: 0 18px;
}

.hero-brand {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10130f;
  min-height: 360px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.hero-brand img {
  width: min(340px, 100%);
  border-radius: 8px;
}

.about-section,
.contacts-section {
  display: grid;
  gap: 18px;
  padding: 30px 0;
}

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

.story-card {
  display: grid;
  gap: 12px;
  max-width: 880px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow);
}

.story-card p {
  margin-bottom: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
}

.info-grid article,
.contacts-grid > div {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}

.contact-link {
  color: var(--accent-dark);
  font-size: 17px;
  font-weight: 900;
  text-decoration: none;
}

.contact-link:hover {
  text-decoration: underline;
}

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

.contacts-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.auth-view {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 420px);
  align-items: center;
  min-height: calc(100vh - 40px);
  gap: 28px;
}

.product-page {
  min-height: calc(100vh - 40px);
  padding: 10px 0 96px;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0 18px;
}

.product-page-body {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: start;
}

.register-view {
  max-width: 680px;
  min-height: calc(100vh - 40px);
  margin: 0 auto;
  padding: 32px 0;
}

.pending-view {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 40px);
}

.admin-view {
  min-height: calc(100vh - 40px);
  padding: 10px 0 96px;
}

.admin-login-card,
.admin-panel {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
  box-shadow: var(--shadow);
}

.admin-login-card {
  max-width: 420px;
}

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

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.admin-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.admin-row h3 {
  margin: 0 0 6px;
  font-size: 17px;
}

.admin-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.danger-btn {
  min-height: 40px;
  border: 1px solid #f0c8bb;
  border-radius: 8px;
  background: #fff6f3;
  color: var(--warning);
  padding: 0 12px;
  font-weight: 800;
}

.status-pill.rejected {
  background: #fce5df;
  color: var(--warning);
}

.status-pill.new {
  background: #e8edf7;
  color: #41516d;
}

.pending-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow);
}

.register-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 0;
  text-align: center;
}

.brand-logo {
  display: block;
  width: min(260px, 72vw);
  height: auto;
  margin-bottom: 18px;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(18, 31, 24, 0.18);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 560px;
  margin-bottom: 12px;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 26px;
}

.lead {
  max-width: 520px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.auth-card,
.register-card,
.client-panel,
.product-card,
.orders-panel,
.cart-drawer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.auth-card,
.register-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  box-shadow: var(--shadow);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

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

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

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 124, 97, 0.14);
}

.primary-btn,
.ghost-btn,
.icon-btn,
.qty-btn,
.link-btn {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}

.link-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--accent-dark);
  padding: 0 12px;
}

.primary-btn {
  background: var(--accent);
  color: #fff;
}

.primary-btn:hover {
  background: var(--accent-dark);
}

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

.muted {
  color: var(--muted);
  font-size: 13px;
}

.topbar,
.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  padding: 10px 0 18px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-logo {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 8px 22px rgba(18, 31, 24, 0.16);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 22px;
}

.client-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 14px;
  margin-bottom: 16px;
}

.client-panel > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.controls {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  gap: 10px;
  padding: 10px 0 14px;
  background: var(--bg);
}

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.category-tabs button {
  flex: 0 0 auto;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 0 14px;
  color: var(--muted);
  font-weight: 800;
}

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

.product-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-bottom: 16px;
}

.product-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
}

.product-visual {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--accent);
  font-size: 34px;
  font-weight: 900;
}

.product-info {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.product-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  border-radius: 999px;
  background: var(--surface-soft);
  padding: 5px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

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

.stock-warning {
  color: var(--warning);
}

.qty-control {
  display: grid;
  grid-template-columns: 38px 42px 38px;
  align-items: center;
  gap: 4px;
}

.qty-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.qty-value {
  text-align: center;
  font-weight: 900;
}

.cart-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  border: 0;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  padding: 0 18px;
  box-shadow: var(--shadow);
  font-weight: 900;
}

.cart-fab strong {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent);
}

.cart-drawer {
  position: fixed;
  top: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 10;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  width: min(420px, calc(100vw - 24px));
  padding: 16px;
  box-shadow: var(--shadow);
}

.cart-items {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding: 14px 0;
}

.cart-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.cart-line-top,
.cart-line-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cart-line h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.remove-btn {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--warning);
  padding: 0 10px;
  font-weight: 800;
}

.checkout-form {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.cart-summary {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.cart-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 18px;
}

.orders-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 100px;
  padding: 14px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.orders-list {
  display: grid;
  gap: 8px;
}

.order-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.order-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.order-row h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.status-pill {
  border-radius: 999px;
  background: #dff2ea;
  color: var(--accent-dark);
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 900;
}

.detail-body {
  display: grid;
  gap: 14px;
}

.detail-visual {
  display: grid;
  place-items: center;
  min-height: 360px;
  border-radius: 8px;
  background: linear-gradient(135deg, #eaf1e7, #ffffff);
  color: var(--accent);
  font-size: 118px;
  font-weight: 900;
}

.detail-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
  box-shadow: var(--shadow);
}

.detail-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.detail-grid > div {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.detail-grid strong {
  font-size: 15px;
}

.detail-description {
  color: var(--muted);
  line-height: 1.5;
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  width: min(360px, calc(100vw - 32px));
  transform: translateX(-50%);
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  padding: 13px 16px;
  text-align: center;
  font-weight: 800;
}

@media (max-width: 760px) {
  .app-shell {
    padding: 86px 14px 14px;
  }

  .site-header {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 10px 14px;
  }

  .site-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .site-logo img {
    width: 38px;
    height: 38px;
  }

  .hero-section {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 18px 0 10px;
  }

  .hero-brand {
    min-height: 230px;
  }

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

  .auth-view {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 12px;
  }

  .register-view {
    min-height: calc(100vh - 28px);
    padding: 14px 0;
  }

  .admin-row {
    grid-template-columns: 1fr;
  }

  .admin-actions {
    justify-content: flex-start;
  }

  .product-page {
    min-height: calc(100vh - 28px);
    padding-bottom: 88px;
  }

  .product-page-body {
    grid-template-columns: 1fr;
  }

  .detail-header {
    align-items: flex-start;
  }

  .detail-visual {
    min-height: 230px;
    font-size: 86px;
  }

  .detail-title {
    font-size: 24px;
  }

  h1 {
    font-size: 48px;
  }

  .lead {
    font-size: 16px;
  }

  .client-panel {
    grid-template-columns: 1fr;
  }

  .product-list {
    grid-template-columns: 1fr;
  }

  .product-card {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .product-visual {
    width: 78px;
    height: 78px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-actions {
    grid-template-columns: 1fr;
  }

  .order-row {
    grid-template-columns: 1fr;
  }

  .order-actions {
    justify-content: flex-start;
  }
}
