:root {
  --color_1: #fff;
  --color_2: #2b2b2b;
  --color_3: #00107C;
  --color_9: rgba(0, 17, 124, 0.818);
  --color_4: #1877F2;
  --color_5: #ff3131;
  --color_6: #ff6b0f;
  --color_7: #1d296a;
  --color_8: #f0f0f0;
  --fuente_A: 'Fira Sans', sans-serif;
}

html {
  box-sizing: border-box;
  font-family: "Fredoka", sans-serif;
  font-optical-sizing: auto;
  font-weight: weight;
  font-style: normal;
  font-variation-settings: "wdth" 100;
  scroll-behavior: smooth;
}

a,
p,
span,
input,
select,
textarea {
  font-family: "Fredoka", sans-serif;
  font-optical-sizing: auto;
  font-weight: weight;
  font-style: normal;
  font-variation-settings: "wdth" 100;
}

*,
*:before,
*:after {
  box-sizing: inherit;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  overflow-x: hidden;
  z-index: 2;
  position: relative;
}

body::-webkit-scrollbar {
  -webkit-appearance: none;
}

body::-webkit-scrollbar:vertical {
  width: 10px;
}

body::-webkit-scrollbar-button:increment,
.contenedor::-webkit-scrollbar-button {
  display: none;
}

body::-webkit-scrollbar:horizontal {
  height: 10px;
}

body::-webkit-scrollbar-thumb {
  background-color: var(--color_5);
  border-radius: 20px;
  border: 1px solid var(--color_5);
}

body::-webkit-scrollbar-track {
  border-radius: 10px;
}

.btnMenu {
  display: none !important;
}

.cajaHeader {
  width: 100%;
  /* Default mobile width */
  height: 100vh;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  background-color: var(--color_1);
  position: fixed;
  z-index: 2000;
  top: 0;
  bottom: 0;
  right: 0;
  /* Align to right */
  left: auto;
  opacity: 1;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(100%);
  /* Hidden by default on the right */
  padding: 1.5rem 0;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
  overflow-y: auto;
}

.cajaHeader.is-active {
  transform: translateX(0);
}

.fa-arrow-right {
  position: absolute;
  top: 1rem;
  left: 1rem;
  /* Moved close icon to left portion for right-aligned menu */
  width: 2.5rem;
  height: 2.5rem;
  background-color: var(--color_3);
  color: var(--color_1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  border-radius: 50%;
  cursor: pointer;
}

.items {
  width: 90%;
  height: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 1rem 0;
}

.items a {
  width: 100%;
  height: 120px;
  background-color: var(--color_3);
  color: var(--color_1);
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: flex-start;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 1.2rem;
  gap: 10px;
  border-radius: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.items a::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(0, 16, 124, 0.9) 0%, rgba(0, 16, 124, 0.4) 50%, transparent 100%);
  z-index: -1;
  transition: opacity 0.3s ease;
}


.items a:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  color: var(--color_1);
}

.items a:hover::before {
  background: linear-gradient(to top, rgba(24, 119, 242, 0.95) 0%, rgba(24, 119, 242, 0.5) 50%, transparent 100%);
}

/* FONDOS ESPECÍFICOS PARA MÓDULOS */
#home {
  background-color: #E31E24 !important;
  /* Rojo Premium */
  height: 60px !important;
  align-items: center !important;
  grid-column: span 2;
}

#home::before {
  display: none;
}

#pagos {
  background-image: url('../img/img_botones_modulos/modulo restuarantes latinos canada.webp');
}

/* Placeholder si falta el de precios */
#calendario {
  background-image: url('../img/img_botones_modulos/modulo de eventos para hispanos en canada.webp');
}

#empleos {
  background-image: url('../img/img_botones_modulos/modulo de empleos para latinos.webp');
}

#jobseek {
  background-image: url('../img/img_botones_modulos/modulo netwroking.webp');
}

#rentas {
  background-image: url('../img/img_botones_modulos/modulos rentas canada.webp');
}

#belleza {
  background-image: url('../img/img_botones_modulos/modulo de belleza y cuidado.webp');
}

#inversiones {
  background-image: url('../img/img_botones_modulos/Modulo inversiones latinos.webp');
}

#networking {
  background-image: url('../img/img_botones_modulos/modulo netwroking.webp');
}

#empresas {
  background-image: url('../img/img_botones_modulos/modulo de servicios latinos.webp');
}

#restaurantes {
  background-image: url('../img/img_botones_modulos/modulo restuarantes latinos canada.webp');
}

#turismo {
  background-image: url('../img/img_botones_modulos/modulo de turismo para latinos.webp');
}

#donaciones {
  background-image: url('../img/img_botones_modulos/Modulo de donaciones.webp');
}

#aliados {
  background-image: url('../img/img_botones_modulos/Modulo networking tarjeta digital.webp');
}

#salir {
  background-color: #2b2b2b !important;
  /* Gris oscuro para salir */
  grid-column: span 2;
  height: 60px !important;
  align-items: center !important;
}

#salir::before {
  background: linear-gradient(to right, rgba(0, 0, 0, 0.5), transparent);
}

.icon-nav {
  font-size: 1.4rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease;
}

.items a:hover .icon-nav {
  transform: scale(1.2);
}

.items a span {
  text-align: left;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.arrow-nav {
  display: none;
}


.div_logo {
  width: 90%;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--color_2);
  margin-bottom: 2rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(245, 247, 255, 0.95) 100%);
  padding: 2.5rem 1.5rem;
  border-radius: 24px;
  box-shadow:
    0 10px 30px rgba(0, 16, 124, 0.04),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  position: relative;
  overflow: hidden;
  margin-top: 10px;
}

.div_logo::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(24, 119, 242, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.logoHeader {
  width: 100%;
  max-width: 190px;
  filter: drop-shadow(0 10px 20px rgba(0, 16, 124, 0.1));
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: logoSoftFloat 4s ease-in-out infinite;
}

@keyframes logoSoftFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.logoHeader:hover {
  transform: scale(1.08) rotate(1deg);
  filter: drop-shadow(0 15px 30px rgba(0, 16, 124, 0.15));
}

.principal {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  margin: 0;
}

.cajaRcw {
  width: 100%;
  background-color: var(--color_1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 1.5rem 0;
  border-top: 1px solid #f0f0f0;
  margin-top: auto;
}

.social_caja {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 90%;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.social-btn {
  width: 100%;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1.2rem;
  border-radius: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  color: white !important;
}

.social-btn i,
.social-btn fab {
  color: white !important;
}

.social-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
  filter: brightness(1.1);
}

.social-btn.facebook {
  background-color: #1877F2;
}

.social-btn.tiktok {
  background-color: #000000;
}

.social-btn.instagram {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.social-btn.linkedin {
  background-color: #0077B5;
}

.social-btn.youtube {
  background-color: #FF0000;
}

.social-btn.x-twitter {
  background-color: #000000;
}

.social-btn.google {
  background-color: #4285F4;
}


.rcw {
  color: var(--color_9);
  font-size: 0.75rem;
  margin-bottom: 0.2rem;
  text-align: center;
}

.footer {
  width: 100%;
  height: 100vh;
  background-color: var(--color_9);
  flex-direction: column;
  color: white;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  background-image: url('../img/pagina/footer2.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 20px;
  position: relative;
}

.container-titulo {
  width: 90%;
  display: flex;
  justify-content: flex-end;
}

.container-titulo p {
  font-size: 1.4rem;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  text-align: right;
}

@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
    align-items: center;
  }
}

.preloader {
  width: 70px;
  height: 70px;
  border: 10px solid #eee;
  border-top: 10px solid var(--color_3);
  border-radius: 50%;
  animation: girar 2s infinite linear;
}

@keyframes girar {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@media screen and (min-width: 1024px) {
  .cajaHeader {
    width: 30%;
    /* Occupy 30% on desktop */
  }

  .items {
    grid-template-columns: 1fr 1fr;
    /* Maintain 2-column grid or adjust as needed */
  }
}

/* ========== ACCESIBILIDAD: MODO ZURDO/DIESTRO ========== */

.accesibilidad_caja {
  width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid #f0f0f0;
}

.toggle-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9ff;
  padding: 0.8rem 1.2rem;
  border-radius: 50px;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-round {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
}

.slider-round:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked+.slider-round {
  background-color: var(--color_4);
}

input:checked+.slider-round:before {
  transform: translateX(22px);
}

/* POSICIONAMIENTO MODO ZURDO */

body.ha-zurdo .btnMenu {
  right: auto !important;
  left: 1rem !important;
}

body.ha-zurdo .cajaHeader {
  right: auto !important;
  left: 0 !important;
  transform: translateX(-100%);
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
}

body.ha-zurdo .cajaHeader.is-active {
  transform: translateX(0) !important;
}

body.ha-zurdo .fa-arrow-right {
  left: auto !important;
  right: 1rem !important;
  transform: rotate(180deg) !important;
}

/* ========== NUEVA NAVEGACIÓN RESPONSIVA (MENÚ BAJO / FLOTANTE) ========== */

.bottom-floating-nav {
  position: fixed;
  z-index: 1500;
  /* Detrás de cajaHeader (2000) */
  display: flex;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item-modern {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #666;
}

.nav-item-modern i {
  font-size: 1.5rem;
  margin-bottom: 2px;
}

.nav-item-modern span {
  font-size: 0.65rem;
  font-weight: 600;
}

.nav-item-modern.active {
  color: var(--color_5);
}

/* --- MODO MÓVIL (Barra Inferior Estándar) --- */
@media screen and (max-width: 768px) {
  .btnMenu {
    display: none !important;
    /* Ocultar hamburguesa en móvil */
  }

  .bottom-floating-nav {
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: white;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding-bottom: 5px;
    border-top: 1px solid #eee;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05);
    align-items: end;
    justify-items: center;
    z-index: 5000 !important;
    /* Siempre encima en móvil */
  }

  .main-item-modern {
    background: var(--color_5);
    color: white !important;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-top: -20px;
    /* Bajado un poco (de -35px a -20px) */
    border: 5px solid white;
    box-shadow: 0 8px 20px rgba(255, 49, 49, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .main-item-modern i {
    margin-bottom: 0;
  }

  .main-item-modern span {
    display: none;
  }
}

/* --- MODO ESCRITORIO (Dock Flotante Premium) --- */
@media screen and (min-width: 769px) {
  .bottom-floating-nav {
    right: 1.5rem;
    /* Pegado al scroll */
    bottom: 1rem;
    background: white;
    padding: 15px;
    /* Reduced for single item dock */
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    gap: 20px;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
  }

  /* Hide all items except "Módulos" on desktop */
  .nav-item-modern:not(#btnModulosModern) {
    display: none;
  }


  .nav-item-modern {
    color: var(--color_3);
  }

  .nav-item-modern:hover {
    color: var(--color_5);
    transform: translateY(-3px);
  }

  .nav-item-modern span {
    display: block;
    /* Show labels on desktop dock */
    font-size: 0.7rem;
  }

  .nav-item-modern.active {
    color: var(--color_5);
  }

  .main-item-modern {
    position: relative;
  }

  .main-item-modern::after {
    content: '';
    position: absolute;
    bottom: -8px;
    width: 5px;
    height: 5px;
    background: var(--color_5);
    border-radius: 50%;
    opacity: 0;
    transition: 0.3s;
  }

  .main-item-modern.active::after {
    opacity: 1;
  }
}

@media screen and (min-width: 769px) {
  body.ha-zurdo .bottom-floating-nav {
    right: auto !important;
    left: 1.5rem !important;
  }
}

/* ========== AJUSTE GLOBAL DE MÁRGENES (TARJETAS MÁS PEQUEÑAS/CENTRADAS) ========== */

@media screen and (min-width: 769px) {

  .contenedor-eventos,
  .contenedor-destacados {
    width: 100% !important;
    max-width: 1200px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

@media screen and (max-width: 768px) {

  .contenedor-eventos,
  .contenedor-destacados {
    width: 100% !important;
    padding-left: 5px !important;
    /* Mínimo para que no pegue al borde físico pero cubra visualmente */
    padding-right: 5px !important;
  }
}