/* =====================================================
   CleanRide Pro — Gallery Styles
   ===================================================== */

.gallery-hero {
  padding: 120px 0 48px;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
}
.gallery-hero .section-heading { font-size: clamp(2rem, 5vw, 3.5rem); margin-bottom: 12px; }

/* ── Filter Bar ── */
.gallery-filters {
  background: var(--color-white);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--color-border);
}
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 9px 20px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--color-border);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-white);
  cursor: pointer;
  transition: var(--transition);
}
.filter-btn:hover  { border-color: var(--color-primary-light); color: var(--color-primary); }
.filter-btn.active { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-white); }

/* ── Gallery Grid ── */
.gallery-section { padding: 56px 0 96px; background: var(--color-bg); }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.gallery-item {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: var(--transition);
}
.gallery-item:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

/* ── Before / After Slider ── */
.before-after-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  cursor: col-resize;
  user-select: none;
  -webkit-user-select: none;
  background: #111;           /* shows while images load */
}

/* Both images fill the container */
.before-after-slider .ba-after,
.before-after-slider .ba-before {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  draggable: false;
}

/* Before image starts clipped to the left half; JS updates clip-path on drag */
.before-after-slider .ba-before {
  clip-path: inset(0 50% 0 0);
  z-index: 1;
}

/* ── Handle ── */
.ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;                  /* JS overrides via style.left */
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: col-resize;
}
.ba-handle-line {
  width: 2px;
  flex: 1;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 6px rgba(0,0,0,0.4);
}
.ba-handle-circle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-primary, #2d9e58);
  box-shadow: 0 2px 12px rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ba-handle:hover .ba-handle-circle,
.ba-handle:active .ba-handle-circle {
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 4px 20px rgba(0,0,0,0.45);
}

/* ── Before / After Labels ── */
.ba-label {
  position: absolute;
  top: 12px;
  z-index: 5;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-pill, 999px);
  pointer-events: none;
}
.ba-label-before {
  left: 12px;
  background: rgba(0,0,0,0.55);
  color: #fff;
}
.ba-label-after {
  right: 12px;
  background: rgba(45,158,88,0.85);
  color: #fff;
}

/* ── Card Info Row ── */
.gallery-item-info {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.gallery-item-caption {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-dark);
}
.gallery-item-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: rgba(45, 158, 88, 0.08);
  color: var(--color-primary);
  border: 1px solid rgba(45, 158, 88, 0.2);
}
.gallery-item.hidden { display: none; }

/* ── Empty State ── */
.gallery-empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--color-text-muted);
}
.gallery-empty div { font-size: 3rem; margin-bottom: 16px; }
.gallery-empty h3  { color: var(--color-dark); margin-bottom: 8px; }

/* ── CTA Section ── */
.gallery-cta-section { background: var(--color-white); padding: 72px 0; }
.gallery-cta-card {
  background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-primary) 100%);
  border-radius: var(--radius-lg);
  padding: 64px;
  text-align: center;
  color: var(--color-white);
}
.gallery-cta-card h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 12px; }
.gallery-cta-card p  { color: rgba(255,255,255,0.75); margin-bottom: 32px; font-size: 1.05rem; }
.gallery-cta-card .btn-primary { background: var(--color-accent); color: var(--color-dark); }
.gallery-cta-card .btn-primary:hover { background: var(--color-white); }

@media (max-width: 768px) {
  .gallery-hero { padding: 100px 0 40px; }
  .gallery-cta-card { padding: 40px 24px; }
  .ba-handle-circle { width: 34px; height: 34px; }
}