
/* ===========================================================
   CARDS FINANCEIROS
   ===========================================================
   Nesta seção estão reunidos os estilos específicos para os cards
   financeiros, incluindo variáveis, estrutura, modais, tooltips, 
   carrossel e ajustes para dispositivos móveis.
----------------------------------------------------------- */

/* ===========================================================
   INVESTMENT CARDS & VARIÁVEIS
   ===========================================================
   Variáveis e estilos dos cards de investimento, modais e tooltips.
----------------------------------------------------------- */
:root {
    --color-blue-primary: #1B7F97;
    --color-blue-hover: #4BA7BB;
    --color-green-primary: #98D442;
    --color-green-hover: #A9E525;
    --color-orange-primary: #F17F24;
    --color-orange-hover: #FF8A3B;
    --color-trophy-primary: #98D442;
    --color-trophy-hover: #A9E525;
    --color-post-fixed: #71B923;
    --border-width-thin: 0.0625rem;
    --border-width-medium: 0.125rem;
    --border-radius-small: 0.25rem;
    --border-radius-medium: 0.5rem;
    --border-radius-large: 1.5rem;
    --shadow-small: 0 0.125rem 0.25rem rgba(0,0,0,0.1);
    --shadow-medium: 0 0.25rem 0.5rem rgba(0,0,0,0.1);
    --shadow-large: 0 0.625rem 0.9375rem rgba(0,0,0,0.1);
  }
  
  .investment-cards-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 0; /* Reduzido de 20px para 10px */
    position: relative;
    transition: all 0.3s ease;
  }
  
  /* Estilo fixo para os cards (desktop) */
  .investment-card {
    font-size: 0.9375rem;
    line-height: 1.5;
    width: 100%;
    min-height: 520px;
    background-color: #fff;
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-large), 0 0.25rem 0.375rem -0.25rem rgba(0,0,0,0.1);
    padding: 1.25rem;
    position: relative;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
  }
  
  .investment-card:hover {
    box-shadow: 0 0.75rem 1.5rem rgba(0,0,0,0.15), 0 0.375rem 0.75rem -0.25rem rgba(0,0,0,0.1);
    transform: translateY(-2px);
  }
  
  .investment-card .card-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: -0.25rem;
  }
  
  .investment-card .header {
    display: block;
    margin-bottom: 0.625rem;
    background-color: transparent;
    padding: 0;
    box-shadow: none !important;
  }
  
  .investment-card .header-top {
    display: block;
    margin-bottom: 0.375rem;
  }
  
  .investment-card .ranking-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .investment-card .trophy-icon {
    font-size: 2rem;
    color: #FFB200;
  }
  
  .investment-card .title {
    margin-bottom: 0;
    margin-top: 0.125rem;
    box-shadow: none !important;
  }
  
  .investment-card .title-text {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    margin-bottom: 5px;
    color: #47474C;
    line-height: 1.3;
    box-shadow: none !important;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: calc(1.3em * 3);
  }
  
  .investment-card .badge {
    color: #fff;
    padding: 0.125rem 0.375rem;
    border-radius: 62.4375rem;
    font-size: 0.5625rem;
    font-weight: 600;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.025rem;
    display: inline-block;
    margin-bottom: 0.375rem;
  }
  
  .investment-card .badge[data-investment-type="PRÉ-FIXADO"] {
    background-color: #35ADD9;
  }
  
  .investment-card .badge[data-investment-type="PÓS-FIXADO"] {
    background-color: #5083C7;
  }
  
  .investment-card .info-list {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.625rem;
    margin-bottom: 0.625rem;
    height: 100%;
  }
  
  .investment-card .info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 1.375rem;
  }
  
  .investment-card .info-item .label {
    flex-shrink: 0;
    white-space: nowrap;
    width: 6.5rem;
    padding-right: 0.5rem;
  }
  
  .investment-card .info-item .value {
    text-align: right;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .investment-card .card-base {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
  }
  
  .investment-card .footer {
    display: flex;
    justify-content: flex-start;
    gap: 0.625rem;
    padding: 0;
    background-color: transparent;
  }
  
  .investment-card .footer-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
  }
  
  .investment-card .footer-icon {
    width: 1.5rem;
    height: 1.5rem;
  }
  
  .investment-card .label {
    font-size: 0.83rem;
    font-weight: 500;
    color: #8E8E93;
  }
  
  .investment-card .value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #47474C;
  }
  
  .investment-card .value-highlight {
    font-size: 1.25rem;
    font-weight: 600;
  }
  
  .investment-card .text-ffb200 { 
    color: #FFB200;
  }
  
  .investment-card .text-green-primary { 
    color: var(--color-green-primary);
  }
  
  .investment-card [data-field="offered-by"],
  .investment-card [data-field="available-at"],
  .investment-card .footer-item .value {
    cursor: pointer;
    color: var(--color-blue-primary);
    transition: color 0.15s ease;
  }
  
  .investment-card [data-field="offered-by"]:hover,
  .investment-card [data-field="available-at"]:hover,
  .investment-card .footer-item:hover .value {
    color: var(--color-blue-hover);
  }
  
  .investment-card .rentability-value {
    cursor: pointer;
    color: var(--color-green-primary);
    transition: color 0.15s ease;
  }
  
  .investment-card .rentability-value:hover {
    color: var(--color-green-hover);
  }
  
  .investment-card .footer-item .value.text-ff6b00 { 
    color: var(--color-orange-primary);
    transition: color 0.15s ease;
    font-size: 0.75rem;
    font-weight: 500;
  }
  
  .investment-card .footer-item:hover .value.text-ff6b00 {
    color: var(--color-orange-hover);
  }
  
  .investment-card .footer-item .value.fgc-text {
    font-size: 0.75rem;
    font-weight: 500;
  }

  /* ===========================================================
     BOTÃO DE DETALHES
     ===========================================================
     Estilos para o botão de detalhes dos cards.
  ----------------------------------------------------------- */
  .details-button-container {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
  }

  .btn-details {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #2E6C86;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
  }

  .btn-details:hover {
    background-color: #1e4a5f;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(46, 108, 134, 0.2);
  }

  .btn-details .material-icons {
    font-size: 1rem;
    transition: transform 0.2s ease;
  }

  .btn-details:hover .material-icons {
    transform: translateX(2px);
  }

  /* ===========================================================
     MODAL E TOOLTIP PARA INVESTMENT CARDS
     ===========================================================
     Estilos para os modais e tooltips dos cards.
  ----------------------------------------------------------- */
  .info-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 0.25rem;
  }
  
  .info-button .material-icons {
    font-size: 1rem;
    color: #C6D4D8;
    vertical-align: middle;
  }
  
  .modal {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 1000;
    border-radius: var(--border-radius-large);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(0.3125rem);
    border: none;
  }
  
  .modal.show {
    opacity: 1;
  }
  
  .modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: justify;
    width: calc(100% - 4.5rem);
    color: #8E8E93;
    font-size: 0.875rem;
    line-height: 1.5;
    border: none;
    box-shadow: none;
    background-color: transparent;
  }
  
  .modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #47474C;
    margin-bottom: 0.75rem;
    text-align: center;
  }
  
  /* ===========================================================
     CARROSSEL & VIEW MODES
     ===========================================================
     Estilos para o carrossel, contêiner de cards e modos de visualização.
  ----------------------------------------------------------- */
  /* Alterado: overflow passa a ser hidden para evitar que slides vazem */
  .carousel {
    overflow: hidden !important;
    margin-bottom: 20px; /* Reduzido de 40px para 20px */
    position: relative;
    width: 100%;
    padding: 0;
  }
  
  .carousel-inner {
    padding: 0;
    overflow: hidden !important;
    width: 100%; /* Utiliza todo o espaço disponível */
  }
  
  .carousel-item {
    overflow: hidden !important;
    min-height: 520px;
    width: 100%; /* Utiliza todo o espaço disponível */
  }
  
  
  .carousel-indicators {
    position: static;
    margin-top: 20px;
    margin-bottom: 0;
    z-index: 10;
  }
  
  .carousel-indicators [data-bs-target] {
    width: 14px; /* Aumentado de 10px para 20px (dobro do tamanho) */
    height: 14px; /* Aumentado de 10px para 20px (dobro do tamanho) */
    border-radius: 50%;
    background-color: #00597C;
    opacity: 0.5;
    margin: 0 10px; /* Aumentado de 5px para 10px (mais espaçamento) */
    border: none;
  }
  
  .carousel-indicators .active {
    opacity: 1;
  }
  
  .card-wrapper {
   display: flex;
   justify-content: space-between;
   gap: 1%;
   flex-wrap: wrap;
   overflow: visible !important;
   position: relative;
   margin: 0 auto;
   padding: 0;
   z-index: 1;
 }
  
  .card-container {
    width: 31%;
    flex: 0 0 auto;
    margin: 0 1%;
    overflow: visible !important;
  }
  
  .view-mode-desktop .desktop-cards-view {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 15px;
  }
  
  .view-mode-desktop .mobile-carousel-view {
    display: none;
  }
  
  .view-mode-tablet .desktop-cards-view,
  .view-mode-mobile .desktop-cards-view {
    display: none;
  }
  
  .view-mode-tablet .mobile-carousel-view,
  .view-mode-mobile .mobile-carousel-view {
    display: block;
  }
  
  .desktop-cards-view {
    display: none;
  }
  
  .mobile-carousel-view {
    display: none;
  }
  
  /* Media Query para telas médias */
@media (min-width: 992px) and (max-width: 1199px) {
  .investment-card {
    width: 31%;
  }
  .card-container {
    width: 31%;
  }
}

/* Media Query extraída para os cards financeiros (min-width: 1200px) */
@media (min-width: 1200px) {
    .investment-cards-container {
      max-width: 1200px;
      padding: 20px 10px;
    }
    .view-mode-desktop .desktop-cards-view {
      overflow-x: visible;
      justify-content: center;
    }
  }
  
  /* Media Query para tablets */
@media (min-width: 768px) and (max-width: 991px) {
  .investment-card {
    width: 48%;
  }
  .card-container {
    width: 48%;
  }
  .card-wrapper {
    /* Já definido no seletor principal */
  }
}

/* ======= AJUSTE FINAL PARA CARDS NO MOBILE ======= */
@media (max-width: 768px) {
    /* Ajuste do carrossel: sem espaço para setas agora */
    /* Na seção do carrossel */
    .carousel {
      overflow: hidden !important;
      margin-bottom: 15px; /* Reduzido de 20px */
      position: relative;
      width: 100%;
      padding: 0;
    }
    
    .carousel-indicators {
      position: static;
      margin-top: 10px; /* Reduzido de 20px */
      margin-bottom: 0;
      z-index: 10;
    }
    
    /* Na seção mobile */
    @media (max-width: 768px) {
      .carousel-item {
        padding-bottom: 10px; /* Reduzido de 20px */
      }
      
      .investment-card {
        width: 100% !important;
        max-width: 100% !important;
        height: auto;
        min-height: 480px; /* Reduzido de 540px */
        margin: 0 auto;
        box-sizing: border-box;
      }
      
      .card-container {
          width: 100% !important;
          max-width: 100% !important;
          margin: 0 0 20px 0;
          padding: 0 5px; /* Adicionando 5px de padding em cada lado */
        box-sizing: border-box;
      }
      .card-wrapper {
          width: 100%;
          gap: 0;
          padding: 0;
      }
    }
    .carousel-item {
      min-height: auto !important;
      height: auto !important;
      padding-bottom: 20px;
    }
    
    /* Ajuste dos cards de investimento para usar quase todo o espaço disponível, com folga de 5px */
    .investment-card {
      width: calc(100% - 6px) !important; /* 3px de cada lado */
      max-width: calc(100% - 6px) !important;
      height: auto;
      min-height: 540px;
      margin: 0 auto;
      box-sizing: border-box;
    }
    .card-container {
      width: 100% !important;
      max-width: 100% !important;
      margin: 0 auto;
      padding: 0 5px; /* Adicionando 5px de padding em cada lado */
      box-sizing: border-box;
    }
    .card-wrapper {
      width: 100%;
      padding: 0;
    }
  }
  
  @media (max-width: 576px) {
    .carousel {
      overflow: hidden !important;
      width: 100% !important;
      padding: 0;
    }
    .carousel-inner,
    .carousel-item {
      overflow: hidden !important;
      width: 100% !important;
    }
    .carousel-item {
      min-height: auto !important;
      height: auto !important;
      padding-bottom: 20px;
    }

    
    .investment-card {
      width: calc(100% - 6px) !important; /* 5px de cada lado */
      max-width: calc(100% - 6px) !important;
      height: auto;
      min-height: 540px;
      margin: 0 auto;
      box-sizing: border-box;
    }
    .card-container {
      width: 100% !important;
      max-width: 100% !important;
      margin: 0 auto;
      padding: 0 5px; /* Adicionando 5px de padding em cada lado */
      box-sizing: border-box;
    }
    .card-wrapper {
      width: 100%;
      padding: 0;
    }
  }
  
/* ===========================================================
   TIMELINES DE RENTABILIDADE E SEGURANÇA
   ===========================================================
   Estilos para as timelines nos cards de investimento.
----------------------------------------------------------- */
.timeline-container {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.timeline-title {
  font-size: 0.75rem;
  font-weight: 500;
  color: #8E8E93;
}

.timeline-value {
  font-size: 0.75rem;
  font-weight: 600;
  color: #47474C;
}

.timeline-bar {
  height: 0.375rem;
  background-color: #F5F5F5;
  border-radius: 0.1875rem;
  overflow: hidden;
}

.timeline-progress {
  height: 100%;
  border-radius: 0.1875rem;
}

.timeline-rentability .timeline-progress {
  background: linear-gradient(90deg, #71B923, #98D442);
}

.timeline-security .timeline-progress {
  background: linear-gradient(90deg, #1B7F97, #35ADD9);
}
  


  /* ===========================================================
     LIQUID VALUES SECTION
     ===========================================================
     Estilo para a seção de valores líquidos nos cards.
  ----------------------------------------------------------- */
  .liquid-values-section {
    position: relative;
    margin-top: 10px;     /* Espaçamento externo acima */
    margin-bottom: 5px;   /* Espaçamento externo abaixo */
    padding: 10px 0;  /* Espaçamento interno: 10px acima e abaixo */
  }
  
  .liquid-values-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    border-top: 1px dashed #e0e0e0;
  }
  
  .liquid-values-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    border-top: 1px dashed #e0e0e0;
  }
  
  .liquid-values-title {
    position: absolute;
    top: -10px;
    left: 0;
    transform: translateX(0);
    background-color: white;
    padding: 0 10px 0 0;  /* Removido o padding-left grande, mantido apenas padding-right */
    font-size: 0.80rem;
    font-weight: 600;
    color: #666;
    text-align: left;
  }
  
  .liquid-values-section .info-item {
    margin-bottom: 8px;
  }
  
  .liquid-values-section .info-item:last-child {
    margin-bottom: 0;
  }
  
  /* Ajuste para mobile */
  @media (max-width: 768px) {
    .liquid-values-section {
      margin: 15px 0;
      padding: 12px 0;
    }
    
    .liquid-values-title {
      font-size: 0.83rem;
    }
  }

/* ===========================================================
   PROGRESS BARS PARA RENTABILIDADE E SEGURANÇA
   ===========================================================
   Estilos para as barras de progresso nos cards de investimento.
----------------------------------------------------------- */
.investment-card-progress-section {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
}

.investment-card-progress-item {
  margin-bottom: 0.5rem;
}

.investment-card-progress-item:last-child {
  margin-bottom: 0;
}

.investment-card-progress-bar {
  height: 0.375rem;
  background-color: #F5F5F5;
  border-radius: 0.1875rem;
  overflow: hidden;
  margin-top: 0.25rem;
}

.investment-card-progress-fill {
  height: 100%;
  border-radius: 0.1875rem;
}

/* Estilo para a barra de rentabilidade */
.investment-card-progress-item:first-child .investment-card-progress-fill {
  background: linear-gradient(90deg, #71B923, #98D442);
}

/* Estilo para a barra de segurança */
.investment-card-progress-item:last-child .investment-card-progress-fill {
  background: linear-gradient(90deg, #1B7F97, #35ADD9);
}
/* Base */
.investment-card {
  min-height: 480px; /* Reduzir altura base */
}

.carousel-item {
  min-height: auto; /* Remover altura fixa */
}

.carousel {
  margin-bottom: 15px; /* Reduzir espaço */
}

.carousel-indicators {
  margin-top: 10px; /* Reduzir espaço dos indicadores */
}

@media (max-width: 768px) {
  .investment-card {
    min-height: 480px; /* Manter consistente com desktop */
  }
  
  .carousel-item {
    padding-bottom: 10px; /* Reduzir padding */
  }
  
  /* Ajustes para mobile - ícones e textos do footer */
  .investment-card .footer-icon {
    width: 1.25rem;
    height: 1.25rem;
  }
  
  .investment-card .footer-item .value.text-ff6b00,
  .investment-card .footer-item .value.fgc-text {
    font-size: 0.6875rem;
    font-weight: 500;
  }
}

