/* ================================================================
   PRODUCTS PAGE — Dark theme
   Desktop: clip-path animation (GPU composited)
   Mobile: stacked cards, click to expand
   ================================================================ */

#products { background: #000 !important; color: #fff !important; }
#products > section { background: #000 !important; }
#products .mb-10 p, #products .mb-10 h2,
#products .mb-12 p, #products .mb-12 h2 { color: #fff !important; }
#products .mb-10 p:first-child,
#products .mb-12 p:first-child { color: rgba(255,255,255,0.45) !important; }

/* ── DESKTOP grid ───────────────────────────────────────────────── */
.products-grid {
  display: flex;
  flex-direction: row;
  gap: 14px;
  max-width: 1400px;
  margin: 0 auto;
  height: 520px;
}

.pg-col {
  position: relative;
  flex: 1;
  min-width: 0;
}

/* Cards fill column, animated via clip-path */
.product-card {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  padding: 24px;
  color: #fff;
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  will-change: clip-path;
  transition: clip-path 0.75s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card.slot-top,
.product-card.slot-bot { justify-content: flex-start; }

/* Background images */
.pc1 { background-image: url('https://images.unsplash.com/photo-1586528116311-ad8dd3c8310d?auto=format&fit=crop&q=80'); }
.pc2 { background-image: url('https://images.unsplash.com/photo-1565043666747-69f6646db940?auto=format&fit=crop&q=80'); }
.pc3 { background-image: url('https://images.unsplash.com/photo-1521737604893-d14cc237f11d?auto=format&fit=crop&q=80'); }
.pc4 { background-image: url('https://images.unsplash.com/photo-1494412574643-ff11b0a5c1c3?auto=format&fit=crop&q=80'); }
.pc5 { background-image: url('https://images.unsplash.com/photo-1554224155-6726b3ff858f?auto=format&fit=crop&q=80'); }
.pc6 { background-image: url('https://images.unsplash.com/photo-1484480974693-6ca0a78fb36b?auto=format&fit=crop&q=80'); }

.product-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  pointer-events: none;
}
.product-card.slot-bot::after {
  background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.3) 60%, rgba(0,0,0,0.05) 100%);
}
.product-card.slot-top::after {
  background: linear-gradient(to bottom, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.3) 60%, rgba(0,0,0,0.05) 100%);
}

/* Content centered within visible region (top/height set by JS) */
.product-card .card-content {
  position: absolute;
  left: 24px;
  right: 24px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: top 0.75s cubic-bezier(0.4, 0, 0.2, 1),
              height 0.75s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card h3 {
  font-size: 17px;
  margin-bottom: 4px;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
  transition: font-size 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.product-card.is-big h3 { font-size: 22px; }

.product-card p {
  font-size: 12px;
  opacity: 0.75;
  line-height: 1.4;
  margin-bottom: 0;
  color: #fff;
}

.product-card ul {
  list-style: none;
  padding: 0;
  margin: 10px 0 0 0;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.1s,
              opacity 0.4s ease 0.2s;
}
.product-card.is-big ul { max-height: 200px; opacity: 1; }
.product-card ul li {
  font-size: 11.5px;
  line-height: 1.6;
  opacity: 0.85;
  margin-bottom: 3px;
  padding-left: 14px;
  position: relative;
  color: #fff;
}
.product-card ul li::before {
  content: "•";
  position: absolute;
  left: 0;
  opacity: 0.55;
}

/* ── STACKED MODE ────────────────────────────────────────────────
   Activated by JS adding .stacked to .products-grid
   All 6 cards shown in a single vertical list, click to expand
   ─────────────────────────────────────────────────────────────── */
.products-grid.stacked {
  flex-direction: column;
  height: auto;
  gap: 10px;
}

/* Columns become simple wrappers with no special positioning */
.products-grid.stacked .pg-col {
  position: static;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: none;
}

/* Cards become normal block elements */
.products-grid.stacked .product-card {
  position: relative;
  inset: auto;
  /* height controlled by JS inline style */
  overflow: hidden;
  clip-path: none !important;
  will-change: height;
  transition: height 0.45s cubic-bezier(0.4, 0, 0.2, 1) !important;
  cursor: pointer;
  justify-content: flex-end;
  align-items: flex-start;
  text-align: left;
}

/* Gradient always from bottom in stacked */
.products-grid.stacked .product-card::after {
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.1) 100%) !important;
}

/* Content back to normal flow in stacked */
.products-grid.stacked .product-card .card-content {
  position: relative;
  left: auto;
  right: auto;
  top: auto !important;
  height: auto !important;
  width: 100%;
  align-items: flex-start;
  justify-content: flex-end;
  transition: none !important;
}

/* Collapsed: only title + subtitle visible */
.products-grid.stacked .product-card ul {
  max-height: 0;
  opacity: 0;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.05s,
              opacity 0.3s ease 0.1s !important;
}

/* Expanded: show bullets */
.products-grid.stacked .product-card.stack-expanded ul {
  max-height: 200px;
  opacity: 1;
}

/* Expand indicator arrow */
.products-grid.stacked .product-card .card-content::after {
  content: "↓";
  position: absolute;
  top: -2px;
  right: 0;
  font-size: 14px;
  opacity: 0.6;
  transition: transform 0.35s ease, opacity 0.3s ease;
}
.products-grid.stacked .product-card.stack-expanded .card-content::after {
  transform: rotate(180deg);
  opacity: 0.9;
}

/* Stacked: heading always visible */
.products-grid.stacked .product-card h3 {
  font-size: 16px !important;
  margin-bottom: 0;
  opacity: 1;
}

/* Stacked collapsed: hide subtitle */
.products-grid.stacked .product-card p {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin: 0;
  transition: max-height 0.35s ease, opacity 0.3s ease;
}

/* Stacked expanded: show subtitle */
.products-grid.stacked .product-card.stack-expanded p {
  max-height: 40px;
  opacity: 0.75;
  transition: max-height 0.35s ease 0.05s, opacity 0.3s ease 0.1s;
}

/* Stacked expanded: show bullets */
.products-grid.stacked .product-card.stack-expanded ul {
  max-height: 200px;
  opacity: 1;
}