/* ============================================================
   TACSA — Modern Theme Layer
   Capa de modernización sobre el CSS compilado (Tailwind).
   Se carga DESPUÉS del CSS base para sobreescribir estilos.
   ============================================================ */

:root {
  --brand: #1a2f4e;
  --brand-600: #0f1e33;
  --brand-700: #070e1e;
  --brand-dark: #040d1a;
  --accent: #e07625;
  --ink: #0f172a;
  --radius-card: 1.25rem;
  --radius-btn: 0.85rem;
  --shadow-lift: 0 20px 40px -16px rgb(2 24 51 / .25);
  --ease-out: cubic-bezier(.22, .8, .26, .99);
}

/* ------------------------------------------------------------
   1) TIPOGRAFÍA — escala fluida y moderna
   ------------------------------------------------------------ */
html { scroll-behavior: smooth; }

body {
  font-family: Inter, system-ui, sans-serif;
  color: var(--ink);
  text-rendering: optimizeLegibility;
}

main h1 {
  font-size: clamp(2.4rem, 5.2vw, 4rem) !important;
  line-height: 1.08 !important;
  letter-spacing: -0.03em;
  font-weight: 800 !important;
}

main h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem) !important;
  line-height: 1.15 !important;
  letter-spacing: -0.02em;
  font-weight: 800 !important;
}

main h3 { letter-spacing: -0.01em; }

/* ------------------------------------------------------------
   2) NAVEGACIÓN — limpia, sin subrayados, con glass effect
   ------------------------------------------------------------ */
header[role="banner"] {
  background: rgb(255 255 255 / .82) !important;
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgb(15 23 42 / .06);
  box-shadow: none !important;
}

header a,
header nav a,
#mobile-menu a {
  text-decoration: none !important;
}

header nav[aria-label="Principal"] > a,
header nav[aria-label="Principal"] .relative.group > a {
  color: #334155 !important;
  font-weight: 600;
  font-size: .925rem;
  padding: .45rem .85rem;
  border-radius: 9999px;
  transition: color .2s var(--ease-out), background-color .2s var(--ease-out);
}

header nav[aria-label="Principal"] > a:hover,
header nav[aria-label="Principal"] .relative.group > a:hover {
  color: var(--brand-600) !important;
  background: rgb(26 47 78 / .08);
}

/* Tagline del logo: más corto y elegante */
header .hidden.sm\:block p {
  max-width: 26ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: .72rem !important;
  letter-spacing: .02em;
  color: #64748b !important;
}

header img[alt="TACSA"] { border-radius: .65rem; }

/* Dropdown del menú servicios */
header .group .absolute {
  border-radius: 1rem !important;
  border: 1px solid rgb(15 23 42 / .07);
  box-shadow: 0 18px 40px -12px rgb(2 24 51 / .18) !important;
  overflow: hidden;
  padding: .25rem;
}

header .group .absolute a {
  border-radius: .6rem;
  text-decoration: none !important;
}

/* ------------------------------------------------------------
   3) BOTONES — modernos, sin subrayado, con elevación
   ------------------------------------------------------------ */
a[class*="bg-primary"],
a[class*="border-2"],
a[class*="rounded-md"],
button[class*="bg-primary"] {
  text-decoration: none !important;
}

a.bg-primary,
a[class*="bg-primary "] {
  background-image: linear-gradient(135deg, #2d4a6e 0%, #1a2f4e 100%);
  border-radius: var(--radius-btn) !important;
  box-shadow: 0 10px 24px -10px rgb(26 47 78 / .55);
  transition: transform .22s var(--ease-out), box-shadow .22s var(--ease-out), filter .22s var(--ease-out);
}

a.bg-primary:hover,
a[class*="bg-primary "]:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -10px rgb(26 47 78 / .6);
  filter: brightness(1.05);
}

/* Botones outline */
a[class*="border-2"] {
  border-radius: var(--radius-btn) !important;
  transition: transform .22s var(--ease-out), background-color .22s var(--ease-out), color .22s var(--ease-out);
}

a[class*="border-2"]:hover { transform: translateY(-2px); }

/* Botón WhatsApp del header */
header a[href^="https://wa.me"] {
  border-radius: 9999px !important;
  background-image: linear-gradient(135deg, #2bd366 0%, #1faa52 100%);
  box-shadow: 0 8px 18px -8px rgb(37 211 102 / .55);
  font-weight: 600;
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out);
}

header a[href^="https://wa.me"]:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 12px 22px -8px rgb(37 211 102 / .65);
}

/* ------------------------------------------------------------
   4) HERO — overlay con gradiente y profundidad
   ------------------------------------------------------------ */
main section.relative.py-40 { min-height: 78vh; display: flex; align-items: center; }

main section.relative.py-40 .bg-black\/40 {
  background: linear-gradient(160deg, rgb(4 16 32 / .88) 0%, rgb(8 20 40 / .60) 45%, rgb(224 118 37 / .20) 100%) !important;
}

/* Kicker "TACSA Nicaragua" como badge pill */
main section.relative.py-40 p.text-lg.md\:text-xl.font-medium {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: .14em;
  padding: .5rem 1.1rem;
  border-radius: 9999px;
  background: rgb(255 255 255 / .12);
  border: 1px solid rgb(255 255 255 / .25);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* ------------------------------------------------------------
   5) STATS BAR — gradiente profundo
   ------------------------------------------------------------ */
main > div.bg-primary.text-white {
  background: linear-gradient(120deg, #040d1a 0%, #0f1e33 55%, #1a2f4e 130%) !important;
  position: relative;
  overflow: hidden;
}

main > div.bg-primary.text-white .divide-x > div {
  border-color: rgb(255 255 255 / .12) !important;
}

main > div.bg-primary.text-white .text-3xl.md\:text-4xl {
  font-size: clamp(2.2rem, 3.6vw, 3rem) !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
}

/* Emojis de stats: contenedor con glass */
main > div.bg-primary.text-white .text-3xl.mb-3 {
  width: 3.4rem;
  height: 3.4rem;
  margin: 0 auto .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem !important;
  border-radius: 1rem;
  background: rgb(255 255 255 / .1);
  border: 1px solid rgb(255 255 255 / .18);
}

/* ------------------------------------------------------------
   6) TARJETAS — bordes suaves, hover lift, radios amplios
   ------------------------------------------------------------ */
.shadow-soft {
  box-shadow: 0 1px 2px rgb(2 24 51 / .05), 0 8px 24px -12px rgb(2 24 51 / .12) !important;
}

main .rounded-lg.shadow-soft,
main article.rounded-lg {
  border-radius: var(--radius-card) !important;
  border: 1px solid rgb(15 23 42 / .06);
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out) !important;
}

main .rounded-lg.shadow-soft:hover,
main article.rounded-lg:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lift) !important;
}

/* Badges */
main span.bg-primary.text-white.px-3 {
  background-image: linear-gradient(135deg, #e07625, #b85e18);
  font-weight: 600;
  letter-spacing: .01em;
  box-shadow: 0 4px 12px -4px rgb(224 118 37 / .5);
}

/* Botones internos de tarjetas */
main .rounded-lg a.bg-primary,
main article a.bg-primary {
  border-radius: .7rem !important;
}

/* Imágenes de tarjetas: zoom más sutil y elegante */
main .rounded-lg img.group-hover\:scale-105,
main article img.group-hover\:scale-105 {
  transition: transform .6s var(--ease-out) !important;
}

/* ------------------------------------------------------------
   7) SECCIONES — fondos alternos refinados
   ------------------------------------------------------------ */
section.bg-neutral-50 { background: #f8f5f0 !important; }

section.bg-primary {
  background:
    radial-gradient(1100px 500px at 85% -10%, rgb(224 118 37 / .14), transparent 60%),
    radial-gradient(900px 420px at 8% 110%, rgb(224 118 37 / .07), transparent 55%),
    #1a2f4e !important;
}

section.bg-primary-50 {
  background:
    radial-gradient(1100px 500px at 85% -10%, rgb(26 47 78 / .07), transparent 60%),
    radial-gradient(900px 420px at 8% 110%, rgb(224 118 37 / .06), transparent 60%),
    #f4f6f9 !important;
}

/* Círculos de íconos en "Por qué TACSA" */
section.bg-primary .w-16.h-16.bg-white.rounded-full,
section.bg-primary-50 .w-16.h-16.bg-white.rounded-full {
  border-radius: 1.15rem !important;
  background: linear-gradient(160deg, #ffffff, #f0f3f8) !important;
  border: 1px solid rgb(224 118 37 / .25);
  box-shadow: 0 10px 22px -10px rgb(26 47 78 / .25) !important;
  transition: transform .25s var(--ease-out);
}

section.bg-primary .text-center:hover .w-16.h-16,
section.bg-primary-50 .text-center:hover .w-16.h-16 {
  transform: translateY(-4px) scale(1.06);
}

/* Pasos del proceso (números circulares) */
main .w-20.h-20.bg-primary.rounded-full {
  background-image: linear-gradient(140deg, #2d4a6e, #1a2f4e);
  box-shadow: 0 12px 26px -10px rgb(26 47 78 / .55);
  border-radius: 1.4rem !important;
}

/* ------------------------------------------------------------
   8) CTA FINAL — gradiente nocturno con acento
   ------------------------------------------------------------ */
section.bg-neutral-900 {
  background:
    radial-gradient(900px 400px at 90% 0%, rgb(224 118 37 / .22), transparent 55%),
    radial-gradient(700px 360px at 0% 100%, rgb(224 118 37 / .10), transparent 55%),
    #0b1626 !important;
}

section.bg-neutral-900 a.bg-white {
  border-radius: var(--radius-btn) !important;
  box-shadow: 0 14px 30px -12px rgb(255 255 255 / .35);
  transition: transform .22s var(--ease-out), box-shadow .22s var(--ease-out);
  text-decoration: none !important;
}

section.bg-neutral-900 a.bg-white:hover { transform: translateY(-2px); }

section.bg-neutral-900 a[class*="border-2"] {
  border-color: rgb(255 255 255 / .4) !important;
}

/* ------------------------------------------------------------
   9) ENLACES GENERALES dentro de main — sin subrayado por defecto
   ------------------------------------------------------------ */
main a.underline,
main a[class*="underline"] {
  text-decoration: none !important;
}

main a[class*="underline"]:hover {
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

/* ------------------------------------------------------------
   10) WHATSAPP FLOAT — con anillo pulsante
   ------------------------------------------------------------ */
body > a[href^="https://wa.me"].fixed {
  background-image: linear-gradient(135deg, #2bd366, #1faa52);
  box-shadow: 0 14px 30px -10px rgb(37 211 102 / .6) !important;
}

body > a[href^="https://wa.me"].fixed::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 9999px;
  border: 2px solid rgb(37 211 102 / .5);
  animation: tacsa-pulse 2.2s var(--ease-out) infinite;
  pointer-events: none;
}

@keyframes tacsa-pulse {
  0%   { transform: scale(.85); opacity: .9; }
  70%  { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(1.25); opacity: 0; }
}

/* ------------------------------------------------------------
   11) SCROLL REVEAL — estados controlados por modern.js
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: no-preference) {
  .tacsa-reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform;
  }

  .tacsa-reveal.tacsa-in {
    opacity: 1;
    transform: none;
  }
}

/* ------------------------------------------------------------
   12) DETALLES FINALES
   ------------------------------------------------------------ */
::selection { background: rgb(224 118 37 / .25); }

/* Scrollbar moderno (WebKit) */
::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb {
  background: #c3d4e8;
  border-radius: 8px;
  border: 2px solid #f1f5f9;
}
::-webkit-scrollbar-thumb:hover { background: #9fb8d6; }

/* Focus visible accesible */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: .5rem;
}
