/* ==========================================================================
   SAIFEE TOOLS & TRADERS - PURE IMAGE BENTO GALLERY & ZOOM LIGHTBOX
   Clean, Minimalist, High-End Industrial Equipment Visual Wall
   Zero text clutter - 100% focused on product imagery
   ========================================================================== */

/* 1. Main Gallery Container */
.gallery-section-pure {
  padding: 3rem 0 5rem 0;
  background: #f8fafc;
  position: relative;
  overflow: hidden;
}

/* 2. Bento Grid Architecture */
.bento-pure-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 240px;
  grid-auto-flow: dense;
  gap: 1.25rem;
  position: relative;
  z-index: 2;
}

/* Card Spans for Visual Rhythm */
.pg-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 65%, #f2f7ff 0%, #dbeafe 100%);
  border: 1px solid rgba(0, 102, 255, 0.1);
  box-shadow: 0 8px 24px rgba(11, 37, 69, 0.05);
  cursor: zoom-in;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.pg-card.span-2x2 {
  grid-column: span 2;
  grid-row: span 2;
}

.pg-card.span-portrait {
  grid-column: span 1;
  grid-row: span 2;
}

.pg-card.span-2x1 {
  grid-column: span 2;
  grid-row: span 1;
}

.pg-card.span-standard {
  grid-column: span 1;
  grid-row: span 1;
}

.pg-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(0, 43, 82, 0.18);
  border-color: rgba(0, 102, 255, 0.35);
}

/* Stage Backdrop Glow & 3D Pedestal */
.pg-stage-pedestal {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 82%;
  height: 44px;
  background: linear-gradient(180deg, #ffffff 0%, #e2eaf4 100%);
  border-radius: 50%;
  box-shadow: 0 10px 20px rgba(0, 60, 140, 0.14), inset 0 2px 4px rgba(255, 255, 255, 0.95);
  z-index: 1;
  pointer-events: none;
}

.pg-stage-glow {
  position: absolute;
  top: -20%;
  right: -20%;
  width: 140%;
  height: 140%;
  background: linear-gradient(135deg, transparent 48%, rgba(0, 102, 255, 0.1) 48%, rgba(0, 102, 255, 0.18) 60%, transparent 60%);
  pointer-events: none;
  z-index: 1;
}

/* Product Image in Stage */
.pg-img {
  position: relative;
  z-index: 2;
  max-height: 84%;
  max-width: 88%;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 20px rgba(0, 43, 82, 0.28));
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.pg-card:hover .pg-img {
  transform: translateY(-8px) scale(1.07);
}

/* Subtle Zoom Hover Icon in Top-Right */
.pg-zoom-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(11, 37, 69, 0.7);
  backdrop-filter: blur(8px);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 3;
  pointer-events: none;
}

.pg-card:hover .pg-zoom-badge {
  opacity: 1;
  transform: scale(1);
}

.pg-zoom-badge svg {
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   3. CLEAN FULL-IMAGE ZOOM LIGHTBOX MODAL
   ========================================================================== */
.clean-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(6, 17, 34, 0.95);
  backdrop-filter: blur(20px);
  display: none;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  user-select: none;
}

.clean-lightbox.open {
  display: flex;
  opacity: 1;
}

/* Top Toolbar: Counter, Zoom Button & Close */
.clb-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(11, 37, 69, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  z-index: 10;
  flex-shrink: 0;
}

.clb-counter {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background: rgba(255, 107, 0, 0.2);
  border: 1px solid #ff6b00;
  color: #ff9142;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 700;
}

.clb-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.clb-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.clb-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.clb-btn.active-zoom {
  background: #ff6b00;
  border-color: #ff6b00;
  color: #ffffff;
  box-shadow: 0 0 15px rgba(255, 107, 0, 0.5);
}

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

.clb-close-btn:hover {
  background: #ef4444;
  border-color: #ef4444;
  transform: rotate(90deg);
}

/* Main Viewport Stage */
.clb-stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 1.5rem;
}

/* Navigation Chevrons */
.clb-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(11, 37, 69, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.clb-nav-arrow:hover {
  background: #ff6b00;
  border-color: #ff6b00;
  transform: translateY(-50%) scale(1.1);
}

.clb-nav-arrow.prev {
  left: 24px;
}

.clb-nav-arrow.next {
  right: 24px;
}

/* Image Wrapper with Zoom & Pan */
.clb-img-wrapper {
  position: relative;
  max-width: 86vw;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.clb-main-img {
  max-width: 86vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5));
}

/* Zoomed-in state */
.clb-img-wrapper.is-zoomed {
  cursor: grab;
}

.clb-img-wrapper.is-zoomed:active {
  cursor: grabbing;
}

.clb-img-wrapper.is-zoomed .clb-main-img {
  transform: scale(2.4);
  cursor: grab;
}

.clb-zoom-tip {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.85);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* ==========================================================================
   4. RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1024px) {
  .bento-pure-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 210px;
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .bento-pure-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 190px;
    gap: 0.85rem;
  }

  .pg-card.span-2x2 {
    grid-column: span 2;
    grid-row: span 2;
  }

  .pg-card.span-portrait {
    grid-column: span 1;
    grid-row: span 2;
  }

  .pg-card.span-2x1 {
    grid-column: span 2;
    grid-row: span 1;
  }

  .clb-nav-arrow {
    width: 40px;
    height: 40px;
  }

  .clb-nav-arrow.prev {
    left: 10px;
  }

  .clb-nav-arrow.next {
    right: 10px;
  }
}

@media (max-width: 480px) {
  .bento-pure-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 170px;
    gap: 0.65rem;
  }

  .pg-card {
    border-radius: 16px;
  }
}
