:root {
  --bg: #f5f7f8;
  --panel: #ffffff;
  --ink: #18211f;
  --muted: #66736f;
  --line: #dce4e0;
  --green: #24785c;
  --green-dark: #145641;
  --blue: #2d5bd1;
  --gold: #d8a12c;
  --danger: #d9543f;
  --shadow: 0 16px 42px rgba(24, 33, 31, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(260px, 560px) auto;
  gap: 18px;
  align-items: center;
  padding: 14px clamp(16px, 4vw, 54px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand span {
  display: grid;
  width: 36px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  color: white;
  font-weight: 900;
}

.search {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.search input,
.buyer-form input,
.catalog-head select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

.search input {
  width: 100%;
  padding: 10px 12px;
}

.cart-button,
.checkout-button,
.add-button,
.filter-button,
.icon-button {
  border: 0;
  border-radius: 8px;
  font-weight: 850;
}

.cart-button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 13px;
  background: var(--ink);
  color: white;
}

.cart-button strong {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: var(--danger);
  font-size: 0.78rem;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 480px);
  gap: 28px;
  align-items: center;
  min-height: 620px;
  padding: clamp(52px, 8vw, 96px) clamp(16px, 5vw, 72px) 54px;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 42%, rgba(36, 120, 92, 0.2), transparent 30%),
    radial-gradient(circle at 12% 16%, rgba(216, 161, 44, 0.18), transparent 26%),
    linear-gradient(120deg, rgba(223, 244, 232, 0.98), rgba(220, 238, 248, 0.84)),
    #dff4e8;
}

.hero::before {
  position: absolute;
  inset: auto 0 0;
  height: 120px;
  content: "";
  background: linear-gradient(0deg, rgba(245, 247, 248, 1), rgba(245, 247, 248, 0));
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 5.7rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero p:not(.eyebrow) {
  color: #35443f;
  line-height: 1.55;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 22px;
}

.hero-points span {
  padding: 9px 11px;
  border: 1px solid rgba(20, 86, 65, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--green-dark);
  font-weight: 850;
}

.ai-orbit {
  position: relative;
  z-index: 1;
  width: min(100%, 480px);
  aspect-ratio: 1;
  justify-self: center;
}

.orbit-ring,
.orbit-core,
.orbit-node {
  position: absolute;
  border-radius: 999px;
}

.orbit-ring {
  inset: 12%;
  border: 1px solid rgba(24, 33, 31, 0.12);
  animation: spin 24s linear infinite;
}

.ring-two {
  inset: 24%;
  animation-duration: 18s;
  animation-direction: reverse;
}

.orbit-ring::before,
.orbit-ring::after {
  position: absolute;
  width: 12px;
  height: 12px;
  content: "";
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 22px rgba(36, 120, 92, 0.45);
}

.orbit-ring::before {
  top: -6px;
  left: 50%;
}

.orbit-ring::after {
  right: 8%;
  bottom: 12%;
  background: var(--gold);
}

.orbit-core {
  inset: 31%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px solid rgba(24, 33, 31, 0.08);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  text-align: center;
  animation: floatCore 5s ease-in-out infinite;
}

.orbit-core strong {
  font-size: clamp(1.5rem, 3vw, 2.4rem);
}

.orbit-core span {
  color: var(--muted);
  font-weight: 800;
}

.orbit-node {
  display: grid;
  min-width: 86px;
  min-height: 42px;
  place-items: center;
  padding: 9px 12px;
  border: 1px solid rgba(24, 33, 31, 0.08);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 34px rgba(24, 33, 31, 0.11);
  color: var(--ink);
  font-weight: 900;
  animation: bob 4s ease-in-out infinite;
}

.node-one {
  top: 8%;
  left: 44%;
}

.node-two {
  top: 28%;
  right: 2%;
  animation-delay: -0.8s;
}

.node-three {
  right: 12%;
  bottom: 16%;
  animation-delay: -1.4s;
}

.node-four {
  bottom: 8%;
  left: 24%;
  animation-delay: -2s;
}

.node-five {
  top: 32%;
  left: 0;
  animation-delay: -2.8s;
}

.node-six {
  top: 58%;
  left: 8%;
  animation-delay: -3.4s;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes floatCore {
  50% {
    transform: translateY(-10px) scale(1.02);
  }
}

@keyframes bob {
  50% {
    transform: translateY(-9px);
  }
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-block: 1px solid var(--line);
  background: white;
}

.stats div {
  display: grid;
  gap: 4px;
  padding: 18px;
  text-align: center;
}

.stats div + div {
  border-left: 1px solid var(--line);
}

.stats strong {
  font-size: 1.3rem;
}

.stats span {
  color: var(--muted);
  font-weight: 750;
}

.market {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 18px 80px;
}

.sidebar {
  align-self: start;
  position: sticky;
  top: 90px;
  display: grid;
  gap: 16px;
}

.sidebar h2 {
  margin: 0;
  font-size: 1.15rem;
}

.sub-filter-title {
  display: none;
}

.sidebar.is-subscription-view .sub-filter-title {
  display: block;
}

.sidebar:not(.is-subscription-view) #subscriptionFilters {
  display: none;
}

.filter-list,
.service-box,
.catalog,
.product-row,
.cart-panel,
.modal-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.filter-list {
  display: grid;
  overflow: hidden;
}

.filter-button {
  min-height: 42px;
  padding: 10px 12px;
  background: white;
  color: var(--ink);
  text-align: left;
}

.filter-button + .filter-button {
  border-top: 1px solid var(--line);
}

.filter-button.is-active {
  background: #e8f6ef;
  color: var(--green-dark);
}

.service-box {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.service-box span {
  padding: 8px 10px;
  border-radius: 8px;
  background: #f3f7f5;
  color: var(--muted);
  font-weight: 750;
}

.service-box strong {
  margin-bottom: 4px;
}

.catalog {
  padding: 18px;
}

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

.catalog-head h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
}

.catalog-head select {
  padding: 8px 12px;
}

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

.product-row {
  display: grid;
  grid-template-columns: 76px minmax(190px, 1fr) minmax(180px, 230px) minmax(170px, 220px) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
}

.logo-box {
  position: relative;
  display: grid;
  width: 76px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 8px;
  background: var(--tone, #dff4e8);
}

.logo-box span {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-weight: 900;
}

.logo-box img {
  position: absolute;
  width: 48px;
  height: 48px;
  object-fit: contain;
  padding: 8px;
  border-radius: 8px;
  background: white;
  box-shadow: 0 8px 20px rgba(24, 33, 31, 0.12);
}

.product-title {
  display: grid;
  gap: 4px;
}

.product-title h3 {
  margin: 0;
  font-size: 1.05rem;
}

.product-title p,
.option-field label,
.cart-items span {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.badge {
  padding: 5px 7px;
  border-radius: 6px;
  background: #f0f4f2;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.details-button {
  width: fit-content;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--green-dark);
  cursor: pointer;
  font-weight: 850;
}

.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.option-field {
  display: grid;
  gap: 5px;
}

.option-field select {
  min-height: 38px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.price-block {
  display: grid;
  gap: 3px;
}

.price-block strong {
  font-size: 1.2rem;
}

.price-block span {
  color: var(--muted);
  font-size: 0.86rem;
}

.add-button {
  min-height: 40px;
  padding: 9px 12px;
  background: var(--green);
  color: white;
}

.drawer,
.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  background: rgba(24, 33, 31, 0.44);
}

.drawer.is-open,
.modal.is-open {
  display: block;
}

.cart-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  width: min(460px, 100%);
  height: 100%;
  grid-template-rows: auto 1fr auto auto;
  border-radius: 0;
  box-shadow: var(--shadow);
}

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

.cart-head h2 {
  margin: 0;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  background: #edf4f1;
  color: var(--ink);
  font-size: 1.35rem;
}

.cart-items {
  overflow: auto;
  padding: 8px 20px;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.cart-item button {
  grid-column: 1 / -1;
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--danger);
  font-weight: 850;
}

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

.buyer-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.buyer-form input {
  padding: 10px 12px;
}

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

.cart-summary div {
  display: flex;
  justify-content: space-between;
}

.checkout-button {
  min-height: 44px;
  background: var(--ink);
  color: white;
}

.checkout-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.modal-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(520px, calc(100% - 32px));
  padding: 28px;
  transform: translate(-50%, -50%);
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.modal-panel h2 {
  margin: 0;
  font-size: 2rem;
  line-height: 1;
}

.modal-panel p {
  color: var(--muted);
  line-height: 1.55;
}

.delivery-preview {
  display: grid;
  gap: 9px;
  padding: 14px;
  border-radius: 8px;
  background: #f4f8f6;
}

.product-modal-panel {
  width: min(760px, calc(100% - 32px));
}

.product-detail-head {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.detail-logo {
  width: 76px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}

.detail-grid div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.detail-grid strong {
  display: block;
  margin-bottom: 10px;
}

.detail-grid ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

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

.coming-soon {
  display: grid;
  gap: 10px;
  min-height: 300px;
  place-items: center;
  align-content: center;
  padding: 42px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(223, 244, 232, 0.8), rgba(220, 238, 248, 0.8)),
    white;
  text-align: center;
}

.coming-soon span {
  padding: 8px 10px;
  border-radius: 8px;
  background: white;
  color: var(--green-dark);
  font-weight: 900;
}

.coming-soon h3 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
}

.coming-soon p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

@media (max-width: 980px) {
  .topbar,
  .hero,
  .market,
  .product-row {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .hero {
    min-height: auto;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats div:nth-child(3) {
    border-left: 0;
  }
}

@media (max-width: 560px) {
  .topbar {
    gap: 12px;
  }

  .catalog-head,
  .options,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .catalog-head {
    display: grid;
  }

  .product-row {
    gap: 12px;
  }

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

  .stats div + div {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}
