/*
 * Alf Theme — Products Across Vehicle Platforms Section + Shared Product Card
 * Figma nodes: 658:2828 (section), shared .pcard used also in 830:2912
 *
 * Beige background section with vehicle type tabs, a swappable banner
 * image, and a 3-column product card grid.
 *
 * ── Shared product card (.pcard) ──────────────────────────────────
 * Used by BOTH portfolio (830:2912) and platforms (658:2828) sections.
 * Floor colour differs: .pcard--portfolio → #f0f0e3 | .pcard--platforms → #f8faf0
 */

/* ═══════════════════════════════════════════════════════════════════
   SHARED PRODUCT CARD  (.pcard)
   ═══════════════════════════════════════════════════════════════════ */
.pcard {
  background-color: #ffffff;
  border: 1px solid #f3f3f3;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px 0 64px;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.pcard:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* ── Image area ─────────────────────────────────────────────────── */
.pcard__media {
  position: relative;
  width: 100%;
  aspect-ratio: 366 / 215;
  overflow: hidden;
  background-color: #ffffff;
}

/* Beige floor strip — expands to fill media area on card hover */
.pcard__floor {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 75px;
  background-color: #f0f0e3;
  z-index: 0;
  transition: height 0.35s ease;
}

.pcard__floor--light {
  background-color: #f8faf0;
}

.pcard:hover .pcard__floor {
  height: 100%;
}

/* Product image — contained above the floor; z-index keeps it above
   the expanding beige background */
.pcard__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  z-index: 1;
}

/* ── Product name ───────────────────────────────────────────────── */
.pcard__name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-primary, #cd261d);
  text-align: center;
  padding: 0 16px;
  margin: 0;
}

/* ── Responsive: grid column changes handled in grid rules below ── */

/* ═══════════════════════════════════════════════════════════════════
   VEHICLE PLATFORMS SECTION  (.products-platforms)
   ═══════════════════════════════════════════════════════════════════ */
.products-platforms {
  background-color: #f0f0e3;
}

/* ── Section header ─────────────────────────────────────────────── */
.products-platforms__header {
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: var(--header-max-width, 896px);
  margin: 0 auto 48px;
  text-align: center;
}

.products-platforms__title {
  font-size: 36px;
  font-weight: 600;
  line-height: 1;
  color: var(--color-dark, #252525);
  margin: 0;
}

.products-platforms__subtitle {
  font-size: 20px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-dark, #252525);
  margin: 0;
}

/* ── Explorer container ─────────────────────────────────────────── */
.products-platforms__explorer {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ── Banner image ───────────────────────────────────────────────── */
.products-platforms__banner-wrap {
  width: 100%;
  aspect-ratio: 1200 / 370;
  border-radius: 16px;
  overflow: hidden;
  background-color: var(--color-dark, #252525);
}

.products-platforms__banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: opacity 0.3s ease;
  display: block;
}

/* ── Vehicle type tabs ──────────────────────────────────────────── */
.products-platforms__tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.products-platforms__vtab {
  padding: 8px 12px;
  border: none;
  border-bottom: 2px solid var(--color-dark, #252525);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  color: var(--color-dark, #252525);
  background-color: #ffffff;
  transition: background-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.products-platforms__vtab:hover:not(.products-platforms__vtab--active) {
  background-color: #e8e8d8;
}

.products-platforms__vtab--active {
  background-color: var(--color-primary, #cd261d);
  border-bottom-color: var(--color-primary, #cd261d);
  color: #ffffff;
}

/* ── Vehicle product panel ──────────────────────────────────────── */
.products-platforms__panel {
  /* Shown/hidden by JS via hidden attr; avoid layout shift */
}

.products-platforms__panel[hidden] {
  display: none;
}

/* ── Product grid — strict 3-column CSS Grid ───────────────────── */
.products-platforms__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (max-width: 900px) {
  .products-platforms__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Mobile (Figma 659:4012) ────────────────────────────────────── */
@media (max-width: 640px) {
  .products-platforms__title {
    font-size: 32px;
  }

  .products-platforms__subtitle {
    font-size: 20px;
  }

  .products-platforms__banner-wrap {
    aspect-ratio: unset;
    height: 200px;
    border-radius: 16px;
  }

  .products-platforms__tabs {
    justify-content: center;
  }

  /* Active tab on mobile: red bg, dark bottom border */
  .products-platforms__vtab--active {
    border-bottom-color: var(--color-dark, #252525);
  }

  .products-platforms__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}