/* =====================================================================
   SELLER DIRECTORY PAGE — Styles
   =====================================================================
   Each block below styles one piece of seller-list.html. The class names
   (like ".seller-card-name") match the "class" attribute on the matching
   element in the HTML/JS, so it's easy to find what to edit: search this
   file for the class name you see in the HTML.

   Common things you might want to change:
   - Colors: look for "color:" or "background:" (the --color-zinc-* values
     near the top are the color palette used everywhere else in this file)
   - Text size: look for "font-size:"
   - Spacing: look for "padding:", "margin:", or "gap:"
   - Number of cards per row: see ".seller-grid" below
   ===================================================================== */

:root {
  /* The color palette used throughout this page, from lightest to darkest. */
  --color-zinc-50: oklch(98.5% 0 0);
  --color-zinc-100: oklch(96.7% .001 286.375);
  --color-zinc-200: oklch(92% .004 286.32);
  --color-zinc-300: oklch(87.1% .006 286.286);
  --color-zinc-400: oklch(70.5% .015 286.067);
  --color-zinc-500: oklch(55.2% .016 285.938);
  --color-zinc-700: oklch(37% .013 285.805);
  --color-zinc-800: oklch(27.4% .006 286.033);
  --color-zinc-900: oklch(21% .006 285.885);

  /* Text sizes that automatically scale a little with screen width. */
  --text-headline: clamp(1.0625rem, 1.5vw + .8125rem, 1.5rem);
  --text-body: clamp(.75rem, .55vw + .4375rem, .875rem);
  --text-small: clamp(.6875rem, .5vw + .4rem, .75rem);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: rgb(244, 243, 241);
}

/* Small animations used below: a spinning loader, and cards gently
   fading/sliding in when they first appear. */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Overall page layout ---- */

.page {
  /* EDIT HERE: change this to make the page wider/narrower. */
  max-width: 1000px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  width: 100%;
}


.page-header {
  max-width: 32rem;
}

.text-headline {
  font-size: var(--text-headline);
  line-height: 1.2em;
  color: var(--color-zinc-900);
  font-weight: 600;
  margin: 0;
}

.text-body {
  font-size: var(--text-body);
  line-height: 1.5em;
  color: var(--color-zinc-700);
}

.text-small {
  font-size: var(--text-small);
  line-height: 1.4em;
  color: var(--color-zinc-400);
}

.page-subtitle {
  margin: 0.5rem 0 0;
  color: var(--color-zinc-500);
}

/* ---- Search box ---- */

.search-wrap {
  position: relative;
  margin-top: 1.75rem;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--color-zinc-400);
}

/* !important below because the shop's theme CSS has its own
   "input:not([type=checkbox],[type=radio])" reset rule that otherwise
   overrides every one of these properties (border included, which is
   why the outline wasn't showing up). */
.search-input {
  width: 100% !important;
  height: 2.75rem !important;
  border: 1px solid var(--color-zinc-400) !important;
  border-radius: 0.625rem !important;
  padding: 0 1rem 0 2.5rem !important;
  font-size: var(--text-body) !important;
  color: var(--color-zinc-900) !important;
  background: #fff !important;
  font-family: inherit !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.search-input:focus {
  outline: none !important;
  border-color: var(--color-zinc-500) !important;
  box-shadow: 0 0 0 3px rgb(0 0 0 / 0.05) !important;
}

.search-input::placeholder {
  color: var(--color-zinc-300) !important;
}

.divider {
  height: 1px;
  background: var(--color-zinc-200);
  margin-top: 2rem;
}

/* ---- Seller card grid ----
   Change the "4" below to show a different number of cards per row on
   wide screens. The two @media rules underneath reduce that number
   automatically on tablet and mobile widths. */

.seller-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-top: 1.75rem;
}

@media (max-width: 1024px) {
  .seller-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .seller-grid {
    grid-template-columns: 1fr;
  }
}

.seller-card {
  background: #fff;
  border: 1px solid var(--color-zinc-200);
  border-radius: 0.8125rem;
  overflow: hidden;
  display: block;
  text-decoration: none;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  animation: fadeUp 0.22s ease both;
}

.seller-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.1), 0 2px 8px rgb(0 0 0 / 0.05);
}

.seller-card-img-wrap {
  overflow: hidden;
  width: 100%;
  height: 168px;
  background: var(--color-zinc-100);
}

.seller-card-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.seller-card:hover .seller-card-img {
  transform: scale(1.06);
}

/* Shown instead of .seller-card-img when a seller has no logo yet
   (the backend sends logoUrl as null in that case). */
.seller-card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d8d3d4;
  background: var(--color-zinc-100);
}

.seller-card-body {
  padding: 0.875rem 1rem 1.125rem;
}

.seller-card-name {
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--color-zinc-900);
  letter-spacing: -0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seller-card-location {
  margin-top: 0.1875rem;
  font-size: var(--text-small);
  color: var(--color-zinc-400);
}

/* ---- "No results" / "No sellers yet" messages ---- */

.state-block {
  padding: 5rem 0;
  text-align: center;
}

.state-icon {
  margin: 0 auto;
  display: block;
  opacity: 0.35;
}

.state-title {
  margin-top: 0.875rem;
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--color-zinc-800);
}

.state-subtitle {
  margin-top: 0.3125rem;
  font-size: var(--text-small);
  color: var(--color-zinc-400);
}

.empty-icon-box {
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--color-zinc-200);
  border-radius: 0.625rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

/* ---- Loading spinner shown while more sellers are loading ---- */

.spinner-row {
  display: flex;
  justify-content: center;
  padding: 2.5rem 0 0;
}

.spinner {
  width: 1.125rem;
  height: 1.125rem;
  border: 1.5px solid var(--color-zinc-200);
  border-top-color: var(--color-zinc-500);
  border-radius: 9999px;
  animation: spin 0.65s linear infinite;
}
