/*
 * styles_total_fusionado.css
 * Versión optimizada y corregida.
 */

/* ==========================================================================
   1. Reglas Base (HTML, Body)
   ========================================================================== */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  background-color: #e0f5ff;
  color: #003366;
  overflow-x: hidden; /* Evitar scroll horizontal por el sidebar */
}

html {
  scroll-behavior: smooth;
}

/* REGLAS CRÍTICAS PARA ELIMINAR MÁRGENES/PADDINGS SUPERIORES INDESEADOS */
html, body {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden;
}
.h2-naranja {  color: #FF6600;
font-weight: bold;
}
body > br {
  display: none !important;
}
body > div:empty {
  display: none !important;
}


/* ==========================================================================
   2. Estilos del Sidebar de Navegación
   ========================================================================== */
.sidebar {
  width: 85px;
  background-color: rgba(0, 0, 0, 0.7);
  padding-top: 20px;
  box-shadow: 2px 0 5px rgba(0,0,0,0.2);
  transition: width 0.3s ease;
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sidebar:hover {
  width: 200px;
}

.sidebar .logo-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 10px !important;
}

.sidebar .logo-link img {
  height: 60px;
  width: 60px;
  object-fit: contain;
  border-radius: 50%;
  border: 2px solid #FF6600;
}

.logo-text {
    opacity: 0;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.3s ease, font-size 0.3s ease;
    max-width: 0;
    color: #FF6600;
    text-align: center;
}

.sidebar:hover .logo-text {
    opacity: 1;
    font-size: 16px;
    max-width: 100%;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 0px !important;
}

.sidebar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0px !important;
  color: white;
  text-decoration: none;
  font-weight: bold;
  white-space: nowrap;
  transition: background-color 0.3s ease, color 0.3s ease;
  width: 100%;
  text-align: center;
  min-height: 0 !important;
  line-height: 0 !important;
}

.sidebar-item:hover {
  background-color: rgba(255, 102, 0, 0.2);
  color: #FF6600;
}

.sidebar-item .icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  margin: 0px !important;
  padding: 0px !important;
  transition: width 0.3s ease, height 0.3s ease, margin 0.3s ease;
  line-height: 1 !important;
  display: block !important;
}

.sidebar-item .text {
  font-size: 13px;
  line-height: 1 !important;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
  margin: 0px !important;
  padding: 0px !important;
}

.sidebar:hover .sidebar-item .icon {
  width: 45px;
  height: 45px;
}

.sidebar:hover .sidebar-item .text {
  display: block;
  opacity: 1;
  margin-left: 0;
  font-size: 15px;
}

/* ==========================================================================
   3. Contenido Principal
   ========================================================================== */
.main-content {
  margin-left: 85px;
  transition: margin-left 0.3s ease;
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.sidebar:hover ~ .main-content {
  margin-left: 200px;
}

.language-menu-sidebar {
  width: 100%;
  text-align: center;
  padding: 10px 0;
  margin-top: 10px !important;
}

.language-menu-sidebar select {
  font-size: 14px;
  padding: 5px 8px;
  border-radius: 4px;
  border: 1px solid #ccc;
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http://www.w3.org/2000/svg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23ffffff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13%205.7l-133.9%20133.9L17.6%2075.1a17.6%2017.6%200%200%200-25%2025l146.4%20146.3a17.6%2017.6%200%200%200%2025%200L287%2094.4a17.6%2017.6%200%200%200%200-25z%22/%3E%3C/svg%3E');
  background-repeat: no-repeat;
  background-position: right 8px top 50%;
  background-size: 12px auto;
}
.language-menu-sidebar select option {
  color: #003366;
  background-color: white;
}

/* ==========================================================================
   4. Secciones Generales y Títulos
   ========================================================================== */
section {
  scroll-margin-top: 0px;
}

header.titulo-fondo {
  background: url('https://nexusinversiones.cl/wp/wp-content/uploads/banner-mar.jpg') no-repeat left center;
  background-size: cover;
  height: 300px;
  display: flex;
  align-items: center;
  padding-left: 60px;
}

header h1 {
  color: #FF6600;
  font-size: 70px;
  font-weight: bold;
}

.espacio-abajo {
  margin-bottom: 1em;
}

.fila-subtitulo {
  width: 100%;
  padding: 20px 40px 0 40px;
  grid-column: 1 / -1;
}
.subtitulo-naranja {
  color: #FF6600;
  font-size: 48px;
  font-weight: bold;
  margin-bottom: 20px;
  text-align: center;
}

.logo-nexus {
  height: 100px;
  width: auto;
  margin-right: 20px;
  vertical-align: middle;
}

/* ==========================================================================
   5. Estilos de Productos y Modales
   ========================================================================== */
.productos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding: 40px;
  background-color: #E0F5FF;
}
.producto {
  width: 100%;
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 6px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.3s ease;
}
.producto:hover {
  transform: translateY(-5px);
}
.producto h2 {
  color: #FF6600;
  font-size: 20px; /* Tamaño base ligeramente aumentado */
  margin-top: 12px;
  margin-bottom: 4px;
  font-weight: bold;
}
.producto p {
  font-size: 14px;
  text-align: justify;
  font-style: italic;
}
.modal {
  display: none;
  position: fixed;
  z-index: 10;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
  padding: 20px;
}
.modal.show {
  display: flex;
}
.modal-content {
  background: white;
  padding: 30px;
  border-radius: 10px;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  text-align: justify;
  position: relative;
  animation: fadein 0.3s ease-in-out;
  z-index: 10000;
}
.close-modal {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
}
.modal h2 {
  color: #FF6600;
  font-size: 22px; /* Tamaño base aumentado */
  margin-top: 12px;
  margin-bottom: 4px;
  font-weight: 600;
}
@keyframes fadein {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.producto-img, .modal-img {
  max-width: 100%;
  height: auto;
  border-radius: 5px;
  margin-bottom: 10px;
  display: block;
}

.producto-img {
  height: 220px;
  object-fit: cover;
  border-radius: 8px;
}

/* ==========================================================================
   6. Estilos Responsivos (Media Queries)
   ========================================================================== */
@media (max-width: 1024px) { /* Para pantallas medianas (tabletas). */
  .productos-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 20px; /* Reducir padding en tablet */
  }
   header.titulo-fondo {
    height: 250px; /* Reducir altura del banner */
    padding-left: 40px;
  }
  header h1 {
    font-size: 50px; /* Reducir fuente del banner */
  }
  .subtitulo-naranja {
    font-size: 40px; /* Reducir subtítulo */
  }
}

@media (max-width: 768px) { /* Para pantallas pequeñas (móviles grandes). */
  .sidebar {
    width: 60px;
  }
  .sidebar:hover {
    width: 150px;
  }
  .sidebar .logo-link img {
    height: 50px;
    width: 50px;
  }
  .sidebar-item .icon {
    margin-right: 0;
    margin-bottom: 3px;
  }
  .main-content {
    margin-left: 60px;
  }
  .sidebar:hover ~ .main-content {
    margin-left: 150px;
  }

  header.titulo-fondo {
    height: 160px; /* **CAMBIO:** Altura reducida, estaba en 200*/
    padding-left: 20px; /* **CAMBIO:** Menos padding */
    background-position: center center;
  }
  header h1 {
    font-size: 28px; /* **CAMBIO:** Fuente más pequeña estaba en 32*/
  }
  .productos-grid {
    grid-template-columns: 1fr;
    padding: 18px;
  }
  .producto-img {
    height: 180px; /* **CAMBIO:** Imagen de producto más pequeña */
  }
  .producto h2 {
      font-size: 18px; /* **CAMBIO:** Título de producto más pequeño */
  }
  .modal-content {
    max-width: 90%;
    padding: 20px;
  }
  .subtitulo-naranja {
    font-size: 32px; /* **CAMBIO:** Subtítulo más pequeño */
  }
}

@media (max-width: 480px) { /* Para pantallas muy pequeñas (móviles). */
  .sidebar {
    width: 0; /* Oculta completamente el sidebar */
  }
  .main-content {
    margin-left: 0;
  }
  .sidebar:hover ~ .main-content {
    margin-left: 0;
  }
  
  header.titulo-fondo {
    height: 100px; /* **CAMBIO:** Banner aún más pequeño estaba eb 150*/
    padding-left: 15px;
  }
  header h1 {
    font-size: 16px; /* **CAMBIO:** Título principal mucho más pequeño estaba en 28 */
  }
  .subtitulo-naranja {
    font-size: 16px; /* **CAMBIO:** Subtítulo más pequeño estaba en 24*/
  }
  .productos-grid {
    padding: 15px; /* Menos padding en los lados */
  }
   .producto-img {
    height: 140px; /* **CAMBIO:** Imagen de producto aún más pequeña estaba en 160 */
  }
   .producto h2 {
      font-size: 12px; /* **CAMBIO:** Título de producto más pequeño */
  }
   .producto p {
      font-size: 10px; /* **CAMBIO:** Párrafo ligeramente más pequeño si es necesario */
  }
}
/* Ajuste para pantallas más pequeñas donde la barra de admin puede cambiar de altura */
@media screen and (max-width: 782px) {
    body.admin-bar .sidebar {
        top: 46px;
        height: calc(100% - 46px);
    }
}

/* ==========================================================================
   7. Reglas Específicas para Video y Ocultamiento de Elementos Antiguos
   ========================================================================== */
video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 16/9;
}

header.fixed {
    display: none !important;
}

#inicio .absolute.inset-0 video {
    z-index: 1;
    opacity: 1 !important;
    display: block !important;
    visibility: visible !important;
}


