/* MATERIALS PAGE - Core Components Subpage */
.page-materials { background: var(--color-bg); }

/* PAGE HEADER */
.page-header { 
  padding: 60px 0 40px; 
  background: var(--color-bg-secondary);
}

.nav-buttons {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-primary);
  text-decoration: none;
  font-weight: 600;
  padding: 12px 24px;
  border: 2px solid var(--color-border);
  border-radius: 12px;
  transition: all 0.3s ease;
  background: var(--color-bg-card);
}

.nav-btn:hover {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

.back-btn {
  border-color: var(--color-accent);
  background: rgba(var(--color-accent-rgb), 0.1);
}

.back-btn:hover {
  transform: translateY(-2px) scale(1.05);
}


.back-btn { 
  display: flex; 
  align-items: center; 
  gap: 8px; 
  color: var(--color-text-primary); 
  text-decoration: none; 
  font-weight: 600; 
  padding: 12px 20px; 
  border: 1px solid var(--color-border); 
  border-radius: 8px; 
  transition: all 0.3s ease;
}
.back-btn:hover { background: var(--color-accent); color: white; }
.breadcrumb { display: flex; gap: 12px; align-items: center; }
.breadcrumb li { color: var(--color-text-secondary); }
.breadcrumb li.active { color: var(--color-text-primary); font-weight: 600; }
.page-title { font-size: 42px; margin: 0; }

/* HERO */
.hero-materials {
  position: relative;
  height: 500px;
  overflow: hidden;
}

.hero-image { 
  height: 100%; 
  background-size: cover; 
  background-position: center; 
  position: relative; 
}
/* Scope to .hero-materials to prevent common.css layout from splitting the text */
.hero-materials .hero-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 800px;
  background: var(--color-bg-card);
  backdrop-filter: blur(10px);
  padding: 36px 40px;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  text-align: center;
  
  /* FORCES STACKED LAYOUT (Top & Bottom) */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-materials .hero-content h2 { 
  font-size: 32px; 
  margin: 0 0 16px; 
  color: var(--color-text-primary);
}

.hero-materials .hero-content p { 
  font-size: 18px; 
  color: var(--color-text-secondary); 
  margin: 0;
}

/* MATERIALS GRID */
.materials-section { padding: 80px 0; }
.materials-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); 
  gap: 32px; 
}

.materials-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: all 0.4s ease;
}

/* use a fixed aspect ratio instead of height:480px */
.materials-image {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;   /* Edit to change card height */
  overflow: hidden;
}

.materials-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}



.materials-card:hover { 
  transform: translateY(-12px); 
  box-shadow: 0 32px 80px rgba(0,0,0,0.15);
}

.materials-card:hover .materials-image img { transform: scale(1.05); }

.materials-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 24px;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.90) 0%,
    rgba(0,0,0,0.70) 35%,
    rgba(0,0,0,0.30) 65%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 1;
}

  .materials-overlay {
    padding: 18px 22px 28px;  /* extra bottom padding */
  }

  .materials-label h3 {
    font-size: 20px;
  }

  .materials-label p {
    font-size: 13px;
  }

.materials-label {
  max-width: 100%;
}

.materials-label h3 { 
  font-size: 24px; 
  font-weight: 800; 
  color: #fff; 
  margin: 0 0 6px; 
}

.materials-label p { 
  color: rgba(255,255,255,0.95); 
  font-size: 14px; 
  margin: 0 0 10px; 
}

.materials-specs { 
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: rgba(255,255,255,0.9);
  justify-content: center;  /* center the spans horizontally */
  text-align: center;       /* center text inside each span */
}
.materials-specs span { 
  background: rgba(255,255,255,0.15); 
  padding: 6px 12px; 
  border-radius: 8px; 
  font-weight: 600; 
}

/* COMPARISON TABLE */
.comparison-section {
  padding: 80px 0;
  background: var(--color-bg-secondary);
}

.comparison-grid {
  display: block;
  background: var(--color-bg-card);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-raised);
}

/* Desktop: 4 columns in one line */
.comparison-header,
.comparison-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1.1fr 2fr; /* Material | Price | Water | Best for */
  column-gap: 16px;
  align-items: center;
}

.comparison-header {
  background: var(--color-accent);
  color: white;
  padding: 16px 24px;
  font-weight: 700;
}

.comparison-row {
  padding: 16px 24px;
  font-size: 14px;
}

.comparison-header span,
.comparison-row span {
  white-space: nowrap;
}

.comparison-row span:last-child {
  white-space: normal; /* allow “Best for” text to wrap */
}

.comparison-row:nth-child(even) { background: rgba(0,0,0,0.02); }
.comparison-row span { font-weight: 600; }
.fa-circle.medium { color: #fbbf24 !important; }
.fa-circle.good   { color: #34d399 !important; }


/* CTA */
.cta-section { 
  padding: 80px 0; 
  background: radial-gradient(
      circle at top left,
      rgba(255, 255, 255, 0.06),
      transparent 55%
    ),
    linear-gradient(
      135deg,
      var(--color-accent) 0%,
      color-mix(in srgb, var(--color-accent) 70%, #000 30%) 100%
    );
  color: white; 
}

.cta-content { text-align: center; max-width: 600px; margin: 0 auto; }
.cta-content h2 { font-size: 36px; margin: 0 0 16px; }
.cta-content p { font-size: 18px; margin: 0 0 40px; opacity: 0.9; }
.cta-buttons { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }

/* .btn-header sizing is inherited from common.css global rules */

/* RESPONSIVE */
@media (max-width: 980px) {
  .materials-grid {
    grid-template-columns: 1fr;
  }

  .materials-card {
    height: auto;          /* let content define height */
  }

  .materials-image {
    aspect-ratio: 4 / 5;   /* keep image ratio */
  }
}


/* Mobile styling for hero content */
@media (max-width: 768px) {
  .hero-content {
    width: calc(100% - 32px);
    padding: 24px;
  }
}

  .comparison-grid { 
    grid-template-columns: 1fr; 
  }



  .comparison-header,
  .comparison-row {
    grid-template-columns: 1.2fr 0.8fr;  /* 2 columns on mobile */
    grid-auto-rows: auto;
    row-gap: 4px;
  }

  .comparison-header span:nth-child(3),
  .comparison-header span:nth-child(4),
  .comparison-row span:nth-child(3),
  .comparison-row span:nth-child(4) {
    justify-self: flex-start;
  }
  
/* Desktop: force 4 columns for comparison table */
@media (min-width: 981px) {
  .comparison-header,
  .comparison-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 equal columns */
    column-gap: 16px;
    align-items: center;
  }
}


@media (max-width: 560px) {
  .page-title { font-size: 32px; }
  .hero-materials { height: 400px; }
  .breadcrumb-nav { flex-direction: column; align-items: flex-start; gap: 16px; }
}

/* MOBILE: make Finishes + Hardware share the 2nd line */
@media (max-width: 560px) {
  .nav-buttons {
    justify-content: center;
    gap: 12px;
  }

  /* First button (Core Components) takes full row */
  .nav-buttons .back-btn {
    flex: 0 0 100%;
    justify-content: center;
  }

  /* Second row: Finishes + Hardware side by side */
  .nav-buttons .nav-btn:not(.back-btn) {
    flex: 0 0 calc(50% - 6px);  /* two per row */
    justify-content: center;
  }
}
