/* ============================================================
   BIOPEPTIX — Component Styles
   Gallery · Lightbox · Cart Drawer · Back-to-Top · Toasts
   ============================================================ */

/* ------------------------------------------------------------
   1. Gallery Section
   ------------------------------------------------------------ */
.gallery-section {
  background: var(--bg);
}

/* Gallery tabs — same pill style as product tabs */
.gallery-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.gallery-tabs button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}

.gallery-tabs button:hover {
  border-color: var(--accent);
  color: var(--text);
}

.gallery-tabs button.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 700;
}

/* Gallery grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

/* Gallery item */
.gallery-item {
  aspect-ratio: 1;
  border-radius: var(--r);
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-item:hover img {
  transform: scale(1.08);
}

/* Hover overlay */
.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-overlay span {
  position: absolute;
  bottom: 16px;
  left: 16px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

/* Gallery placeholder (empty state / upload hint) */
.gallery-placeholder {
  aspect-ratio: 1;
  border-radius: var(--r);
  border: 2px dashed var(--border);
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.3s;
}

.gallery-placeholder:hover {
  border-color: var(--accent);
}

.gallery-placeholder-icon {
  font-size: 48px;
  color: var(--text2);
  opacity: 0.4;
}

.gallery-placeholder-text {
  font-size: 13px;
  color: var(--text2);
  opacity: 0.5;
}

/* Placeholder inner content (from gallery.js) */
.placeholder-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.placeholder-icon {
  font-size: 36px;
  opacity: 0.4;
}

.placeholder-label {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  opacity: 0.6;
}

.placeholder-status {
  font-size: 12px;
  color: var(--accent);
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* Gallery overlay text layout */
.gallery-overlay-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  opacity: 0.8;
}

.gallery-overlay-text {
  position: absolute;
  bottom: 16px;
  left: 16px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

/* ------------------------------------------------------------
   2. Gallery Lightbox Modal
   ------------------------------------------------------------ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(5, 12, 24, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.lightbox.active {
  display: flex;
}

/* Lightbox content */
.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--r);
}

/* Close button */
.lightbox-close {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s;
  z-index: 1010;
}

.lightbox-close:hover {
  background: var(--accent);
  color: var(--bg);
}

/* Navigation arrows */
.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s, border-color 0.25s;
  z-index: 1010;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-prev:hover,
.lightbox-next:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* Caption */
.lightbox-caption {
  text-align: center;
  margin-top: 16px;
  color: var(--text2);
  font-size: 14px;
}

/* Counter */
.lightbox-counter {
  text-align: center;
  margin-top: 8px;
  color: var(--text2);
  font-size: 12px;
  opacity: 0.6;
}

/* ------------------------------------------------------------
   3. CART DRAWER (Removed - Handled by WordPress)
   ------------------------------------------------------------ */

/* ------------------------------------------------------------
   4. Back to Top Button
   ------------------------------------------------------------ */
.back-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 50;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #050c18;
  border: none;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s, box-shadow 0.3s;
}

.back-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.back-top:hover {
  box-shadow: 0 6px 24px rgba(0, 212, 160, 0.35);
  transform: translateY(0) scale(1.08);
}

/* ------------------------------------------------------------
   5. Animations
   ------------------------------------------------------------ */

/* ------------------------------------------------------------
   7. Responsive Overrides for Components
   ------------------------------------------------------------ */
@media (max-width: 768px) {
  /* Gallery grid — 2 cols on tablet */
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
  }

  /* Lightbox close repositioned */
  .lightbox-close {
    top: 8px;
    right: 8px;
  }

  /* Gallery tabs center */
  .gallery-tabs {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  /* Gallery single column */
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  /* Back to top smaller offset */
  .back-top {
    bottom: 20px;
    right: 20px;
  }
}
