@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400&display=swap");

* {
  font-family: "Inter", sans-serif;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  --color-base: #f0eee9;
  --color-line: rgba(53, 46, 47, 0.1);
  --color-bg: rgb(233, 231, 226);
  --color-textinput-placeholder: rgba(0, 0, 0, 0.4);
  --color-textinput-border: rgb(230, 230, 225);
  --color-textinput-border-focus: rgba(0, 0, 0, 1);
  --color-blue: #0600ff;
  --color-black25: rgba(0, 0, 0, 0.25);
  --color-black5: rgba(0, 0, 0, 0.05);
  --color-element-secondary: #d9d9d9;
  --borderradius-small: 4px;
  --header-height: 57px;
  --max-width: 1600px;
}

/* Prototype banner */
.proto-banner {
  background: #000;
  color: var(--color-base);
  text-align: center;
  padding: 6px 16px;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-family: "JetBrains Mono", monospace;
}

body {
  background-color: var(--color-base);
  color: #000;
  min-height: 100vh;
}

/* Header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--color-line);
  background: var(--color-base);
  position: sticky;
  top: 0;
  z-index: 10;
}

header .title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

header h1 {
  font-size: 22px;
  font-weight: 400;
  white-space: nowrap;
}

header .badge {
  font-size: 10px;
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 8px;
  border: 1px dashed var(--color-black25);
  border-radius: var(--borderradius-small);
  color: var(--color-textinput-placeholder);
  white-space: nowrap;
}

/* Search form */
.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-form input {
  font-size: 14px;
  padding: 10px 16px;
  border: 1px solid var(--color-textinput-border);
  border-radius: var(--borderradius-small);
  background: var(--color-base);
  outline: none;
  width: 320px;
  height: 40px;
}

.search-form input::placeholder {
  color: var(--color-textinput-placeholder);
}

.search-form input:focus {
  border-color: var(--color-textinput-border-focus);
}

.search-form button {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 10px 20px;
  height: 40px;
  border: 1px solid #000;
  border-radius: var(--borderradius-small);
  background: transparent;
  cursor: pointer;
}

.search-form button:hover {
  background: #000;
  /* color: var(--color-base); */
}

.search-area button:hover {
  background: #000;
  color: var(--color-base);
}

/* Results grid */
.results-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 32px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* Product card */
.product-card {
  display: flex;
  flex-direction: column;
}

.product-card .image-wrapper {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--color-bg);
  overflow: hidden;
  margin-bottom: 12px;
}

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

.product-card .image-wrapper .placeholder {
  width: 100%;
  height: 100%;
  background: var(--color-bg);
}

.product-card .info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.product-card .info .brand {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}

.product-card .info .vendor {
  font-size: 13px;
  color: var(--color-textinput-placeholder);
  line-height: 1.4;
}

.product-card .info .product-title {
  font-size: 13px;
  color: rgba(0, 0, 0, 0.6);
  line-height: 1.4;
}

.product-card .info .score {
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
  color: var(--color-textinput-placeholder);
  margin-top: 4px;
  background: var(--color-black5);
  padding: 2px 6px;
  border-radius: 3px;
  width: fit-content;
}

/* Spinner */
.spinner {
  display: flex;
  justify-content: center;
  padding: 80px 0;
  width: 100%;
}

.spinner-ring {
  width: 32px;
  height: 32px;
  border: 2px solid var(--color-line);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Empty state */
.empty-state {
  text-align: center;
  padding: 80px 0;
  color: var(--color-textinput-placeholder);
  font-size: 14px;
}

/* Responsive */
@media (max-width: 1024px) {
  .results-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  header {
    padding: 12px 16px;
  }
  .results-container {
    padding: 16px;
  }
  .results-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .search-form input {
    width: 180px;
  }
}

@media (max-width: 480px) {
  header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  header h1 {
    font-size: 18px;
  }
  .search-form {
    width: 100%;
  }
  .search-form input {
    width: 100%;
    flex: 1;
  }
  .results-container {
    padding: 12px;
  }
  .results-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .product-card .info {
    min-width: 0;
  }
  .product-card .info .brand {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
  }
  .product-card .info .vendor,
  .product-card .info .product-title {
    font-size: 11px;
  }
}
