/* ──────────────────────────────────────────────
   Mants — Buy Section (Block 6)
   ────────────────────────────────────────────── */

.buy-section {
  padding: 80px 0;
}

.buy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 100px;
  align-items: center;
}

.buy__image-wrap {
  overflow: hidden;
}

/* ── Gallery (Swiper) ───────────────────────── */

.buy__gallery {
  /* Lock the gallery box to the image ratio so its height NEVER depends on
     Swiper's init/update state. A changing height is what let the browser
     re-anchor the scroll and jolt the page down on color switch. */
  aspect-ratio: 1920 / 2688;
  overflow-anchor: none;
}

.buy__gallery[hidden] {
  display: none;
}

.buy__gallery .swiper-wrapper,
.buy__gallery .swiper-slide {
  height: 100%;
}

.buy__gallery .swiper-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Brand-tuned navigation arrows */
.buy__gallery .swiper-button-prev,
.buy__gallery .swiper-button-next {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(247, 245, 241, 0.85);
  color: var(--ink);
  transition: background 0.2s;
}

.buy__gallery .swiper-button-prev:hover,
.buy__gallery .swiper-button-next:hover {
  background: var(--bg);
}

.buy__gallery .swiper-button-prev::after,
.buy__gallery .swiper-button-next::after {
  font-size: 18px;
  font-weight: 700;
}

/* Pagination bullets */
.buy__gallery .swiper-pagination-bullet {
  background: var(--ink-soft);
  opacity: 0.35;
  transition: opacity 0.2s, transform 0.2s;
}

.buy__gallery .swiper-pagination-bullet-active {
  background: var(--ink);
  opacity: 1;
  transform: scale(1.3);
}

.buy__eyebrow {
  margin-bottom: 16px;
}

.buy__title {
  font-family: var(--ff-serif);
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 300;
  line-height: 1.05;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.buy__price {
  font-family: var(--ff-sans);
  font-size: 28px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 20px;
}

.buy__desc {
  font-family: var(--ff-sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: 36px;
}

.buy__desc p {
  margin: 0 0 12px;
}

.buy__desc p:last-child {
  margin-bottom: 0;
}

/* ── Swatches ───────────────────────────────── */

.buy__label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.buy__label--color {
  justify-content: flex-start;
  gap: 6px;
}

.buy__color-sep,
.buy__color-name {
  font-family: var(--ff-sans);
  font-size: 13px;
  color: var(--ink);
}

.buy__color-name {
  font-weight: 500;
}

.buy__label-link {
  font-size: 12px;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.color-swatches {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
}

.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  border: 1px solid rgba(22, 21, 19, 0.12);
  background-size: cover;
  background-position: center;
  cursor: pointer;
  padding: 0;
  outline: 1.5px solid transparent;
  outline-offset: 2px;
  transition: outline-color 0.15s, border-color 0.15s;
}

.color-swatch:hover {
  border-color: var(--ink-soft);
}

.color-swatch.is-active {
  outline-color: var(--brand);
}

.size-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  margin-bottom: 36px;
}

.size-btn {
  aspect-ratio: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(157, 82, 72, 0.35);
  border-radius: 4px;
  background: transparent;
  color: var(--brand);
  font-family: var(--ff-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  padding: 0;
}

.size-btn:hover {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--on-brand);
}

.size-btn.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--on-brand);
}

.size-btn.is-unavailable {
  border-color: rgba(157, 82, 72, 0.18);
  background: transparent;
  color: var(--brand);
  opacity: 0.5;
  text-decoration: line-through;
  pointer-events: none;
}

.buy__cta {
  width: 100%;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.buy__note {
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* ── Responsive ─────────────────────────────── */

@media (max-width: 991px) { /* lg and down */
  .buy-section {
    padding: 72px 0;
  }

  .buy-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  /* Keep the portrait gallery from dominating the stacked layout. */
  .buy__image-wrap {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
  }

  .size-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (max-width: 575px) { /* sm and down */
  .buy-section {
    padding: 48px 0;
  }

  .size-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .buy__gallery .swiper-button-prev,
  .buy__gallery .swiper-button-next {
    width: 36px;
    height: 36px;
  }

  .buy__gallery .swiper-button-prev::after,
  .buy__gallery .swiper-button-next::after {
    font-size: 15px;
  }
}
