/* ==========================================================================
   PRODUCTS PAGE EXCLUSIVE STYLES
   Handles specific CSS rules for layout blocks unique to products.html.
   ========================================================================== */

/* --- Base Product Card Styling --- */
.prod-card {
  position: relative;
  overflow: hidden;
  background: #111;
  cursor: pointer;
  /* Inner glassmorphism stroke (1px subtle white) */
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Product card image — starts invisible, fades in once loaded */
.prod-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 0.7s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.5s ease;
  opacity: 0;
}

/* Image visible state — added by JS once img fires load event */
.prod-card img.loaded {
  opacity: 0.88;
}

/* Zoom and darken on hover — only after image is fully visible */
.prod-card:hover img.loaded {
  transform: scale(1.05);
  opacity: 0.7;
}

/* --- Performance: defer paint for below-fold sections --- */
#webbing,
#elastic,
#treatment,
#molded-pulp {
  content-visibility: auto;
  contain-intrinsic-size: 0 950px;
}

/* --- Card Content Overlays & Labels --- */
/* Semi-transparent dark overlay on product card text elements */
.prod-card .card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.75) 0%,
    rgba(0, 0, 0, 0.1) 40%,
    transparent 60%
  );
  pointer-events: none;
}

/* Text label container placed at the bottom of the card */
.prod-card .card-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.25rem 1.25rem 1rem;
}

/* Enhanced text contrast for card labels over thin overlays */
.prod-card .card-label h3,
.prod-card .card-label p {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
}

.prod-card .card-label p {
  color: #f9fafb !important; /* Force text to gray-50 (bright white) */
  font-weight: 500 !important; /* Force font weight to medium */
}

/* --- Section Formatting Elements --- */
/* Decorative horizontal rule gradient */
.section-rule-gradient {
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--color-tertiary) 0%,
    var(--color-secondary) 100%
  );
  margin-bottom: 2.5rem;
}

/* Secondary dark section background styling */
.section-dark {
  background: var(--color-secondary);
}

/* Section title padding */
.section-heading {
  padding-top: 2rem;
}

/* Numeric section badge formatting */
.section-num {
  font-family: "Barlow", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #9ca3af;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.25rem;
}

/* --- Button Styling --- */
/* Semi-transparent ghost button */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  color: #fff;
  font-family: "Barlow", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition:
    background 0.2s,
    border-color 0.2s;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.5);
}

/* --- Quick Navigation Pills --- */
.qnav-pill {
  font-family: "Barlow", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 7px 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.65);
  transition: all 0.2s;
  white-space: nowrap;
}

.qnav-pill:hover {
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.qnav-pill.active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

/* --- Asymmetrical Grid Definitions --- */
/* Shoelaces Grid layout (4 Items - Balanced Editorial Layout) */
.grid-shoelace {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: 320px 280px;
  gap: 6px;
}
.sl-flat {
  grid-column: 1 / 7;
  grid-row: 1 / 3;
}
.sl-round {
  grid-column: 7 / 10;
  grid-row: 1 / 2;
}
.sl-oval {
  grid-column: 10 / 13;
  grid-row: 1 / 2;
}
.sl-dualwidth {
  grid-column: 7 / 13;
  grid-row: 2 / 3;
}

/* Webbing Grid layout */
.grid-webbing {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: 420px 240px;
  gap: 6px;
}
.wb-jacquard {
  grid-column: 1 / 7;
  grid-row: 1 / 2;
}
.wb-needle {
  grid-column: 7 / 13;
  grid-row: 1 / 2;
}
.wb-twill {
  grid-column: 1 / 7;
  grid-row: 2 / 3;
}
.wb-gathering {
  grid-column: 7 / 13;
  grid-row: 2 / 3;
}

/* Elastic Grid layout */
.grid-elastic {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 420px;
  gap: 6px;
}
.el-tape {
  grid-column: 1 / 2;
}
.el-jacq {
  grid-column: 2 / 3;
}
.el-knit {
  grid-column: 3 / 4;
}

/* Additional Treatment Grid layout */
.grid-treatment {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: 400px 300px;
  gap: 6px;
}
.tr-tipping {
  grid-column: 1 / 7;
  grid-row: 1 / 2;
}
.tr-screen {
  grid-column: 7 / 13;
  grid-row: 1 / 2;
}
.tr-laser {
  grid-column: 1 / 5;
  grid-row: 2 / 3;
}
.tr-water {
  grid-column: 5 / 9;
  grid-row: 2 / 3;
}
.tr-wax {
  grid-column: 9 / 13;
  grid-row: 2 / 3;
}

/* Molded Pulp Grid layout */
.grid-molded {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: 420px;
  gap: 6px;
}
.mp-sf1 {
  grid-column: 1 / 6;
}
.mp-tray {
  grid-column: 6 / 13;
}

/* Pulp Packaging Grid layout */
.grid-pulp {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: 280px 200px;
  gap: 6px;
}
.pp-protective {
  grid-column: 1 / 6;
  grid-row: 1 / 2;
}
.pp-battery {
  grid-column: 6 / 13;
  grid-row: 1 / 2;
}
.pp-electronics {
  grid-column: 1 / 5;
  grid-row: 2 / 3;
}
.pp-egg {
  grid-column: 5 / 9;
  grid-row: 2 / 3;
}
.pp-industrial {
  grid-column: 9 / 13;
  grid-row: 2 / 3;
}

/* --- Media Queries (Tablet Responsive Grid Collapse) --- */
@media (max-width: 1024px) {
  .grid-shoelace,
  .grid-webbing,
  .grid-elastic,
  .grid-treatment,
  .grid-molded,
  .grid-pulp {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    gap: 6px;
  }
  .grid-shoelace > div,
  .grid-webbing > div,
  .grid-elastic > div,
  .grid-treatment > div,
  .grid-molded > div,
  .grid-pulp > div {
    grid-column: auto;
    grid-row: auto;
    min-height: 260px;
  }

  .grid-pulp .pp-protective {
    grid-column: 1 / 3;
  }
}

/* --- Media Queries (Mobile Responsive Grid Collapse) --- */
@media (max-width: 640px) {
  .grid-shoelace,
  .grid-webbing,
  .grid-elastic,
  .grid-treatment,
  .grid-molded,
  .grid-pulp {
    grid-template-columns: 1fr;
  }
  .grid-shoelace > div,
  .grid-webbing > div,
  .grid-elastic > div,
  .grid-treatment > div,
  .grid-molded > div,
  .grid-pulp > div {
    grid-column: 1 / -1;
    grid-row: auto;
    min-height: 240px;
  }
  .grid-shoelace .sl-flat {
    min-height: 280px;
  }
}
