/* ════════════════════════════════════════════════════════════════════════
   TRIXEL — Components
   Botones, formularios, lang switcher, WhatsApp flotante, social icons,
   tarjetas reutilizables, modal de cookies.
   ════════════════════════════════════════════════════════════════════════ */

/* ── Botones ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-sm);
  letter-spacing: 0.01em;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    transform var(--t-base),
    box-shadow var(--t-base),
    background var(--t-base),
    border-color var(--t-base),
    color var(--t-base);
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn .arrow { transition: transform var(--t-base); }
.btn:hover .arrow { transform: translateX(4px); }
.btn--block { width: 100%; }

/* Tamanos */
.btn--lg { padding: var(--sp-4) var(--sp-6); font-size: var(--fs-base); }
.btn--sm { padding: var(--sp-2) var(--sp-4); font-size: var(--fs-xs); }

/* Variantes */
.btn--primary {
  background: var(--grad-brand);
  color: var(--c-white);
  box-shadow: var(--sh-glow);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 50px rgba(31, 182, 206, 0.36);
}

.btn--ghost {
  background: transparent;
  color: var(--c-text);
  border-color: var(--c-border-strong);
}
.btn--ghost:hover {
  border-color: var(--c-violet);
  background: var(--c-violet-tint);
  color: var(--c-text);
}
.section--graphite .btn--ghost,
.cta-block .btn--ghost {
  color: var(--c-warm-white);
  border-color: rgba(255, 255, 255, 0.30);
}
.section--graphite .btn--ghost:hover,
.cta-block .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: var(--c-cyan-soft);
  color: var(--c-white);
}

/* Ghost claro: para usar sobre fondos oscuros (hero full-screen) */
.btn--ghost-light {
  background: transparent;
  color: var(--c-white);
  border-color: rgba(255, 255, 255, 0.5);
}
.btn--ghost-light:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--c-white);
  color: var(--c-white);
}

.btn--wa {
  background: var(--c-whatsapp);
  color: var(--c-white);
  box-shadow: 0 10px 30px -10px rgba(37, 211, 102, 0.6);
}
.btn--wa:hover {
  background: var(--c-whatsapp-dark);
  color: var(--c-white);
  transform: translateY(-2px);
  box-shadow: 0 16px 40px -10px rgba(37, 211, 102, 0.85);
}

.btn--ice {
  background: var(--c-cyan-tint);
  color: var(--c-cyan-dark);
  border-color: var(--c-cyan-tint);
}
.btn--ice:hover { background: var(--c-cyan); color: var(--c-white); }

.btn.is-error { background: #FCE7E7; color: #9B2222; border-color: #F1B7B7; }

/* ── Language switcher ─────────────────────────────────────────────────── */
.lang-switcher { position: relative; }
.lang-switcher__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 0;
  background: none;
  color: rgba(250, 250, 247, 0.85);
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  letter-spacing: 0.04em;
  font-weight: 700;
  transition: color var(--t-fast);
}
.lang-switcher__btn:hover { color: var(--c-violet); }
.lang-switcher__btn svg { pointer-events: none; }
.lang-switcher__globe { width: 18px; height: 18px; flex-shrink: 0; }
.lang-switcher__caret { width: 12px; height: 12px; transition: transform var(--t-fast); }
.lang-switcher.is-open .lang-switcher__caret { transform: rotate(180deg); }
.lang-switcher__menu {
  position: absolute;
  top: calc(100% + var(--sp-2));
  right: 0;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-md);
  padding: var(--sp-2);
  min-width: 180px;
  display: none;
  z-index: 80;
}
.lang-switcher.is-open .lang-switcher__menu { display: block; }
.lang-switcher__menu li button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  color: var(--c-text);
  font-size: var(--fs-sm);
  transition: background var(--t-fast);
}
.lang-switcher__menu li button:hover { background: var(--c-ice); }
.lang-switcher__menu li button span {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  color: var(--c-text-dim);
  letter-spacing: 0.08em;
}

/* ── Social icons ──────────────────────────────────────────────────────── */
.social-icons {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.social-icons__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.social-icons__link img,
.social-icons__link svg { width: 18px; height: 18px; }
.social-icons__link:hover {
  background: var(--c-violet);
  border-color: var(--c-violet);
  transform: translateY(-2px);
}
.social-icons--topbar .social-icons__link { width: 36px; height: 36px; }
.social-icons--topbar .social-icons__link img,
.social-icons--topbar .social-icons__link svg { width: 18px; height: 18px; }

/* Variante para el footer (sobre fondo cian): círculo translúcido y blanco */
.social-icons--footer .social-icons__link {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.30);
  color: var(--c-white);
}
.social-icons--footer .social-icons__link:hover {
  background: var(--c-white);
  border-color: var(--c-white);
  color: var(--c-cyan-dark);
}

/* ── Botones flotantes ──────────────────────────────────────────────────── */
.wa-float {
  position: fixed;
  right: var(--sp-5);
  bottom: var(--sp-5);
  z-index: 90;
  width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  background: var(--c-graphite) !important;
  color: #fff;
  box-shadow: 0 8px 22px rgba(31, 29, 42, 0.32);
  transition: transform var(--t-base), background var(--t-fast), box-shadow var(--t-base);
}
.wa-float:hover {
  background: var(--c-graphite-2) !important;
  transform: scale(1.06);
  box-shadow: 0 8px 22px rgba(31, 29, 42, 0.42);
}
.wa-float span { display: none; }
.wa-float svg,
.wa-float .wa-icon { width: 24px; height: 24px; }
.wa-float::after { display: none; }

.scroll-top {
  position: fixed;
  right: var(--sp-5);
  bottom: calc(var(--sp-5) + 48px + var(--sp-3));
  z-index: 89;
  width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--c-graphite) !important;
  color: #fff;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  box-shadow: 0 8px 22px rgba(31, 29, 42, 0.32);
  transition: opacity var(--t-base), visibility var(--t-base), transform var(--t-base), background var(--t-fast), box-shadow var(--t-base);
}
.scroll-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.scroll-top:hover { background: var(--c-graphite-2) !important; transform: translateY(-2px); box-shadow: 0 8px 22px rgba(31, 29, 42, 0.42); }
.scroll-top svg { width: 22px; height: 22px; }

@media (max-width: 720px) {
  .wa-float { right: var(--sp-4); bottom: var(--sp-4); width: 44px; height: 44px; }
  .scroll-top { right: var(--sp-4); bottom: calc(var(--sp-4) + 44px + var(--sp-3)); width: 44px; height: 44px; }
  .wa-float svg,
  .wa-float .wa-icon { width: 22px; height: 22px; }
  .scroll-top svg { width: 20px; height: 20px; }
}

/* ── Cards genericas ───────────────────────────────────────────────────── */
.card {
  position: relative;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  transition: transform var(--t-base), border-color var(--t-base), box-shadow var(--t-base);
  overflow: hidden;
}
.card:hover {
  transform: translateY(-6px);
  border-color: var(--c-border-strong);
  box-shadow: var(--sh-md);
}
.card__icon {
  width: 54px; height: 54px;
  border-radius: var(--r-md);
  display: grid; place-items: center;
  background: var(--c-violet-tint);
  margin-bottom: var(--sp-5);
}
.card__icon img,
.card__icon svg { width: 28px; height: 28px; }
.card__title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
  margin-bottom: var(--sp-3);
}
.card__text { color: var(--c-text-soft); font-size: var(--fs-sm); }
.card__link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-5);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-violet-dark);
  transition: gap var(--t-base);
}
.card:hover .card__link { gap: var(--sp-3); }

/* Card destacada (borde sólido cian) */
.card--feature {
  background: var(--c-white);
  border: 1px solid var(--c-violet);
}

/* ── Formularios genericos ─────────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.field label {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-text-dim);
}
input[type="email"],
input[type="text"],
select,
textarea {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  background: var(--c-white);
  font-size: var(--fs-base);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
input[type="email"]:focus,
input[type="text"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--c-violet);
  box-shadow: 0 0 0 4px rgba(31, 182, 206, 0.15);
}

/* ── Modal de cookies ──────────────────────────────────────────────────── */
.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: var(--sp-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base);
}
.cookie-modal.is-open { opacity: 1; pointer-events: auto; }
.cookie-modal__overlay {
  position: absolute; inset: 0;
  background: rgba(20, 18, 28, 0.45);
  backdrop-filter: blur(4px);
}
.cookie-modal__panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: var(--c-white);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  padding: var(--sp-7);
  transform: translateY(20px);
  transition: transform var(--t-base);
}
.cookie-modal.is-open .cookie-modal__panel { transform: translateY(0); }
.cookie-modal__title {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  margin: var(--sp-3) 0 var(--sp-3);
  letter-spacing: -0.02em;
}
.cookie-modal__text { color: var(--c-text-soft); font-size: var(--fs-sm); margin-bottom: var(--sp-3); }
.cookie-modal__text a { color: var(--c-violet-dark); text-decoration: underline; }
.cookie-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-5);
}
.cookie-modal__back {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  color: var(--c-text-dim);
  margin-bottom: var(--sp-3);
}
.cookie-cat {
  margin: var(--sp-5) 0;
  padding: var(--sp-4);
  background: var(--c-ice);
  border-radius: var(--r-md);
}
.cookie-cat__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-4);
}
.cookie-cat__title { font-family: var(--font-display); font-size: var(--fs-base); margin-bottom: var(--sp-1); }
.cookie-cat__desc { font-size: var(--fs-xs); color: var(--c-text-soft); }
.cookie-cat__toggle--locked {
  font-size: var(--fs-xs);
  padding: var(--sp-1) var(--sp-3);
  background: var(--c-cyan-tint);
  color: var(--c-cyan-dark);
  border-radius: var(--r-pill);
  font-weight: 600;
}
.cookie-cat__items {
  margin-top: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--c-text-soft);
}
.cookie-cat__items li { padding: var(--sp-1) 0; }
