/* ═══════════════════════════════════════════
   KaXz3D — styles.css
   ═══════════════════════════════════════════ */

:root {
  --bg-gradient: linear-gradient(135deg, #a855f7, #f97316, #22c55e);
  --bg-body: #f5f7fb;
  --bg-card: #ffffff;
  --text-main: #111827;
  --text-soft: #6b7280;
  --accent: #6366f1;
  --accent-2: #ec4899;
  --border-soft: rgba(148, 163, 184, 0.25);
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.12);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-pill: 999px;
}

/* ── RESET ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  background: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── LAYOUT ── */
.container {
  width: min(1120px, 100% - 2.5rem);
  margin: 0 auto;
}

.section {
  padding: 4.5rem 0;
}

.section-light {
  background: #ffffff;
}

.section-title {
  font-size: clamp(1.8rem, 2.6vw, 2.2rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  text-align: center;
  color: var(--text-soft);
  max-width: 560px;
  margin: 0 auto 2.5rem;
}

/* ── NAVBAR ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-soft);
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.logo span {
  font-weight: 700;
  font-size: 1.25rem;
  background: linear-gradient(120deg, #8b5cf6, #ec4899);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  font-size: 0.95rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-soft);
  font-weight: 500;
  transition: color 0.2s ease;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.2s ease;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  transition: background 0.15s ease;
  line-height: 1;
}

.nav-toggle:hover {
  background: rgba(99, 102, 241, 0.08);
}

/* ── HERO ── */
.hero {
  background:
    radial-gradient(circle at top left, rgba(129, 140, 248, 0.25), transparent 55%),
    radial-gradient(circle at bottom right, rgba(244, 114, 182, 0.3), transparent 55%);
  padding: 4.5rem 0 5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
}

.hero-text h1 {
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  line-height: 1.1;
  margin-bottom: 1rem;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.85rem;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.04);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  color: var(--text-soft);
  max-width: 480px;
  margin-bottom: 1.8rem;
  font-size: 1.05rem;
}

.gradient-text {
  background-image: var(--bg-gradient);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-soft);
}

.hero-badges span {
  padding: 0.25rem 0.85rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-soft);
}

.hero-image {
  background: #ffffff;
  border-radius: 34px;
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Fallback si la imagen no carga */
.hero-image.img-placeholder::before {
  content: '🖨️';
  font-size: 5rem;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.7rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, color 0.12s ease;
  font-family: inherit;
}

.btn.primary {
  background-image: linear-gradient(120deg, #6366f1, #ec4899);
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(129, 140, 248, 0.35);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(129, 140, 248, 0.45);
}

.btn.ghost {
  background: #ffffff;
  border-color: var(--border-soft);
  color: var(--text-main);
}

.btn.ghost:hover {
  background: #f9fafb;
  transform: translateY(-1px);
}

.btn.whatsapp {
  background: #22c55e;
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(34, 197, 94, 0.35);
}

.btn.whatsapp:hover {
  background: #16a34a;
  transform: translateY(-2px);
}

.btn.full-width {
  width: 100%;
}

/* ── CARDS ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.7rem;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.8rem 1.5rem;
  text-align: center;
  border: 1px solid var(--border-soft);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-soft);
  border-color: rgba(129, 140, 248, 0.45);
}

.card-icon {
  width: 140px;
  height: 140px;
  margin: 0 auto 1.2rem;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

.card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-emoji {
  font-size: 2rem;
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card p {
  font-size: 0.9rem;
  color: var(--text-soft);
}

/* ── GALLERY ── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.2rem;
}

.gallery-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #e5e7eb;
  aspect-ratio: 1 / 1;
  cursor: zoom-in;
  position: relative;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* Placeholder si imagen falla */
.gallery-item.img-error::before {
  content: '📷';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

/* ── CTA ── */
.section-cta {
  background-image: var(--bg-gradient);
  color: #ffffff;
}

.cta-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.cta-box h2 {
  font-size: 1.7rem;
  margin-bottom: 0.4rem;
}

.cta-box p {
  opacity: 0.88;
  max-width: 420px;
}

/* ── CONTACT ── */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: flex-start;
}

.contact-list {
  list-style: none;
  margin-top: 1.3rem;
}

.contact-list li {
  margin-bottom: 0.6rem;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.contact-form {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.8rem 1.6rem;
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.08);
  border: 1px solid var(--border-soft);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  background: #fafafa;
  color: var(--text-main);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
  background: #fff;
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

/* ── FOOTER ── */
.footer {
  padding: 1.8rem 0 2.2rem;
  background: #0f172a;
  color: #9ca3af;
  font-size: 0.82rem;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: space-between;
  align-items: center;
}

/* ── ALERTAS ── */
.alerta {
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.88rem;
  text-align: center;
}

.alerta-error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.alerta-success {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

/* ── FORM ERRORS ── */
.form-group input.error,
.form-group textarea.error {
  border-color: #f87171 !important;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.2) !important;
}

/* ── LIGHTBOX ── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 1000;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 88vh;
  border-radius: var(--radius-md);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  transition: transform 0.25s ease;
}

.lightbox.active .lightbox-img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  font-size: 1.8rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease;
  line-height: 1;
  display: grid;
  place-items: center;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ── SCROLL TOP ── */
.scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background: linear-gradient(120deg, #6366f1, #ec4899);
  border: none;
  border-radius: 50%;
  color: #ffffff;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  z-index: 99;
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
  display: grid;
  place-items: center;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top:hover {
  transform: translateY(-3px) scale(1.07);
}

/* ── ANIMACIONES SCROLL ── */
.card,
.section-title,
.gallery-item {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card:nth-child(2) { transition-delay: 0.1s; }
.card:nth-child(3) { transition-delay: 0.2s; }
.gallery-item:nth-child(2) { transition-delay: 0.07s; }
.gallery-item:nth-child(3) { transition-delay: 0.14s; }
.gallery-item:nth-child(4) { transition-delay: 0.21s; }

.card.animado,
.section-title.animado,
.gallery-item.animado {
  opacity: 1;
  transform: translateY(0);
}

/* ── FOCUS VISIBLE ── */
:focus-visible {
  outline: 3px solid #6366f1;
  outline-offset: 3px;
  border-radius: 6px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ── RESPONSIVE ── */
@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-image {
    order: -1;
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
  }

  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .cta-box {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    inset-inline: 0;
    top: 70px;
    background: #ffffff;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0 1.4rem;
    border-bottom: 1px solid var(--border-soft);
    transform: scaleY(0);
    transform-origin: top;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.18s ease, opacity 0.18s ease;
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
  }

  .nav-links.nav-open {
    transform: scaleY(1);
    opacity: 1;
    pointer-events: auto;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-box h2 {
    font-size: 1.35rem;
  }

  .section {
    padding: 3.5rem 0;
  }
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ── FALLBACK NAVBAR SIN BACKDROP-FILTER ── */
@supports not (backdrop-filter: blur(10px)) {
  .navbar {
    background: rgba(255, 255, 255, 0.98);
  }
}