/* viewer2.css */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: var(--font-avenir);
}
.video-container {
  position: relative;
  width: 100vw;
  height: 100vh;
}
.video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  gap: 0;
  pointer-events: none;
}
.brand-title {
  display: block;
  text-align: center;
  position: absolute;
  top: 0;
  left: 0;
  /* Coordinates (left/top/width/height) are set via JS for precision over grid cells */
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 2px;
  color: #fff;
  margin: 0;
  white-space: nowrap;
  pointer-events: none; /* let clicks pass to buttons below */
  z-index: 5;
}
.brand-title::after {
  content: "LÓGICA®";
  font-weight: 700;
  color: #fff;
  margin-left: 2px;
}
.grid-overlay-mobile {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none; /* only on mobile */
  gap: 10px;
  padding: 10px;
  box-sizing: border-box;
  pointer-events: none;
}
.grid-cell {
  width: 100%;
  height: 100%;
  border-right: 1px solid rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.mobile-cell {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  box-sizing: border-box;
  opacity: 0.65; /* let the video show through */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.mobile-cell.transparent { background: transparent; opacity: 1; }

/* Bordes para la primera fila */
.grid-cell[data-row="0"] {
  border-top: 1px solid rgba(0, 0, 0, 0.2);
}

/* Bordes para la primera columna */
.grid-cell[data-col="0"] {
  border-left: 1px solid rgba(0, 0, 0, 0.2);
}

/* Sin bordes para celdas transparentes */
.grid-cell.transparent-cell {
  border: none;
}
.grid-cell:hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
/* Botones de navegación principales (inicio, proyectos, categorías, etc) */
.nav-btn {
  pointer-events: auto;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  display: inline;
  cursor: pointer;
  font-family: var(--font-avenir);
  font-weight: 500;
  font-size: clamp(0.65rem, 1.1vw, 1.35rem);
  color: #333;
  transition: color 0.3s ease;
  white-space: nowrap;
  line-height: 1;
}
@media (max-width: 1200px) {
  .nav-btn { font-size: clamp(0.6rem, 1vw, 1.2rem); }
}
@media (max-width: 768px) {
  .nav-btn { font-size: clamp(0.55rem, 1.05vw, 1.1rem); }
}

/* Hacer que el botón de idioma cubra toda la celda - INACTIVO con fondo gris */
.lang-cell .nav-btn {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  background-color: #d3d3d3;
  color: #666;
  box-sizing: border-box;
  border: none;
  margin: 0;
  padding: 0;
}

/* Estilo para el botón de idioma ACTIVO - verde lima como color por defecto */
.lang-cell .nav-btn.active {
  background-color: rgb(196, 245, 61);
  color: #000;
}

/* Efecto hover específico para los botones de idioma ESP/ENG */
.lang-cell {
  transition: background-color 0.3s ease, transform 0.3s ease;
  /* Asegura que el botón hijo pueda ocupar toda la celda */
  align-items: stretch;
}

.lang-cell:hover {
  background-color: rgba(255, 255, 255, 0.3) !important;
  transform: scale(1.05);
}

.lang-cell:hover .nav-btn {
  color: #000;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* --- Mobile Hamburger Menu (hidden on desktop) --- */
.hamburger {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  display: none; /* shown via media query */
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 8px;
  cursor: pointer;
  color: #111;
  z-index: 50;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #111;
  margin: 4px 0;
  transition: transform .2s ease, opacity .2s ease;
}

.mobile-menu {
  position: fixed;
  inset: 0;
  display: none; /* toggled by .open */
  z-index: 60;
}
.mobile-menu.open { display: block; }
.mobile-menu .menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
}
.mobile-menu .menu-panel {
  position: absolute;
  top: 0; right: 0;
  width: min(82vw, 360px);
  height: 100%;
  background: #fff;
  box-shadow: -8px 0 20px rgba(0,0,0,.25);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.mobile-menu .menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}
.mobile-menu .brand { font-weight: 700; letter-spacing: .5px; }
.mobile-menu .menu-close {
  background: transparent;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.mobile-menu .menu-list {
  list-style: none;
  padding: 8px 12px;
  margin: 0;
}
.mobile-menu .menu-list li { margin: 6px 0; }
.mobile-menu .menu-link {
  width: 100%;
  padding: 14px 12px;
  border: 1px solid rgba(0,0,0,0.1);
  background: #fff;
  border-radius: 8px;
  font-weight: 500;
  font-family: var(--font-avenir);
  cursor: pointer;
}
.mobile-menu .menu-link:hover { background: rgba(0,0,0,0.04); }
.mobile-menu .menu-lang {
  margin-top: auto;
  padding: 16px 12px 20px;
  display: flex;
  gap: 10px;
}
.mobile-menu .menu-lang-btn {
  flex: 1;
  padding: 12px 10px;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 8px;
  background: #111;
  color: #fff;
  font-weight: 500;
  cursor: pointer;
}
.mobile-menu .menu-lang-btn.active {
  background: #f7f7f7;
  color: #000;
  border-color: rgba(0,0,0,0.15);
}

/* Lock scroll when menu open */
body.no-scroll { overflow: hidden; }

/* Responsive rules: show hamburger, hide grid top-row nav and lang cells */
@media (max-width: 768px) {
  .brand-title, .brand-title::after { color: #0018cc; }
  .hamburger { display: inline-flex; }
  /* Hide first-row nav cells and language cells on mobile */
  .grid-overlay { display: none !important; }
  .grid-overlay-mobile { 
    display: grid; 
    gap: 0;
    padding: 0;
  }
  .mobile-cell {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 0;
    border-right: 1px solid rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 1;
  }
  .mobile-cell.transparent { 
    background: transparent; 
    opacity: 1;
    border: none;
  }
  
  /* Bordes para la primera fila en móvil */
  .mobile-cell[data-row="0"] {
    border-top: 1px solid rgba(0, 0, 0, 0.2);
  }
  
  /* Bordes para la primera columna en móvil */
  .mobile-cell[data-col="0"] {
    border-left: 1px solid rgba(0, 0, 0, 0.2);
  }
}
