/* Estilos generales */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Montserrat', sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f8f8;
}

.s-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

a {
  color: #7a2d99;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
}

.clearfix:after {
  content: "";
  display: table;
  clear: both;
}

/* Header */
.section-header {
  background-color: #fff;
  padding: 15px 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.buscar {
  flex: 1;
  max-width: 300px;
}

.buscar form {
  display: flex;
  border: 1px solid #ddd;
  border-radius: 20px;
  overflow: hidden;
}

.buscar input.text {
  border: none;
  padding: 8px 15px;
  width: 100%;
  outline: none;
}

.buscar input.submit {
  background: #7a2d99;
  color: white;
  border: none;
  padding: 8px 15px;
  cursor: pointer;
}

.logo {
  flex: 1;
  text-align: right;
}

.logo img {
  height: 60px;
}

.breadcrumb {
  padding: 10px 0;
  margin-bottom: 20px;
  font-size: 14px;
  list-style-type: none;
  margin-left: 0;
}

.breadcrumb li {
  display: inline-block;
  margin-right: 10px;
  color: #777;
  vertical-align: middle;
}

.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

/* Hero Section */
.hero-container {
  display: flex;
  align-items: center;
  gap: 30px;
  background-color: #fff;
  padding: 40px;
  border-radius: 8px;
  margin-bottom: 40px;
}

.hero-content {
  flex: 1;
}

.hero-content h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 20px;
  color: #222;
}

.hero-content p {
  margin-bottom: 20px;
  font-size: 16px;
  color: #555;
}

.contact {
  margin-top: 30px;
  padding: 15px 0;
  border-top: 1px solid #eee;
}

.contact strong {
  color: #7a2d99;
}

/* Hero Image - Correcciones para eliminar el reborde gris */
.hero-image {
  flex: 1;
  position: relative;
  border-radius: 0;
  overflow: visible;
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 0;
  margin: 0;
}

.hero-image a {
  display: block;
  border: none;
  outline: none;
  padding: 0;
  margin: 0;
}

.hero-image img {
  width: 100%;
  display: block;
  border: none !important;
  border-radius: 0;
  box-shadow: none !important;
  padding: 0;
  margin: 0;
  background: transparent;
}

.image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 20px;
  background: rgba(0,0,0,0.5);
  color: #fff;
}

.image-overlay h3 {
  font-size: 20px;
  font-weight: 600;
}

/* Categories Section */
.section-categories {
  padding: 50px 0;
  background-color: #f3f0f6;
}

.title {
  text-align: center;
  margin-bottom: 40px;
}

.title h3 {
  font-size: 24px;
  color: #333;
  margin-bottom: 10px;
}

.sep {
  height: 3px;
  width: 60px;
  background-color: #7a2d99;
  margin: 0 auto;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.category-grid li a {
  display: block;
  height: 100%;
  text-decoration: none;
}

.category-item {
  background-color: #fff;
  border-radius: 10px;
  padding: 25px 15px;
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
  height: 100%;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.category-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.category-item img {
  height: auto;
  max-height: 100px;
  width: auto;
  max-width: 90%;
  margin-bottom: 15px;
  object-fit: contain;
}

.category-item h4 {
  font-size: 15px;
  font-weight: 600;
  color: #333;
}

/* Policy Banner */
.section-policy {
  padding: 40px 0;
}

.dual-banner-container {
    display: flex;
    width: 100%;
    gap: 15px; /* Espacio entre imágenes */
}

.half-banner {
    width: calc(50% - 7.5px); /* Ajuste para el gap */
    display: block;
}

.policy-banner {
    height: 300px;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    color: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.policy-banner:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0);
}

.banner-content {
    position: relative;
    z-index: 2;
    padding: 0 40px;
}

.policy-banner h2 {
    font-size: 32px;
    font-weight: 600;
}

/* Estilos específicos para cada banner (background-image) */
.dual-banner-container .half-banner:nth-child(1) .policy-banner {
    background-image: url(https://vortex-custom.s3.amazonaws.com/junar/accounts/vicentelopez/Ilustraciones-junar-02-Politica-boton.png);
}

.dual-banner-container .half-banner:nth-child(2) .policy-banner {
    background-image: url(https://vortex-custom.s3.amazonaws.com/junar/accounts/vicentelopez/Decreto-Gobernanza_Datos-boton.png);
}

/* Sección de Estadísticas - CON CAMBIOS APLICADOS */
.section-stats {
  padding: 40px 0;
  background-color: #fff;
  margin-bottom: 40px;
}

.stats-container {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  text-align: center;
}

.stat-item {
  padding: 20px;
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-size: 48px;
  font-weight: 700;
  color: #7a2d99;
  margin-bottom: 10px;
}

.stat-number.loading {
    font-size: 24px;
    color: #999;
}

.stat-label {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  text-align: center;
  width: 100%;
  white-space: nowrap; /* Impide el salto de línea */
}

/* Ajuste específico para categorías con nombres largos */
.stats-container .stat-item:nth-child(2) .stat-label {
  white-space: nowrap;
}

.label-text {
  display: block;
  margin-bottom: 5px; /* Espacio entre texto y tooltip */
}

.tooltip-icon {
  position: relative;
  cursor: pointer;
  font-size: 14px;
  color: #555;
  display: inline-block;
}

.tooltip-icon:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.tooltip-text {
  visibility: hidden;
  opacity: 0;
  width: 220px;
  background-color: #333;
  color: #fff;
  text-align: center;
  padding: 8px;
  border-radius: 6px;
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
  font-size: 12px;
  line-height: 1.4;
  z-index: 10;
}

.tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

/* Responsive Styles */
@media (max-width: 992px) {
  .hero-container {
    flex-direction: column;
  }
  
  .category-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .stat-item {
    min-width: 180px; /* Reducido para permitir que quepan mejor en pantallas medianas */
  }
}

@media (max-width: 768px) {
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stats-container {
    flex-direction: column;
  }
  
  .stat-item {
    margin-bottom: 20px;
  }
}

@media (max-width: 576px) {
  .category-grid {
    grid-template-columns: 1fr;
  }
  
  .header-container {
    flex-direction: column;
    gap: 15px;
  }
  
  .buscar {
    max-width: 100%;
  }
  
  .logo {
    text-align: center;
  }
}

/* Sección de Novedades - Carrusel */
.section-news {
  padding: 50px 0;
  background-color: #f8f8f8;
}

.carousel-container {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  overflow: hidden;
}

.carousel-container input {
  display: none;
}

.carousel-items {
  display: flex;
  overflow: hidden;
  width: 400%;  /*rdm*/
  transition: transform 0.5s ease;
}

.carousel-item {
  width: 25%;
  padding: 0 15px;
  box-sizing: border-box;
}

.carousel-card {
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  height: 100%;
}

.carousel-image {
  height: 450px;  //250
  overflow: hidden;
}

.carousel-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.carousel-card:hover .carousel-image img {
  transform: scale(1.05);
}

.carousel-content {
  padding: 20px;
}

.carousel-content h4 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #333;
}

.carousel-content p {
  font-size: 14px;
  color: #666;
  margin-bottom: 15px;
  line-height: 1.5;
}

.read-more {
  display: inline-block;
  color: #7a2d99;
  font-weight: 600;
  font-size: 14px;
  transition: color 0.3s;
}

.read-more:hover {
  color: #5b1e73;
}

.carousel-nav {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.carousel-nav-item {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #ddd;
  margin: 0 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.carousel-nav-item:hover {
  background-color: #bbb;
}

/* Control del carrusel con radio buttons */
#item-1:checked ~ .carousel-items {
  transform: translateX(0);
}

#item-2:checked ~ .carousel-items {
  transform: translateX(-25%);
}

#item-3:checked ~ .carousel-items {
  transform: translateX(-50%);
}

#item-4:checked ~ .carousel-items {
    transform: translateX(-75%);
  }
  

#item-1:checked ~ .carousel-nav label:nth-child(1),
#item-2:checked ~ .carousel-nav label:nth-child(2),
#item-3:checked ~ .carousel-nav label:nth-child(3),
#item-4:checked ~ .carousel-nav label:nth-child(4) {
  background-color: #7a2d99;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .carousel-items {
    width: 100%;
    flex-direction: column;
  }
  
  .carousel-item {
    width: 100%;
    padding: 0;
    margin-bottom: 20px;
  }
  
  #item-1:checked ~ .carousel-items,
  #item-2:checked ~ .carousel-items,
  #item-3:checked ~ .carousel-items,
  #item-4:checked ~ .carousel-items {
    transform: none;
  }
  
  .carousel-item {
    display: none;
  }
  
  #item-1:checked ~ .carousel-items .carousel-item:nth-child(1),
  #item-2:checked ~ .carousel-items .carousel-item:nth-child(2),
  #item-3:checked ~ .carousel-items .carousel-item:nth-child(3),
  #item-4:checked ~ .carousel-items .carousel-item:nth-child(4) {
    display: block;
  }
}


/* ===== Tooltip Fixes ===== */
.tooltip {
position: relative;
display: inline-block;
}

.tooltip .tooltiptext {
visibility: hidden;
width: 200px;
background-color: #000;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 5px 0;
position: absolute;
z-index: 9999; /* Mostrar por encima de todo */
bottom: 125%;
left: 50%;
margin-left: -100px;
opacity: 0;
transition: opacity 0.3s;
white-space: normal;
}

.tooltip:hover .tooltiptext {
visibility: visible;
opacity: 1;
}

/* ===== Container Fixes ===== */
.main-content,
.card,
.row,
.col,
.container,
.section {
overflow: visible !important; /* Evitar recortes de tooltips */
position: relative;
}

/* === Tooltip Base === */
.tooltip-icon {
position: relative;
cursor: help;
display: inline-block;
}

.tooltip-icon .tooltip-text {
visibility: hidden;
opacity: 0;
width: 220px;
background-color: rgba(0, 0, 0, 0.85);
color: #fff;
text-align: left;
border-radius: 6px;
padding: 8px 10px;
position: absolute;
z-index: 1000;
bottom: 125%; /* aparece arriba del ícono */
left: 50%;
transform: translateX(-50%);
white-space: normal; /* permite saltos de línea */
word-wrap: break-word; /* fuerza cortes de palabras largas */
box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.3);
transition: opacity 0.3s ease;
}

.tooltip-icon:hover .tooltip-text {
visibility: visible;
opacity: 1;
}