/* ═══════════════════════════════════════════════════════════════════
   LS DOMÓTICA — base.css
   ------------------------------------------------------------------
   Estilos globales que usan TODAS las secciones:
     · Reset
     · Tipografía base
     · Formularios (inputs, textareas, selects)
     · Botones reutilizables (.btn, .btn-primary, .btn-ghost, etc)
     · Badges y texto con gradiente
     · Contenedor (.container) y header de sección
     · Scrollbar custom
     · Utilidades (.hidden, .gradient-text)

   Cada sección tiene su propio .css aparte para estilos específicos.
═══════════════════════════════════════════════════════════════════ */

/* ─── RESET ────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 10px); /* evita que el nav fijo tape el anchor */
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── TIPOGRAFÍA ──────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.18;
  font-weight: 800;
  color: var(--text);
}

p {
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--t-fast);
}

a:hover {
  color: var(--accent);
}

img, svg, video {
  max-width: 100%;
  display: block;
}

/* ─── BOTONES (reset + clases reutilizables) ──────────────────── */
button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: .82rem 1.8rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .93rem;
  transition: all .22s;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 4px 24px rgba(0, 149, 255, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-accent);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1.5px solid rgba(239, 68, 68, 0.35);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--danger);
}

/* ─── INPUTS ──────────────────────────────────────────────────── */
input, textarea, select {
  font-family: inherit;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: .75rem 1rem;
  outline: none;
  transition: border-color var(--t-fast);
  width: 100%;
  font-size: .95rem;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
}

::placeholder {
  color: var(--muted);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* ─── LAYOUT (container + section) ────────────────────────────── */
section {
  padding: var(--section-pad) 0;
  /* Anchor deep-links scrollean considerando el nav fijo. Las secciones
     que necesitan offset distinto (ej: .services) lo sobrescriben.    */
  scroll-margin-top: var(--nav-height);
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* Encabezado estándar de sección (badge + h2 + subtítulo) */
.section-header {
  text-align: center;
  margin-bottom: 4rem;
}
.section-header .badge {
  margin-bottom: 1rem;
}
.section-header h2 {
  font-size: clamp(1.9rem, 3.5vw, 2.9rem);
  margin-bottom: 1rem;
}
.section-header p {
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.05rem;
}

/* ─── UTILIDADES ──────────────────────────────────────────────── */

/* Badge pill con acento */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 149, 255, 0.12);
  border: 1px solid rgba(0, 149, 255, 0.25);
  color: var(--accent);
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  padding: 5px 13px;
  border-radius: 999px;
}

/* Texto con gradiente de marca */
.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Clase para ocultar elementos (usada por los portales/modales) */
.hidden {
  display: none !important;
}

/* Scroll lock (lo aplican los overlays para evitar scroll del body) */
body.no-scroll {
  overflow: hidden;
}

/* ─── SCROLLBAR ───────────────────────────────────────────────── */
::-webkit-scrollbar        { width: 6px; }
::-webkit-scrollbar-track  { background: var(--bg); }
::-webkit-scrollbar-thumb  { background: rgba(0, 149, 255, 0.35); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ─── SELECCIÓN DE TEXTO ──────────────────────────────────────── */
::selection {
  background: var(--accent);
  color: #fff;
}

/* ─── TOAST ───────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(145deg, #0d1630, #111827);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  min-width: 280px;
  max-width: 380px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1),
              opacity 280ms ease;
}

#toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-content { flex: 1; min-width: 0; }

.toast-title {
  font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.toast-title:empty { display: none; }

.toast-body {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.45;
}

.toast-close {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 150ms ease, background 150ms ease;
}

.toast-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 480px) {
  #toast {
    bottom: 16px;
    right: 16px;
    left: 16px;
    max-width: none;
  }
}