/* =========================================================
   NECXUS HEADER + MENU (Mobile First)
   ========================================================= */

/* -------- Utils locales -------- */
[hidden] {
  display: none !important;
}

/* -------- Header -------- */
.nx-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: 56px;
  padding: var(--nx-space-sm);
  background: var(--nx-color-bg);
  color: var(--nx-color-text);
  contain: layout style;
}

.nx-header__row {
  display: flex;
  align-items: center;
  gap: var(--nx-space-sm);
}

/* -------- Logo -------- */
.nx-header__logo {
  display: flex;
  align-items: center;
  height: 24px;
}

.nx-header__logo img {
  height: 24px;
  width: 27px;
  display: block;
}

/* -------- Search -------- */
.nx-header__search {
  flex: 1;
}

.nx-header__search input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  font-size: 14px;
  border: none;
  border-radius: var(--nx-radius-md);
  background: var(--nx-input-bg);
  color: var(--nx-text-dark);
}

.nx-header__search input::placeholder {
  color: var(--nx-color-muted);
}

.nx-header__search input:focus {
  outline: none;
  background: var(--nx-input-bg-focus);
}

/* -------- Menu button -------- */
.nx-header__menu {
  display: flex;
  align-items: center;
  padding: 6px;
  border-radius: var(--nx-radius-sm);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.35);
  cursor: pointer;
}

.nx-header__menu svg {
  width: 26px;
  height: 26px;
  fill: var(--nx-color-text);
}

.nx-header__menu:active {
  transform: scale(0.96);
}

/* -------- Hamburger → X -------- */
.nx-header__menu svg rect {
  transform-origin: center;
  transition: transform 0.2s ease, opacity 0.15s ease;
}

.nx-header__menu[aria-expanded="true"] svg rect:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nx-header__menu[aria-expanded="true"] svg rect:nth-child(2) {
  opacity: 0;
}

.nx-header__menu[aria-expanded="true"] svg rect:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* =========================================================
   FULLSCREEN MENU
   ========================================================= */

.nx-menu {
  position: fixed;
  top: 56px;
  left: 0;
  width: 100%;
  height: calc(100vh - 56px);
  background: var(--nx-surface-2);
  z-index: 9999;

  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.nx-menu.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nx-menu__content {
  height: 100%;
  overflow: hidden;
}

/* -------- Usuario -------- */
.nx-menu__user {
  background: var(--nx-surface-3);
  padding: var(--nx-space-md);
  margin-bottom: 10px;
}

.nx-menu__welcome {
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 12px;
  color: var(--nx-text-dark);
}

/* -------- Botones -------- */
.nx-btn {
  display: flex;
  align-items: center;
  padding: 14px;
  margin-bottom: 10px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 14px;
  text-decoration: none;
}

.nx-btn--primary {
  background: var(--nx-color-button-b);
  color: #fff;
  width: 100%;
}

.nx-btn--secondary {
  background: var(--nx-surface-1);
  border: 1px solid var(--nx-border-light);
  color: var(--nx-text-dark);
  width: 100%;
}

/* -------- Links -------- */
.nx-menu__links,
.nx-menu__cat-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
}

.nx-menu__links--cards,
.nx-menu__cat-list {
  padding: 0 10px;
}

.nx-menu__links--cards li a,
.buttonmenu1,
.nx-menu__cat-list li {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--nx-surface-1);
  border-radius: 14px;
  border: 1px solid var(--nx-border-light);
  font-size: 15px;
  font-weight: 600;
  color: var(--nx-text-dark);
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
}

/* FIX: evita hueco blanco entre bloques */
.nx-menu__links--cards:first-of-type li:last-child a {
  margin-bottom: 0;
}

.nx-menu__links--cards li a:active,
.buttonmenu1:active {
  transform: scale(0.97);
  background: var(--nx-surface-2);
}

/* -------- Iconos -------- */
.nx-icon {
  display: inline-flex;
  align-items: center;
  margin-right: 10px;
  line-height: 1;
}

/* -------- Skip link -------- */
.nx-skip-link {
  position: absolute;
  left: -9999px;
}

.nx-skip-link:focus {
  left: 16px;
  top: 16px;
  background: var(--nx-color-bg);
  color: var(--nx-color-text);
  padding: 8px;
  z-index: 9999;
}

/* -------- Touch -------- */
a,
button {
  -webkit-tap-highlight-color: transparent;
}

/* =========================================================
   CATEGORÍAS / FAMILIAS
   ========================================================= */

/* ===== Layout principal ===== */
.nx-cat-layout {
  display: flex;
  height: 100%;
  min-height: 0;
}

/* ===== Columna izquierda ===== */
.nx-cat-families {
  width: 50%;
  max-width: 180px;
  background: var(--nx-surface-2);
  border-right: 1px solid var(--nx-border-light);
  overflow-y: auto;
}

.nx-cat-families ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nx-cat-families li {
  padding: 12px 5px 12px 30px;
  font-size: 14px;
  cursor: pointer;
  border-left: 3px solid transparent;
  color: var(--nx-text-dark);
}

.nx-cat-families li.is-active {
  background: var(--nx-color-background-c);
  border-left-color: var(--nx-color-accent);
  font-weight: 700;
  color: var(--nx-color-text);
}
.icon-phone {
  stroke: #2A2A2A;
  fill: none;
}

.icon-phone circle {
  fill: #2A2A2A;
}

.menu-activo .icon-phone {
  stroke: #FFFFFF;
}

.menu-activo .icon-phone circle {
  fill: #FFFFFF;
}
.icon-phone {
  color: #2A2A2A;
}

.menu-activo .icon-phone {
  color: #FFFFFF;
}


/* ===== Panel derecho ===== */
.nx-cat-subfamilies {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  min-height: 0;
}

/* ===== Grilla ===== */
.nx-subfamily-grid {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 14px;
}

.nx-subfamily-grid.is-active {
  display: grid;
}

/* ===== Cards ===== */
.nx-subfamily-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 10px;
  background: var(--nx-surface-1);
  border-radius: 12px;
  border: 1px solid var(--nx-border-light);
  text-decoration: none;
  color: var(--nx-text-dark);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.nx-subfamily-card img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin-bottom: 8px;
}

.nx-subfamily-card:active {
  transform: scale(0.96);
}
.nx-back{
  width: 100%;
}
/** Nav celular**/
/* =================== Bottom Nav =================== */
.nx-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--nx-color-bg);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1000;
}

.nx-bottom-nav__list {
  display: flex;
  justify-content: space-around;
  margin: 0;
  padding: 6px 0;
  list-style: none;
}

.nx-bottom-nav__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--nx-color-text);
  text-decoration: none;
  padding: 4px 0;
  transition: color 0.15s ease;
  border:0px;
  background: transparent;
}

.nx-bottom-nav__link:active,
.nx-bottom-nav__link--active {
  color: var(--nx-color-accent);
}

.nx-bottom-nav__icon {
  display: flex;
  margin-bottom: 2px;
  line-height: 1;
}

.nx-bottom-nav__icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
}
.divimgcat{
  position: absolute;margin-left: -30px;
    margin-top: -5px;
}


/* ===== Loader ===== */
.nx-page-loader-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.nx-spinner {
  width: 42px;
  height: 42px;
  border: 4px solid var(--nx-color-accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: nx-spin .9s linear infinite;
}

@keyframes nx-spin {
  to { transform: rotate(360deg); }
}

.nx-loader-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--nx-text-dark);
  margin: 0;
}


/* =========================================================
   GLOBAL PAGE LOADER (MOBILE ONLY)
   ========================================================= */

#nx-page-loader {
  position: fixed;
  inset: 0;
  z-index: 20000; /* más alto que menu y bottom nav */
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);

  display: flex;
  align-items: center;
  justify-content: center;

  pointer-events: auto;
}

#nx-page-loader.hidden {
  display: none;
}

/* Caja central */
#nx-page-loader .nx-page-loader-box {
  background: #ffffff;
  padding: 22px 24px;
  border-radius: 16px;
  text-align: center;
  width: auto;
  max-width: 80%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

/* Spinner */
#nx-page-loader .nx-spinner {
  width: 38px;
  height: 38px;
  border-width: 4px;
}

/* Texto */
#nx-page-loader .nx-loader-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--nx-text-dark);
}
.nx-bottom-nav__list li button{
  background: transparent;
  border: 0;
  color: var(--nx-color-text);
}

/* Contenedor principal que inyecta Google */
#credential_picker_container,
#credential_picker_iframe {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 2147483647 !important;
}
.nx-enter-with-email, .nx-enter-with-gmail{
  display: none;
}
.nx-enter-with-email button{
  background: transparent;
  border: 0;
  color: var(--nx-color-accent);
  cursor: pointer;
}

.nx-enter-with-gmail h3{
  margin-bottom: 0;
}

.google-login-wrapper {
  justify-content: center;
}
.nx-auth-desktop-switch{
  background: transparent;
  border: 0;
  color: var(--nx-color-accent);
}
#toast-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* Centrado total */
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 99999; /* Muy arriba, encima de modales y overlays */
  pointer-events: none; /* No bloquea clicks de fondo */
  align-items: center; /* Centrado horizontal de los toasts */
}

.toast {
  min-width: 250px;
  max-width: 350px;
  background-color: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 0.8rem 1rem;
  border-radius: 5px;
  font-size: 0.95rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  opacity: 0;
  transform: translateY(-20px); /* Animación de entrada vertical */
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: auto; /* Permite cerrar si ponemos botón */
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success { background-color: var(--nx-color-background-v); }
.toast.error   { background-color: var(--nx-color-background-r); }
.toast.info    { background-color: var(--nx-color-background-c); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#nx-confirm-container {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.nx-confirm {
  background: var(--nx-color-bg-w);
  color: var(--nx-color-bg-soft);
  border-radius: 10px;
 /* width: 90%;*/
  max-width: 600px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  padding: 1.2rem;
  text-align: center;

  opacity: 0;
  transform: scale(0.9);
  transition: all 0.25s ease;
  pointer-events: auto;
}

.nx-confirm.show {
  opacity: 1;
  transform: scale(1);
}

.nx-confirm-title {
  font-weight: 600;
  font-size: var(--nx-font-offper);
  margin-bottom: 0.5rem;
}

.nx-confirm-text {
  font-size: var(--nx-font-m);
  margin-bottom: 1rem;
  color: var(--nx-color-text-textcommen);
}

.nx-confirm-actions {
  display: flex;
  gap: 0.5rem;
}

.nx-confirm-btn {
  flex: 1;
  padding: 0.6rem;
  border-radius: 6px;
  font-size: var(--nx-font-m);
  cursor: pointer;
  border: none;
}

.nx-confirm-btn.cancel {
  background: var(--nx-surface-3);
}

.nx-confirm-btn.confirm {
  background: var(--nx-color-background-v);
  color: var(--nx-color-text);
}
#nx-confirm-container {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none; /* 🔥 CLAVE */
  align-items: center;
  justify-content: center;
}
#nx-confirm-container::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.3);
}

.nx-confirm-btn.confirm.success {
  background: var(--nx-color-background-v);
  color: var(--nx-color-text);
}

.nx-confirm-btn.confirm.danger {
  background: var(--nx-color-background-r);
  color: var(--nx-color-text);
}


.nx-confirm input.nx-input {
  width: 100%;
  box-sizing: border-box;
}
#nx-confirm-container {
  align-items: center;
  justify-content: center;
}

@media (max-width: 480px) {
  .nx-confirm {
    border-radius: 12px;
    padding: 1rem;
  }
}