/* =======================================
  PRODUCTS MAIN HERO
======================================= */
.products-main-hero {
  position: relative;
  min-height: 800px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.products-main-hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
}

.products-main-hero .row {
  max-width: 1560px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.products-main-hero__content {
  max-width: 650px;
  color: #fff;
}

.products-main-hero__eyebrow {
  display: inline-block;
  font-family: "Lato", sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 24px;
  color: #ed1c24;
  margin-bottom: 30px;
}

.products-main-hero__title {
  color: #fff;

  /* H1 */
  font-family: Poppins;
  font-size: 50px;
  font-style: normal;
  font-weight: 700;
  line-height: normal;
  margin-bottom: 20px;
}

.products-main-hero__text {
  color: #fafbfc;

  /* P */
  font-family: Lato;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: 24px; /* 150% */
}

/* =======================================
  PRODUCTS MAIN GRID SECTION
======================================= */
.products-main .row {
  max-width: 1560px;
  margin: 0 auto;
}

.products-main__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  margin-bottom: 30px;
}

.products-main__title .red_text {
  color: #ed1c24;
  font-family: "Lato", sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 30px;
  text-align: left;
  display: inline-block;
}

.products-main__h2 {
  margin: 0;
  color: #151515;
  font-family: "Poppins", sans-serif;
  font-size: clamp(26px, 2.2vw, 40px);
  font-weight: 700;
  line-height: normal;
  max-width: 600px;

  @media (max-width: 1199px) {
    max-width: unset;
  }
}

.products-main__desc {
  max-width: 650px;
}

.products-main__desc p {
  color: var(--P, #4a4a4a);

  /* P */
  font-family: Lato;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: 24px; /* 150% */
}

/* Grid */
.products-main__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

/* Card */
.pm-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #f3f3f3;
  height: 500px;
}

.pm-card:nth-child(-n + 3) {
  height: 500px; /* top row slightly taller (like ref) */
}

.pm-card__media {
  position: absolute;
  inset: 0;
}

.pm-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  transition: transform 0.6s ease;
}

.pm-card:hover .pm-card__img {
  transform: scale(1.2);
}

/* Content sits at the bottom with a fixed layout */
.pm-card__content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;

  padding: 30px;
  color: #fff;
  z-index: 2;

  display: grid;
  grid-template-rows:
    36px
    96px;

  row-gap: 20px;
}

.pm-card--with-btn .pm-card__content {
  grid-template-rows:
    36px
    96px
    40px;
}

/* TITLE SLOT */
.pm-card__content h3 {
  margin: 0;
  font-family: "Poppins", sans-serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 28px;

  max-height: 36px; /* 2 lines */
  overflow: hidden;
}

/* DESC SLOT */
.pm-card__content p {
  margin: 0;
  font-family: Lato;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: #fff;

  max-height: 96px; /* 4 lines */
  overflow: hidden;
}

/* BUTTON SLOT */
.pm-card__btn {
  align-self: start;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 40px;
  padding: 0 18px;
  border-radius: 999px;

  background: #ed1c24;
  border: 1px solid #ed1c24;
  color: #fff;
  text-decoration: none;

  font-family: Lato;
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;

  width: fit-content;
}
.pm-card__btn:hover {
  background: #000;
  border: 1px solid #ed1c24;
}

/* Wide last card */
.pm-card--wide {
  grid-column: 1 / -1;
  height: 500px;
}

/* =======================================
  RESPONSIVE
======================================= */
@media (max-width: 991px) {
  .products-main-hero {
    min-height: 460px;
  }

  .products-main-hero__content {
    padding: 90px 0;
    max-width: 560px;
  }

  .products-main__header {
    flex-direction: column;
    gap: 14px;
  }

  .products-main__desc {
    max-width: 100%;
  }

  .products-main__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  .pm-card,
  .pm-card:nth-child(-n + 3) {
    height: 320px;
  }

  .pm-card--wide {
    grid-column: 1 / -1;
    height: 240px;
  }
}

@media (max-width: 575px) {
  .products-main-hero {
    min-height: 420px;
  }

  .products-main-hero__content {
    padding: 70px 0;
  }

  .products-main__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .pm-card,
  .pm-card:nth-child(-n + 3),
  .pm-card--wide {
    height: 320px;
  }
}

/* =======================================
  RESPONSIVE – CARDS + CONTENT SLOTS
  Paste at the very bottom so it overrides
======================================= */

/* Optional: smooth card height scaling instead of hard jumps */
@media (max-width: 1199px) {
  .pm-card,
  .pm-card:nth-child(-n + 3),
  .pm-card--wide {
    height: 460px;
  }

  .pm-card__content {
    padding: 26px;
    grid-template-rows: 52px 90px 40px; /* title / desc / button */
    row-gap: 12px;
  }

  .pm-card__content h3 {
    font-size: 22px;
    line-height: 28px;
  }

  .pm-card__content p {
    font-size: 15px;
    line-height: 22px;
  }

  .pm-card__btn {
    height: 38px;
    font-size: 15px;
    padding: 0 16px;
  }
}

/* Tablet */
@media (max-width: 991px) {
  .pm-card,
  .pm-card:nth-child(-n + 3),
  .pm-card--wide {
    height: 380px;
  }

  .pm-card__content {
    padding: 22px;
    grid-template-rows: 46px 78px 36px;
    row-gap: 10px;
  }

  .pm-card__content h3 {
    font-size: 20px;
    line-height: 24px;
  }

  .pm-card__content p {
    font-size: 14px;
    line-height: 20px;
  }

  .pm-card__btn {
    height: 34px;
    font-size: 14px;
    padding: 0 14px;
  }
}

/* Mobile */
@media (max-width: 575px) {
  .pm-card,
  .pm-card:nth-child(-n + 3),
  .pm-card--wide {
    height: 320px;
  }

  .pm-card__content {
    padding: 18px;
    grid-template-rows: 40px 64px 34px;
    row-gap: 10px;
  }

  .pm-card__content h3 {
    font-size: 18px;
    line-height: 22px;
  }

  .pm-card__content p {
    font-size: 13px;
    line-height: 18px;
  }

  .pm-card__btn {
    height: 32px;
    font-size: 13px;
    padding: 0 12px;
  }
}

.pm-card--wide .pm-card__content {
  z-index: 2; /* above overlay */
  left: 0;
  right: auto; /* IMPORTANT: stops it spanning full width */
  bottom: 0;

  width: min(520px, 100%);

  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Keep title/desc tidy */
.pm-card--wide .pm-card__content h3 {
  max-height: none; /* wide card can breathe */
  overflow: visible;
}

.pm-card--wide .pm-card__content p {
  white-space: nowrap;
  overflow: visible;
}

/* Button sits nicely under text (not forced to the bottom) */
.pm-card--wide .pm-card__btn {
  margin-top: 8px;
}

/* Responsive tweaks */
@media (max-width: 991px) {
  .pm-card--wide .pm-card__content {
    width: min(520px, 100%);
    padding: 28px 24px;
  }

  .pm-card--wide .pm-card__content p {
    max-width: 100%;
  }
}

@media (max-width: 575px) {
  .pm-card--wide .pm-card__content {
    width: 100%;
    padding: 20px;
  }
}
