* {
  box-sizing: border-box;
}

/* Optimizaciones de rendimiento */
img {
  max-width: 100%;
  height: auto;
}

/* Espacio dedicado a publicidad */

#publicidad-top {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px; ;
    background-color: #e0f2f7; 
    margin: 5px;
    padding: 15px 20px;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    font-family: 'Inter', sans-serif;
    color: #333;
    font-size: 1.1em;
    font-weight: 600;
}


    
body {
  font-family: 'Inter', sans-serif; 
  margin: 0;
  line-height: 1.6;
  color: #333;
  background-color: #f4f7f6;
  overflow-x: hidden; /* Evitar scroll horizontal global */
  padding-bottom: 0;
}

/* Regla global para eliminar scrollbars no deseadas en headers */
.header,
.header *,
.header-titulo-fecha,
.header-cotizacion {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.header::-webkit-scrollbar,
.header *::-webkit-scrollbar,
.header-titulo-fecha::-webkit-scrollbar,
.header-cotizacion::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* Asegurar que el header siempre sea visible */
.header .header-titulo-fecha,
.header .header-titulo-fecha h1,
.header .header-titulo-fecha .header-subtitulo,
.header .header-titulo-fecha #fecha-larga {
  visibility: visible;
  opacity: 1;
}

/* Correcciones específicas para Chrome y navegadores Webkit */
@supports (-webkit-appearance: none) {
  .header .header-titulo-fecha {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
  }
  
  .header .header-titulo-fecha h1 {
    display: block;
    visibility: visible;
    opacity: 1;
    color: white;
    -webkit-text-fill-color: white;
  }
}


.header {
  font-family: 'Inter', sans-serif; 
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background: #2c3e50; 
  color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  gap: 20px;
  width: 100%;
  height: auto;
  min-height: 120px;
  box-sizing: border-box;
  z-index: 1000;
  position: relative;
}

.header-cotizacion {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
  flex-grow: 0;
  position: absolute;
  left: 20px;
  max-width: 35%;
  overflow: hidden;
}

.header-titulo-fecha {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 1010;
  height: auto;
  position: relative;
  flex: 1;
}

.header h1 {
  font-size: clamp(1.1em, 3vw, 1.3em);
  margin: 0;
  padding: 0;
  font-weight: 600;
  color: white;
}

.header-subtitulo {
  font-family: 'Inter', sans-serif;
  color: white;
  font-size: clamp(0.9em, 1.5vw, 1em);
  margin: 0;
  padding: 0;
  font-weight: 400;
}

#fecha-larga {
  font-family: 'Inter', sans-serif; 
  color: white;
  margin: 0;
  padding: 0;
  font-size: clamp(0.75em, 2vw, 0.95em);
  line-height: 1.2;
  text-align: center;
}

#widget-cotizaciones {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 100%;
}

#widget-cotizaciones .carrusel {
  display: flex;
  align-items: center;
  height: 100%;
}



/* Column container */

.row {
  display: flex;
  flex-wrap: wrap; 
  padding: 20px;
  max-width: 95%; /* Limita el ancho máximo de la fila a 95% del ancho de la ventana
  margin: 20px auto; /* Centra el contenedor y agrega margen */
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}


.side {
  flex: 30%; /* Ocupa el 30% del ancho disponible */
  background-color: #f8f9fa; /* Fondo muy claro para la barra lateral */
  padding: 20px;
  border-right: 1px solid #eee; /* Separador sutil */
  min-width: 280px; /* Ancho mínimo para la barra lateral en desktop */

  /* --- Estilos para hacer la barra lateral fija --- */
  
  position: -webkit-sticky;
  position: sticky;
  
  /* Ajusta este valor a la altura de tu barra de navegación fija (aprox. 40px) */
  top: 40px; 
  align-self: flex-start; /* Necesario para que 'sticky' funcione en un contenedor flex */
  height: calc(100vh - 40px); /* Altura de la ventana menos el espacio para la navbar */
  overflow-y: auto; /* Permite el scroll si el contenido lateral es muy largo */
}

/* Main column */
.main {
  flex: 70%; /* Ocupa el 70% del ancho disponible */
  background-color: white;
  padding: 20px;
}


.main h2 {
    color: #2c3e50; /* Título principal con el color del header */
    margin-top: 0;
    font-size: 2em;
    border-bottom: 2px solid #2ecc71; /* Subrayado verde vibrante */
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.main h5 {
    color: #6c757d;
    font-size: 1.1em;
    margin-bottom: 15px;
}

.fakeimg {
  background-color: #e9ecef; 
  width: auto;
  padding: 20px;
  margin-bottom: 15px; 
  border-radius: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #6c757d;
  font-style: italic;
}

/* Footer */
.footer {
  padding: 25px !important;
  text-align: center !important;
  background: #34495e !important;
  color: white !important;
  margin-top: 20px !important;
  margin-bottom: 150px !important;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.15) !important;
  z-index: 10002 !important;
  position: relative !important;
  bottom: auto !important;
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
  min-height: auto !important;
  visibility: visible !important;
  opacity: 1 !important;
  clear: both !important;
}
.footer h2 {
    margin: 0 0 10px 0 !important;
    font-size: 1.8em !important;
    font-weight: 600 !important;
    display: block !important;
    visibility: visible !important;
}
.footer h4 {
    margin: 0 0 10px 0 !important;
    font-size: 1.2em !important;
    font-weight: 600 !important;
    color: #2ecc71 !important;
    display: block !important;
    visibility: visible !important;
}
.footer p {
    margin: 0 !important;
    font-size: 0.9em !important;
    color: rgba(255,255,255,0.8) !important;
    display: block !important;
    visibility: visible !important;
}

.footer p a {
    color: #2ecc71 !important;
    text-decoration: underline !important;
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.footer p a:hover {
    color: #27ae60 !important;
}



/* Estilos específicos para laptops y pantallas grandes (769px - 1366px) */
@media screen and (min-width: 1367px) {
  /* Aquí puedes agregar estilos específicos si es necesario */
}


/* Responsive layout - when the screen is less than 700px wide, make the two columns stack on top of each other instead of next to each other */
@media screen and (max-width: 768px) { /* Ajustado a 768px para tabletas */
  .row {
    flex-direction: column;
    padding: 10px;
    margin: 10px auto;
  }
  .side, .main {
    flex: 100%; /* Ocupa todo el ancho */
    border-right: none; /* Eliminar borde en modo columna */
    padding: 15px;
  }
  .side {
      min-width: unset; /* Eliminar ancho mínimo */
      border-bottom: 1px solid #eee; /* Añadir borde inferior */
      /* --- Restablecer el comportamiento fijo en móviles --- */
      position: static;
      height: auto;
      overflow-y: visible;
  }
  .navbar {
    flex-direction: column;
    align-items: center;
  }
  .navbar a {
      width: 100%; /* Los enlaces ocupan todo el ancho */
      text-align: center;
  }

  .header {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 15px 10px;
      gap: 15px;
      height: auto;
      min-height: auto;
      position: relative;
  }

  .header-titulo-fecha {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      z-index: 1010;
      height: auto;
      position: relative;
      flex: 1;
      width: 100%;
  }

  .header-cotizacion {
      display: flex;
      font-size: 0.55em;
      align-items: center;
      justify-content: center;
      position: relative;
      left: auto;
      width: 100%;
  }

  #fecha-larga {
      font-size: clamp(0.7em, 2vw, 0.9em);
      display: block;
      margin: 0;
      padding: 0;
  }
  
  .main h2 {
      font-size: 1.8em;
  }
  .cookie-banner {
      flex-direction: column;
      gap: 10px;
      text-align: center;
  }
  #publicidad-top {
      height: 150px;
      font-size: 1em;
  }
  .fakeimg {
      padding: 15px;
  }
}

/* Mejoras para pantallas de 6 pulgadas (360px-414px) */
@media screen and (max-width: 414px) {
  .header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    font-size: 0.9em;
    width: 100%;
    box-sizing: border-box;
    gap: 10px;
    height: auto;
    min-height: auto;
    position: relative;
  }
  
  .header-titulo-fecha {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 10;
    height: auto;
    width: 100%;
    position: relative;
  }
  
  #fecha-larga {
    font-size: clamp(0.7em, 3vw, 0.85em);
    padding: 0;
    text-align: center;
    margin: 0;
    line-height: 1;
    color: white;
    display: block;
  }
  
  .header-cotizacion {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    width: 100%;
    position: relative;
    left: auto;
    font-size: 0.75em;
  }
  
  .main h2 {
    font-size: 1.5em;
  }
  .main h5 {
    font-size: 1em;
  }
}

/* Mejoras adicionales para dispositivos muy pequeños (menos de 360px) */
@media screen and (max-width: 360px) {
  .header {
    padding: 6px 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: auto;
    min-height: auto;
    width: 100%;
  }
  
  .header h1 {
    font-size: clamp(0.95em, 5vw, 1.1em);
    padding: 0;
    margin: 0;
  }
  
  .header-titulo-fecha {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: auto;
    width: 100%;
  }

  .header-cotizacion {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65em;
    padding: 0;
    width: 100%;
    max-width: 100%;
  }
  
  #fecha-larga {
    font-size: clamp(0.65em, 3vw, 0.8em);
    padding: 0;
    margin: 0;
  }
  
  .main h2 {
    font-size: 1.2em;
  }
  .main h5 {
    font-size: 0.95em;
  }
  
  /* Footer responsive */
  .footer {
    padding: 15px !important;
    font-size: 0.85em !important;
    margin-bottom: 120px !important;
  }
  
  .footer h4 {
    font-size: 1em !important;
  }
  
  .footer p {
    font-size: 0.8em !important;
  }
}

/* Garantizar visibilidad total del footer y sus elementos */
#footer-main {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  clear: both !important;
}

#footer-main h4,
#footer-main h2 {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

#footer-main p {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

#footer-main p a {
  display: inline !important;
  visibility: visible !important;
  opacity: 1 !important;
  color: #2ecc71 !important;
  text-decoration: underline !important;
  cursor: pointer !important;
}
