:root {
  --primary: #5b45e0;
  --primary-dark: #4532bd;
  --ink: #202033;
  --muted: #77778b;
  --surface: #ffffff;
  --background: #f7f7fb;
  --border: #e9e8f1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--background);
  color: var(--ink);
}

a {
  text-decoration: none;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  background: white;
  padding: 12px;
  z-index: 1000;
}

.skip-link:focus {
  top: 12px;
}

/* Navigation */

.intent-navbar {
  background: white;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.intent-logo {
  color: var(--ink);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -1px;
}

.intent-logo span {
  color: var(--primary);
}

.nav-search {
  display: flex;
  width: min(480px, 45%);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--background);
}

.nav-search input {
  width: 100%;
  border: 0;
  outline: none;
  padding: 12px 15px;
  background: transparent;
}

.nav-search button {
  border: 0;
  background: var(--primary);
  color: white;
  padding: 0 18px;
  font-size: 1.5rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  font-weight: 600;
}

.nav-actions a {
  color: var(--ink);
}

.cart-link span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.75rem;
}

/* Hero */

.market-hero {
  background: linear-gradient(120deg, #242044, #5b45e0);
  color: white;
  padding: 75px 0;
}

.hero-content {
  max-width: 650px;
}

.hero-tag,
.section-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 2px;
  font-weight: 800;
}

.hero-tag {
  color: #c8c0ff;
}

.hero-content h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.05;
  margin: 18px 0;
  letter-spacing: -2px;
}

.hero-content h1 span {
  color: #c8c0ff;
}

.hero-content p {
  max-width: 440px;
  color: #e0ddff;
  font-size: 1.1rem;
  line-height: 1.7;
}

.hero-button {
  display: inline-block;
  background: white;
  color: var(--primary-dark);
  padding: 14px 22px;
  border-radius: 9px;
  margin-top: 18px;
  font-weight: 700;
}

.hero-button:hover {
  background: #f0edff;
  color: var(--primary-dark);
}

/* Catalog */

.catalog-section {
  padding-top: 55px;
  padding-bottom: 70px;
}

.catalog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.section-eyebrow {
  color: var(--primary);
}

.catalog-heading h2 {
  font-size: 2rem;
  font-weight: 800;
  margin: 8px 0;
}

.catalog-heading p {
  color: var(--muted);
  margin: 0;
}

.clear-button {
  border: 1px solid var(--border);
  background: white;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
}

.filter-panel {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: 14px;
  background: white;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.filter-field label {
  font-size: 0.8rem;
  font-weight: 700;
}

.filter-field input,
.filter-field select {
  width: 100%;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.filter-field input:focus,
.filter-field select:focus,
.nav-search:focus-within {
  outline: 2px solid #c8c0ff;
  border-color: var(--primary);
}

.catalog-status {
  margin: 25px 0 15px;
  color: var(--muted);
  font-size: 0.9rem;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

/* Product cards */

.product-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  min-width: 0;
}

.product-image-wrap {
  height: 220px;
  background: #f0eff6;
  overflow: hidden;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-placeholder {
  height: 220px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--muted);
  background: #f0eff6;
}

.product-info {
  padding: 18px;
}

.product-brand {
  color: var(--muted);
  font-size: 0.8rem;
}

.product-name {
  font-size: 1rem;
  font-weight: 700;
  margin: 8px 0;
  min-height: 42px;
}

.product-description {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
  min-height: 40px;
}

.product-price {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 14px 0;
}

.add-to-cart {
  width: 100%;
  background: var(--primary);
  color: white;
  border: 0;
  border-radius: 8px;
  padding: 12px;
  font-weight: 700;
  cursor: pointer;
}

.add-to-cart:hover {
  background: var(--primary-dark);
}

.empty-state {
  background: white;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  color: var(--muted);
}

/* Skeleton loading */

.skeleton {
  background: linear-gradient(90deg, #eeeef4 25%, #f8f8fb 50%, #eeeef4 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.4s infinite;
}

.skeleton-image {
  height: 220px;
}

.skeleton-line {
  height: 14px;
  margin: 14px 0;
  border-radius: 6px;
}

@keyframes skeleton-loading {
  to {
    background-position: -200% 0;
  }
}

/* Responsive */

@media (max-width: 1100px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .intent-navbar .container {
    flex-wrap: wrap;
    gap: 15px;
  }

  .nav-search {
    order: 3;
    width: 100%;
  }

  .nav-actions {
    margin-left: auto;
  }

  .market-hero {
    padding: 50px 0;
  }

  .filter-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .product-image-wrap,
  .skeleton-image {
    height: 170px;
  }

  .product-info {
    padding: 12px;
  }

  .catalog-heading h2 {
    font-size: 1.6rem;
  }
}

@media (max-width: 420px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .product-image-wrap,
  .skeleton-image {
    height: 230px;
  }

  .filter-panel {
    grid-template-columns: 1fr;
  }
}

/* Vestibular accessibility */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
