/* === Variables === */
:root {
  --ceysa-verde: #196B4B;
  --ceysa-naranja: #CE6B04;
  --ceysa-blanco: #fff;
  --ceysa-gris-fondo: #D9D9D9;
  --ceysa-tipografia: 'Open Sans', sans-serif;
}

/* === Reset básico === */
* {
  box-sizing: border-box;
  user-select: none;    /* permite seleccionar/copiar none nada, text solo texto seleccionar */
  caret-color: transparent; /* oculta el cursor de texto que parpadea */
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--ceysa-tipografia);
  height: 100%;
  overflow-x: hidden;
  max-width: 100vw;
  
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

@media (min-width: 768px) {
  body.pagina-inicio {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
  }

  body.pagina-inicio main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fadeIn 0.5s ease-in;
    min-height: 50vh;
  }

  body.pagina-inicio > footer {
    margin-top: auto;
  }
}

header, nav, footer {
  flex-shrink: 0;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

main {
  display: block;
  overflow: visible;
  animation: fadeIn 0.5s ease-in;
}

body.pagina-novedades main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  animation: fadeIn 0.5s ease-in;
}

/* === Header CEYSA === */
.header-ceysa {
  background-color: var(--ceysa-gris-fondo);
  padding: 1.5rem 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo-ceysa {
  height: 80px;
  max-width: 100%;
  flex-shrink: 0;
  margin-right: 1rem;
}

.logo-ceysa:hover {
  transform: scale(1.1);  
}

@media (max-width: 768px) {
  .logo-ceysa {
    display: none;
  }
}

.slogan {
  font-family: 'Inter', sans-serif;
  font-size: 32px;
  font-weight: 600;
  font-style: italic;
  margin: 0;
}

/* === desk === */
.icono-red .icono-wrapper {
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.icono-red .icono-wrapper:hover,
.icono-red .icono-wrapper:active {
  transform: scale(1.2);  
}


/* === oculto slogan en mobile === */
@media (max-width: 768px) {
  .slogan {
    display: none;
  }
}


.sub-slogan {
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 400;
  font-style: normal;
  margin: 0;
}

.icono-red .icono-wrapper {
  width: 44px;
  height: 44px;
  background-color: var(--ceysa-verde);
  color: var(--ceysa-blanco);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border-radius: 4px;
}

.icono-red .icono-wrapper:active {
  transform: scale(1.1);
}

/* Responsive Header */
@media (max-width: 768px) {
  .header-ceysa {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem;
  }

  .icono-red {
    justify-content: center;
    width: 100%;
  }
  
  .icono-red .icono-wrapper {
    width: 36px;
    height: 36px;
    font-size: 16px;
    transition: transform 0.2s ease, background-color 0.2s ease;
  }

  .icono-red .icono-wrapper:hover {
    transform: scale(1.1);
  }

  .logo-ceysa {
    height: 50px;
    margin-bottom: 0.5rem;
  }

  .slogan {
    font-size: 1.2rem;
    margin: 0.3rem 0;
  }

  .sub-slogan {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-weight: 700; /* esto hace que sea bold */
  }

}

/* === NAV === */
.navbar-ceysa {
  background-color: var(--ceysa-verde);
}

.navbar-ceysa .nav-item {
  margin: 0 1rem;
}

.navbar-ceysa .nav-link {
  color: var(--ceysa-gris-fondo);
  font-family: 'Inter', sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 20px;
  line-height: 24px;
  display: flex;
  align-items: center;
  text-align: center;
  padding: 0.75rem 1rem;
  transition: all 0.2s ease;
}

.navbar-ceysa .nav-link:hover {
  color: var(--ceysa-gris-fondo);
  font-weight: 700;
  transform: scale(1.05);
}

/* === Iconos sociales en NAV para mobile === */
@media (max-width: 768px) {
  .icono-red-mobile .icono-wrapper {
    width: 36px;
    height: 36px;
    color: var(--ceysa-gris-fondo);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    border-radius: 4px;
  }

  .icono-red-mobile {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-left: auto;
    padding-right: 1rem;
  }
}

@media (min-width: 768px) {
  .icono-red-mobile { display: none; }
}

.icono-menu-ceysa {
  color: var(--ceysa-gris-fondo);
  font-size: 2rem;
}

/* === Carrusel === */
.carousel-item img {
  object-fit: cover;
  width: 100%;
  height: 100%;
  max-height: 85vh;
}

.carousel-inner,
.carousel-item {
  height: 100%;
}

/* Mobile: limitar mínimo pero no romper desktop */
@media (max-width: 768px) {
  .carousel-item img {
    height: auto;
    min-height: 50vh;
  }

  .carousel-inner,
  .carousel-item {
    height: auto;
    min-height: 50vh;
  }
}


/* === Flechas personalizadas === */
.custom-arrow-btn {
  width: 100px;
  height: 100px;
  background-color: transparent;
  border: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.carousel-control-prev.custom-arrow-btn {
  left: 1rem;
}

.carousel-control-next.custom-arrow-btn {
  right: 1rem;
}

.custom-arrow {
  font-size: 10rem;
  font-weight: regular;
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.3s ease, transform 0.1s ease;
  transform: translateY(-50%) scale(1);
}

.custom-arrow-btn:hover .custom-arrow {
  color: white;
  transform: translateY(-50%) scale(1.1);
}

.custom-arrow-btn:active .custom-arrow {
  color: var(--ceysa-verde);
  transform: translateY(-50%) scale(1.2);
}

@media (max-width: 768px) {
  .custom-arrow-btn {
    display: none;
  }
}

/* === Footer CEYSA === */
.footer-ceysa {
  background-color: var(--ceysa-verde);
  color: white;
  font-size: 0.85rem;
  line-height: 1.4;
}

.footer-ceysa p {
  margin-bottom: 0.3rem;
}

.footer-ceysa .container {
  max-width: 1140px;
}

.footer-ceysa a {
  color: white;
  text-decoration: underline;
}

.footer-ceysa a:hover {
  color: var(--ceysa-naranja);
}

.footer-ceysa .border-white-50 {
  border-color: rgba(255, 255, 255, 0.2) !important;
}

.footer-ceysa .small {
  font-size: 0.8rem;
}

/* === Título CEYSA indentado con subrayado === */
.bloque-titulo-ceysa {
  margin-top: 3rem;
  border-bottom: 4px solid var(--ceysa-verde);
  width: fit-content;
  padding-left: clamp(1rem, 5vw, 3rem);
}

.titulo-ceysa-indentado {
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: var(--ceysa-verde);
  font-weight: 700;
  font-size: 2.2rem;
  text-indent: 13rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Estilo actual para desktop está bien, solo ajustamos en mobile */
@media (max-width: 768px) {
  .bloque-titulo-ceysa {
    margin-top: 1rem;
    border-bottom-width: 3px;
  }

  .titulo-ceysa-indentado {
    font-size: 1.6rem;
    text-indent: 0;
    white-space: normal;
  }
}


/* === Consejo de Administración === */
.consejo-wrapper {
  padding-left: 1rem;
  padding-right: 1rem;
}

.consejo-bloque p {
  margin-bottom: 0.5rem;
}

.logo-consejo {
  max-width: 200px;
  width: 100%;
  height: auto;
  display: block;
  opacity: 1;
}

.texto-seccion {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 100%; /* por si estaba limitado */
  padding-right: 1rem;
}

@media (min-width: 992px) {
  .texto-seccion {
    font-size: 1.5rem;
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* === Servicios === */
.icono-servicio {
  max-width: 200px;
  max-height: 150px;
  width: 100%;
  height: auto;
  display: block;
  margin-left: 3rem;
}


/* === Hover para links general === */
.link-hover {
  transition: all 0.2s ease-in-out;
}

.link-hover:hover {
  color: var(--ceysa-verde) !important;  
}

/* === Hover para links Footer === */
.link-hover-footer {
  transition: all 0.2s ease-in-out;
  display: inline-block; /* necesario para que scale funcione */
}

.link-hover-footer:hover {
  color: var(--ceysa-gris-fondo) !important;
  
}

@media (max-width: 768px) {

  /* oculto el icono en mobile */
  .icono-servicio {
      display: none;
    }

    .texto-seccion {
      position: relative; /* asegura contexto de stacking */
      z-index: 2; /* encima del ícono */
    }
  }



  @media (max-width: 768px) {
    section.servicio-bloque {
      margin-top: 1rem !important;
      margin-bottom: 0rem !important;
    }
}

/* === Información Útil === */

.icono-contacto {
    color: var(--ceysa-gris-fondo);
    margin-right: 0.5rem;
  }

  .enlace-util {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s ease-in-out, color 0.2s ease-in-out;
}

.enlace-util i {
  color: var(--ceysa-gris-fondo);
  transition: color 0.2s ease-in-out;
}

.enlace-util:hover {
  color: var(--ceysa-verde);
  transform: scale(1.1);
}

.enlace-util:hover i {
  color: var(--ceysa-verde);
}

/* === Botón documentación === */
.btn-custom-ceysa {
  background-color: var(--ceysa-verde);
  color: white;
  font-weight: 600;
  border: none;
  padding: 0.5rem 1rem;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-custom-ceysa:hover {
  background-color: var(--ceysa-gris-fondo);
  color: black;
  transform: scale(1.05);
}

.icono-descarga-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--ceysa-verde);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.icono-descarga-link:hover {
  background-color: var(--ceysa-naranja);
  transform: scale(1.1);
}

.icono-descarga-link i {
  font-size: 1.2rem;
}

/* === Enlace completo clickeable con ícono personalizado === */
.enlace-anexo {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease, transform 0.2s ease;
}

.enlace-anexo:hover {
  color: black;
  transform: scale(1.02);
}

/* Ícono cuadrado */
.icono-anexo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: var(--ceysa-verde);
  color: white;
  border-radius: 6px;
  transition: background-color 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
}

.enlace-anexo:hover .icono-anexo {
  background-color: var(--ceysa-gris-fondo);
  color: black;
}

.icono-documento {
  font-size: 6rem;
  color: #ccc;
  transition: color 0.3s ease;
}

.enlace-documento:hover .icono-documento {
  color: var(--ceysa-verde);
}

@media (max-width: 576px) {
  .icono-documento {
    font-size: 4rem;
  }

  .btn-custom-ceysa {
    font-size: 0.95rem;
    padding: 0.45rem 0.9rem;
  }

  .icono-anexo {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .enlace-anexo {
    font-size: 0.95rem;
  }
}
