/* ==========================================================================
   VITALYS — OUR WATER COLLECTION (PRODUCT SHOWCASE)
   Sections: Variables, Section, Header, Grid, Product Cards, Images,
   Typography, Hover Effects, Animations, Responsive Breakpoints.
   Shares brand tokens (--font-nav, --color-accent, --color-navy,
   --ease-out-quart, etc.) already defined in navbar.css / features.css;
   only section-specific tokens live here.
   ========================================================================== */

/* ==========================================================================
   1. VARIABLES
   ========================================================================== */
:root {
  --collection-padding-desktop: 100px;
  --collection-padding-tablet: 80px;
  --collection-padding-mobile: 60px;

  --collection-description-max-width: 700px;

  --collection-heading-desktop: 52px;
  --collection-heading-tablet: 42px;
  --collection-heading-mobile: 32px;

  --collection-image-height-desktop: 340px;
  --collection-image-height-tablet: 260px;
  --collection-image-height-mobile: 180px;

  --collection-card-radius: 20px;
  --collection-card-padding: 25px;
}

/* ==========================================================================
   2. SECTION
   ========================================================================== */
.product-collection {
  background: #ffffff;
  padding-top: var(--collection-padding-desktop);
  padding-bottom: var(--collection-padding-desktop);
  text-align: center;
}

/* ==========================================================================
   3. HEADER
   ========================================================================== */
.product-collection-subtitle {
  margin: 0 0 15px;
  font-family: var(--font-nav);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--color-accent);
}

.product-collection-heading {
  margin: 0 0 20px;
  font-family: var(--font-nav);
  font-weight: 700;
  font-size: var(--collection-heading-desktop);
  line-height: 1.15;
  color: var(--color-navy);
  text-wrap: balance;
}

.product-collection-description {
  margin: 0 auto 70px;
  max-width: var(--collection-description-max-width);
  font-family: var(--font-nav);
  font-size: 18px;
  line-height: 1.8;
  color: var(--color-description);
  text-wrap: pretty;
}

/* ==========================================================================
   4. GRID
   ========================================================================== */
.product-grid > .col {
  display: flex;
}

/* ==========================================================================
   5. PRODUCT CARDS
   ========================================================================== */
.product-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  background: transparent;
  border-radius: var(--collection-card-radius);
  padding: var(--collection-card-padding);
  text-align: center;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.product-card:hover,
.product-card:focus-within {
  transform: translateY(-8px);
  box-shadow: 0 24px 48px rgba(12, 44, 81, 0.14);
}

/* ==========================================================================
   6. IMAGES
   ========================================================================== */
.product-image-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: var(--collection-image-height-desktop);
  overflow: hidden;
}

.product-image {
  max-width: 100%;
  height: 100%;
  width: auto;
  object-fit: contain;
  transition: transform 0.35s ease;
}

.product-card:hover .product-image,
.product-card:focus-within .product-image {
  transform: scale(1.05);
}

/* ==========================================================================
   7. TYPOGRAPHY
   ========================================================================== */
.product-title {
  margin: 25px 0 0;
  font-family: var(--font-nav);
  font-weight: 600;
  font-size: 28px;
  color: var(--color-navy);
  transition: color 0.35s ease;
}

.product-description {
  margin: 10px auto 0;
  max-width: 220px;
  font-family: var(--font-nav);
  font-size: 15px;
  line-height: 1.7;
  color: #777777;
}

/* ==========================================================================
   8. HOVER EFFECTS
   ========================================================================== */
.product-card:hover .product-title,
.product-card:focus-within .product-title {
  color: var(--color-accent);
}

/* ==========================================================================
   9. ANIMATIONS
   ========================================================================== */
@keyframes productFadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Cards are fully visible by default. product-collection.js opts individual
   cards into the hidden pre-animation state (.will-animate) only after
   confirming IntersectionObserver support and no reduced-motion
   preference — so a JS failure or a headless/no-scroll render never
   ships a blank section. */
.product-card.will-animate {
  opacity: 0;
  transform: translateY(30px);
}

.product-card.will-animate.is-visible {
  animation: productFadeUp 0.7s var(--ease-out-quart) both;
}

.product-grid > .col:nth-child(1) .product-card.is-visible {
  animation-delay: 0ms;
}

.product-grid > .col:nth-child(2) .product-card.is-visible {
  animation-delay: 150ms;
}

.product-grid > .col:nth-child(3) .product-card.is-visible {
  animation-delay: 300ms;
}

.product-grid > .col:nth-child(4) .product-card.is-visible {
  animation-delay: 450ms;
}

@media (prefers-reduced-motion: reduce) {
  .product-card.will-animate,
  .product-card.will-animate.is-visible {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .product-card:hover,
  .product-card:focus-within {
    transform: none;
  }

  .product-card:hover .product-image,
  .product-card:focus-within .product-image {
    transform: none;
  }
}

/* ==========================================================================
   10. RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* Tablet: 768px–991px */
@media (min-width: 768px) and (max-width: 991.98px) {
  .product-collection {
    padding-top: var(--collection-padding-tablet);
    padding-bottom: var(--collection-padding-tablet);
  }

  .product-collection-heading {
    font-size: var(--collection-heading-tablet);
  }

  .product-image-wrap {
    height: var(--collection-image-height-tablet);
  }

  .product-title {
    font-size: 24px;
  }
}

/* Mobile: below 768px */
@media (max-width: 767.98px) {
  .product-collection {
    padding-top: var(--collection-padding-mobile);
    padding-bottom: var(--collection-padding-mobile);
  }

  .product-collection-heading {
    font-size: var(--collection-heading-mobile);
  }

  .product-collection-description {
    margin-bottom: 50px;
  }

  .product-image-wrap {
    height: var(--collection-image-height-mobile);
  }

  .product-card {
    padding: 18px 12px;
  }

  .product-title {
    margin-top: 18px;
    font-size: 20px;
  }
}
