/*  PRODUCT GALLERY MODAL STYLES  */
.product-card {
  outline: none;
}

.product-card:focus-visible {
  outline: 2px solid #C9973B;
  outline-offset: 3px;
  border-radius: 1rem;
}

/* Overlay */
.pgm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.pgm-overlay[hidden] {
  display: none !important;
}

.pgm-overlay.pgm-visible .pgm-backdrop {
  opacity: 1;
}

.pgm-overlay.pgm-visible .pgm-container {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.pgm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 7, 7, 0.92);
  backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.35s ease;
}

/* Container */
.pgm-container {
  position: relative;
  z-index: 1;
  background: #141414;
  border: 1px solid rgba(201, 151, 59, 0.25);
  border-radius: 1.5rem;
  width: 100%;
  max-width: 860px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(24px) scale(0.97);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(201, 151, 59, 0.08);
}

/* Header */
.pgm-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.5rem 1.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.pgm-category {
  display: block;
  color: #C9973B;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.pgm-title {
  color: #fff;
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
}

.pgm-close {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}

.pgm-close:hover {
  background: rgba(201, 151, 59, 0.2);
  color: #C9973B;
  border-color: #C9973B;
}

/* Main zoom area */
.pgm-main-wrap {
  position: relative;
  flex-shrink: 0;
  height: 400px;
  overflow: hidden;
  background: #0a0a0a;
}

.pgm-zoom-area {
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: zoom-in;
  position: relative;
}

.pgm-zoom-area.zoomed {
  cursor: grab;
}

.pgm-zoom-area.zoomed.dragging {
  cursor: grabbing;
}

.pgm-main-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: 0 0;
  transition: transform 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  user-select: none;
  pointer-events: none;
}

.pgm-main-img.no-transition {
  transition: none;
}

/* Zoom cursor indicator */
.pgm-zoom-cursor {
  position: absolute;
  right: 0.75rem;
  bottom: 3.5rem;
  background: rgba(201, 151, 59, 0.15);
  border: 1px solid rgba(201, 151, 59, 0.4);
  color: #C9973B;
  border-radius: 0.5rem;
  padding: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  pointer-events: none;
  transition: opacity 0.3s;
}

.pgm-zoom-cursor::after {
  content: 'Scroll para zoom';
  white-space: nowrap;
}

.pgm-zoom-area.zoomed .pgm-zoom-cursor {
  opacity: 0;
}

/* Zoom controls */
.pgm-zoom-controls {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(13, 13, 13, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 0.35rem 0.5rem;
  backdrop-filter: blur(8px);
}

.pgm-zoom-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.pgm-zoom-btn:hover {
  background: rgba(201, 151, 59, 0.2);
  color: #C9973B;
  border-color: rgba(201, 151, 59, 0.4);
}

.pgm-zoom-level {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.7rem;
  font-weight: 600;
  min-width: 2.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Nav arrows */
.pgm-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(13, 13, 13, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(4px);
}

.pgm-nav:hover {
  background: rgba(201, 151, 59, 0.25);
  color: #C9973B;
  border-color: rgba(201, 151, 59, 0.5);
}

.pgm-nav:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

.pgm-nav-prev {
  left: 0.75rem;
}

.pgm-nav-next {
  right: 0.75rem;
}

/* Counter */
.pgm-counter {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13, 13, 13, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  backdrop-filter: blur(4px);
}

/* Empty state */
.pgm-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.pgm-empty[hidden] {
  display: none;
}

.pgm-empty p {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.9rem;
  margin: 0;
}

/* Thumbnails */
.pgm-thumbs {
  display: flex;
  gap: 0.6rem;
  padding: 1rem 1.75rem;
  overflow-x: auto;
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 151, 59, 0.3) transparent;
}

.pgm-thumbs::-webkit-scrollbar {
  height: 4px;
}

.pgm-thumbs::-webkit-scrollbar-track {
  background: transparent;
}

.pgm-thumbs::-webkit-scrollbar-thumb {
  background: rgba(201, 151, 59, 0.3);
  border-radius: 2px;
}

.pgm-thumb {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 0.6rem;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s;
  position: relative;
}

.pgm-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pgm-thumb:hover {
  border-color: rgba(201, 151, 59, 0.5);
  transform: translateY(-2px);
}

.pgm-thumb.active {
  border-color: #C9973B;
  box-shadow: 0 0 0 2px rgba(201, 151, 59, 0.2);
}

/* Description */
.pgm-description {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.85rem;
  line-height: 1.7;
  padding: 0 1.75rem 1.5rem;
  margin: 0;
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 0.75rem;
}

/* Image loading skeleton */
.pgm-main-img.loading {
  background: linear-gradient(90deg, #1a1a1a 25%, #222 50%, #1a1a1a 75%);
  background-size: 200% 100%;
  animation: pgm-skeleton 1.2s ease infinite;
}

@keyframes pgm-skeleton {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Responsive */
@media (max-width: 640px) {
  .pgm-main-wrap {
    height: 260px;
  }

  .pgm-container {
    border-radius: 1rem;
  }

  .pgm-title {
    font-size: 1.1rem;
  }

  .pgm-thumb {
    width: 52px;
    height: 52px;
  }

  .pgm-zoom-cursor::after {
    display: none;
  }
}