/* ==========================================================================
   SHOPSPHERE - GALLERY PAGE STYLESHEET (css/gallery.css)
   Clean, category-wise visual showcase (Image and Name only)
   ========================================================================== */

/* Page Sticky Footer Support */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main.gallery-main-section {
  flex: 1 0 auto;
  padding: 36px 0 80px 0;
  background-color: var(--bg-body);
}

/* --------------------------------------------------------------------------
   1. GALLERY HERO SECTION (Minimalist & Clean)
   -------------------------------------------------------------------------- */
.gallery-hero-section {
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-muted) 100%);
  padding: 36px 0 28px 0;
  border-bottom: 1px solid var(--border-color);
  text-align: center;
}

.gallery-hero-inner {
  max-width: 680px;
  margin: 0 auto;
}

.gallery-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.gallery-hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.gallery-hero-title span {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gallery-hero-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   2. CATEGORY FILTER TABS TOOLBAR
   -------------------------------------------------------------------------- */
.gallery-toolbar-section {
  background-color: var(--bg-surface);
  padding: 18px 0;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 72px;
  z-index: 95;
  box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.04);
}

.gallery-toolbar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.gallery-filter-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.gallery-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  color: var(--text-body);
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.gallery-tab-btn i {
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.gallery-tab-btn .tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.08);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  margin-left: 2px;
}

.gallery-tab-btn:hover {
  background: var(--bg-surface);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.gallery-tab-btn:hover i {
  color: var(--primary);
}

.gallery-tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: var(--shadow-primary);
}

.gallery-tab-btn.active i {
  color: #ffffff;
}

.gallery-tab-btn.active .tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   3. GALLERY GRID (Image and Name ONLY)
   -------------------------------------------------------------------------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  transition: all 0.3s ease;
}

/* Clean Card Design (Only Image & Name) */
.gallery-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease, border-color 0.28s ease;
  display: flex;
  flex-direction: column;
}

.gallery-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

/* Image Container */
.gallery-card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: var(--bg-muted);
}

.gallery-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-card:hover .gallery-card-img {
  transform: scale(1.08);
}

/* Hover Zoom Indicator (Subtle overlay icon) */
.gallery-card-img-wrap::after {
  content: '\f00e'; /* fa-magnifying-glass-plus */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  opacity: 0;
  transition: all 0.25s ease;
  pointer-events: none;
}

.gallery-card:hover .gallery-card-img-wrap::after {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Card Name Box (Clean & Bold) */
.gallery-card-name-box {
  padding: 14px 16px;
  text-align: center;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-card-name {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  margin: 0;
  transition: color 0.2s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gallery-card:hover .gallery-card-name {
  color: var(--primary);
}

/* --------------------------------------------------------------------------
   4. FULLSCREEN LIGHTBOX POPUP (Click to open, Next/Prev to browse)
   -------------------------------------------------------------------------- */
.gallery-lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(10, 15, 29, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  padding: 20px;
}

.gallery-lightbox-modal.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-wrapper {
  position: relative;
  max-width: 960px;
  width: 100%;
  display: flex;
  flex-direction: column;
  background: #0f172a;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-lightbox-modal.active .lightbox-wrapper {
  transform: scale(1);
}

/* Lightbox Header Bar */
.lightbox-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.lightbox-counter-badge {
  font-size: 0.86rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.5px;
}

.lightbox-close-btn {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  transition: all 0.2s ease;
}

.lightbox-close-btn:hover {
  background: var(--accent-red);
  transform: rotate(90deg);
}

/* Main Image Display Stage */
.lightbox-stage {
  position: relative;
  width: 100%;
  min-height: 340px;
  max-height: 65vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #060911;
  overflow: hidden;
  padding: 12px;
}

.lightbox-image {
  max-width: 100%;
  max-height: 62vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  display: block;
  transition: opacity 0.2s ease;
}

/* Navigation Arrows (Next / Prev) */
.lightbox-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.lightbox-nav-arrow:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.lightbox-arrow-prev {
  left: 20px;
}

.lightbox-arrow-next {
  right: 20px;
}

/* Lightbox Name Bar (Name Only) */
.lightbox-name-bar {
  padding: 16px 24px;
  background: rgba(15, 23, 42, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.lightbox-product-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   5. RESPONSIVE BREAKPOINTS
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .gallery-toolbar-section {
    top: 64px;
    padding: 14px 0;
  }

  .gallery-hero-title {
    font-size: 1.75rem;
  }

  .gallery-tab-btn {
    padding: 8px 16px;
    font-size: 0.84rem;
  }

  .lightbox-nav-arrow {
    width: 40px;
    height: 40px;
    font-size: 1.05rem;
  }

  .lightbox-arrow-prev { left: 10px; }
  .lightbox-arrow-next { right: 10px; }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .gallery-filter-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .gallery-tab-btn {
    white-space: nowrap;
  }
}
