/* ==================================================
   PRODUCTS INTRO
   ================================================== */

.products-intro {
  padding: 7rem 5%;

  background-color: #111111;
  color: #ffffff;

  text-align: center;
}

.products-intro-content {
  max-width: 800px;
  margin: 0 auto;
}

.products-intro h1 {
  margin-bottom: 1.2rem;

  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.1;
}

.products-intro p:not(.section-label) {
  color: #cccccc;

  font-size: 1.05rem;
}

/* ==================================================
   PRODUCT CATEGORY
   ================================================== */

.product-category {
  padding: 7rem 5%;

  background-color: #ffffff;
}

/* Alternate the background of every second section */
.product-category:nth-of-type(even) {
  background-color: #f7f7f7;
}

.product-category-heading {
  width: 100%;
  max-width: 750px;
  margin: 0 auto 4rem;

  text-align: center;
}

.product-category-heading h2 {
  margin-bottom: 1rem;

  color: #111111;

  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
}

.product-category-heading p:not(.section-label) {
  color: #666666;

  font-size: 1.05rem;
}

/* ==================================================
   PRODUCT GRID
   4 per row on desktop, 3 on tablet, 2 on mobile.
   Flex (not grid) so an incomplete last row stays centred.
   ================================================== */

.product-grid {
  --gap: 1.5rem;
  --columns: 4;

  width: 100%;
  max-width: 1200px;
  margin: 0 auto;

  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--gap);
}

/* ==================================================
   SUB-PRODUCT CARDS (image + text + Get Quote button)
   ================================================== */

.sub-card {
  width: calc((100% - (var(--columns) - 1) * var(--gap)) / var(--columns));

  display: flex;
  flex-direction: column;

  overflow: hidden;

  background-color: #ffffff;

  border-radius: 16px;

  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.06);

  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease;
}

.sub-card:hover {
  transform: translateY(-8px);

  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
}

/* ---------- Image ---------- */

.sub-card-image {
  aspect-ratio: 4 / 3;

  overflow: hidden;

  /* Shows while the image is empty or loading */
  background-color: #e9e9e9;
}

.sub-card-image img {
  width: 100%;
  height: 100%;

  object-fit: cover;

  transition: transform 0.6s ease;
}

.sub-card:hover .sub-card-image img {
  transform: scale(1.07);
}

/* ---------- Body ---------- */

.sub-card-body {
  flex: 1;

  display: flex;
  flex-direction: column;

  padding: 1.25rem 1.25rem 1.5rem;
}

.sub-card-body h3 {
  margin-bottom: 0.6rem;

  color: #111111;

  font-size: 1.05rem;
  line-height: 1.3;
}

.sub-card-body p {
  margin-bottom: 1.25rem;

  color: #666666;

  font-size: 0.88rem;
}

/* Button pinned to the bottom of the card */
.sub-card-btn {
  margin-top: auto;

  padding: 0.7rem 1rem;

  font-size: 0.88rem;
  text-align: center;
}

/* ==================================================
   RESPONSIVE: TABLETS (3 per row)
   ================================================== */

@media (max-width: 900px) {
  .product-grid {
    --columns: 3;
  }
}

/* ==================================================
   RESPONSIVE: MOBILE PHONES (2 per row)
   ================================================== */

@media (max-width: 600px) {
  .products-intro,
  .product-category {
    padding: 5rem 5%;
  }

  .product-grid {
    --columns: 2;
    --gap: 1rem;
  }

  .sub-card {
    border-radius: 12px;
  }

  .sub-card-body {
    padding: 1rem 0.9rem 1.1rem;
  }

  .sub-card-body h3 {
    font-size: 0.95rem;
  }

  .sub-card-body p {
    margin-bottom: 1rem;

    font-size: 0.8rem;
  }

  .sub-card-btn {
    padding: 0.65rem 0.5rem;

    font-size: 0.8rem;
  }
}