:root {
  --bg: #0f1512;
  --bg-alt: #141b17;
  --card: #1a221d;
  --border: #263029;
  --text: #eef2ee;
  --muted: #9fb0a5;
  --accent: #3fae6b;
  --accent-dark: #2c8a53;
  --danger: #e64848;
  --radius: 14px;
  --maxw: 1180px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Permitir seleccionar texto normal (precio, contacto, descripción) para que
   la página siga siendo usable; solo las imágenes quedan bloqueadas. */
p, li, .selectable {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}

img, .protected-bg {
  -webkit-user-drag: none;
  user-drag: none;
}

a, button, .filters button, .lightbox-close, .lightbox-nav {
  pointer-events: auto;
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

header.hero {
  background:
    linear-gradient(180deg, rgba(10,14,11,.55), rgba(10,14,11,.85)),
    linear-gradient(135deg, #16261c, #0f1512 60%);
  border-bottom: 1px solid var(--border);
  padding: 48px 0 34px;
}

.badge {
  display: inline-block;
  background: var(--danger);
  color: #fff;
  font-weight: 700;
  letter-spacing: .06em;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}

h1 { margin: 0 0 8px; font-size: clamp(28px, 4vw, 42px); line-height: 1.15; }
.subtitle { color: var(--muted); font-size: 16px; margin: 0 0 26px; max-width: 640px; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.stat .value { font-size: 18px; font-weight: 700; margin-top: 4px; }
.stat .value.placeholder { color: #e0b34a; }

.notice {
  margin-top: 22px;
  background: rgba(230, 72, 72, .08);
  border: 1px solid rgba(230, 72, 72, .35);
  color: #f3b9b9;
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.5;
}
.notice strong { color: #fff; }

main { padding: 34px 0 70px; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}
.filters button {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  transition: background .15s, border-color .15s;
}
.filters button:hover { border-color: var(--accent); }
.filters button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #06170d;
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
}
.card .thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  transition: transform .3s ease;
}
.card:hover .thumb { transform: scale(1.04); }
.card .cap {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}
.card .tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 999px;
  letter-spacing: .04em;
}
.card.doc-card .thumb { aspect-ratio: 3 / 4; background-size: contain; background-color: #f4f4f2; }

.video-card video {
  width: 100%;
  aspect-ratio: 16/9;
  display: block;
  background: #000;
}

.empty-state {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(4,6,5,.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 30px;
}
.lightbox.open { display: flex; }
.lightbox-inner { max-width: 92vw; max-height: 86vh; text-align: center; }
.lightbox-viewport {
  width: 90vw;
  height: 70vh;
  max-width: 92vw;
  max-height: 76vh;
  overflow: hidden;
  border-radius: 10px;
  position: relative;
  touch-action: none;
}
.lightbox-img {
  width: 100%;
  height: 100%;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  cursor: zoom-in;
  transform-origin: 0 0;
  will-change: transform;
}
.lightbox-viewport.zoomed .lightbox-img { cursor: grab; }
.lightbox-viewport.zoomed.dragging .lightbox-img { cursor: grabbing; }
.lightbox-cap { color: var(--muted); margin-top: 14px; font-size: 14px; }

.zoom-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}
.zoom-controls button {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  border-radius: 8px;
  min-width: 42px;
  height: 36px;
  font-size: 16px;
  cursor: pointer;
}
.zoom-controls button:hover { background: rgba(255,255,255,.16); }
#zoomReset { font-size: 12px; min-width: 56px; }
.lightbox-close, .lightbox-nav {
  position: absolute;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  border-radius: 999px;
  width: 44px;
  height: 44px;
  font-size: 20px;
  cursor: pointer;
}
.lightbox-close { top: 22px; right: 22px; }
.lightbox-nav.prev { left: 22px; top: 50%; transform: translateY(-50%); }
.lightbox-nav.next { right: 22px; top: 50%; transform: translateY(-50%); }

footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 13px;
}
footer .contact { color: var(--text); font-size: 15px; margin-bottom: 6px; }

/* Protección: oscurece todo cuando la pestaña pierde el foco o se detectan
   herramientas de desarrollador (medida disuasiva, no infalible). */
body.protected-blur .grid,
body.protected-blur .lightbox-img,
body.protected-blur header.hero {
  filter: blur(22px) brightness(.4);
  transition: filter .15s ease;
}
.protect-overlay {
  position: fixed;
  inset: 0;
  background: #05070a;
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 2000;
  font-size: 18px;
  padding: 30px;
}
.protect-overlay.show { display: flex; }

@media print {
  body { display: none !important; }
}

@media (max-width: 600px) {
  .lightbox-nav { width: 38px; height: 38px; font-size: 16px; }
}
