/* ============================================================
   gallery.css  –  Dynamic Gallery page for NutriconBio Life
   ============================================================ */

/* ── PAGE HERO ──────────────────────────────────────────── */
.gallery-hero {
  background: linear-gradient(135deg, #0D2B55 0%, #1a3f75 55%, #1E7A5A 100%);
  padding: 80px 24px 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.gallery-hero::before {
  content: ''; position: absolute;
  top: -80px; right: -80px;
  width: 360px; height: 360px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}
.gallery-hero::after {
  content: ''; position: absolute;
  bottom: -60px; left: -60px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
}
.gallery-hero-inner {
  max-width: 700px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.gallery-hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
  color: #a8d8c8;
  font-size: 12px; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase;
  padding: 6px 20px; border-radius: 50px;
  margin-bottom: 22px;
}
.gallery-hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800; color: #fff;
  line-height: 1.12; margin-bottom: 16px;
  letter-spacing: -0.5px;
}
.gallery-hero h1 span { color: #4ecda4; }
.gallery-hero p { font-size: 16px; color: #b8d8f0; line-height: 1.7; }

/* Breadcrumb */
.breadcrumb {
  max-width: 1280px; margin: 0 auto;
  padding: 14px 24px; font-size: 13px; color: #5a7a9a;
  display: flex; align-items: center; gap: 8px;
}
.breadcrumb a { color: #2E5FA3; font-weight: 500; transition: color .2s; }
.breadcrumb a:hover { color: #1E7A5A; }
.breadcrumb .sep { color: #9ca3af; }

/* ── MAIN WRAP ───────────────────────────────────────────── */
.gallery-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 24px 80px;
}

/* ── HORIZONTAL FILTER BAR ───────────────────────────────── */
.gallery-filter-wrap {
  position: relative;
  margin-bottom: 40px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 4px 24px rgba(14,43,85,0.06);
  border: 1px solid #e0eaf5;
  padding: 16px;
  overflow: hidden;
}
.gallery-filter-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.gallery-filter-scroll::-webkit-scrollbar {
  height: 6px;
}
.gallery-filter-scroll::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 10px;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 50px;
  border: 1.5px solid #e5e7eb;
  background: #f8fafc;
  color: #4b5563;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.filter-btn:hover {
  border-color: #2E5FA3;
  color: #2E5FA3;
  background: #eef3fb;
}
.filter-btn.active {
  background: linear-gradient(135deg, #2E5FA3, #1E7A5A);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(46,95,163,0.3);
}

/* Results text */
.results-info {
  text-align: center;
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 30px;
}
.results-info strong { color: #0D2B55; }

/* ── MASONRY GRID ────────────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  grid-auto-rows: 240px;
  gap: 20px;
}

/* Dynamic row spanning based on image aspect ratio will be handled via JS or CSS */
.gallery-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #f1f5f9;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(13,43,85,0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.gallery-item.hidden {
  display: none;
}
.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(13,43,85,0.15);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.gallery-item:hover img {
  transform: scale(1.08);
}

/* Hover overlay */
.gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13,43,85,0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.gallery-item:hover .gallery-overlay {
  opacity: 1;
}
.zoom-icon {
  width: 44px; height: 44px;
  background: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  color: #2E5FA3;
  transform: translateY(15px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.gallery-item:hover .zoom-icon {
  transform: translateY(0);
}
.item-category {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  margin-top: 12px;
  letter-spacing: 1px;
  transform: translateY(10px);
  transition: transform 0.3s ease;
}
.gallery-item:hover .item-category {
  transform: translateY(0);
}


/* ── LIGHTBOX ────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.lightbox.open {
  opacity: 1;
  visibility: visible;
}
.lightbox-img-wrap {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}
.lightbox-img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}
.lightbox.open .lightbox-img {
  transform: scale(1);
}

/* Lightbox Controls */
.lb-close, .lb-prev, .lb-next {
  position: absolute;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.2s;
  backdrop-filter: blur(4px);
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover {
  background: rgba(255,255,255,0.25);
}

.lb-close {
  top: 20px; right: 20px;
  width: 44px; height: 44px;
  font-size: 24px;
  position: fixed;
}
.lb-prev {
  left: 20px; top: 50%; transform: translateY(-50%);
  width: 50px; height: 50px; font-size: 20px;
  position: fixed;
}
.lb-next {
  right: 20px; top: 50%; transform: translateY(-50%);
  width: 50px; height: 50px; font-size: 20px;
  position: fixed;
}

/* Empty State */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  display: none;
}
.no-results .icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.no-results h3 { font-size: 20px; color: #0D2B55; margin-bottom: 8px; }
.no-results p { color: #6b7280; }

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); grid-auto-rows: 180px; gap: 12px; }
  .lb-prev, .lb-next { width: 40px; height: 40px; }
  .lb-prev { left: 10px; } .lb-next { right: 10px; }
}
