/* ===== GALERÍA ===== */
#galeria {
  position: relative; overflow: hidden;
  background: radial-gradient(circle at 12% 12%,rgba(245,196,0,.08),transparent 24%),
    linear-gradient(180deg,#ffffff 0%,#f8faf7 100%);
}
#galeria .container { max-width: 1180px; }
.gallery-grid {
  display: grid; grid-template-columns: repeat(12,1fr);
  grid-auto-rows: 180px; gap: 1rem;
}
.gallery-item { position: relative; overflow: hidden; border-radius: 20px; background: #dfe8e1; box-shadow: 0 16px 40px rgba(8,53,28,.10); cursor: pointer; }
.gallery-item:nth-child(1) { grid-column: span 7; grid-row: span 2; }
.gallery-item:nth-child(2), .gallery-item:nth-child(3) { grid-column: span 5; }
.gallery-item:nth-child(4), .gallery-item:nth-child(5), .gallery-item:nth-child(6) { grid-column: span 4; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .45s ease, filter .45s ease; }
.gallery-item::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg,transparent 45%,rgba(4,29,15,.75)); opacity: .82; transition: opacity .3s ease; }
.gallery-item:hover img { transform: scale(1.06); filter: saturate(1.08); }
.gallery-item:hover::after { opacity: .95; }
.gallery-caption { position: absolute; left: 1rem; right: 1rem; bottom: .9rem; z-index: 2; color: #fff; }
.gallery-caption strong { display: block; font-size: 1rem; margin-bottom: .2rem; }
.gallery-caption span { font-size: .75rem; color: rgba(255,255,255,.72); }
.gallery-empty { min-height: 100%; display: grid; place-items: center; color: var(--verde-o); font-weight: 700; background: linear-gradient(135deg,rgba(15,77,42,.08),rgba(245,196,0,.12)); }

@media(max-width:900px) {
  .gallery-grid { grid-template-columns: repeat(2,1fr); grid-auto-rows: 190px; }
  .gallery-item, .gallery-item:nth-child(n) { grid-column: span 1; grid-row: span 1; }
  .gallery-item:nth-child(1) { grid-column: 1/-1; grid-row: span 2; }
}
@media(max-width:620px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-item, .gallery-item:nth-child(n) { grid-column: 1; grid-row: span 1; }
}

/* ===== REMATE EN VIVO ===== */
#remate {
  position: relative; overflow: visible;
  background: radial-gradient(circle at 50% 0,rgba(245,196,0,.08),transparent 32%),
    linear-gradient(180deg,#07160d 0%,#0a1d11 100%);
  color: #fff;
}
.ri { max-width: 1120px; margin: 0 auto; }
.rh { text-align: center; margin-bottom: 2rem; }
.live-badge { display: inline-flex; align-items: center; gap: .5rem; background: rgba(255,50,50,.12); border: 1px solid rgba(255,90,90,.3); color: #ff7a7a; font-size: .72rem; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; padding: .35rem .9rem; border-radius: 999px; margin-bottom: .9rem; }
.ldot { width: 8px; height: 8px; background: #ff4444; border-radius: 50%; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.45;transform:scale(.65)} }
.rh h2 { font-size: clamp(1.9rem,3.5vw,3rem); font-weight: 800; color: #fff; margin-bottom: .55rem; }
.rh h2 em { color: var(--amarillo); font-style: normal; }
.rh p { color: rgba(255,255,255,.66); line-height: 1.65; }
.live-player-shell { position: relative; width: 100%; transition: all .28s ease; }
.vbox { position: relative; width: 100%; aspect-ratio: 16/9; overflow: hidden; background: #020705; border: 1px solid rgba(255,255,255,.11); border-radius: 20px; box-shadow: 0 24px 70px rgba(0,0,0,.35); }
.vbox iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: 2rem; text-align: center; color: rgba(255,255,255,.48); background: radial-gradient(circle at center,rgba(15,77,42,.2),transparent 42%),#020705; }
.vic { width: 70px; height: 70px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; background: rgba(245,196,0,.12); border: 1px solid rgba(245,196,0,.25); color: var(--amarillo); }
.live-source { display: flex; justify-content: center; align-items: center; gap: .55rem; margin-top: 1rem; color: rgba(255,255,255,.46); font-size: .75rem; }
.live-source span { padding: .25rem .65rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.11); background: rgba(255,255,255,.05); }
/* ── PIP flotante ─────────────────────────────────────── */
.live-player-shell { position: relative; transition: none; }

/* Estado PIP activo */
.live-player-shell.is-pip {
  position: fixed;
  right: 18px;
  bottom: 18px;
  left: auto;
  top: auto;
  z-index: 1800;
  width: min(380px, calc(100vw - 36px));
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.1);
  animation: pipIn .22s cubic-bezier(.34,1.56,.64,1) both;
}
.live-player-shell.is-pip .vbox { border-radius: 0 0 16px 16px; }
.live-player-shell.is-pip .live-source { display: none; }

/* Barra superior del PIP (handle para arrastrar) */
.pip-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: .45rem .7rem;
  background: #07160d;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.pip-bar:active { cursor: grabbing; }
.live-player-shell.is-pip .pip-bar { display: flex; }

.pip-bar-title {
  font-size: .7rem;
  font-weight: 700;
  color: rgba(255,255,255,.85);
  letter-spacing: .3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pip-bar-actions { display: flex; gap: .3rem; flex-shrink: 0; margin-left: .5rem; }
.pip-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: .8rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
  line-height: 1;
  padding: 0;
}
.pip-btn:hover { background: rgba(255,255,255,.25); }
.pip-btn-close:hover { background: rgba(239,68,68,.75); }

/* Botón cerrar viejo (oculto, compatibilidad) */
.pip-close { display: none; }

@keyframes pipIn {
  from { opacity: 0; transform: translateY(20px) scale(.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 680px) {
  .live-player-shell.is-pip {
    right: 8px;
    bottom: 8px;
    width: min(300px, calc(100vw - 16px));
  }
  .vbox { border-radius: 12px; }
}
