:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --panel: #ffffff;
  --text: #18212f;
  --muted: #687386;
  --line: #e6e9ee;
  --primary: #0f7b6c;
  --primary-strong: #075f55;
  --accent: #e85d3f;
  --soft: #edf7f5;
  --shadow: 0 10px 30px rgba(18, 31, 49, .08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px max(18px, calc((100vw - 1180px) / 2));
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

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

.brand-logo-img {
  display: grid;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: inset 0 0 0 1px rgba(18, 31, 49, .08), 0 8px 18px rgba(18, 31, 49, .08);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 17px;
}

.brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.cart-button,
.cart-head button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
}

.cart-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.cart-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: var(--primary-strong);
}

.cart-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.cart-button:hover {
  border-color: rgba(15, 123, 108, .35);
  box-shadow: 0 8px 18px rgba(15, 123, 108, .12);
  transform: translateY(-1px);
}

#cartBadge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  line-height: 22px;
  text-align: center;
}

.layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 18px;
  width: min(1180px, calc(100vw - 36px));
  margin: 18px auto 44px;
}

.sidebar,
.notice,
.search-panel,
.list-head,
.product-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sidebar {
  position: sticky;
  top: 84px;
  align-self: start;
  max-height: calc(100vh - 104px);
  overflow: auto;
}

.panel-title {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}

.category-list {
  padding: 8px;
}

.category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.category-item span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-item span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.category-item.active {
  background: var(--soft);
  color: var(--primary-strong);
  font-weight: 700;
}

.content {
  min-width: 0;
}

.notice {
  display: flex;
  gap: 10px;
  padding: 13px 14px;
  color: var(--muted);
  line-height: 1.55;
}

.notice strong {
  color: var(--accent);
  white-space: nowrap;
}

.search-panel {
  margin-top: 12px;
  padding: 14px;
}

.search-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfc;
}

.search-box span {
  color: var(--muted);
  font-size: 14px;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.mobile-categories {
  display: none;
}

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding: 14px;
}

.list-head h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.list-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.list-head select {
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.product-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.product-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.product-card:hover {
  border-color: rgba(15, 123, 108, .35);
  box-shadow: var(--shadow);
}

.product-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(18, 31, 49, .08), 0 8px 20px rgba(18, 31, 49, .08);
}

.brand-logo {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
}

.brand-logo svg {
  display: block;
  width: 34px;
  height: 34px;
}

.brand-mail,
.brand-sms {
  border-radius: 8px;
  background: transparent;
}

.product-main {
  min-width: 0;
}

.product-title {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.45;
  font-size: 15px;
  font-weight: 650;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.tag {
  padding: 3px 7px;
  border-radius: 999px;
  background: #f1f3f5;
}

.product-buy {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.price {
  color: var(--accent);
  font-size: 18px;
  font-weight: 800;
}

.add-button {
  min-width: 92px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.add-button:disabled {
  cursor: not-allowed;
  background: #c8ced6;
}

.empty-state {
  padding: 32px 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.cart-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(10, 18, 28, .28);
  backdrop-filter: blur(2px);
}

.category-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(10, 18, 28, .22);
  backdrop-filter: blur(2px);
}

.category-drawer {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 50;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(340px, calc(100vw - 72px));
  height: calc(100vh - 24px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 0 8px 8px 0;
  background: #fff;
  box-shadow: 18px 0 38px rgba(10, 18, 28, .14);
  transform: translateX(calc(-100% - 18px));
  transition: transform .2s ease;
}

.category-drawer.open {
  transform: translateX(0);
}

.category-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.category-drawer-head strong,
.category-drawer-head span {
  display: block;
}

.category-drawer-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.category-drawer-head button {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.category-drawer-list {
  overflow: auto;
  padding: 10px;
}

.category-drawer-list .category-item {
  min-height: 42px;
  margin-bottom: 4px;
}

.cart-drawer {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 50;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(420px, calc(100vw - 72px));
  height: calc(100vh - 24px);
  background: #fff;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 8px 0 0 8px;
  box-shadow: -18px 0 38px rgba(10, 18, 28, .16);
  transform: translateX(calc(100% + 18px));
  transition: transform .2s ease;
  overflow: hidden;
}

.cart-drawer.open {
  transform: translateX(0);
}

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.cart-head strong,
.cart-head span {
  display: block;
}

.cart-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.cart-head button {
  height: 36px;
  padding: 0 12px;
}

.cart-items {
  overflow: auto;
  padding: 10px 12px;
}

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

.cart-item-main {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
}

.cart-item-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(18, 31, 49, .08), 0 6px 14px rgba(18, 31, 49, .07);
}

.cart-item-icon .brand-logo,
.cart-item-icon .brand-logo svg {
  width: 26px;
  height: 26px;
}

.cart-item-copy {
  min-width: 0;
}

.cart-item-title {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
}

.cart-item small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.qty {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.qty span {
  min-width: 24px;
  text-align: center;
}

.cart-footer {
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: #fff;
}

.total-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.total-line strong {
  color: var(--accent);
  font-size: 22px;
}

.checkout-button {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.checkout-button:disabled {
  cursor: not-allowed;
  background: #c8ced6;
}

.contact-field {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.contact-field span,
.subscribe-field,
.cart-note {
  color: var(--muted);
  font-size: 12px;
}

.contact-field input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  outline: 0;
}

.contact-field input:focus {
  border-color: rgba(15, 123, 108, .45);
  box-shadow: 0 0 0 3px rgba(15, 123, 108, .1);
}

.contact-field input.invalid {
  border-color: rgba(232, 93, 63, .7);
  box-shadow: 0 0 0 3px rgba(232, 93, 63, .12);
}

.subscribe-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.subscribe-field input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.cart-note {
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 8px;
  background: #f8faf9;
  line-height: 1.5;
}

.cart-note strong {
  display: block;
  margin-bottom: 3px;
  color: var(--primary-strong);
}

.cart-note p {
  margin: 0;
}

.cart-footer p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.telegram-service {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #1677a8;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.telegram-service svg {
  width: 20px;
  height: 20px;
}

.mobile-nav {
  display: none;
}

@media (max-width: 760px) {
  .site-header {
    padding: 12px 14px;
  }

  .brand-logo-img {
    width: 36px;
    height: 36px;
  }

  .brand strong {
    font-size: 16px;
  }

  .brand span {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .layout {
    display: block;
    width: auto;
    margin: 10px 10px 76px;
  }

  .sidebar {
    display: none;
  }

  .notice {
    align-items: flex-start;
    padding: 12px;
    font-size: 13px;
  }

  .search-panel {
    position: sticky;
    top: 61px;
    z-index: 15;
    margin-top: 10px;
    padding: 10px;
    box-shadow: 0 8px 18px rgba(18, 31, 49, .06);
  }

  .search-box {
    height: 42px;
  }

  .mobile-categories {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-top: 10px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .mobile-categories::-webkit-scrollbar {
    display: none;
  }

  .mobile-categories .category-item {
    flex: 0 0 auto;
    width: auto;
    min-height: 34px;
    border: 1px solid var(--line);
    background: #fff;
    white-space: nowrap;
  }

  .mobile-categories .category-item.active {
    border-color: rgba(15, 123, 108, .35);
    background: var(--soft);
  }

  .mobile-categories .category-item span:last-child {
    display: none;
  }

  .list-head {
    margin-top: 10px;
    padding: 12px;
  }

  .list-head h1 {
    font-size: 18px;
  }

  .list-head select {
    max-width: 128px;
    font-size: 13px;
  }

  .product-list {
    gap: 8px;
    margin-top: 10px;
  }

  .product-card {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    padding: 11px;
  }

  .product-icon {
    width: 40px;
    height: 40px;
  }

  .brand-logo,
  .brand-logo svg {
    width: 30px;
    height: 30px;
  }

  .product-title {
    font-size: 14px;
  }

  .product-buy {
    grid-column: 1 / -1;
    grid-template-columns: 1fr auto;
    align-items: center;
    justify-items: start;
    width: 100%;
    margin-top: 2px;
  }

  .add-button {
    justify-self: end;
  }

  .mobile-nav {
    position: fixed;
    right: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
  }

  .mobile-nav a,
  .mobile-nav button {
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 44px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
  }

  .mobile-nav svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
  }

  .mobile-nav span {
    line-height: 1;
  }

  .mobile-nav .active {
    background: var(--soft);
    color: var(--primary-strong);
    font-weight: 700;
  }

  .category-drawer {
    top: 10px;
    left: 0;
    width: calc(100vw - 34px);
    max-width: 380px;
    height: calc(100vh - 20px);
    border-radius: 0 8px 8px 0;
  }

  .category-backdrop {
    background: rgba(10, 18, 28, .18);
  }

  .cart-drawer {
    top: 10px;
    right: 0;
    width: calc(100vw - 34px);
    max-width: 420px;
    height: calc(100vh - 20px);
    border-radius: 8px 0 0 8px;
  }

  .cart-backdrop {
    background: rgba(10, 18, 28, .22);
  }
}
