/* ============================================================
   PRODUCTS.CSS — Products Page Styles
   RULE 304: Classes follow [component-name]-[element]-[modifier]
   No global element selectors. No generic class names.
   Colocated with pages/products.html.
   Nav and footer styles live in global.css.
   ============================================================ */


/* ================================================================
   PAGE HERO
   ================================================================ */

.products-hero-section {
  background-color: var(--color-dark);
  background-image: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 50%, #0f2a2b 100%);
  padding: 80px var(--gutter) 88px;
}

.products-hero-content {
  max-width: var(--max-width);
  margin: 0 auto;
}

.products-hero-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--color-green);
  margin-bottom: 20px;
}

.products-hero-heading {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  color: var(--color-white);
  line-height: 1.12;
  letter-spacing: -1.5px;
  max-width: 700px;
  margin-bottom: 20px;
}

.products-hero-subtext {
  font-size: clamp(1rem, 2vw, 1.1rem);
  color: #999999;
  max-width: 520px;
  line-height: 1.75;
}


/* ================================================================
   FILTER BAR
   ================================================================ */

.products-filter-section {
  background-color: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 68px; /* height of nav-header */
  z-index: 10;
}

.products-filter-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.products-filter-container::-webkit-scrollbar {
  display: none;
}

.products-filter-bar {
  display: flex;
  gap: 4px;
  padding: 12px 0;
  white-space: nowrap;
}

.products-filter-btn {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-mid);
  background-color: transparent;
  border: 1px solid var(--color-border);
  padding: 7px 16px;
  border-radius: 999px;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.products-filter-btn:hover {
  border-color: var(--color-black);
  color: var(--color-black);
}

.products-filter-btn--active {
  background-color: var(--color-black);
  color: var(--color-white);
  border-color: var(--color-black);
}


/* ================================================================
   GALLERY
   ================================================================ */

.products-gallery-section {
  padding: 56px var(--gutter) 80px;
  background-color: var(--color-white);
}

.products-gallery-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.products-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* Hidden items (filtered out by JS) */
.products-gallery-item--hidden {
  display: none;
}

/* Fade-in when items become visible */
.products-gallery-item {
  cursor: pointer;
  margin: 0;
  position: relative;
}

.products-gallery-item-img-wrap {
  position: relative;
  overflow: hidden;
  background-color: var(--color-light);
  aspect-ratio: 4 / 3;
}

.products-gallery-item-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.products-gallery-item:hover .products-gallery-item-img {
  transform: scale(1.04);
}

/* Collage Cover Style */
.products-gallery-item-collage {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  width: 100%;
  height: 100%;
  background-color: var(--color-border);
  border: 1px solid var(--color-border);
  border-radius: 2px;
  overflow: hidden;
  box-sizing: border-box;
}

.products-gallery-item-collage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

/* Hover effects for the collage */
.products-gallery-item:hover .products-gallery-item-collage img {
  transform: scale(1.05);
}

/* Placeholder state — shown while image is loading or src is placeholder */
.products-gallery-item-img[src*="placeholder"] {
  object-fit: contain;
  padding: 32px;
  opacity: 0.2;
  filter: grayscale(1);
}

.products-gallery-item-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.25s;
}

.products-gallery-item:hover .products-gallery-item-overlay {
  background-color: rgba(0, 0, 0, 0.35);
}

.products-gallery-item-zoom {
  font-size: 1.6rem;
  color: var(--color-white);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.25s, transform 0.25s;
}

.products-gallery-item:hover .products-gallery-item-zoom {
  opacity: 1;
  transform: scale(1);
}

.products-gallery-item-caption {
  padding: 10px 0 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.products-gallery-item-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-black);
  line-height: 1.3;
}

.products-gallery-item-tag {
  font-size: 0.75rem;
  color: var(--color-green);
  font-weight: 600;
}

/* Stacked cards effect for albums */
.products-gallery-item--album {
  padding: 8px;
}

.products-gallery-item--album .products-gallery-item-img-wrap {
  overflow: visible;
}

.products-gallery-item--album .products-gallery-item-img-wrap::before,
.products-gallery-item--album .products-gallery-item-img-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 2px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, border-color 0.3s ease;
  pointer-events: none;
}

/* Back-most card */
.products-gallery-item--album .products-gallery-item-img-wrap::before {
  z-index: -2;
  transform: rotate(-3deg) translate(-4px, -4px);
}

/* Middle card */
.products-gallery-item--album .products-gallery-item-img-wrap::after {
  z-index: -1;
  transform: rotate(3deg) translate(4px, -2px);
}

/* Hover effects */
.products-gallery-item--album:hover .products-gallery-item-img-wrap::before {
  transform: rotate(-6deg) translate(-8px, -8px);
  border-color: var(--color-green);
}

.products-gallery-item--album:hover .products-gallery-item-img-wrap::after {
  transform: rotate(6deg) translate(8px, -4px);
  border-color: var(--color-green);
}

.products-gallery-album-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background-color: rgba(0, 0, 0, 0.7);
  color: var(--color-white);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
  z-index: 2;
  transition: background-color 0.2s;
}

.products-gallery-item:hover .products-gallery-album-badge {
  background-color: var(--color-green);
}

/* Empty state */
.products-gallery-empty {
  text-align: center;
  padding: 64px 0;
  font-size: 1rem;
  color: var(--color-grey);
}


/* ================================================================
   LIGHTBOX
   ================================================================ */

.products-lightbox-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.92);
  z-index: 200;
}

.products-lightbox {
  position: fixed;
  inset: 0;
  z-index: 201;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.products-lightbox[hidden],
.products-lightbox-backdrop[hidden] {
  display: none;
}

.products-lightbox-inner {
  max-width: 680px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background-color: var(--color-white);
  padding: 32px;
  border-radius: 4px;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

@media (max-width: 599px) {
  .products-lightbox {
    padding: 12px;
  }
  .products-lightbox-inner {
    padding: 20px 16px;
    max-height: 90vh;
    gap: 16px;
  }
  .products-lightbox-album-title {
    font-size: 1.2rem;
  }
}

.products-lightbox-header {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 16px;
}

.products-lightbox-album-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-black);
  margin: 0 0 6px;
}

.products-lightbox-album-caption {
  font-size: 0.9rem;
  color: var(--color-mid);
  margin: 0;
  line-height: 1.5;
}

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

@media (min-width: 600px) {
  .products-lightbox-grid {
    gap: 24px;
  }
}

.products-lightbox-card {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  background-color: var(--color-light);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.products-lightbox-card-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.products-lightbox-card:hover .products-lightbox-card-img {
  transform: scale(1.03);
}

.products-lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  font-size: 1.5rem;
  color: var(--color-white);
  background-color: rgba(0, 0, 0, 0.6);
  border: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, transform 0.2s;
  z-index: 205;
}

.products-lightbox-close:hover {
  background-color: rgba(0, 0, 0, 0.85);
  transform: scale(1.05);
}


/* ================================================================
   QUOTE CTA
   ================================================================ */

.products-quotecta-section {
  padding: 88px var(--gutter);
  background-color: var(--color-green);
}

.products-quotecta-container {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

.products-quotecta-heading {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--color-white);
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.products-quotecta-text {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 32px;
}

.products-quotecta-btn {
  display: inline-block;
  background-color: var(--color-white);
  color: var(--color-green);
  font-size: 1rem;
  font-weight: 700;
  padding: 14px 32px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.products-quotecta-btn:hover {
  background-color: var(--color-light);
}


/* ================================================================
   RESPONSIVE — Tablet 600px+
   ================================================================ */

@media (min-width: 600px) {

  .products-gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}


/* ================================================================
   RESPONSIVE — Desktop 1024px+
   ================================================================ */

@media (min-width: 1024px) {

  .products-gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
  }
}
