/* =============================================
   1. Keyframes / Animaciones
   ============================================= */
   @keyframes zoomEffect {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.2); }
    100% { transform: scale(1); }
  }
  
  @keyframes diagonalDrawEffect {
    0%   { clip-path: polygon(0 0, 0 0, 0 100%, 0 100%); }
    100% { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
  }
  
  @keyframes flashAnimation {
    25%, 75% { opacity: 0; }
    50%, 75%, 100% { opacity: 1; }
  }
  
  /* =============================================
     2. Tipografía y Estilos Base (Mobile)
     ============================================= */
  /* Se han reducido los tamaños de fuente en la versión base */
  .TituloPrincipal {
    font-size: 1.5rem; /* Antes 1.75rem */
    margin-top: 3vh;
    font-weight: bold;
    text-align: center;
    color: black;
  }

  .subtitulos{
    font-weight: bolder;
  }
  
  .fuente-enlace {
    color: #1e2023;
    text-decoration: none;
    font-size: 1rem;
  }
  .fuente-enlace:hover {
    color: #b7e0a9;
  }
  
  #typewriter-subtitulo {
    font-size: 0.9rem; /* Antes 1.1rem */
    font-weight: bold;
    background-color: #9cc5a1e6;
    padding: 10px;
    border-radius: 10px;
  }

  .blinking-dot {
    color: rgb(237, 6, 6);
    animation: blink 1s infinite;
  }
  
  @keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
  }
  
  /* Fuente “Chelsea Market” para componentes de tarjetas y tablas */
  .card-title,
  .card-subtitle,
  .firstPrice,
  .secondPrice,
  .card-text,
  .var,
  .table {
    font-family: 'Chelsea Market', cursive;
    color: white;
  }
  
  .card-title    { font-size: 1rem;  /* Antes 1.2rem */ font-weight: bold; }
  .card-subtitle { font-size: 0.9rem; /* Antes 1rem   */ font-weight: bold; }
  .firstPrice    { font-size: 0.8rem; margin-top: 0.8rem; /* Antes 1.2rem */ }
  .secondPrice   { font-size: 0.7rem; /* Antes 1rem   */ }
  #precio_promedio { 
    font-size: 20px; /* Antes 25px */
    font-weight: bold;
    line-height: 0.6em;
  }
  #secondText {
    font-size: 12px; /* Antes 15px */
    font-weight: bold;
    line-height: 1.2em;
  }
  #var_posit,
  #var_negat {
    font-size: 10px;
    font-weight: bold;
    margin-top: -40px;
    margin-left: 20px;
  }
  #var_posit { color: #59bd59; }
  #var_negat { color: #e75f5f; }

  .carousel-control-next, .carousel-control-prev {
        width: 8%;
    }
  
  /* =============================================
     3. Componentes y Layout para tarjetas (cards)
     ============================================= */
  /* Estas reglas se aplican únicamente a los elementos que forman parte de tarjetas,
     de modo que no afectan las tablas de otras vistas */
  .card {
    padding: 15px;
    margin-bottom: 20px;
    background-color: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }
  
  .card-wrapper.card-item{
    margin-bottom: 0.7rem;
  }

  /* Para móviles forzamos layout en columna incluso si se usa "flex-row" */
  .card.flex-row {
    display: flex;
    flex-direction: column;
  }
  
  /* Contenido principal de la tarjeta */
  .card-body {
    background-color: #24282c;
    border-radius: 0.5rem;
    background-size: cover;
    opacity: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  
  /* --- Sección de imágenes pequeñas para redirecciones (solo en cards) --- */

  /* Contenedor de los enlaces (botones) */
.card-extra-links {
    display: flex;
    flex-direction: row; /* Por defecto, en móviles se muestran en fila */
    gap: 10px;
    margin-top: 10px;
    justify-content: space-evenly;
  }
  
  /* Estilo para que los card-extra-links se vean como botones circulares */
  .card-extra-links a {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: transparent; /* O el color de fondo que prefieras */
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    text-decoration: none;
    overflow: hidden; /* Importante para que el contenedor mantenga la forma circular */
    transition: background-color 0.3s ease, transform 0.2s ease, opacity 0.3s ease;
  }
  
  .card-extra-links a:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
  }
  
  /* La imagen se centra y se ajusta dentro del botón */
  .card-extra-links a img {
    width: 80%; /* O 100% si preferís que ocupe todo el espacio */
    height: 80%;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.3s ease;
  }
  
  .card-extra-links a img:hover {
    transform: scale(1.1);
  }
  
  /* Spinner posicionado justo encima del botón clickeado */
  .spinner-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px; /* Tamaño del spinner */
    height: 30px;
    margin: -15px 0 0 -15px; /* Para centrarlo (mitad del ancho y alto) */
    border: 6px solid #ccc;
    border-top-color: #042746;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
  }
  
  @keyframes spin {
    to { transform: rotate(360deg); }
  }
  
/* --- Botón Moderno --- */
.btn-ver-mas {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: #fff;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 12px;
    font-size: 12px;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-ver-mas:hover {
    background: linear-gradient(135deg, #4279b0, #3a6999);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-ver-variantes {
  background-color: #6c757d;         /* gris */
  color: #fff;
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  transition: 
    background-color 0.3s ease,      /* suaviza el cambio de color */
    transform 0.2s ease;              /* para el scale */
}

.btn-ver-variantes:hover {
  background-color: #0d6efd;         /* azul al posar */
  transform: scale(1.05);            /* ligero “pop” */
}
  
  .btn-secondary {
    background-color: #6c757d;
    color: white;
    border-color: #6c757d;
    transition: background-color 0.3s ease, color 0.3s ease;
  }
  .btn-secondary:hover {
    background-color: #4279b0;
    border-color: #495057;
  }
  .btn-secondary:active {
    background-color: #4279b0;
    border-color: #343a40;
  }
  .tablas.active {
    background-color: #4279b0;
    color: #fff;
  }
  
  /* --- Elementos dentro de cards --- */
  .card-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
  }
  .card-buttons a.btn { margin: 5px; }
  .card-buttons a img {
    max-width: 50px;
    height: auto;
    margin: 5px;
  }

  .btn-circular {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background-color: #5a6268;
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    transition: background-color 0.2s ease, transform 0.2s ease;
  }
  
  .btn-circular:hover {
    background-color: #4279b0;
    transform: scale(1.1);
  }

  /* --- Ancho fijo para columna de imagen y calificación --- */
  .card .flex-column.image-column {
    flex: 0 0 auto;
    width: 85px; /* 65px imagen + 20px margin */
    min-width: 85px;
    max-width: 85px;
  }

  /* --- Fecha del producto --- */
  .product-date {
    font-size: 0.65rem;
    color: #666;
    text-align: center;
    margin: 2px 0;
    width: 65px;
    padding: 0 2px;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    line-height: 1;
    text-transform: lowercase;
  }

  /* --- Fecha del producto en el header como badge --- */
  .product-date-badge {
    font-size: 0.7rem;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    text-transform: lowercase;
    padding: 0.35em 0.65em;
    border-radius: 0.375rem;
    background-color: #6c757d !important;
    color: #fff;
  }

  /* --- Sistema de Calificación con Pulgares --- */
  .rating-system {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: 8px auto; /* Centrado horizontal */
    padding: 8px 4px;
    width: 65px; /* Mismo ancho que la imagen */
    box-sizing: border-box;
  }

  .rating-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    width: 100%;
  }

  .thumb-btn {
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    border: 1px solid rgba(255,255,255,0.2);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #ccc;
    position: relative;
    overflow: hidden;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }

  .thumb-btn:hover {
    transform: translateY(-2px) scale(1.05);
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.1));
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    border-color: rgba(255,255,255,0.3);
  }

  .thumb-btn.active.thumbs-up {
    color: #28a745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.2), rgba(40, 167, 69, 0.1));
    border-color: rgba(40, 167, 69, 0.4);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
  }

  .thumb-btn.active.thumbs-down {
    color: #dc3545;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.2), rgba(220, 53, 69, 0.1));
    border-color: rgba(220, 53, 69, 0.4);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
  }

  .thumb-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
  }

  .rating-text {
    font-size: 0.6rem;
    color: #888; /* Color gris para el texto */
    text-align: center;
    margin-top: 3px;
    width: 65px; /* Mismo ancho que la imagen */
    line-height: 1.1;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    padding: 0 2px;
    box-sizing: border-box;
    transition: all 0.3s ease;
  }

  .rating-text.rated {
    color: #28a745 !important; /* Verde para indicar éxito */
    font-weight: 600; /* Más bold */
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(40, 167, 69, 0.05));
    border: 1px solid rgba(40, 167, 69, 0.2);
    border-radius: 8px;
    padding: 4px 6px;
    margin-top: 6px;
    position: relative;
    overflow: hidden;
    animation: ratingSuccess 0.8s ease-out, subtlePulse 2s ease-in-out infinite 1s;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
  }

  /* Animación de aparición del texto de confirmación */
  @keyframes ratingSuccess {
    0% {
      opacity: 0;
      transform: translateY(-10px) scale(0.8);
      background: rgba(40, 167, 69, 0.3);
    }
    50% {
      opacity: 1;
      transform: translateY(0) scale(1.05);
      background: rgba(40, 167, 69, 0.2);
    }
    100% {
      opacity: 1;
      transform: translateY(0) scale(1);
      background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(40, 167, 69, 0.05));
    }
  }

  /* Efecto de brillo que pasa por el texto */
  .rating-text.rated::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(255, 255, 255, 0.4),
      transparent
    );
    transition: left 0.6s ease;
    z-index: 1;
  }

  .rating-text.rated.shine::before {
    left: 100%;
  }

  /* Pulso sutil continuo para mantener atención */
  @keyframes subtlePulse {
    0%, 100% {
      box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
      border-color: rgba(40, 167, 69, 0.2);
    }
    50% {
      box-shadow: 0 2px 12px rgba(40, 167, 69, 0.3);
      border-color: rgba(40, 167, 69, 0.3);
    }
  }

  /* Icono de check que aparece al lado del texto */
  .rating-text.rated::after {
    content: '✓';
    color: #28a745;
    font-weight: bold;
    font-size: 0.8rem;
    margin-left: 4px;
    opacity: 0;
    animation: checkAppear 0.5s ease-out 0.3s forwards;
  }

  @keyframes checkAppear {
    0% {
      opacity: 0;
      transform: scale(0) rotate(-180deg);
    }
    100% {
      opacity: 1;
      transform: scale(1) rotate(0deg);
    }
  }

  /* Animación de pulso para feedback */
  .thumb-btn.pulse {
    animation: thumbPulse 0.6s ease-out;
  }

  @keyframes thumbPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
  }
  
  /* --- Imágenes y Elementos Gráficos --- */
  .flechitas {
    width: 25px;
    height: 25px;
    animation: zoomEffect 1s;
    animation-iteration-count: 6;
    animation-direction: alternate;
  }
  /* img.graf_tendencia { */
    /* max-height: 160px;
    height: auto;
    width: auto;
    border-radius: 0.5rem;
    transition: transform 0.3s ease;
    object-fit: contain; */

  /* } */

  img.graf_tendencia {
    display: block;
    max-width: 600px;         /* límite ancho en desktop */
    margin: 0;                /* sin centrado automático */
    aspect-ratio: 16/9;       /* reserva espacio antes de cargar */
    object-fit: contain;
    transition: transform 0.3s ease;
  }

  .graf_tendencia:hover {
    position: relative; /* Necesario para que z-index tenga efecto */
    z-index: 9999;      /* Valor alto para superponer a otros elementos */
    transform: scale(1.5);
    background-color: #343a40;
    margin-left: 20px;
    margin-top: -10px;
  }
  
  .LogosVerdu { width: 200px; }
  .mapa_arg {
    /* display: block;
    max-width: 50px; */
    height: auto;
  }
  img.card-img-top {
    width: 65px;
    height: 65px;
    margin: 10px;
    object-fit: contain; /* Mantiene proporción sin recortar */
    max-width: 100%; /* No excede el ancho del contenedor */
    max-height: 100%; /* No excede la altura del contenedor */
    box-sizing: border-box; /* Incluye padding/border en las dimensiones */
  }
  img.card-img-tend {
    width: 40px;
    height: 40px;
    position: relative;
    animation: diagonalDrawEffect 1s linear infinite;
  }
  
  .badge { 
    font-size: 10px;
    font-weight: bold;
    color: rgb(236, 242, 236);
  }
  .fas { padding: 1px; }
  
  /* =============================================
     4. Estilos para Tablas (no afectan a cards)
     ============================================= */
  /* Se definen tamaños de fuente más reducidos para móviles */

  .modern-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* scroll suave en iOS */
  }

  .modern-table-container table {
    width: 100%;
    min-width: 1000px; /* asegurate de ajustar esto al mínimo necesario */
    table-layout: auto;
    white-space: nowrap; /* evita saltos de línea */
  }

  .modern-table-container th,
  .modern-table-container td {
    padding: 8px 12px;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap; /* mantiene el contenido en una sola línea */
  }

  .table.table-striped {
    max-height: 300px;
    overflow-y: auto;
  }
  .table-responsive {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 300px;
    border-radius: 10px;
  }
  table.table-dark tbody tr.filas-tabla:hover {
    cursor: pointer;
  }
  .filas-tabla:hover .col1 .flechitas {
    transform: rotate(360deg);
    transition: transform 0.3s ease;
  }
  .table-fixed-header {
    width: 100%;
    table-layout: fixed;
  }
  .sticky-header {
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: #343a40;
  }
  th, td {
    white-space: normal;
    overflow: hidden;
    font-size: 10px;  /* Texto reducido en móviles */
    word-break: break-word;
    overflow-wrap: break-word;
    vertical-align: middle;
  }
  
  /* Definición de anchos de columnas para tablas */
  .col1 { width: 10%; text-align: center; }
  .col2 { width: 25%; }
  .col3 { width: 22%; }
  .col4 { width: 24%; }
  /* Columnas de variación optimizadas para móvil */
  .col-var { width: 15%; text-align: center; font-size: 0.85rem; }
  /* La columna .col5 se usa en algunas tablas (ej. "mayores aumentos") */
  .col5 { width: 15%; }

  .card-body .table-responsive {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }
  
  .card-body .table {
    width: 100%;
    table-layout: auto;
    white-space: nowrap;
    font-family: 'Roboto', sans-serif;
  }
  
  /* Este evita que las celdas provoquen expansión horizontal */
  .card-body td, .card-body th {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px; /* podés ajustar este valor si querés truncar antes */
    padding: 2px 2px !important; /* compacta filas */
    font-size: 0.7rem;  
  }


  /* =============================================
     5. Formularios y Filtros
     ============================================= */
  #filter-container {
    font-family: 'Roboto', sans-serif;
    align-items: center;
    gap: 10px;
    border: 1px solid #ccc;
    background-color: #f5f5f5;
    padding: 10px;
    border-radius: 4px;
    height: auto;
  }
  .form-select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: white;
    color: #333;
    font-size: 14px;
    height: 71vh;
  }
  
  /* =============================================
     6. Estilos Responsive (Overrides) para pantallas más grandes
     ============================================= */
  
  /* --- Medium Screens (min-width: 641px) --- */
  @media (min-width: 641px) {
    .TituloPrincipal { font-size: 2.75rem; }
    #typewriter-subtitulo { font-size: 1.6rem; }
    .btn.btn-secondary.tablas { width: auto; }
    .titulo-tablas { font-size: 2rem; }
    th, td { font-size: 15px; }
    /* Ajustamos la columna extra para tablas intermedias */
    .col5 { width: 10%; }
    .badge { font-size: 13px; }
    .fas { padding: 2px; }
    img.graf_tendencia { height: 150px; }
    img.card-img-top { width: 100px; height: 100px; }
    .flechitas { width: 30px; height: 30px; }
    .detalles { font-size: 5px; }
    #seccion-detalles {
      margin-bottom: 30px;
      position: relative;
      z-index: 1;
    }
    .boton-detalles {
      width: 115px;
      height: 50px;
      font-size: 15px;
      margin-bottom: 5px;
    }
    .card-buttons { justify-content: flex-end; }
  }
  
  /* --- Medium Screens (min-width: 768px) --- */
  @media (min-width: 768px) {
    .rating-system .rating-btn {
      width: 32px;
      height: 32px;
      font-size: 1rem;
    }
    
    .rating-text {
      font-size: 9px;
    }
  }

  /* --- Large Screens (min-width: 992px) --- */
  @media (min-width: 992px) {
    /* Restablece el layout en fila para tarjetas */
    .card.flex-row {
      flex-direction: row;
      position: relative; /* Para posicionamiento de hijos */
    }
    
    /* Columna de imagen con posición absoluta fija */
    .card .flex-column.image-column {
      position: absolute;
      left: 15px; /* Considerando el padding de .card */
      top: 15px;  /* Considerando el padding de .card */
      width: 85px;
      max-width: 85px; /* Límite estricto de ancho */
      overflow: hidden; /* Oculta cualquier desbordamiento */
      z-index: 2; /* Asegura que esté por encima */
    }
    
    /* Imagen dentro de la columna siempre contenida */
    @media (min-width: 992px) {
      img.card-img-top {
        width: 100%; /* Ocupa todo el ancho disponible de la columna */
        max-width: 65px; /* Pero nunca más de 65px */
        height: auto; /* Altura proporcional */
        max-height: 65px; /* Altura máxima */
        margin: 10px auto; /* Centrado horizontal */
        display: block; /* Comportamiento de bloque para centrado */
      }
    }
    
    /* Card-body que NUNCA puede invadir el espacio de la imagen */
    .card-body {
      margin-left: 105px; /* 85px imagen + 20px gap - ZONA PROHIBIDA */
      margin-right: 10px;
      flex: 1;
      order: 2;
      overflow: hidden;
    }
    
    /* Ubica el contenedor extra a la derecha */
    .card-extra-links {
      flex: 0 0 13rem;
      flex-direction: column;
      justify-content: space-evenly;
      margin-left: 0;
      margin-top: 0;
      order: 3;
    }

    /* Aumenta el tamaño de los botones y/o imágenes dentro de los enlaces */
    .card-extra-links a {
        font-size: 1rem;
    }
  }

  @media (max-width: 991px) {
    /* Permite el wrapping de los hijos de la card */
    .card.flex-row {
      flex-wrap: wrap;
    }
    /* Forzamos el orden: la imagen primero, luego el body y, al final, los extra links */
    .card > .flex-column { 
      order: 1;
      flex: 0 0 auto;
    }
    .card-body {
      order: 2;
      flex: 1;
    }
    .card-extra-links {
      order: 3;
      width: 100%;
      margin-left: 0 !important;
      margin-top: 10px !important;
    }

  }

/* Media Query para pantallas móviles */
@media (max-width: 600px) {

    #typewriter-subtitulo {
      margin-left: 0.75rem;
      margin-right: 0.75rem;
      width: calc(100% - 1.5rem);
    }

    .row-limitado {
      width: 100%;
      flex-wrap: wrap;
      overflow-x: hidden;
    }
    
    /* Optimizar botón "Ver +" para mostrar solo "+" en móvil */
    .btn-ver-mas {
        padding: 6px 10px;
        font-size: 0; /* Oculta el texto original */
        border-radius: 10px;
    }
    
    .btn-ver-mas::before {
        content: '+';
        font-size: 16px; /* Tamaño del símbolo + */
    }

    .fuente-enlace {
        font-size: 0.7rem;
      }

    .card-body {
      width: 100%;
      max-width: 100vw; /* nunca más ancho que la pantalla */
      overflow-x: hidden;
    }
  
    .card-body .table-responsive {
      overflow-x: auto;
      width: 100%;
      max-width: 100%;
    }
  
    .card-body .table {
      width: max-content;
      table-layout: auto;
      white-space: nowrap;
    }
  
    .card-body td,
    .card-body th {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 120px;
      font-size: 0.6rem;  
    }

  .btn-ver-variantes {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }

  img.graf_tendencia {
    width: 100%;
    max-width: 300px;       /* ajuste móvil */
    aspect-ratio: auto;
  }

  .fw-bold.fs-6 {
    font-size: 0.8rem !important;
  }
}

/* =============================================
   6. Sidebar de Noticias (pantallas grandes)
   ============================================= */
.sidebar-noticias {
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
  margin-top: 2rem;
}

.sidebar-title {
  font-family: 'Roboto', sans-serif;
  font-size: 1.2rem;
  font-weight: bold;
  color: #24282c;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #9cc5a1;
}

/* Botón para ver todas las noticias en el header del sidebar */
.sidebar-noticias .btn-outline-primary {
  border-color: #9cc5a1;
  background-color: #9cc5a1;
  color: white;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.sidebar-noticias .btn-outline-primary:hover {
  background-color: #7fa885;
  border-color: #7fa885;
  color: white;
  transform: translateX(3px);
}

.sidebar-content {
  color: #333;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Sticky sidebar que se mantiene visible al hacer scroll */
@media (min-width: 992px) {
  .sidebar-noticias.sticky-top {
    position: sticky;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
  }
}

/* Cards pequeñas de noticias en sidebar */
.noticia-card-small {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.noticia-card-small:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.noticia-card-small a {
  display: block;
  color: inherit;
}

.noticia-media-small {
  position: relative;
  width: 100%;
  height: 120px;
  overflow: hidden;
  background-color: #f0f0f0;
}

.noticia-img-small {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.noticia-placeholder-small {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #9cc5a1 0%, #7ab089 100%);
  color: white;
  font-size: 2rem;
}

.noticia-content-small {
  padding: 0.75rem;
}

.noticia-titulo-small {
  font-size: 0.85rem;
  font-weight: 600;
  color: #24282c;
  margin-bottom: 0.5rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.noticia-fecha-small {
  font-size: 0.7rem;
  color: #666;
  margin: 0;
}

.noticia-fecha-small i {
  margin-right: 0.25rem;
}

/* Botón "Ver todas las noticias" */
.sidebar-content .btn-outline-secondary {
  border-color: #9cc5a1;
  color: #24282c;
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
  transition: all 0.3s ease;
}

.sidebar-content .btn-outline-secondary:hover {
  background-color: #9cc5a1;
  border-color: #9cc5a1;
  color: white;
}

/* =============================================
   7. Selector de Moneda
   ============================================= */
.selector-moneda {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  padding: 0.55rem 0.9rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  backdrop-filter: blur(4px);
  width: fit-content;
  max-width: 100%;
}

.selector-moneda-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: #4a4a4a;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.selector-moneda-btns {
  display: flex;
  gap: 6px;
}

.moneda-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: #f0f2f5;
  border: 1.5px solid transparent;
  border-radius: 10px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  transition: all 0.22s ease;
  min-width: 52px;
}

.moneda-btn:hover {
  background: #e2e6ea;
  border-color: #9cc5a1;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.moneda-btn.active {
  background: linear-gradient(135deg, #24282c, #3a4048);
  border-color: #24282c;
  box-shadow: 0 3px 10px rgba(36, 40, 44, 0.3);
  transform: translateY(-1px);
}

.moneda-flag-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.moneda-btn:hover .moneda-flag-img {
  transform: scale(1.08);
  box-shadow: 0 3px 8px rgba(0,0,0,0.25);
}

.moneda-btn.active .moneda-flag-img {
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

.moneda-code {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #495057;
  text-transform: uppercase;
}

.moneda-btn.active .moneda-code {
  color: #ffffff;
}

#estado-cotizacion {
  font-size: 0.72rem;
  font-weight: 500;
  color: #6c757d;
  font-style: italic;
}

/* Mobile: hacer el selector full-width y centrado */
@media (max-width: 600px) {
  .selector-moneda {
    width: 100%;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    border-radius: 10px;
    padding: 0.35rem 0.6rem;
    gap: 0.4rem;
  }

  .selector-moneda-label {
    font-size: 0.7rem;
    white-space: nowrap;
  }

  .selector-moneda-btns {
    gap: 4px;
  }

  .moneda-btn {
    min-width: 42px;
    padding: 0.25rem 0.4rem;
    gap: 1px;
    border-radius: 8px;
  }

  .moneda-flag-img {
    width: 26px;
    height: 26px;
  }

  .moneda-code {
    font-size: 0.58rem;
  }

  #estado-cotizacion {
    display: none; /* en móvil el texto de cotización se oculta para ahorrar espacio */
  }
}

/* =============================================
   8. Botón WhatsApp PDC
   ============================================= */
.btn-whatsapp-pdc {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #ffffff;
  border: none;
  border-radius: 14px;
  padding: 0.7rem 1.2rem;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  box-shadow: 0 3px 12px rgba(37, 211, 102, 0.28);
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.btn-whatsapp-pdc i {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.btn-whatsapp-pdc:hover {
  background: linear-gradient(135deg, #20bf5b 0%, #0e7a6e 100%);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.4);
}

.btn-whatsapp-pdc:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(37, 211, 102, 0.25);
}