.marketplace-page {
  min-height: 100vh;
  color: #172126;
  background: #f4f6f5;
}

.marketplace-page .site-header {
  background: rgba(7, 13, 16, 0.92);
}

.nav-tabs .products-tab[aria-current="page"] {
  color: #071013;
  border-color: #9bea61;
  background: #9bea61;
  box-shadow: 0 0 24px rgba(141, 227, 79, 0.22);
}

.marketplace-main {
  min-height: 100vh;
  padding-top: 96px;
}

.marketplace-auth {
  width: min(1180px, calc(100% - 40px));
  min-height: calc(100vh - 120px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  align-items: center;
  gap: clamp(48px, 8vw, 112px);
  padding: 72px 0 88px;
}

.auth-copy {
  max-width: 690px;
}

.marketplace-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  color: #397713;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.marketplace-eyebrow span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #8de34f;
  box-shadow: 0 0 0 5px rgba(141, 227, 79, 0.16);
}

.auth-copy h1,
.marketplace-titlebar h1 {
  margin: 0;
  max-width: 820px;
  color: #0d171b;
  font-size: clamp(3rem, 6.2vw, 5.8rem);
  line-height: 0.98;
  font-weight: 900;
  letter-spacing: 0;
}

.auth-copy > p:not(.marketplace-eyebrow) {
  max-width: 620px;
  margin: 28px 0 0;
  color: #57666b;
  font-size: 1.12rem;
  line-height: 1.7;
}

.auth-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

.auth-points span {
  padding: 9px 12px;
  border: 1px solid #d3dbd8;
  border-radius: 4px;
  background: #fff;
  color: #36454a;
  font-size: 0.78rem;
  font-weight: 800;
}

.marketplace-login {
  padding: 30px;
  border: 1px solid #d5ddda;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(19, 38, 44, 0.12);
}

.login-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 26px;
  border-radius: 50%;
  background: #071013;
}

.login-mark img {
  width: 42px;
  height: 42px;
}

.marketplace-login > p:first-of-type {
  margin: 0 0 8px;
  color: #397713;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.marketplace-login h2 {
  margin: 0 0 26px;
  color: #111b1f;
  font-size: 1.75rem;
  line-height: 1.15;
}

.marketplace-login label {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.marketplace-login label span,
.filter-select > span {
  color: #354348;
  font-size: 0.78rem;
  font-weight: 800;
}

.marketplace-login input,
.marketplace-search input,
.marketplace-toolbar select,
.filter-select select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cbd5d2;
  border-radius: 4px;
  background: #fff;
  color: #152126;
  font: inherit;
}

.marketplace-login input,
.marketplace-search input {
  padding: 0 14px;
}

.marketplace-login input:focus,
.marketplace-search input:focus,
.marketplace-toolbar select:focus,
.filter-select select:focus {
  outline: 3px solid rgba(30, 169, 255, 0.18);
  border-color: #1687c7;
}

.marketplace-login button,
.marketplace-search button {
  min-height: 48px;
  border: 0;
  border-radius: 4px;
  background: #0d171b;
  color: #fff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.marketplace-login button {
  width: 100%;
  margin-top: 24px;
}

.marketplace-login button:hover,
.marketplace-search button:hover {
  background: #236902;
  transform: translateY(-1px);
}

.marketplace-login small {
  display: block;
  margin-top: 14px;
  color: #778388;
  font-size: 0.72rem;
  line-height: 1.5;
}

.auth-message {
  min-height: 20px;
  margin: 12px 0 0;
  color: #a52b2b;
  font-size: 0.78rem;
  font-weight: 700;
}

.marketplace[hidden],
.marketplace-auth[hidden] {
  display: none;
}

.marketplace {
  width: min(1320px, calc(100% - 40px));
  margin: 0 auto;
  padding: 52px 0 64px;
}

.marketplace-titlebar {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 28px;
}

.marketplace-titlebar h1 {
  max-width: 900px;
  font-size: clamp(2.5rem, 5vw, 4.9rem);
}

.marketplace-titlebar > div > p:last-child {
  max-width: 760px;
  margin: 22px 0 0;
  color: #617075;
  font-size: 1.02rem;
  line-height: 1.65;
}

.marketplace-preview-note {
  margin: 24px 0 18px;
  padding: 13px 16px;
  color: #315b3a;
  background: #eef8e9;
  border: 1px solid #c8e8bf;
  border-radius: 5px;
  font-size: 0.84rem;
  line-height: 1.5;
}

.marketplace-preview-note a {
  margin-left: 8px;
  color: #1b6c2b;
  font-weight: 850;
  text-decoration: underline;
}

.logout-button,
.filter-heading button,
.empty-products button {
  border: 0;
  background: transparent;
  color: #445257;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}

.marketplace-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 8px;
  margin-top: 42px;
  padding: 10px;
  border: 1px solid #d0d8d5;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(30, 47, 53, 0.07);
}

.marketplace-search input {
  min-height: 50px;
  border: 0;
  background: #f3f6f5;
}

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 22px 0 12px;
  scrollbar-width: thin;
}

.category-tabs button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid #cbd5d2;
  border-radius: 4px;
  background: #fff;
  color: #344247;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.category-tabs button[aria-pressed="true"] {
  border-color: #0d171b;
  background: #0d171b;
  color: #fff;
}

.marketplace-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0;
  border-top: 1px solid #d8dfdd;
  border-bottom: 1px solid #d8dfdd;
}

.marketplace-toolbar p {
  margin: 0;
  color: #657277;
  font-size: 0.86rem;
}

.marketplace-toolbar p strong {
  color: #142025;
}

.marketplace-toolbar label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #657277;
  font-size: 0.78rem;
  font-weight: 700;
}

.marketplace-toolbar select,
.filter-select select {
  min-height: 40px;
  padding: 0 34px 0 11px;
}

.marketplace-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  padding-top: 28px;
}

.filter-panel {
  align-self: start;
  position: sticky;
  top: 108px;
}

.filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
}

.filter-heading h2 {
  margin: 0;
  font-size: 1rem;
}

.filter-panel fieldset {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 20px 0;
  border: 0;
  border-top: 1px solid #d8dfdd;
}

.filter-panel legend,
.filter-select > span {
  margin-bottom: 12px;
  color: #1f2b30;
  font-size: 0.78rem;
  font-weight: 900;
}

.filter-panel fieldset label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #4e5c61;
  font-size: 0.82rem;
}

.filter-panel input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: #397713;
}

.filter-select {
  display: grid;
  padding: 20px 0;
  border-top: 1px solid #d8dfdd;
}

.filter-note {
  margin-top: 16px;
  padding: 18px;
  border-left: 3px solid #1ea9ff;
  background: #e8f6fc;
}

.filter-note strong {
  font-size: 0.84rem;
}

.filter-note p {
  margin: 8px 0 14px;
  color: #52646b;
  font-size: 0.78rem;
  line-height: 1.5;
}

.filter-note a {
  color: #075e8b;
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: underline;
}

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

.product-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d6ddda;
  border-radius: 6px;
  background: #fff;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.product-card:hover {
  transform: translateY(-3px);
  border-color: #aab8b3;
  box-shadow: 0 18px 42px rgba(22, 39, 44, 0.12);
}

.product-image-button {
  position: relative;
  width: 100%;
  display: block;
  padding: 0;
  border: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #edf0ef;
  cursor: pointer;
}

.product-image-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 260ms ease;
}

.product-card:hover .product-image-button img {
  transform: scale(1.025);
}

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 8px;
  border-radius: 3px;
  background: rgba(7, 16, 19, 0.9);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.product-card-body {
  padding: 16px;
}

.product-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #708086;
  font-size: 0.7rem;
  font-weight: 700;
}

.product-card h2 {
  min-height: 48px;
  margin: 10px 0 8px;
  color: #111c20;
  font-size: 1rem;
  line-height: 1.35;
}

.product-location {
  margin: 0;
  color: #647278;
  font-size: 0.76rem;
}

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

.product-specs span {
  display: grid;
  min-width: 0;
  padding: 8px;
  background: #f3f6f5;
  color: #67767b;
  font-size: 0.62rem;
}

.product-specs strong {
  overflow: hidden;
  margin-top: 3px;
  color: #1d2a2f;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-card-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid #e1e6e4;
}

.product-card-actions,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.product-passport-link,
.dialog-passport-link {
  color: #0a83bb;
  font-size: 0.68rem;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.product-price {
  display: grid;
  gap: 2px;
  color: #738085;
  font-size: 0.62rem;
}

.product-price strong {
  color: #111c20;
  font-size: 1rem;
}

.view-product-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #182529;
  border-radius: 3px;
  background: #fff;
  color: #182529;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 900;
  cursor: pointer;
}

.view-product-button:hover {
  background: #182529;
  color: #fff;
}

.empty-products {
  padding: 80px 24px;
  border: 1px dashed #bdc8c4;
  background: #fff;
  text-align: center;
}

.empty-products h2 {
  margin: 0 0 8px;
}

.empty-products p {
  color: #66747a;
}

.catalogue-disclaimer {
  margin: 34px 0 0 248px;
  color: #758287;
  font-size: 0.72rem;
  line-height: 1.6;
}

.product-dialog {
  width: min(920px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: #fff;
  color: #162126;
  box-shadow: 0 32px 100px rgba(3, 10, 12, 0.4);
}

.product-dialog::backdrop {
  background: rgba(5, 10, 12, 0.72);
  backdrop-filter: blur(5px);
}

.dialog-close {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(7, 16, 19, 0.88);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}

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

.dialog-product-image {
  min-height: 100%;
  background: #eef1f0;
}

.dialog-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dialog-product-content {
  padding: 42px;
}

.dialog-product-content > span {
  color: #397713;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dialog-product-content h2 {
  margin: 12px 0;
  font-size: 2rem;
  line-height: 1.1;
}

.dialog-product-content > p {
  color: #5b696e;
  line-height: 1.65;
}

.dialog-spec-list {
  margin: 24px 0;
  border-top: 1px solid #dfe5e3;
}

.dialog-spec-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid #dfe5e3;
  font-size: 0.82rem;
}

.dialog-spec-list dt {
  color: #6b787d;
}

.dialog-spec-list dd {
  margin: 0;
  font-weight: 800;
  text-align: right;
}

.dialog-quote {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 26px;
}

.dialog-quote strong {
  font-size: 1.2rem;
}

.dialog-quote a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border-radius: 4px;
  background: #0d171b;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
}

.dialog-actions .dialog-passport-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
}

@media (max-width: 1080px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .marketplace-auth {
    grid-template-columns: 1fr;
    gap: 44px;
    padding-top: 50px;
  }

  .auth-copy h1 {
    font-size: clamp(2.8rem, 11vw, 5rem);
  }

  .marketplace-layout {
    grid-template-columns: 1fr;
  }

  .filter-panel {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 22px;
    padding: 16px;
    border: 1px solid #d6ddda;
    background: #fff;
  }

  .filter-heading,
  .filter-note {
    grid-column: 1 / -1;
  }

  .catalogue-disclaimer {
    margin-left: 0;
  }

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

  .dialog-product-image {
    max-height: 330px;
  }
}

@media (max-width: 620px) {
  .marketplace-main {
    padding-top: 82px;
  }

  .marketplace-auth,
  .marketplace {
    width: min(100% - 24px, 1320px);
  }

  .marketplace-auth {
    padding-top: 38px;
  }

  .auth-copy h1,
  .marketplace-titlebar h1 {
    font-size: clamp(2.4rem, 13vw, 4rem);
  }

  .marketplace-titlebar {
    display: block;
  }

  .logout-button {
    margin-top: 18px;
  }

  .marketplace-search {
    grid-template-columns: 1fr;
  }

  .marketplace-login input,
  .marketplace-search input,
  .filter-panel select {
    font-size: 16px;
  }

  .product-dialog::backdrop {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

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

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

  .filter-heading,
  .filter-note {
    grid-column: auto;
  }

  .marketplace-toolbar label span {
    display: none;
  }

  .dialog-product-content {
    padding: 28px 20px;
  }

  .dialog-quote {
    align-items: stretch;
    flex-direction: column;
  }

  .dialog-quote a {
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .marketplace-page .site-header {
    left: 6px;
    right: 6px;
    padding: 6px;
  }

  .marketplace-page .nav-brand img {
    width: 28px;
    height: 28px;
  }

  .marketplace-page .nav-tabs a {
    min-height: 30px;
    padding: 0 5px;
    font-size: 0.55rem;
  }

  .marketplace-login {
    padding: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-card,
  .product-image-button img,
  .marketplace-login button,
  .marketplace-search button {
    transition: none;
  }
}

.marketplace-regulatory-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  margin: 14px 0 22px;
  padding: 15px 17px;
  color: #364740;
  background: #f4f8f5;
  border: 1px solid #d2dcd7;
  border-left: 4px solid #188ed1;
  border-radius: 8px;
}

.marketplace-regulatory-note strong {
  white-space: nowrap;
}

.marketplace-regulatory-note p {
  margin: 0;
  color: #5c6b66;
  line-height: 1.5;
}

.passport-availability {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 8px;
  color: #6b551f;
  background: #fff7df;
  border: 1px solid #ead49c;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 850;
}

@media (max-width: 620px) {
  .marketplace-regulatory-note {
    grid-template-columns: 1fr;
  }

  .marketplace-regulatory-note strong {
    white-space: normal;
  }
}
