/* IT Media - OLX Gallery Styles */

/* Gallery card */
.product-card.has-gallery .product-media {
  position: relative;
  overflow: hidden;
}

.product-card .product-media {
  position: relative;
}

.product-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.product-no-image {
  width: 100%;
  aspect-ratio: 4/3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted, #94a3b8);
  background: #f1f5f9;
}

/* Gallery dots */
.gallery-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 5;
}

.gallery-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all 0.2s ease;
}

.gallery-dot.active {
  background: #fff;
  width: 16px;
  border-radius: 3px;
}

.gallery-dot:hover {
  background: rgba(255,255,255,0.8);
}

/* Gallery arrows */
.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  color: #1a1a2e;
}

.product-card:hover .gallery-arrow {
  opacity: 1;
}

.gallery-arrow:hover {
  background: #fff;
}

.gallery-arrow-left {
  left: 6px;
}

.gallery-arrow-right {
  right: 6px;
}

.gallery-arrow:disabled,
.gallery-arrow[style*="opacity: 0.3"] {
  opacity: 0.3 !important;
}

/* Gallery image count badge */
.gallery-count {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.65rem;
  padding: 3px 7px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 5;
  backdrop-filter: blur(4px);
}

.gallery-count svg {
  width: 12px;
  height: 12px;
}

/* Touch: show arrows always on mobile */
@media (max-width: 760px) {
  .gallery-arrow {
    opacity: 0.7;
    width: 24px;
    height: 24px;
  }
  .gallery-arrow svg {
    width: 12px;
    height: 12px;
  }
}

/* Lightbox overlay (full-screen gallery) */
.olx-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.olx-lightbox.open {
  opacity: 1;
  visibility: visible;
}

.olx-lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
}

.olx-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background 0.2s;
}

.olx-lightbox-close:hover {
  background: rgba(255,255,255,0.3);
}

.olx-lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background 0.2s;
}

.olx-lightbox-arrow:hover {
  background: rgba(255,255,255,0.3);
}

.olx-lightbox-prev { left: 16px; }
.olx-lightbox-next { right: 16px; }

.olx-lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.8);
  font-size: 0.85rem;
}
