/* Shop By Category — modenza full-bleed collection row */

.bsp-shop-categories {
  background: #ffffff;
  padding: 0;
  overflow-x: clip;
}

.bsp-shop-categories__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  width: 100%;
  min-width: 0;
}

.bsp-shop-categories__card {
  margin: 0;
  min-width: 0;
  overflow: hidden;
}

.bsp-shop-categories__card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.bsp-shop-categories__card-link:focus-visible {
  outline: 2px solid #111111;
  outline-offset: -2px;
}

.bsp-shop-categories__card-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4.6;
  background: var(--bsp-sc-media-bg, #e8e4df);
}

.bsp-shop-categories__card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.bsp-shop-categories__card-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(165deg, #ebe7e2 0%, #ddd8d2 100%);
}

.bsp-shop-categories__card-link:hover .bsp-shop-categories__card-media img,
.bsp-shop-categories__card-link:focus-visible .bsp-shop-categories__card-media img {
  transform: scale(1.03);
}

.bsp-shop-categories__card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  text-align: center;
  padding: clamp(24px, 4vw, 40px) clamp(14px, 2vw, 20px);
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 58%,
    rgba(0, 0, 0, 0.12) 78%,
    rgba(0, 0, 0, 0.38) 100%
  );
  pointer-events: none;
}

.bsp-shop-categories__card-title {
  margin: 0;
  color: var(--bsp-sc-card-title, #ffffff);
  font-family: var(--bsp-font-heading);
  font-size: clamp(1.25rem, 2.1vw, 1.75rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.15;
  text-transform: none;
  text-shadow: 0 1px 24px rgba(0, 0, 0, 0.22);
}

.bsp-shop-categories__card-subtitle {
  margin: 8px 0 0;
  max-width: 22ch;
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--bsp-font-body, inherit);
  font-size: clamp(11px, 1.1vw, 13px);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.45;
  text-transform: none;
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.2);
}

.bsp-shop-categories__footer {
  display: none;
}

.bsp-shop-categories__view-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 32px;
  border: 1px solid var(--bsp-sc-btn-bg, #111111);
  border-radius: 0;
  background: transparent;
  color: var(--bsp-sc-btn-bg, #111111);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-decoration: none;
}

@media (min-width: 768px) {
  .bsp-shop-categories__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .bsp-shop-categories__card-media {
    aspect-ratio: 3 / 4.75;
  }

  /* 6 items: row 1 = 4 tiles, row 2 = 2 half-width tiles (same height as row 1) */
  .bsp-shop-categories__card:nth-child(5):nth-last-child(2) {
    grid-column: 1 / span 2;
  }

  .bsp-shop-categories__card:nth-child(6):last-child {
    grid-column: 3 / span 2;
  }

  .bsp-shop-categories__card:nth-child(5):nth-last-child(2) .bsp-shop-categories__card-media,
  .bsp-shop-categories__card:nth-child(6):last-child .bsp-shop-categories__card-media {
    aspect-ratio: 6 / 4.75;
  }
}

@media (min-width: 1200px) {
  .bsp-shop-categories__card-title {
    font-size: clamp(1.4rem, 1.6vw, 1.85rem);
  }

  .bsp-shop-categories__card-subtitle {
    font-size: 13px;
    margin-top: 10px;
  }
}

@media (max-width: 767px) {
  .bsp-shop-categories__card-media {
    aspect-ratio: 3 / 4.2;
  }

  .bsp-shop-categories__card-overlay {
    padding: 20px 12px;
  }

  .bsp-shop-categories__card-title {
    font-size: clamp(1.05rem, 4.2vw, 1.25rem);
  }

  .bsp-shop-categories__card-subtitle {
    font-size: 10px;
    margin-top: 6px;
    max-width: 18ch;
  }
}

@media (max-width: 479px) {
  .bsp-shop-categories__card-media {
    aspect-ratio: 3 / 4;
  }
}
