/*
Theme Name: Máster Piscinas
Theme URI: https://masterenpiscinas.cl
Author: Apollo TI · RayoWeb
Description: Tema a medida para Máster Piscinas. Diseño fijo, contenido autoadministrable (textos, contacto y galería) vía campos personalizados. No requiere page builder.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: masterpiscinas
*/

/* ===== Base ===== */
html, body { overflow-x: hidden; max-width: 100%; font-family: 'Inter', sans-serif; }
body { background: #080f1e; color: #e8f4fd; position: relative; margin: 0; }
img, video, svg, canvas, iframe { max-width: 100%; height: auto; }
.flex > *, .grid > *, [class*="flex"] > *, [class*="grid"] > * { min-width: 0; }
h1, h2, h3, p, a, span, button, label { overflow-wrap: anywhere; word-break: break-word; }

/* NAV */
#mainNav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background .3s ease, box-shadow .3s ease;
}
#mainNav.scrolled {
  background: rgba(8, 15, 30, 0.96);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(14, 165, 233, 0.12);
}

/* HERO */
.hero-section {
  min-height: 100svh;
  position: relative;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.hero-bg {
  position: absolute; inset: 0;
  background-position: center 40%;
  background-size: cover;
  background-repeat: no-repeat;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(8,15,30,0.78) 0%,
    rgba(8,15,30,0.52) 45%,
    rgba(8,15,30,0.82) 100%
  );
}
@media (max-width: 480px) {
  .hero-overlay {
    background: linear-gradient(
      to bottom,
      rgba(8,15,30,0.85) 0%,
      rgba(8,15,30,0.65) 50%,
      rgba(8,15,30,0.88) 100%
    );
  }
}

/* ACCENT LINE */
.accent-line {
  display: inline-block;
  width: 48px; height: 3px;
  background: linear-gradient(90deg, #0ea5e9, #22d3ee);
  border-radius: 2px;
  margin-bottom: 16px;
}

/* SERVICE CARDS */
.service-card {
  background: rgba(11, 26, 48, 0.9);
  border: 1px solid rgba(14, 165, 233, 0.12);
  border-radius: 16px;
  transition: border-color .3s, transform .25s, box-shadow .3s;
}
.service-card:hover {
  border-color: rgba(14, 165, 233, 0.45);
  transform: translateY(-4px);
  box-shadow: 0 20px 48px rgba(14, 165, 233, 0.1);
}

/* STEP NUMBER */
.step-number {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #22d3ee);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 22px; color: #080f1e;
  flex-shrink: 0;
}

/* GALLERY ITEM */
.gallery-item {
  overflow: hidden; border-radius: 14px;
  aspect-ratio: 4/3;
  cursor: pointer;
}
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease;
}
.gallery-item:hover img { transform: scale(1.04); }

/* GLOW BORDER */
.glow-border {
  border: 1px solid rgba(14, 165, 233, 0.2);
  box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.05) inset;
}

/* WhatsApp flotante */
.rw-whatsapp {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, calc(env(safe-area-inset-bottom) + 16px));
  z-index: 60;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(37,211,102,.35), 0 2px 6px rgba(0,0,0,.15);
  transition: transform .15s ease, box-shadow .2s ease;
  text-decoration: none;
}
.rw-whatsapp:hover { transform: scale(1.05); }
.rw-whatsapp svg { width: 28px; height: 28px; fill: #fff; }
@media (max-width: 480px) {
  .rw-whatsapp { width: 52px; height: 52px; }
  .rw-whatsapp svg { width: 26px; height: 26px; }
}

/* LIGHTBOX */
.lb-overlay {
  position: fixed; inset: 0; z-index: 8000;
  background: rgba(8,15,30,.96);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.lb-overlay.lb-open { opacity: 1; pointer-events: auto; }
.lb-img {
  max-width: 92vw; max-height: 88vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 32px 80px rgba(0,0,0,.6);
}
.lb-close {
  position: fixed; top: 16px; right: 16px;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: none; cursor: pointer; color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s; z-index: 1;
}
.lb-close:hover { background: rgba(255,255,255,.22); }
.lb-nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: none; cursor: pointer; color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s; z-index: 1;
}
.lb-nav:hover { background: rgba(255,255,255,.22); }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
@media (max-width: 640px) {
  .lb-nav { width: 36px; height: 36px; }
}
