/* Estilos generales */
body {
  font-family: 'Urbanist', sans-serif;
  background-color: #fffff;
  color: var(--text-color);
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

/* HEADER + NAVBAR combinados */
.main-header {
  background: linear-gradient(to right, #ffffff, #e4c7f2);
  padding: 0.6rem 1rem;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.4s ease;
}

.main-header img {
  max-width: 300px;
  height: auto;
  display: block;
  margin: 0 auto 0.3rem auto;
}

.social-share {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
}

.social-share a img {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease, filter 0.3s ease;
  filter: grayscale(40%) brightness(1.1);
}

.social-share a:hover img {
  transform: scale(1.2);
  filter: none;
}

/* Navbar dentro del header */
.navbar {
  background: transparent !important;
  padding-top: 0;
  padding-bottom: 0;
}

.navbar-nav .nav-link {
  color: #000;
  font-weight: 600;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
  transform: scale(1.05);
  color: #000;
}

/* HEADER texto (si vuelves a usarlo) */
header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}
header p {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}
header a {
  background: white;
  color: var(--accent-dark);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
}

/* TITULOS */
.section-title {
  font-size: 1.6rem;
  font-weight: bold;
  margin: 2rem 0 1rem;
  text-align: center;
}

/* Tarjetas - Card */
.card {
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  overflow: hidden;
  transition: transform 0.3s ease;
  background: white;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card:hover {
  transform: translateY(-5px);
}

/* Nueva clase para los artículos del carrusel */
.card.card-carousel {
  background-color: #FFFCFC;
  box-shadow: none;
}

.card-body {
  padding: 1rem;
  flex-grow: 1;
}

.card-body h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.card-body p {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 0;
}

/* Imágenes adaptativas sin recorte */
.article-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

#noticias .card img,
#noticias2 .card img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  background-color: #f0f0f0;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  display: block;
}

/* FOOTER */
footer {
  background: #2e2e2e;
  color: white;
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  margin-top: 2rem;
}

/* POPUP newsletter */
#general-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  background-color: rgba(0, 0, 0, 0.4);
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

#general-popup .popup-content {
  background-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* POPUP cookies */
#cookie-popup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
  z-index: 9999;
}

#cookie-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
}

/* Botones en popups */
.popup-buttons button {
  margin: 5px;
  padding: 10px 20px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.popup-buttons button:hover {
  background-color: #0056b3;
}

/* Enlaces */
a {
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s ease, color 0.2s ease;
}

a:visited {
  color: inherit;
}

a:hover {
  transform: scale(1.02);
  cursor: pointer;
}

/* --- HEADER Y JERARQUÍA VISUAL --- */
.header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  /* Añadimos transición para que la ocultación/aparición sea suave */
  transition: opacity 0.4s ease, height 0.4s ease, padding 0.4s ease; 
}

.header-logo {
  max-width: 250px;
  height: auto;
  transition: all 0.4s ease;
}

.social-share {
  order: -1;
  margin-bottom: 1rem;
  transition: all 0.4s ease;
}

@media (min-width: 768px) {
  .header-content {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
  .social-share {
    order: 0;
    margin-bottom: 0;
  }
}

/* --- REDUCCIÓN Y OCULTACIÓN DEL HEADER AL HACER SCROLL (Nuevo) --- */
.main-header.shrink {
  /* Eliminamos el padding del main-header para que la navbar se pegue al top */
  padding: 0 !important; 
}

.main-header.shrink .container {
  /* El div.container tiene py-3, eliminamos el padding vertical de Bootstrap cuando se activa shrink */
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.main-header.shrink .header-content {
  /* Oculta completamente el contenido del header (logo y redes sociales) */
  opacity: 0;
  height: 0;
  margin-top: 0;
  margin-bottom: 0;
  overflow: hidden;
}

/* NOTA: Las reglas de reducción de tamaño anteriores para .header-logo y .social-share 
   dentro de .main-header.shrink han sido eliminadas ya que el contenedor padre ahora se oculta. */