/* ============================================================
   MORDAN — CSS global
   Cargado en todas las páginas via functions.php del tema hijo
   ============================================================ */

/* ── Reset de links ──────────────────────────────────────────
   Los <a> de texto SÍ pueden mostrarse en azul (comportamiento
   esperado). Solo se bloquea el azul en links que son botones.
   ─────────────────────────────────────────────────────────── */
a,
a:link,
a:visited,
a:hover,
a:active,
a:focus {
  text-decoration: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
button,
button:hover,
button:focus {
  color: inherit;
  text-decoration: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

/* ── Links que son botones — nunca azul ─────────────────────
   Cualquier <a> con fondo (bg-), relleno+bordes redondeados,
   o clases de componente propio de Mordan conserva el color
   diseñado (blanco, negro o lima) aunque sea un enlace.
   ─────────────────────────────────────────────────────────── */
a[class*="bg-"],
a[class*="btn"],
a[class*="px-"][class*="rounded"],
a[class*="border"][class*="rounded"][class*="px-"],
a.mordan-badge,
a.mordan-badge--dark,
a.cat-btn,
a.social-card,
a.service-card {
  color: inherit !important;
}

/* Outline de foco accesible — negro en lugar de azul */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #0a0f0d;
  outline-offset: 2px;
}

/* ── Variables de marca ──────────────────────────────────── */
:root {
  --accent:      #b5ff4d;
  --accent-dark: #8fd628;
  --dark:        #0a0f0d;
  --dark-2:      #121a14;
  --dark-3:      #1c2b1e;
  --mid:         #2e4030;
}

/* ── Tipografía base ─────────────────────────────────────── */
body {
  font-family: 'DM Sans', sans-serif;
  background: #fff;
  color: #374151;
}
.font-display { font-family: 'Syne', sans-serif; }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 20px; }

/* ── Acordeón FAQ (details/summary) ─────────────────────── */
details > summary                  { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details[open] summary ~ *          { animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Service card hover ──────────────────────────────────── */
.service-card {
  transition: transform 0.3s cubic-bezier(0.22,1,0.36,1), box-shadow 0.3s ease;
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.12);
}

/* ── Marquee genérico ────────────────────────────────────── */
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee-track       { animation: marquee 22s linear infinite; }
.marquee-track:hover { animation-play-state: paused; }

/* ── Ticker de cards (home) ──────────────────────────────── */
@keyframes tickerLeft {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes tickerRight {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}
.cards-row-left            { animation: tickerLeft  18s linear infinite; }
.cards-row-right           { animation: tickerRight 18s linear infinite; }
.cards-row-left:hover,
.cards-row-right:hover     { animation-play-state: paused; }

/* ── Clientes marquee (home) ─────────────────────────────── */
@keyframes clientsMarquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.clients-marquee       { animation: clientsMarquee 30s linear infinite; }
.clients-marquee:hover { animation-play-state: paused; }

/* ── Floating badge (home) ───────────────────────────────── */
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(var(--r, -6deg)); }
  50%       { transform: translateY(-8px) rotate(var(--r, -6deg)); }
}
.float-badge { animation: float 3s ease-in-out infinite; }

/* ── Step connector (home proceso) ──────────────────────── */
.step-line::after {
  content: '';
  position: absolute;
  top: 30px; left: calc(100% + 16px);
  width: calc(100% - 48px);
  height: 1px;
  background: linear-gradient(to right, #d1d5db, transparent);
}

/* ── Tech card (landing diseño web) ─────────────────────── */
.tech-card { min-width: 260px; scroll-snap-align: start; }
@media (min-width: 640px) { .tech-card { min-width: 0; } }

/* ── Mega menu (nav-mordan.php) ──────────────────────────── */
.mega-dropdown {
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  pointer-events: none;
  background: #ffffff !important;   /* Fix 4 */
}
.mega-parent:hover .mega-dropdown,
.mega-parent:focus-within .mega-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  background: #ffffff !important;   /* Fix 4 */
}
.mega-parent > a::after {
  content: '';
  display: inline-block;
  width: 0; height: 0;
  margin-left: 5px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  vertical-align: middle;
  transition: transform 0.2s;
}
.mega-parent:hover > a::after { transform: rotate(180deg); }

/* Fix 6: Bridge ampliado — distancia entre el nav y la caja del megamenú */
.mega-parent::before {
  content: '';
  position: absolute;
  top: 100%; left: 0;
  width: 100%; height: 24px;
}
.mega-dropdown { padding-top: 24px; }
.mega-dropdown-inner {
  background: #ffffff !important;
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;           /* esquinas más curvadas */
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
  /* padding gestionado inline en el PHP para control fino */
}

/* Active nav link */
nav a.nav-active { color: #b5ff4d !important; font-weight: 600; }

/* ── Scroll-aware nav ─────────────────────────────────────
   Siempre blanco — la transparencia inicial causaba azul en links
   y rompía la legibilidad en páginas no-hero.
   ─────────────────────────────────────────────────────── */
#mordan-nav {
  background: rgba(255,255,255,0.97);
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 0 #e2e8f0;
  transition: box-shadow 0.3s ease;
}

/* Logo — sin hover de color ni subrayado nunca */
#mordan-nav .nav-logo,
#mordan-nav .nav-logo:hover,
#mordan-nav .nav-logo:visited,
#mordan-nav .nav-logo:focus  {
  color: inherit;
  text-decoration: none;
  outline: none;
}

/* Links principales — cortar azul de navegador, hover = lima */
#mordan-nav .nav-link        { color: #475569; text-decoration: none; }
#mordan-nav .nav-link:hover  { color: #b5ff4d; text-decoration: none; }
#mordan-nav .nav-link:visited{ color: #475569; }

/* Estado scrolled — pequeño refuerzo de sombra */
#mordan-nav.scrolled {
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

/* Mobile hamburger */
#mordan-nav .nav-hamburger   { color: #0a0f0d; }

/* Mobile menu siempre blanco */
#mobile-menu           { display: none; }
#mobile-menu.open      { display: block; }

/* ─────────────────────────────────────────────────────
   CRO — Tools ticker (marquee móvil)
   ───────────────────────────────────────────────────── */
@keyframes tools-ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.tools-ticker         { animation: tools-ticker 18s linear infinite; }
.tools-ticker:hover   { animation-play-state: paused; }

/* ─────────────────────────────────────────────────────
   Automation CRM — Ciclo de pasos (stacked móvil)
   ───────────────────────────────────────────────────── */
@media (max-width: 639px) {
  .ciclo-stack              { display: flex; flex-direction: column; }
  .ciclo-card               {
    position: sticky;
    border-radius: 1rem;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.45);
  }
  .ciclo-card:nth-child(1)  { top: 80px;  z-index: 1; }
  .ciclo-card:nth-child(2)  { top: 96px;  z-index: 2; }
  .ciclo-card:nth-child(3)  { top: 112px; z-index: 3; }
  .ciclo-card:nth-child(4)  { top: 128px; z-index: 4; }
}
@media (min-width: 640px) {
  .ciclo-stack { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
}
@media (min-width: 1024px) {
  .ciclo-stack { grid-template-columns: repeat(4, 1fr); }
}

/* ── Todos los servicios — scroll sin scrollbar ─────────── */
.services-scroll                     { scrollbar-width: none; -ms-overflow-style: none; }
.services-scroll::-webkit-scrollbar  { display: none; }

/* ============================================================
   COMPONENTE: MORDAN TAB (dark sidebar — quienes-somos, seo-geo, etc.)
   Uso: <button class="mordan-tab" data-panel="...">
        <span class="mordan-tab-num">01</span>
        <span class="mordan-tab-title">Título</span>
   ============================================================ */

.mordan-tab {
  color: #475569;
}
.mordan-tab .mordan-tab-num   { color: rgba(181,255,77,.28); }
.mordan-tab .mordan-tab-title { color: #475569; }

.mordan-tab:hover .mordan-tab-num   { color: rgba(181,255,77,.6); }
.mordan-tab:hover .mordan-tab-title { color: #e2e8f0; }

.mordan-tab.is-active {
  background: rgba(255,255,255,.05);
  border-left: 2px solid #b5ff4d;
  padding-left: calc(1rem - 2px);
}
.mordan-tab.is-active .mordan-tab-num   { color: #b5ff4d; }
.mordan-tab.is-active .mordan-tab-title { color: #ffffff; }

/* Animación de panel — compartida */
@keyframes mordan-tab-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mordan-tab-panel.is-entering {
  animation: mordan-tab-in 0.35s cubic-bezier(0.22,1,0.36,1) forwards;
}

/* ============================================================
   COMPONENTE: SECTION BADGE
   Versión light: .mordan-badge
   Versión dark:  .mordan-badge--dark
   ============================================================ */

.mordan-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: #f1f5f9;
  color: #475569;
  font-size: .6875rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  padding: .375rem .875rem;
  border-radius: 9999px;
}
.mordan-badge::before {
  content: '';
  width: 6px; height: 6px;
  background: #b5ff4d;
  border-radius: 50%;
  flex-shrink: 0;
}

.mordan-badge--dark {
  background: rgba(181,255,77,.08);
  border: 1px solid rgba(181,255,77,.18);
  color: #b5ff4d;
}
.mordan-badge--dark::before {
  background: #b5ff4d;
}

/* ============================================================
   COMPONENTE: SCROLL SNAP LIST (proceso cards, etc.)
   Reemplaza el inline style="-webkit-overflow-scrolling: touch; scrollbar-width: none;"
   Uso: añade clase scroll-snap-list al flex container con overflow-x-auto
   ============================================================ */

.scroll-snap-list {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.scroll-snap-list::-webkit-scrollbar { display: none; }

/* ============================================================
   COMPONENTE: FADE-UP (animación entrada)
   Uso: class="fade-up fade-up-1" etc.
   ============================================================ */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up           { opacity: 0; animation: fadeUp 0.55s ease forwards; }
.fade-up-1         { animation-delay: .1s; }
.fade-up-2         { animation-delay: .22s; }
.fade-up-3         { animation-delay: .36s; }
.fade-up-4         { animation-delay: .5s; }

/* ============================================================
   COMPONENTE: SOCIAL CARD (compartir / gracias / etc.)
   ============================================================ */

.social-card {
  transition: transform 0.3s cubic-bezier(0.22,1,0.36,1), box-shadow 0.3s ease;
}
.social-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 48px rgba(0,0,0,0.14);
}

/* ============================================================
   COMPONENTE: CAT-BTN (filtro blog)
   ============================================================ */

.cat-btn           { color: #94a3b8; background: transparent; }
.cat-btn:hover     { color: #ffffff; background: rgba(255,255,255,.06); }
.cat-btn.is-active { color: #0a0f0d; background: #b5ff4d; }

/* ── Back-to-top button — eliminar fondo azul del tema ────── */
#back-to-top, .back-to-top, #scroll-to-top, .scroll-to-top,
[class*="scrolltop"], [id*="scrolltop"], [class*="scroll-up"],
[class*="totop"], [id*="totop"] {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #b5ff4d !important;
}
