/* ============================================================
   MRC Systems — Estilos personalizados
   Complementa el framework Tailwind CSS (style.css)
   ============================================================ */

/* ── Variables del tema ──────────────────────────────────── */
:root {
  /* Botones / elevación */
  --button-outline:                rgba(0, 0, 0, 0.10);
  --badge-outline:                 rgba(0, 0, 0, 0.05);
  --opaque-button-border-intensity: -8;
  --elevate-1:                     rgba(0, 0, 0, 0.03);
  --elevate-2:                     rgba(0, 0, 0, 0.08);

  /* Paleta semántica (HSL) */
  --background:           220 30% 98%;
  --foreground:           224 55% 14%;
  --border:               214 28% 89%;
  --input:                214 28% 89%;
  --ring:                 199 95% 44%;
  --card:                 0 0% 100%;
  --card-foreground:      224 55% 14%;
  --card-border:          214 28% 89%;
  --primary:              224 67% 28%;
  --primary-foreground:   210 40% 98%;
  --secondary:            210 35% 95%;
  --secondary-foreground: 224 55% 14%;
  --muted:                210 35% 95%;
  --muted-foreground:     215 18% 48%;
  --accent:               199 95% 44%;
  --accent-foreground:    210 40% 98%;
  --destructive:          0 84.2% 60.2%;
  --destructive-foreground: 210 40% 98%;

  /* Bordes derivados */
  --primary-border:     hsl(from hsl(var(--primary))     h s calc(l + var(--opaque-button-border-intensity)) / alpha);
  --secondary-border:   hsl(from hsl(var(--secondary))   h s calc(l + var(--opaque-button-border-intensity)) / alpha);
  --muted-border:       hsl(from hsl(var(--muted))       h s calc(l + var(--opaque-button-border-intensity)) / alpha);
  --accent-border:      hsl(from hsl(var(--accent))      h s calc(l + var(--opaque-button-border-intensity)) / alpha);
  --destructive-border: hsl(from hsl(var(--destructive)) h s calc(l + var(--opaque-button-border-intensity)) / alpha);

  /* Tipografía */
  --font-display:  'Plus Jakarta Sans', sans-serif;
  --app-font-sans: 'Inter', sans-serif;
  --app-font-mono: Menlo, monospace;

  /* Radio y sombras */
  --radius:     0.5rem;
  --shadow-sm:  0px 2px 0px 0px hsl(0 0% 0% / 0.05), 0px 1px 2px -1px hsl(0 0% 0% / 0.1);
  --shadow-md:  0px 2px 0px 0px hsl(0 0% 0% / 0.05), 0px 2px 4px -1px hsl(0 0% 0% / 0.1);
  --shadow-lg:  0px 2px 0px 0px hsl(0 0% 0% / 0.05), 0px 4px 6px -1px hsl(0 0% 0% / 0.1);

  /* Acentos del sitio */
  --site-accent:   #10b8f5;
  --site-accent-2: #30d38a;
  --site-shadow:   0 20px 60px rgba(2, 10, 28, 0.18);

  /* Espaciado Tailwind */
  --spacing: 0.25rem;
  --color-border: hsl(var(--border));
}

/* ── Cabecera: estado inicial (sobre hero oscuro) ─────────── */
#site-header {
  background:     transparent !important;
  border-bottom:  none !important;
  box-shadow:     none !important;
  padding-top:    1.25rem;
  padding-bottom: 1.25rem;
  transition: background 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}

#site-header .header-brand-name {
  display:      block;
  font-family:  'Plus Jakarta Sans', sans-serif;
  font-size:    1.125rem;
  font-weight:  700;
  letter-spacing: -0.025em;
  color:        #ffffff !important;
}
#site-header .header-brand-sub {
  display:      block;
  font-size:    0.75rem;
  font-weight:  500;
  letter-spacing: 0.025em;
  color:        rgba(255, 255, 255, 0.60) !important;
}

#site-header .header-nav-link {
  font-size:       0.875rem;
  font-weight:     500;
  color:           rgba(255, 255, 255, 0.60) !important;
  transition:      color 0.2s ease;
  text-decoration: none;
}
#site-header .header-nav-link:hover { color: #ffffff !important; }

#site-header .header-nav-btn {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  padding:         0.5rem 1.5rem;
  border-radius:   9999px;
  font-size:       0.875rem;
  font-weight:     600;
  text-decoration: none;
  color:           #ffffff !important;
  background:      #06b6d4 !important;
  border:          none !important;
  transition:      background 0.25s ease;
}
#site-header .header-nav-btn:hover { background: #0891b2 !important; }

/* ── Cabecera: estado al hacer scroll (is-scrolled) ───────── */
#site-header.is-scrolled {
  background:              rgba(255, 255, 255, 0.97) !important;
  backdrop-filter:         blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom:           1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow:              0 2px 16px rgba(0, 0, 0, 0.08) !important;
  padding-top:             0.75rem;
  padding-bottom:          0.75rem;
}

#site-header.is-scrolled .header-brand-name { color: #162044 !important; }
#site-header.is-scrolled .header-brand-sub  { color: #64748b !important; }

#site-header.is-scrolled .header-nav-link       { color: rgba(22, 32, 68, 0.55) !important; }
#site-header.is-scrolled .header-nav-link:hover { color: #162044 !important; }

#site-header.is-scrolled .header-nav-btn       { background: #1a3a8f !important; }
#site-header.is-scrolled .header-nav-btn:hover { background: #142d72 !important; }


html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  background-color: hsl(var(--background));
  font-family: var(--app-font-sans);
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
}

* {
  border-color: hsl(var(--border));
}

/* ── Efecto elevación en botones ──────────────────────────── */
.hover-elevate:not(.no-default-hover-elevate),
.active-elevate:not(.no-default-active-elevate),
.hover-elevate-2:not(.no-default-hover-elevate),
.active-elevate-2:not(.no-default-active-elevate) {
  position: relative;
  z-index: 0;
}

.hover-elevate:not(.no-default-hover-elevate)::after,
.active-elevate:not(.no-default-active-elevate)::after,
.hover-elevate-2:not(.no-default-hover-elevate)::after,
.active-elevate-2:not(.no-default-active-elevate)::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 999;
}

.hover-elevate:hover:not(.no-default-hover-elevate)::after,
.active-elevate:active:not(.no-default-active-elevate)::after {
  background-color: var(--elevate-1);
}

.hover-elevate-2:hover:not(.no-default-hover-elevate)::after,
.active-elevate-2:active:not(.no-default-active-elevate)::after {
  background-color: var(--elevate-2);
}

.border.hover-elevate:not(.no-hover-interaction-elevate)::after,
.border.active-elevate:not(.no-active-interaction-elevate)::after,
.border.hover-elevate-2:not(.no-hover-interaction-elevate)::after,
.border.active-elevate-2:not(.no-active-interaction-elevate)::after {
  inset: -1px;
}

/* ── Animaciones de entrada ───────────────────────────────── */
.reveal-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s ease, transform 0.75s ease;
  will-change: opacity, transform;
}

.reveal-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.service-modal.is-open .reveal-scale {
  opacity: 1;
  transform: scale(1);
}

/* ── Menú móvil ───────────────────────────────────────────── */
.mobile-menu-panel {
  position: fixed;
  top: 76px;
  left: 1rem;
  right: 1rem;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.mobile-menu-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.mobile-menu-inner {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.22);
  backdrop-filter: blur(20px);
  border-radius: 1.25rem;
  box-shadow: var(--site-shadow);
  padding: 0.85rem;
  display: grid;
  gap: 0.35rem;
}

.mobile-nav-link {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 0.95rem;
}

.mobile-nav-link:hover {
  background: rgba(16, 184, 245, 0.08);
}

/* ── Modal de servicios ───────────────────────────────────── */
.service-trigger {
  cursor: pointer;
}

.service-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.service-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.service-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.62);
  backdrop-filter: blur(8px);
}

.service-modal__dialog {
  position: relative;
  width: min(92vw, 640px);
  margin: 10vh auto 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 1.5rem;
  box-shadow: var(--site-shadow);
  padding: 2rem;
}

.service-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: none;
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.service-modal__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--site-accent);
  margin-bottom: 0.75rem;
}

.service-modal__title {
  font-size: clamp(1.6rem, 2vw, 2.25rem);
  line-height: 1.1;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 1rem;
}

.service-modal__description {
  font-size: 1rem;
  line-height: 1.75;
  color: #334155;
}

.service-modal__actions {
  margin-top: 1.5rem;
}

.service-modal__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 1.25rem;
  border-radius: 999px;
  color: #ffffff;
  font-weight: 700;
  background: linear-gradient(135deg, var(--site-accent), var(--site-accent-2));
  box-shadow: 0 16px 35px rgba(16, 184, 245, 0.25);
}

/* ── Formulario de contacto ───────────────────────────────── */
.form-status {
  min-height: 1.5rem;
}

.form-status.is-success {
  color: #047857;
}

.form-status.is-error {
  color: #b91c1c;
}

/* ── Toast de notificación ────────────────────────────────── */
.site-toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 120;
  min-width: 260px;
  max-width: min(92vw, 420px);
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  background: rgba(15, 23, 42, 0.94);
  color: #fff;
  box-shadow: var(--site-shadow);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.site-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Botón flotante WhatsApp ──────────────────────────────── */
.whatsapp-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #25D366;
  color: #fff;
  text-decoration: none;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 12px 20px 12px 14px;
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease, padding 0.3s ease;
  white-space: nowrap;
  animation: wab-enter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 1.2s both;
  opacity: 0;
}

.whatsapp-fab svg {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.whatsapp-fab:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 8px 28px rgba(37, 211, 102, 0.55);
}

.whatsapp-fab:active {
  transform: translateY(0) scale(0.97);
}

.whatsapp-fab::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50px;
  background: #25D366;
  z-index: -1;
  animation: wab-pulse 2.4s ease-out 2s infinite;
}

@keyframes wab-enter {
  from { opacity: 0; transform: translateY(16px) scale(0.85); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

@keyframes wab-pulse {
  0%   { transform: scale(1);    opacity: 0.6; }
  70%  { transform: scale(1.35); opacity: 0;   }
  100% { transform: scale(1.35); opacity: 0;   }
}

@media (max-width: 480px) {
  .whatsapp-fab span { display: none; }
  .whatsapp-fab      { padding: 14px; border-radius: 50%; }
}

/* ── Accesibilidad: movimiento reducido ───────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration:       0.01ms !important;
    animation-iteration-count: 1     !important;
    transition-duration:       0.01ms !important;
    scroll-behavior:           auto   !important;
  }
  .reveal-up,
  .reveal-scale {
    opacity: 1 !important;
    transform: none !important;
  }
}
