/**
 * Homepage — Best Sellers.
 * Scoped under .v-best-sellers / .v-home-section--best-sellers.
 *
 * Curated counterpart to New Arrivals: tonal ground, centered header,
 * taller portrait crops, wider gutters, quieter motion. Product cards
 * themselves come from the shared card component and are not restyled
 * beyond section-scoped rhythm.
 */

/* --------------------------------------------------------------------------
   Section shell — slower vertical rhythm than New Arrivals
   -------------------------------------------------------------------------- */

.v-section.v-home-section--best-sellers {
  padding-block: clamp(5rem, 9vw, 9.5rem);
}

.v-best-sellers {
  --v-bs-cols: 3;
  /* Taller, gallery-like crop — the clearest signal against New Arrivals. */
  --v-product-card-ratio: 3 / 4;

  display: flex;
  flex-direction: column;
  /* Requirement: generous separation between heading block and grid. */
  gap: clamp(3.25rem, 6.5vw, 6.5rem);
}

/* Sharp editorial cards inside this section */
.v-best-sellers .v-product-card__media,
.v-best-sellers .v-product-card__quick-add,
.v-best-sellers .v-badge {
  border-radius: 0;
}

.v-best-sellers .v-product-card__swatch {
  border-radius: 50%;
}

/* --------------------------------------------------------------------------
   Header — centered, curated, hairline marker
   -------------------------------------------------------------------------- */

.v-best-sellers__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--v-space-5);
  text-align: center;
}

/* Vertical hairline above the eyebrow — quiet editorial punctuation. */
.v-best-sellers__header::before {
  content: "";
  display: block;
  width: 1px;
  height: clamp(2.25rem, 4vw, 3.5rem);
  margin-bottom: var(--v-space-2);
  background: rgba(18, 20, 18, 0.2);
}

.v-best-sellers__copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--v-space-4);
  max-width: 34rem;
}

.v-best-sellers__eyebrow {
  margin: 0;
  font-size: var(--v-text-xs);
  font-weight: var(--v-font-weight-medium, 500);
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  color: var(--v-color-ink-muted);
}

.v-best-sellers__heading {
  margin: 0;
  font-family: var(--v-font-display);
  font-weight: var(--v-font-weight-light, 300);
  font-size: clamp(2.125rem, 5vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.005em;
  color: var(--v-color-ink);
}

.v-best-sellers__desc {
  margin: 0;
  max-width: 30rem;
  font-size: var(--v-text-md);
  line-height: var(--v-leading-loose, 1.9);
  color: var(--v-color-ink-muted);
  font-weight: var(--v-font-weight-light);
}

/* --------------------------------------------------------------------------
   Product grid — fewer columns, wider gutters
   -------------------------------------------------------------------------- */

.v-best-sellers__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--v-space-8) var(--v-space-4);
}

.v-best-sellers__item {
  min-width: 0;
}

/* Odd trailing card centers instead of hanging left in a 2-up grid. */
.v-best-sellers__item:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  width: calc((100% - var(--v-space-4)) / 2);
  margin-inline: auto;
}

@media (max-width: 379.98px) {
  .v-best-sellers__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .v-best-sellers__item:last-child:nth-child(odd) {
    grid-column: auto;
    width: 100%;
  }
}

@media (min-width: 768px) {
  .v-best-sellers__header {
    gap: var(--v-space-6);
  }

  .v-best-sellers__grid {
    gap: var(--v-space-10) var(--v-space-6);
  }

  .v-best-sellers__item:last-child:nth-child(odd) {
    width: calc((100% - var(--v-space-6)) / 2);
  }
}

@media (min-width: 1024px) {
  .v-best-sellers__grid {
    grid-template-columns: repeat(var(--v-bs-cols, 3), minmax(0, 1fr));
    gap: var(--v-space-11) var(--v-space-7);
  }

  .v-best-sellers__item:last-child:nth-child(odd) {
    grid-column: auto;
    width: 100%;
    margin-inline: 0;
  }

  /* Slight inset keeps the curated grid narrower than New Arrivals. */
  .v-best-sellers__grid,
  .v-best-sellers__footer {
    width: min(100%, 82rem);
    margin-inline: auto;
  }
}

/* --------------------------------------------------------------------------
   Footer CTA — centered beneath the grid, with air around it
   -------------------------------------------------------------------------- */

.v-best-sellers__footer {
  display: flex;
  justify-content: center;
  margin-top: clamp(0.5rem, 1.5vw, 1.5rem);
}

.v-best-sellers__cta-btn {
  letter-spacing: 0.2em;
  min-height: 48px;
  padding-inline: clamp(2rem, 4vw, 3.25rem);
  border-radius: 0;
  font-size: var(--v-text-xs);
}

/* --------------------------------------------------------------------------
   Shared product-card rhythm (section-scoped only — card component untouched)
   -------------------------------------------------------------------------- */

.v-best-sellers .v-product-card {
  gap: var(--v-space-4);
}

/* Ratio is driven by --v-product-card-ratio above; the shared card rule keeps
   the media box, so this only tones the placeholder ground. */
.v-best-sellers .v-product-card > .v-product-card__media {
  background: rgba(18, 20, 18, 0.04);
}

.v-best-sellers .v-product-card__link {
  display: block;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.v-best-sellers .v-product-card__link:focus-visible {
  outline: none;
  box-shadow: var(--v-shadow-focus);
}

.v-best-sellers .v-product-card__imgs {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: var(--v-product-card-ratio, 3 / 4);
  overflow: hidden;
}

.v-best-sellers .v-product-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  /* Calmer than New Arrivals: rests unscaled, drifts only slightly on hover. */
  transform: scale(1);
  transition:
    opacity 900ms var(--v-ease-standard),
    transform 1100ms var(--v-ease-emphasized);
}

.v-best-sellers .v-product-card__img--secondary {
  opacity: 0;
}

@media (hover: hover) and (pointer: fine) {
  .v-best-sellers .v-product-card:hover .v-product-card__img--primary,
  .v-best-sellers .v-product-card:focus-within .v-product-card__img--primary {
    transform: scale(1.028);
  }

  .v-best-sellers .v-product-card--has-hover-image:hover .v-product-card__img--primary,
  .v-best-sellers .v-product-card--has-hover-image:focus-within .v-product-card__img--primary {
    opacity: 0;
    transform: scale(1);
  }

  .v-best-sellers .v-product-card--has-hover-image:hover .v-product-card__img--secondary,
  .v-best-sellers .v-product-card--has-hover-image:focus-within .v-product-card__img--secondary {
    opacity: 1;
    transform: scale(1.028);
  }
}

.v-best-sellers .v-product-card > .v-product-card__body {
  align-items: center;
  text-align: center;
  padding-top: 1.05rem;
  gap: 0.4rem;
}

.v-best-sellers .v-product-card > .v-product-card__body > .v-product-card__title {
  letter-spacing: 0.13em;
}

.v-best-sellers .v-product-card > .v-product-card__body > .v-product-card__title a:focus-visible {
  outline: none;
  box-shadow: var(--v-shadow-focus);
}

.v-best-sellers .v-product-card > .v-product-card__body > .v-product-card__meta,
.v-best-sellers .v-product-card > .v-product-card__body > .v-price {
  justify-content: center;
}

.v-best-sellers .v-price del {
  opacity: 0.5;
  margin-right: 0.35em;
}

.v-best-sellers .v-badge--sold-out {
  background: rgba(247, 245, 240, 0.92);
  color: var(--v-color-ink);
}

.v-best-sellers .v-product-card .v-product-card__swatches {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
}

.v-best-sellers .v-product-card--sold-out .v-product-card__img--primary {
  opacity: 0.72;
}

/* --------------------------------------------------------------------------
   Admin empty state
   -------------------------------------------------------------------------- */

.v-best-sellers__empty {
  padding: var(--v-space-10) var(--v-space-5);
  border: 1px dashed var(--v-color-border-strong, #d4cfc4);
  text-align: center;
}

.v-best-sellers__empty-title {
  margin: 0 0 var(--v-space-2);
  font-family: var(--v-font-display);
  font-size: var(--v-text-xl, 1.25rem);
  font-weight: var(--v-font-weight-regular);
}

.v-best-sellers__empty-text {
  margin: 0 auto;
  max-width: 32rem;
  color: var(--v-color-ink-muted);
  font-size: var(--v-text-sm);
  line-height: var(--v-leading-relaxed);
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .v-best-sellers .v-product-card__img,
  .v-best-sellers .v-product-card__actions {
    transition: none !important;
  }

  .v-best-sellers .v-product-card:hover .v-product-card__img--primary,
  .v-best-sellers .v-product-card:focus-within .v-product-card__img--primary {
    transform: scale(1);
  }
}
