/*
 * The sellers directory at /marketplace.html (storefront redesign T13, design decisions 23 and 24). Every colour is a
 * token from cce-theme.css; this file writes no hex colour (a scan test checks it). One column on a phone, two from
 * 576px, three from 992px. The banner and the avatar shapes are the store header's, from merchant-storefront.css.
 */

.cce-dir {
  color: var(--cce-text);
}

.cce-dir-title {
  margin: 0 0 0.75rem;
  color: var(--cce-ink);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  line-height: 1.15;
}

/* ───────── Search ───────── */

.cce-dir-search {
  margin-bottom: 1.25rem;
}

.cce-dir-search-label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--cce-ink);
  font-weight: 700;
}

.cce-dir-search-row {
  display: flex;
  gap: 0.5rem;
}

.cce-dir-search-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.6rem 1rem;
  border: 1px solid var(--cce-line);
  border-radius: var(--cce-radius-pill);
  background: var(--cce-surface);
  color: var(--cce-text);
}

.cce-dir-search-button {
  padding: 0.6rem 1.2rem;
  border: 0;
  border-radius: var(--cce-radius-pill);
  background: var(--cce-primary);
  color: var(--cce-on-dark);
  font-weight: 700;
  white-space: nowrap;
}

/* ───────── Tiles ───────── */

.cce-dir-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}

@media (min-width: 576px) {
  .cce-dir-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 992px) {
  .cce-dir-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.cce-dir-tile {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--cce-surface);
  border: 1px solid var(--cce-line);
  border-radius: var(--cce-radius-card);
  box-shadow: var(--cce-shadow-card);
}

.cce-dir-tile-banner .cce-banner {
  border-radius: 0;
}

.cce-dir-tile-body {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0 1rem 1rem;
}

.cce-dir-tile-id {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
}

.cce-dir .cce-dir-tile .cce-avatar {
  z-index: 1;
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  margin-top: -36px;
}

.cce-dir-tile-name {
  margin: 0;
  padding-top: 0.5rem;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.cce-dir-tile-name a {
  color: var(--cce-ink);
  text-decoration: none;
}

.cce-dir-tile-headline {
  margin: 0;
  color: var(--cce-text);
  overflow-wrap: anywhere;
}

.cce-dir-tile-count {
  margin: 0;
  color: var(--cce-muted);
  font-size: 0.9rem;
}

.cce-dir-tile-visit {
  align-self: flex-start;
  margin-top: auto;
  padding: 0.45rem 1rem;
  border: 1px solid var(--cce-primary);
  border-radius: var(--cce-radius-pill);
  color: var(--cce-primary);
  font-weight: 700;
  text-decoration: none;
}

.cce-dir-tile-visit:hover {
  background: var(--cce-primary-tint);
}

.cce-dir-empty {
  padding: 2rem 0;
  color: var(--cce-muted);
  text-align: center;
}

.cce-dir-pager {
  margin-top: 1.5rem;
}

.cce-dir :focus-visible {
  outline: 3px solid var(--cce-primary);
  outline-offset: 2px;
}
