/* =============================================
   Vendors Pages â pages/vendors.css
   (.search-hero styles live in components.css)
   ============================================= */

/* --- Discovery sections --- */

.vendors-discovery {
  padding-top: 48px;
  padding-bottom: 24px;
}

.vendors-discovery .section-title + .vendors-carousel {
  margin-top: 24px;
}

/* Category card carousel */

.vendors-carousel {
  position: relative;
  margin-bottom: 32px;
}

.vendors-carousel__track {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.vendors-carousel__track::-webkit-scrollbar {
  display: none;
}

.vendors-carousel__arrow {
  position: absolute;
  top: 125px;
  transform: translateY(-50%);
  z-index: 3;
}

.vendors-carousel__arrow.carousel-arrow--prev {
  left: -18px;
}

.vendors-carousel__arrow.carousel-arrow--next {
  right: -18px;
}

.vendors-carousel__arrow.hidden {
  visibility: hidden;
  pointer-events: none;
}

.vendors-category-card {
  flex: 0 0 198px;
  display: block;
  text-decoration: none;
  color: var(--sdwd-subtext);
}

.vendors-category-card:hover {
  color: var(--sdwd-subtext);
  text-decoration: none;
}

.vendors-category-card__media {
  display: block;
  width: 198px;
  height: 248px;
  overflow: hidden;
  border-radius: var(--sdwd-radius-lg);
  background: var(--sdwd-soft);
}

.vendors-category-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.vendors-category-card:hover img {
  transform: scale(1.03);
}

.vendors-category-card__body {
  display: grid;
  gap: 4px;
  padding: 10px 0 0;
}

.vendors-category-card__title {
  font-size: 0.93rem;
  font-weight: 700;
}

.vendors-category-card__count {
  color: var(--sdwd-muted);
  font-size: 0.88rem;
}

/* --- Popout section --- */

.vendors-popout-section {
  padding-top: 48px;
  padding-bottom: 0;
}

.vendors-popout-section:first-of-type {
  padding-top: 0;
}

.vendors-category-cards {
  padding-top: 0;
}

.vendor-popout {
  position: relative;
  min-height: 300px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 24px;
}

.vendor-popout__image {
  width: 66.6667%;
  overflow: hidden;
  border-radius: var(--sdwd-radius-lg);
}

.vendor-popout__image img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
}

.vendor-popout__content {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: min(40%, 560px);
  padding: 36px 30px;
  background: var(--sdwd-bg);
  border-radius: var(--sdwd-radius-lg);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.19);
  z-index: 3;
}

.vendor-popout__title {
  margin-bottom: 10px;
}

.vendor-popout__desc {
  color: var(--sdwd-body-text);
  line-height: 1.6;
  font-size: 0.92rem;
  margin: 0 0 20px;
}

.vendor-popout__cta {
  background: var(--sdwd-accent);
  border-color: var(--sdwd-accent);
  color: var(--sdwd-bg);
}

@media (max-width: 1024px) {
  .vendor-popout {
    min-height: 0;
    display: block;
  }

  .vendor-popout__image {
    width: 100%;
  }

  .vendor-popout__content {
    width: min(60%, 620px);
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
  }
}

@media (max-width: 768px) {
  .vendor-popout__content {
    width: min(100%, 620px);
    margin-top: -40px;
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 480px) {
  .vendor-popout__image {
    display: none;
  }

  .vendor-popout__content {
    width: 100%;
    margin-top: 0;
    padding: 0;
    box-shadow: none;
  }
}

/* --- Vendor cards per category --- */

.vendors-category-cards__heading {
  margin-bottom: 24px;
}

.vendors-category-cards__cta {
  text-align: center;
  margin-top: 24px;
}

/* --- Category SEO sections (taxonomy-vendor-category) --- */

.vendors-seo {
  padding-top: var(--sdwd-section-gap-lg);
}

.vendors-seo__intro {
  width: 100%;
}

.vendors-seo__intro-title {
  margin-bottom: 16px;
}

.vendors-seo__intro-body {
  color: var(--sdwd-body-text);
  line-height: 1.75;
}

.vendors-seo__intro-body p {
  margin: 0 0 14px;
}

.vendors-seo__intro-body p:last-child {
  margin-bottom: 0;
}

.vendors-seo__intro-body a {
  color: var(--sdwd-link);
  text-decoration: underline;
}

.vendors-seo__intro-body a:hover {
  color: var(--sdwd-link-hover);
}

.vendors-seo__columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sdwd-row-gap);
  margin-top: 40px;
}

.vendors-seo__col-title {
  font-size: var(--sdwd-h2-sm);
  margin-bottom: 12px;
}

.vendors-seo__col-text {
  color: var(--sdwd-body-text);
  line-height: 1.7;
}

.vendors-seo__col-text p {
  margin: 0 0 12px;
}

.vendors-seo__col-text p:last-child {
  margin-bottom: 0;
}

.vendors-seo__col-text a {
  color: var(--sdwd-link);
  text-decoration: underline;
}

.vendors-seo__col-text a:hover {
  color: var(--sdwd-link-hover);
}


/* --- Category button row --- */

.vendors-type-buttons {
  padding-top: 0;
}

.vendors-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 0 28px;
}

/* --- Link grids (match home page inline flow style) --- */

.vendors-landing .link-grid {
  margin-bottom: var(--gutter);
}

.vendors-landing .link-grid:last-child {
  margin-bottom: 0;
}

.vendors-landing .link-grid__heading {
  margin-bottom: calc(var(--gutter) / 2);
}

.vendors-landing .link-grid__row {
  display: inline;
  line-height: 2;
}

.vendors-landing .link-grid__row + .link-grid__row::before {
  content: "\2022";
  margin: 0 calc(var(--gutter) / 2.5);
  color: var(--sdwd-muted);
}

.vendors-landing .link-grid__sep {
  margin: 0 calc(var(--gutter) / 2.5);
  color: var(--sdwd-muted);
}

.vendors-landing .link-grid__item {
  color: var(--sdwd-subtext);
  font-size: var(--sdwd-body);
  text-decoration: none;
}

.vendors-landing .link-grid__item:hover,
.vendors-landing .link-grid__item:focus {
  color: var(--sdwd-cta);
}

/* --- Vendor listing hero --- */

.vendors-listing-hero {
  background: var(--sdwd-bg);
  height: 165px;
  display: flex;
  align-items: flex-start;
  border-bottom: 1px solid var(--sdwd-border);
}

.vendors-listing-hero .container {
  padding-top: 24px;
}

.vendors-listing-hero .breadcrumb {
  margin-bottom: 6px;
}

.vendors-listing-hero__title {
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--sdwd-heading);
  margin: 0;
}

.vendors-listing-hero__layout {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

/* Unified search bar */

.vendors-hero-search {
  display: flex;
  align-items: center;
  background: var(--sdwd-bg);
  border-radius: var(--sdwd-hero-search-radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  flex-shrink: 0;
}

.vendors-hero-search__field {
  display: flex;
  align-items: center;
  padding: 0 20px;
  min-height: 52px;
}

.vendors-hero-search__field--category {
  border-right: 1px solid var(--sdwd-border);
}

.vendors-hero-search__field--location {
  gap: 8px;
  padding-right: 6px;
}

.vendors-hero-search__text {
  color: var(--sdwd-subtext);
  font-size: 1rem;
  white-space: nowrap;
}

.vendors-hero-search select {
  border: 0;
  background: transparent;
  color: var(--sdwd-subtext);
  font-size: 1rem;
  min-height: 50px;
  cursor: pointer;
}

.vendors-hero-search select:focus {
  outline: none;
}

.vendors-hero-search__submit {
  min-height: 40px;
  min-width: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--sdwd-radius-lg);
  flex-shrink: 0;
}

/* --- Vendor browser (archive/taxonomy pages) --- */

.vendors-search-form {
  display: grid;
  grid-template-columns: 1.3fr 1fr auto;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--sdwd-border);
  border-radius: var(--sdwd-radius-lg);
  background: var(--sdwd-soft);
}

.vendors-search-form__field,
.vendors-search-form__chip {
  display: flex;
  align-items: center;
  min-height: 56px;
  border-radius: var(--sdwd-radius-lg);
  background: var(--sdwd-bg);
  border: 1px solid var(--sdwd-border);
  padding: 0 16px;
}

.vendors-search-form__field input,
.vendors-search-form__field select {
  width: 100%;
  min-height: 54px;
  border: 0;
  background: transparent;
  color: var(--sdwd-subtext);
}

.vendors-search-form__field input:focus,
.vendors-search-form__field select:focus {
  outline: none;
}

.vendors-search-form__chip {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
}

.vendors-search-form__chip-label {
  color: var(--sdwd-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.vendors-search-form__submit {
  min-height: 56px;
  padding: 0 20px;
}

.vendors-browser__layout {
  align-items: start;
}

.vendors-filter-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  border-radius: var(--sdwd-radius-lg);
  background: var(--sdwd-soft);
  border: 1px solid var(--sdwd-border);
}

.vendors-filter-form__group {
  margin: 0;
  padding: 0 0 18px;
  border: 0;
  border-bottom: 1px solid var(--sdwd-border);
}

.vendors-filter-form__group:last-of-type {
  padding-bottom: 0;
  border-bottom: 0;
}

.vendors-filter-form__label {
  display: block;
  margin-bottom: 10px;
  color: var(--sdwd-subtext);
  font-size: 0.92rem;
  font-weight: 700;
}

.vendors-filter-form__options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vendors-filter-form__option {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sdwd-body-text);
  font-size: 0.95rem;
}

.vendors-filter-form__option input {
  accent-color: var(--sdwd-accent);
}

.vendors-filter-form__submit,
.vendors-filter-form__reset {
  width: 100%;
}

.vendors-browser__results-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 24px;
}

.vendors-browser__results-title {
  margin-bottom: 6px;
}

.vendors-browser__results-summary {
  margin: 0;
  color: var(--sdwd-muted);
}

/* --- Vendor category grid (archive-vendor.php) --- */

.vcat-section {
  padding-top: 40px;
  padding-bottom: 56px;
}

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

.vcat-card {
  position: relative;
  display: block;
  border-radius: var(--sdwd-radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  text-decoration: none;
  background: var(--sdwd-soft);
}

.vcat-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.vcat-card:hover .vcat-card__img {
  transform: scale(1.04);
}

.vcat-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.08) 55%, transparent 100%);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 14px 16px;
}

.vcat-card__info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.vcat-card__name {
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.vcat-card__count {
  display: inline-block;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  font-size: 0.78rem;
  padding: 3px 9px;
  border-radius: 20px;
  line-height: 1.5;
  width: fit-content;
}

.vcat-card__icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  color: #fff;
  font-size: 1rem;
  flex-shrink: 0;
  align-self: flex-end;
}

/* --- Responsive --- */

@media (max-width: 1023px) {
  .vendors-landing .search-hero__submit {
    display: none;
  }

  .vendors-landing .search-hero__field--location {
    border-right: 0;
  }
}

@media (max-width: 1024px) {
  .vendors-search-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vcat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .vendors-listing-hero {
    height: auto;
    padding: 24px 0 20px;
  }

  .vendors-listing-hero__layout {
    flex-direction: column;
    align-items: stretch;
  }

  .vendors-category-card {
    flex-basis: 160px;
  }

  .vendors-seo__columns {
    grid-template-columns: 1fr;
  }

  .vendors-search-form {
    grid-template-columns: 1fr;
  }

  .vendors-browser__results-head {
    align-items: start;
  }

  .vcat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Mobile swipe row (Pattern A, see components.css [data-swipe]) --- */
@media (max-width: 640px) {
  .vendors-carousel__track[data-swipe] {
    --peek: 160px; /* match the card's existing ≤768px flex-basis */
    gap: 18px; /* keep the section's own gap over the utility default */
  }
}
