/* ==========================================================
   COMPONENTES — header, botones, tarjetas, formulario, etc.
   ========================================================== */

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background-color .25s var(--ease), border-color .25s var(--ease);
}
.header-inner {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand img { height: 34px; width: auto; }
.brand-name {
  font-size: 1.35rem; font-weight: 800; letter-spacing: -.03em;
  color: var(--brand-name);
}

.nav ul { display: flex; align-items: center; gap: 28px; }
.nav a {
  font-size: .9rem; font-weight: 500; color: var(--text-muted);
  transition: color .2s;
}
.nav a:hover { color: var(--link); }

.header-actions { display: flex; align-items: center; gap: 10px; }

/* Botón de tema */
.theme-toggle, .menu-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  transition: border-color .2s, background-color .2s;
}
.theme-toggle:hover, .menu-btn:hover { border-color: var(--primary); }
.theme-toggle svg, .menu-btn svg {
  width: 20px; height: 20px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.menu-btn { display: none; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: 10px; border: 1.5px solid transparent;
  font-weight: 600; font-size: .95rem; line-height: 1.2; text-align: center;
  transition: background-color .2s, border-color .2s, color .2s, transform .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-sm { padding: 10px 18px; font-size: .875rem; }
.btn-block { width: 100%; }

.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); }

.btn-outline { border-color: var(--border); background: var(--surface); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--link); }

.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: var(--wa-hover); }

/* ---------- Etiqueta ---------- */
.badge {
  display: inline-block; padding: 5px 14px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-soft-text);
  font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}

/* ---------- Tarjetas ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 26px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s, background-color .25s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.card-icon {
  width: 46px; height: 46px; display: grid; place-items: center;
  border-radius: 12px; background: var(--primary-soft); color: var(--primary-soft-text);
}
.card-icon svg {
  width: 24px; height: 24px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.card h3 { margin-top: 16px; font-size: 1.1rem; font-weight: 700; }
.card p { margin-top: 8px; font-size: .92rem; color: var(--text-muted); }

/* ---------- Formulario ---------- */
.form { display: grid; gap: 16px; }
.field label { display: block; margin-bottom: 6px; font-size: .85rem; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent);
}
.field textarea { resize: vertical; min-height: 96px; }
.field-row { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.form-note { font-size: .8rem; color: var(--text-muted); text-align: center; }

/* ---------- Preguntas frecuentes ---------- */
.faq { border-block: 1px solid var(--border); }
.faq details + details { border-top: 1px solid var(--border); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 20px 4px; font-weight: 600; cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ''; flex: none; width: 10px; height: 10px; margin-right: 4px;
  border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg); transition: transform .25s var(--ease);
}
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq details p { padding: 0 4px 20px; color: var(--text-muted); font-size: .94rem; }

/* ---------- Botón flotante de WhatsApp ---------- */
.wa-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  width: 56px; height: 56px; display: grid; place-items: center;
  border-radius: 50%; background: var(--wa); color: #fff; box-shadow: var(--shadow-md);
  transition: transform .2s, background-color .2s;
}
.wa-float:hover { background: var(--wa-hover); transform: scale(1.06); }
.wa-float svg { width: 28px; height: 28px; fill: currentColor; }

/* ---------- Responsive del header ---------- */
@media (max-width: 960px) {
  .menu-btn { display: inline-grid; }
  .hide-sm { display: none; }
  .nav {
    position: absolute; left: 0; right: 0; top: var(--header-h);
    background: var(--bg); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    display: none;
  }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 20px 16px; }
  .nav a { display: block; padding: 14px 4px; font-size: 1rem; border-bottom: 1px solid var(--border); }
  .nav li:last-child a { border-bottom: 0; }
}
@media (max-width: 520px) {
  .field-row { grid-template-columns: 1fr; }
}
