/*
 * NoMasCaos Web Manager - Flexy Public Format v1.38.64
 * Inspirado en FlexyTheme, pero adaptado a web comercial pública.
 * Layout recomendado: portal_topbar. Layout legacy: sidebar_topbar.
 */
:root {
  --nmc-flexy-rail: 286px;
  --nmc-flexy-rail-bg: #111827;
  --nmc-flexy-rail-bg-2: #0f172a;
  --nmc-flexy-rail-line: rgba(255, 255, 255, .10);
  --nmc-flexy-rail-text: rgba(255, 255, 255, .88);
  --nmc-flexy-rail-muted: rgba(255, 255, 255, .62);
  --nmc-flexy-primary: #e30613;
  --nmc-flexy-primary-dark: #b90410;
  --nmc-flexy-primary-soft: rgba(227, 6, 19, .11);
  --nmc-flexy-ink: #111827;
  --nmc-flexy-muted: #64748b;
  --nmc-flexy-surface: #ffffff;
  --nmc-flexy-soft: #f8fafc;
  --nmc-flexy-line: #e5e7eb;
  --nmc-flexy-shadow: 0 18px 60px -44px rgba(15, 23, 42, .72);
  --nmc-flexy-shadow-strong: 0 26px 80px -56px rgba(15, 23, 42, .95);
  --nmc-flexy-radius: 24px;
  --nmc-flexy-wrap: 1360px;
}

body.nmc-flexy-public {
  color: var(--nmc-flexy-ink);
  background:
    radial-gradient(circle at top left, rgba(227, 6, 19, .055), transparent 32rem),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 56%, #ffffff 100%);
}

body.nmc-flexy-public a { text-underline-offset: 3px; }

/* -------------------------------------------------------------------------
   Layout recomendado: portal_topbar. Más web comercial, menos panel ERP.
   ------------------------------------------------------------------------- */
body.nmc-flexy-layout--portal_topbar {
  padding-left: 0;
  padding-bottom: 86px;
}

body.nmc-flexy-layout--portal_topbar .site-header {
  display: none !important;
}

body.nmc-flexy-layout--portal_topbar main,
body.nmc-flexy-layout--portal_topbar .page-main,
body.nmc-flexy-layout--portal_topbar #contenido,
body.nmc-flexy-layout--portal_topbar .public-root,
body.nmc-flexy-layout--portal_topbar .nmc-page {
  position: relative;
}

.nmc-flexy-public-shell {
  position: relative;
  z-index: 10000;
}

.nmc-flexy-topbar {
  position: sticky;
  top: 0;
  z-index: 10040;
  min-height: 76px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 12px clamp(16px, 3vw, 36px);
  border-bottom: 1px solid rgba(226, 232, 240, .92);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 60px -50px rgba(15, 23, 42, .72);
}

.nmc-flexy-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 210px;
  color: var(--nmc-flexy-ink);
  text-decoration: none;
}

.nmc-flexy-brand__mark {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background:
    linear-gradient(135deg, var(--nmc-flexy-primary), var(--nmc-flexy-primary-dark));
  box-shadow: 0 18px 42px -28px rgba(227, 6, 19, .95);
  font-weight: 900;
  letter-spacing: -.06em;
}

.nmc-flexy-brand strong {
  display: block;
  font-size: 1.1rem;
  letter-spacing: -.04em;
  line-height: 1.05;
}

.nmc-flexy-brand small {
  display: block;
  margin-top: 2px;
  color: var(--nmc-flexy-muted);
  font-size: .78rem;
  line-height: 1.15;
}

.nmc-flexy-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.nmc-flexy-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  color: #334155;
  text-decoration: none;
  font-size: .94rem;
  font-weight: 700;
  white-space: nowrap;
}

.nmc-flexy-nav__link:hover,
.nmc-flexy-nav__link:focus,
.nmc-flexy-nav__link.is-active {
  color: var(--nmc-flexy-primary-dark);
  background: var(--nmc-flexy-primary-soft);
}

.nmc-flexy-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.nmc-flexy-phone {
  color: var(--nmc-flexy-ink);
  text-decoration: none;
  font-weight: 900;
  white-space: nowrap;
}

.nmc-flexy-cta {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 999px;
  color: #fff;
  background: var(--nmc-flexy-primary);
  box-shadow: 0 16px 42px -28px rgba(227, 6, 19, .95);
  text-decoration: none;
  font-weight: 900;
  white-space: nowrap;
}

.nmc-flexy-cta:hover,
.nmc-flexy-cta:focus {
  color: #fff;
  background: var(--nmc-flexy-primary-dark);
  text-decoration: none;
}

.nmc-flexy-cta--ghost {
  color: var(--nmc-flexy-ink);
  background: #fff;
  border: 1px solid var(--nmc-flexy-line);
  box-shadow: none;
}

.nmc-flexy-cta--ghost:hover,
.nmc-flexy-cta--ghost:focus {
  color: var(--nmc-flexy-primary-dark);
  background: var(--nmc-flexy-primary-soft);
}

.nmc-flexy-menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--nmc-flexy-line);
  border-radius: 15px;
  background: #fff;
  box-shadow: none;
}

.nmc-flexy-menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 4px;
  background: var(--nmc-flexy-ink);
}

.nmc-flexy-trustbar {
  position: sticky;
  top: 76px;
  z-index: 10020;
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 8px 16px;
  color: #475569;
  background: rgba(248, 250, 252, .94);
  border-bottom: 1px solid rgba(226, 232, 240, .76);
  font-size: .88rem;
  backdrop-filter: blur(14px);
}

.nmc-flexy-trustbar a {
  color: var(--nmc-flexy-primary-dark);
  font-weight: 900;
  text-decoration: none;
}

.nmc-flexy-panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(15, 23, 42, .52);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

body.nmc-flexy-panel-open .nmc-flexy-panel-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.nmc-flexy-mobile-panel {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 10060;
  width: min(88vw, 380px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  background: #fff;
  box-shadow: -24px 0 80px -44px rgba(15, 23, 42, .9);
  transform: translateX(105%);
  transition: transform .22s ease;
}

body.nmc-flexy-panel-open .nmc-flexy-mobile-panel {
  transform: translateX(0);
}

.nmc-flexy-mobile-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--nmc-flexy-line);
}

.nmc-flexy-mobile-panel__head button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: var(--nmc-flexy-soft);
  font-size: 22px;
}

.nmc-flexy-mobile-panel nav {
  display: grid;
  gap: 8px;
}

.nmc-flexy-mobile-panel .nmc-flexy-nav__link {
  justify-content: flex-start;
  border-radius: 14px;
  min-height: 46px;
  background: var(--nmc-flexy-soft);
}

.nmc-flexy-mobile-panel__cta,
.nmc-flexy-mobile-panel__phone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 16px;
  text-decoration: none;
  font-weight: 900;
}

.nmc-flexy-mobile-panel__cta {
  margin-top: auto;
  color: #fff;
  background: var(--nmc-flexy-primary);
}

.nmc-flexy-mobile-panel__phone {
  color: var(--nmc-flexy-primary-dark);
  background: var(--nmc-flexy-primary-soft);
}

.nmc-flexy-bottom-dock {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 10030;
  display: none;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(226, 232, 240, .92);
  border-radius: 24px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(18px);
  box-shadow: 0 22px 70px -40px rgba(15, 23, 42, .88);
}

.nmc-flexy-bottom-dock__item {
  min-height: 52px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 5px 2px;
  border-radius: 18px;
  color: #475569;
  text-decoration: none;
  font-size: .7rem;
  font-weight: 800;
}

.nmc-flexy-bottom-dock__item i { font-size: 1rem; }

.nmc-flexy-bottom-dock__item.is-active,
.nmc-flexy-bottom-dock__item:hover,
.nmc-flexy-bottom-dock__item:focus {
  color: var(--nmc-flexy-primary-dark);
  background: var(--nmc-flexy-primary-soft);
}

/* Mejora visual de bloques existentes sin depender de nombres exactos */
body.nmc-flexy-public .card,
body.nmc-flexy-public .center-card,
body.nmc-flexy-public .nmc-card,
body.nmc-flexy-public .service-card,
body.nmc-flexy-public .blog-card,
body.nmc-flexy-public .stat-card,
body.nmc-flexy-public .feature-card,
body.nmc-flexy-public .pricing-card {
  border: 1px solid rgba(226, 232, 240, .92);
  border-radius: var(--nmc-flexy-radius);
  box-shadow: var(--nmc-flexy-shadow);
}

body.nmc-flexy-public .hero,
body.nmc-flexy-public .home-hero,
body.nmc-flexy-public .page-hero,
body.nmc-flexy-public .nmc-hero {
  border-radius: 0 0 34px 34px;
}

body.nmc-flexy-layout--portal_topbar .hero,
body.nmc-flexy-layout--portal_topbar .home-hero,
body.nmc-flexy-layout--portal_topbar .page-hero,
body.nmc-flexy-layout--portal_topbar .nmc-hero {
  margin-top: -1px;
  border-top: 1px solid transparent;
}

body.nmc-flexy-public .hero-btn,
body.nmc-flexy-public .header-cta-v18,
body.nmc-flexy-public .nmc-smart-ribbon__primary,
body.nmc-flexy-public .btn-primary,
body.nmc-flexy-public .button-primary {
  box-shadow: 0 16px 42px -28px rgba(227, 6, 19, .9);
}

body.nmc-flexy-public .footer {
  border-top: 1px solid var(--nmc-flexy-line);
  background: #0f172a;
}

body.nmc-flexy-layout--portal_topbar .footer {
  padding-bottom: 76px;
}

/* -------------------------------------------------------------------------
   Layout alternativo: sidebar_topbar. Se conserva para quien prefiera app.
   ------------------------------------------------------------------------- */
@media (min-width: 1180px) {
  body.nmc-flexy-layout--sidebar_topbar {
    padding-left: var(--nmc-flexy-rail);
  }

  body.nmc-flexy-layout--sidebar_topbar .site-header {
    left: var(--nmc-flexy-rail);
    width: calc(100% - var(--nmc-flexy-rail));
  }
}

.nmc-flexy-rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10020;
  width: var(--nmc-flexy-rail);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 18px;
  color: var(--nmc-flexy-rail-text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .055), transparent 20%),
    linear-gradient(180deg, var(--nmc-flexy-rail-bg), var(--nmc-flexy-rail-bg-2));
  box-shadow: 26px 0 70px -50px rgba(15, 23, 42, .9);
  transform: translateX(-104%);
  transition: transform .22s ease;
}

body.nmc-flexy-open .nmc-flexy-rail,
body.nmc-flexy-public .nmc-flexy-rail.is-open { transform: translateX(0); }

@media (min-width: 1180px) { .nmc-flexy-rail { transform: none; } }

.nmc-flexy-rail__brand {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 16px;
  border-bottom: 1px solid var(--nmc-flexy-rail-line);
}

.nmc-flexy-rail__brand a { color: #fff; text-decoration: none; }
.nmc-flexy-rail__brand strong { display: block; font-size: 1.28rem; letter-spacing: -.04em; }
.nmc-flexy-rail__brand span { display: block; margin-top: 3px; color: var(--nmc-flexy-rail-muted); font-size: .88rem; }

.nmc-flexy-rail__close {
  appearance: none;
  border: 0;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  color: #fff;
  background: rgba(255, 255, 255, .08);
  font-size: 22px;
  line-height: 1;
}

@media (min-width: 1180px) { .nmc-flexy-rail__close { display: none; } }

.nmc-flexy-rail__nav { display: grid; gap: 7px; }

.nmc-flexy-rail__link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--nmc-flexy-rail-text);
  text-decoration: none;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.nmc-flexy-rail__link i { width: 22px; text-align: center; opacity: .86; }
.nmc-flexy-rail__link:hover,
.nmc-flexy-rail__link:focus,
.nmc-flexy-rail__link.is-active { color: #fff; background: rgba(255, 255, 255, .095); transform: translateX(2px); }
.nmc-flexy-rail__link.is-active { background: linear-gradient(90deg, rgba(227, 6, 19, .92), rgba(227, 6, 19, .38)); box-shadow: 0 14px 42px -26px rgba(227, 6, 19, .95); font-weight: 700; }

.nmc-flexy-rail__panel { margin-top: auto; padding: 16px; border: 1px solid var(--nmc-flexy-rail-line); border-radius: 22px; background: rgba(255, 255, 255, .075); }
.nmc-flexy-rail__panel span { display: block; margin-bottom: 6px; color: var(--nmc-flexy-rail-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.nmc-flexy-rail__panel strong { display: block; color: #fff; line-height: 1.25; }
.nmc-flexy-rail__panel a { display: inline-flex; align-items: center; justify-content: center; margin-top: 14px; min-height: 40px; padding: 0 14px; border-radius: 14px; color: #fff; background: var(--nmc-flexy-primary); text-decoration: none; font-weight: 800; }

.nmc-flexy-rail__mini { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.nmc-flexy-rail__mini a { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--nmc-flexy-rail-line); border-radius: 12px; color: #fff; text-decoration: none; font-size: .88rem; }

.nmc-flexy-toggle {
  position: fixed;
  left: 14px;
  bottom: 18px;
  z-index: 10030;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 46px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: #111827;
  box-shadow: 0 22px 54px -28px rgba(15, 23, 42, .85);
}

.nmc-flexy-toggle span { display: block; width: 14px; height: 2px; border-radius: 4px; background: #fff; }
.nmc-flexy-toggle span + span { margin-left: -11px; transform: translateY(5px); }
.nmc-flexy-toggle span + span + span { transform: translateY(-5px); }
.nmc-flexy-toggle strong { margin-left: 5px; font-size: .88rem; }

@media (min-width: 1180px) { .nmc-flexy-toggle { display: none; } }

.nmc-flexy-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10010;
  background: rgba(15, 23, 42, .55);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

body.nmc-flexy-open .nmc-flexy-backdrop { opacity: 1; pointer-events: auto; }

body.nmc-flexy-layout--sidebar_topbar .site-header {
  position: sticky;
  top: 0;
  z-index: 9000;
  border-bottom: 1px solid rgba(226, 232, 240, .86);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(16px);
  box-shadow: 0 14px 46px -42px rgba(15, 23, 42, .55);
}

body.nmc-flexy-public .header-shell-v18,
body.nmc-flexy-public .wrap,
body.nmc-flexy-public .container,
body.nmc-flexy-public .nmc-wrap {
  max-width: min(var(--nmc-flexy-wrap), calc(100vw - 32px));
}

@media (max-width: 1180px) {
  .nmc-flexy-topbar {
    grid-template-columns: auto auto;
    justify-content: space-between;
    gap: 12px;
  }

  .nmc-flexy-nav,
  .nmc-flexy-phone,
  .nmc-flexy-actions .nmc-flexy-cta--ghost {
    display: none;
  }

  .nmc-flexy-menu-btn { display: inline-block; }
  .nmc-flexy-trustbar { top: 76px; font-size: .78rem; }
  .nmc-flexy-bottom-dock { display: grid; }
  body.nmc-flexy-layout--portal_topbar { padding-bottom: 92px; }
  .nmc-flexy-rail { width: min(88vw, 332px); }
}

@media (max-width: 680px) {
  .nmc-flexy-topbar { min-height: 66px; padding: 10px 12px; }
  .nmc-flexy-brand { min-width: 0; gap: 9px; }
  .nmc-flexy-brand__mark { width: 38px; height: 38px; border-radius: 14px; }
  .nmc-flexy-brand strong { font-size: 1rem; }
  .nmc-flexy-brand small { max-width: 170px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .nmc-flexy-actions .nmc-flexy-cta { min-height: 38px; padding: 0 12px; font-size: .88rem; }
  .nmc-flexy-trustbar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .nmc-flexy-rail,
  .nmc-flexy-backdrop,
  .nmc-flexy-rail__link,
  .nmc-flexy-panel-backdrop,
  .nmc-flexy-mobile-panel { transition: none; }
}
