/* ===== POLAROID GALLERY (galería de joyas del home) ===== */
.pg {
  --pgw: min(300px, 74vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: 28px auto 4px;
  user-select: none;
  -webkit-user-select: none;
}
.pg-title {
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
  letter-spacing: .5px;
  text-shadow: 0 2px 0 rgba(0,0,0,.25);
}
.pg-stack {
  position: relative;
  width: var(--pgw);
  height: calc(var(--pgw) + 74px); /* 10px marco + foto (pgw-20) + 84px pie */
  margin: 6px 0 23px;
  touch-action: pan-y;
  outline: none;
}
.pg-stack:focus-visible { box-shadow: 0 0 0 3px rgba(255,255,255,.5); border-radius: 6px; }
.pg-card {
  position: absolute;
  inset: 0;
  margin: 0;
  background: #fdfdfb;
  padding: 10px 10px 0;
  border-radius: 3px;
  box-shadow: 0 10px 22px rgba(0,0,0,.28), 0 2px 5px rgba(0,0,0,.18);
  transition: transform .34s cubic-bezier(.2,.8,.25,1), opacity .34s ease;
  will-change: transform;
  cursor: grab;
}
.pg-card.pg-drag { transition: none; cursor: grabbing; }
.pg-card.pg-noanim { transition: opacity .3s ease; }
.pg-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #e9e7e2;
  overflow: hidden;
}
.pg-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}
.pg-caption {
  box-sizing: border-box;
  height: 84px;
  padding: 7px 8px 6px;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px; font-weight: 500; /* polaroid-gallery.js lo reduce si el texto no cabe */
  line-height: 1.3;
  color: #2b2b2b;
  text-align: center;
  overflow: hidden;
  white-space: pre-line;
  word-break: break-word;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pg-caption-text { display: block; max-height: 100%; }
/* Si aun con la letra mínima no cabe, se corta con "…" (el texto completo se ve al ampliar) */
.pg-caption.is-clamped { align-items: flex-start; }
.pg-caption.is-clamped .pg-caption-text {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pg-tape {
  position: absolute;
  top: -11px;
  left: 50%;
  width: 84px;
  height: 22px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(255,255,255,.55);
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
  backdrop-filter: blur(1px);
}
.pg-controls {
  display: flex;
  align-items: center;
  gap: 18px;
}
.pg-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.75);
  background: rgba(0,0,0,.25);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .15s;
}
.pg-btn:hover { background: rgba(0,0,0,.45); }
.pg-btn:active { transform: scale(.92); }
.pg-count {
  min-width: 56px;
  text-align: center;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.pg-hint {
  margin-top: 8px;
  font-size: 13px;
  color: rgba(255,255,255,.7);
}
.pg.is-single .pg-controls { display: none; }
@media (min-width: 981px) {
  .pg { --pgw: 330px; }
}

/* ===== LIGHTBOX ===== */
.pg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10060;
  background: rgba(10,10,12,.94);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 16px 24px;
  touch-action: pan-y;
}
.pg-lightbox.is-open { display: flex; animation: pgFade .2s ease; }
.pg-lb-img {
  max-width: min(92vw, 1100px);
  max-height: 70vh;
  object-fit: contain;
  border: 8px solid #fdfdfb;
  border-radius: 2px;
  box-shadow: 0 10px 40px rgba(0,0,0,.6);
  -webkit-user-drag: none;
}
.pg-lb-caption {
  max-width: min(92vw, 640px);
  margin-top: 16px;
  color: #f2f2f2;
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
  white-space: pre-line;
  word-break: break-word;
  max-height: 18vh;
  overflow-y: auto;
}
.pg-lb-count { margin-top: 10px; color: rgba(255,255,255,.6); font-size: 14px; font-variant-numeric: tabular-nums; }
.pg-lb-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.pg-lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 26px;
  cursor: pointer;
}
.pg-lb-prev { left: 12px; }
.pg-lb-next { right: 12px; }
.pg-lightbox.is-single .pg-lb-nav { display: none; }
@media (max-width: 640px) {
  .pg-lb-nav { top: auto; bottom: 18px; transform: none; }
  .pg-lb-img { max-height: 58vh; }
  .pg-lightbox { padding-bottom: 80px; }
}
body.pg-lock { overflow: hidden; }
@keyframes pgFade { from { opacity: 0; } to { opacity: 1; } }

/* ===== SELLO "APARTADA" / "VENDIDA" ===== */
.pg-photo { position: relative; }
.pg-stamp {
  position: absolute;
  top: 16px;
  right: -6px;
  padding: 6px 16px;
  border: 3px solid currentColor;
  border-radius: 6px;
  background: rgba(255,255,255,.88);
  font-family: 'Quicksand', Helvetica, Arial, sans-serif;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  transform: rotate(12deg);
  box-shadow: 0 3px 8px rgba(0,0,0,.25);
  pointer-events: none;
}
.pg-stamp-sold { color: #d32f2f; }
.pg-stamp-reserved { color: #e08a00; }
.pg-card[data-status="sold"] .pg-photo img { filter: grayscale(.55) brightness(.92); }

/* Lightbox: sello y botón de WhatsApp por pieza */
.pg-lb-figure { position: relative; display: inline-block; }
.pg-lb-stamp { top: 22px; right: -10px; font-size: 20px; }
.pg-lb-wa {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 11px 22px;
  border-radius: 999px;
  background: #25D366;
  color: #fff !important;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(37,211,102,.35);
  transition: transform .15s, filter .2s;
}
.pg-lb-wa:hover { filter: brightness(1.06); }
.pg-lb-wa:active { transform: scale(.97); }
.pg-lb-wa i { font-size: 20px; }

@media (prefers-reduced-motion: reduce) {
  .pg-card { transition: opacity .2s ease; }
}
