:root {
  color-scheme: light;
  --blue-50: #eff7ff;
  --blue-100: #d8ecff;
  --blue-200: #acd7ff;
  --blue-500: #0a84ff;
  --blue-600: #0067d8;
  --blue-700: #064f9e;
  --ink: #111827;
  --muted: #667085;
  --line: rgba(17, 24, 39, 0.1);
  --panel: rgba(255, 255, 255, 0.76);
  --white: #ffffff;
  --violet: #5632ff;
  --green: #21b48b;
  --shadow: 0 24px 70px rgba(6, 35, 80, 0.18);
  --radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 15% 20%, rgba(86, 50, 255, 0.2), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(33, 180, 139, 0.16), transparent 26%),
    linear-gradient(135deg, #eaf5ff 0%, #cfe8ff 42%, #f8fbff 100%);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.shell {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: none;
  backdrop-filter: blur(28px);
}

.rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 22px 12px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 24px rgba(10, 132, 255, 0.18);
}

.brand-mark img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.top-logo {
  width: min(220px, 100%);
  height: auto;
  display: block;
  margin: 0 0 12px;
}

.rail-nav {
  display: grid;
  gap: 12px;
}

.rail-link {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius);
  color: #41516b;
  background: transparent;
  cursor: pointer;
}

.rail-link:hover,
.rail-link.active {
  color: var(--blue-700);
  background: var(--blue-50);
}

.rail-link svg,
.search svg,
.dialog-close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cart-toggle {
  margin-top: auto;
}

.cart-count {
  position: absolute;
  right: 4px;
  top: 2px;
  min-width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border: 2px solid var(--white);
  border-radius: 999px;
  color: var(--white);
  background: var(--violet);
  font-size: 10px;
  font-weight: 700;
}

.marketplace {
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: rgba(248, 251, 255, 0.8);
}

.topbar {
  min-height: 88px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue-600);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  letter-spacing: 0;
}

.search {
  height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.86);
}

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

.top-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  color: var(--white);
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  box-shadow: 0 14px 26px rgba(10, 132, 255, 0.25);
  font-weight: 700;
  cursor: pointer;
}

.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(10, 132, 255, 0.18);
  border-radius: 999px;
  color: var(--blue-700);
  background: rgba(255, 255, 255, 0.82);
  font-weight: 700;
}

.primary.small {
  min-width: 116px;
}

.secondary.small {
  min-width: 92px;
}

.hero-board {
  margin: 24px 28px 0;
  min-height: 210px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
  align-items: end;
  gap: 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 0;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94) 0%, rgba(238, 247, 255, 0.9) 45%, rgba(205, 231, 255, 0.78) 100%),
    var(--blue-50);
  box-shadow: 0 18px 50px rgba(6, 35, 80, 0.1);
}

.hero-copy {
  max-width: 720px;
  padding: 36px;
}

.hero-copy h2 {
  max-width: 760px;
  font-size: clamp(34px, 5vw, 68px);
  line-height: 0.98;
}

.hero-copy p:last-child {
  max-width: 560px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 28px 28px 0;
}

.hero-metrics div {
  min-height: 86px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.hero-metrics strong {
  font-size: 26px;
}

.hero-metrics span {
  color: var(--muted);
  font-size: 12px;
}

.content-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  padding: 18px 28px 28px;
}

.filters {
  align-self: start;
  position: sticky;
  top: 18px;
  display: grid;
  gap: 20px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.78);
}

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

.filter-head button {
  border: 0;
  color: var(--blue-600);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

fieldset {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.filter-options {
  display: grid;
  gap: 10px;
}

legend {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 800;
}

label {
  color: #344054;
  font-size: 14px;
}

input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0 8px 0 0;
  vertical-align: -3px;
  accent-color: var(--blue-500);
}

.catalog {
  min-width: 0;
}

.catalog-head {
  min-height: 58px;
}

.catalog-head h2 {
  font-size: 28px;
}

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

.catalog-search {
  width: min(420px, 42vw);
}

.sort {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.sort select {
  height: 38px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--white);
}

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

.product-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 28px rgba(6, 35, 80, 0.07);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px rgba(6, 35, 80, 0.13);
}

.template-preview {
  aspect-ratio: 16 / 9;
  height: auto;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(10, 132, 255, 0.18), rgba(86, 50, 255, 0.08)),
    var(--blue-50);
}

.template-preview.image-preview-card {
  padding: 0;
  background: var(--blue-50);
}

.template-preview.image-preview-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.preview-window {
  height: 100%;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 0 0 1px rgba(10, 132, 255, 0.05);
}

.preview-sidebar,
.preview-main {
  display: grid;
  gap: 8px;
}

.preview-sidebar span,
.preview-line,
.preview-tile,
.preview-pill {
  border-radius: 999px;
  background: rgba(10, 132, 255, 0.16);
}

.preview-sidebar span {
  height: 10px;
}

.preview-main {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
}

.preview-line {
  grid-column: 1 / -1;
  height: 12px;
}

.preview-tile {
  min-height: 38px;
  border-radius: var(--radius);
  background: rgba(10, 132, 255, 0.11);
}

.preview-pill {
  height: 18px;
  background: linear-gradient(135deg, var(--blue-500), var(--green));
}

.product-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.product-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.product-title {
  margin: 0 0 5px;
  font-size: 18px;
  line-height: 1.2;
}

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

.rating {
  white-space: nowrap;
  color: #f59e0b;
  font-size: 13px;
  font-weight: 700;
}

.product-description {
  min-height: 44px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--blue-700);
  background: var(--blue-50);
  font-size: 12px;
  font-weight: 700;
}

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

.price {
  display: grid;
  gap: 2px;
}

.price span {
  color: var(--muted);
  font-size: 12px;
}

.price strong {
  font-size: 22px;
}

.buy {
  min-width: 122px;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(10, 132, 255, 0.3);
  border-radius: 0;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
  text-align: center;
}

.checkout {
  width: min(880px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 0;
  border-radius: 24px;
  padding: 24px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.checkout::backdrop {
  background: rgba(10, 28, 55, 0.34);
  backdrop-filter: blur(8px);
}

.dialog-close {
  position: absolute;
  right: 16px;
  top: 16px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--white);
  cursor: pointer;
}

.checkout-preview {
  aspect-ratio: 16 / 9;
  height: auto;
  margin-bottom: 20px;
  overflow: hidden;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(10, 132, 255, 0.24), rgba(86, 50, 255, 0.12)),
    var(--blue-50);
}

.checkout-preview .template-preview {
  height: 100%;
  padding: 14px;
}

.popup-gallery {
  display: grid;
  gap: 10px;
}

.popup-gallery-main {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 16px;
  background: var(--blue-50);
}

.popup-gallery-main img,
.popup-gallery-thumbs img,
.checkout-video iframe,
.checkout-video video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.popup-gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 8px;
}

.popup-gallery-thumbs button {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 0;
  background: var(--blue-50);
  cursor: pointer;
}

.popup-gallery-thumbs button.active {
  border-color: var(--blue-500);
}

.checkout-video {
  aspect-ratio: 16 / 9;
  margin: 0 0 20px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--blue-50);
}

.checkout-video[hidden] {
  display: none;
}

.checkout-video iframe,
.checkout-video video {
  border: 0;
}

.video-link {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--blue-700);
  font-weight: 800;
}

.checkout h2 {
  margin: 0 0 10px;
  font-size: 28px;
}

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

.checkout-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.checkout-link {
  width: 100%;
}

.checkout-note {
  margin: 14px 0 0;
  font-size: 12px;
}

.reviews-panel {
  display: grid;
  gap: 16px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.reviews-head h3 {
  margin: 0;
  font-size: 20px;
}

.review-form {
  display: grid;
  gap: 12px;
}

.review-form label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 700;
}

.review-form input,
.review-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  outline: 0;
}

.star-input {
  display: inline-flex;
  gap: 6px;
}

.star-input button {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(245, 158, 11, 0.24);
  border-radius: 999px;
  color: #c77803;
  background: rgba(255, 251, 235, 0.72);
  cursor: pointer;
  font-size: 18px;
}

.star-input button.active {
  color: var(--white);
  background: #f59e0b;
}

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

.comments-empty,
.comment-item {
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.comment-item {
  display: grid;
  gap: 8px;
}

.comment-item div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.comment-item span {
  color: #f59e0b;
}

.comment-item p {
  margin: 0;
}

.comment-item time {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1180px) {
  .hero-board {
    grid-template-columns: 1fr;
  }

  .hero-metrics {
    padding: 0 28px 28px;
  }
}

@media (max-width: 900px) {
  .shell {
    width: 100%;
    grid-template-columns: 1fr;
    border-radius: 0;
  }

  .rail {
    min-height: 68px;
    flex-direction: row;
    justify-content: space-between;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .rail-nav {
    grid-auto-flow: column;
  }

  .cart-toggle {
    margin-top: 0;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px;
  }

  .topbar .primary {
    display: none;
  }

  .top-actions {
    justify-content: stretch;
  }

  .top-actions .secondary {
    width: 100%;
  }

  .hero-board {
    margin: 18px;
  }

  .hero-copy {
    padding: 26px;
  }

  .hero-copy h2 {
    font-size: 40px;
  }

  .content-grid {
    grid-template-columns: 1fr;
    padding: 0 18px 22px;
  }

  .filters {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter-head {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    border-radius: 0;
  }

  .rail {
    padding: 12px;
  }

  .brand-mark,
  .rail-link {
    width: 38px;
    height: 38px;
  }

  .hero-metrics,
  .filters,
  .product-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy h2 {
    font-size: 34px;
  }

  .hero-metrics {
    padding: 0 18px 18px;
  }

  .catalog-head,
  .product-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-actions,
  .catalog-search {
    width: 100%;
  }

  .buy,
  .primary {
    width: 100%;
  }
}
