/* ==========================================================================
   CSM Portal Editorial - Header & Footer Styles (Mockup Pixel-Perfect)
   ========================================================================== */

/* Cabeçalho Fixo com a Cor Oficial da Marca: Azul #1C1277 (Índigo Royal / Gradiente #2F0A79) */
.csm-site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(135deg, #1C1277 0%, #2F0A79 100%);
  box-shadow: 0 2px 10px rgba(12, 10, 80, 0.25);
}

.csm-header-main {
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.csm-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  gap: 1.5rem;
}

/* Logo do Cabeçalho */
.csm-site-branding {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.csm-brand-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.csm-brand-logo-img {
  height: 28px;
  width: auto;
  display: block;
}

.csm-brand-link {
  text-decoration: none;
  display: block;
}

.csm-brand-group {
  display: flex;
  flex-direction: column;
}

.csm-brand-title {
  font-family: var(--csm-font-sans);
  font-size: 1.32rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.csm-brand-title strong {
  font-weight: 900;
  color: #FFFFFF;
}

.csm-brand-tagline {
  font-size: 0.72rem;
  font-weight: 500;
  color: #CBD5E1;
  letter-spacing: -0.01em;
  margin-top: 1px;
}

/* Menu de Navegação Superior */
.csm-main-navigation {
  display: flex;
  align-items: center;
}

.csm-nav-menu {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.csm-nav-menu > .menu-item > a {
  font-size: 0.92rem;
  font-weight: 600;
  color: #F1F5F9;
  text-decoration: none;
  transition: color 0.15s ease;
}

.csm-nav-menu > .menu-item > a:hover {
  color: #FF8A3D;
}

/* Ações: Busca e Botão Laranja Cotar */
.csm-header-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.csm-search-trigger {
  background: none;
  border: none;
  color: #FFFFFF;
  cursor: pointer;
  padding: 0.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.csm-search-trigger:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: #FF8A3D;
}

.csm-header-cta {
  background: linear-gradient(135deg, #F35D28 0%, #E04B16 100%);
  color: #FFFFFF !important;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.65rem 1.4rem;
  border-radius: 8px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(243, 93, 40, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.csm-header-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(243, 93, 40, 0.35);
  text-decoration: none;
}

/* Mobile Toggle */
.csm-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

@media (max-width: 991px) {
  .csm-menu-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .csm-menu-drawer {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    background: #FFFFFF;
    border-bottom: 2px solid #E2E8F0;
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
  }
  .csm-menu-drawer.is-active {
    display: block;
  }
  .csm-nav-menu {
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    align-items: flex-start;
  }
  .csm-header-cta {
    padding: 0.5rem 0.9rem;
    font-size: 0.82rem;
  }
}

/* ==========================================================================
   BANNER FITA GLOBAL NO TOPO (VIAZA)
   ========================================================================== */
.csm-global-top-banner {
  padding-top: 1.25rem;
  padding-bottom: 0.25rem;
}

.csm-global-top-banner-link {
  display: block;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(12, 27, 60, 0.07);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  line-height: 0;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.csm-global-top-banner-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(12, 27, 60, 0.15);
}

.csm-global-top-banner-img {
  width: 100%;
  height: auto;
  aspect-ratio: 1656 / 142;
  display: block;
  border-radius: 12px;
  object-fit: cover;
  transition: filter 0.25s ease;
}

.csm-global-top-banner-link:hover .csm-global-top-banner-img {
  filter: brightness(1.02);
}

@media (max-width: 640px) {
  .csm-global-top-banner {
    padding-top: 0.75rem;
    padding-bottom: 0;
  }
  .csm-global-top-banner-link,
  .csm-global-top-banner-img {
    border-radius: 8px;
  }
}

/* ==========================================================================
   RODAPÉ EDITORIAL COMPLETO: ALERTAS, ECOSSISTEMA, 4 COLUNAS & COMPLIANCE
   ========================================================================== */
.csm-site-footer {
  background-color: #0B0733;
  color: #FFFFFF;
  margin-top: 4rem;
  font-family: var(--csm-font-sans, system-ui, -apple-system, sans-serif);
}

/* 1. PRÉ-RODAPÉ: ALERTAS DE MILHAS (NEWSLETTER) */
.csm-footer-newsletter {
  background: linear-gradient(135deg, #1C1277 0%, #2F0A79 100%);
  padding: 3rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  overflow: hidden;
}

.csm-footer-newsletter::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 107, 0, 0.15) 0%, rgba(255, 107, 0, 0) 70%);
  pointer-events: none;
}

.csm-newsletter-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
  position: relative;
  z-index: 1;
}

.csm-newsletter-info {
  flex: 1;
  max-width: 620px;
}

.csm-newsletter-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #FDE047;
  text-transform: uppercase;
  margin-bottom: 0.85rem;
}

.csm-newsletter-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.25;
  margin: 0 0 0.5rem 0;
}

.csm-newsletter-desc {
  font-size: 0.95rem;
  color: #E2E8F0;
  line-height: 1.5;
  margin: 0;
}

.csm-newsletter-action {
  flex-shrink: 0;
  width: 100%;
  max-width: 440px;
}

.csm-newsletter-input-wrap {
  display: flex;
  background: #FFFFFF;
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.csm-newsletter-input-wrap:focus-within {
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
}

.csm-newsletter-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
  color: #0F172A;
  outline: none;
  min-width: 0;
}

.csm-newsletter-input::placeholder {
  color: #94A3B8;
}

.csm-button-newsletter {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #FF6B00;
  color: #FFFFFF;
  border: none;
  border-radius: 6px;
  padding: 0 1.25rem;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.csm-button-newsletter:hover {
  background-color: #E05A00;
  transform: translateY(-1px);
}

.csm-newsletter-note {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.65rem;
  font-size: 0.76rem;
  color: #CBD5E1;
}

/* 2. ECOSSISTEMA DO GRUPO (SINERGIA COMERCIAL) */
.csm-footer-ecosystem {
  background-color: #0E093D;
  padding: 3rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.csm-ecosystem-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 2.25rem;
}

.csm-ecosystem-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #38BDF8;
  margin-bottom: 0.4rem;
}

.csm-ecosystem-headline {
  font-size: 1.35rem;
  font-weight: 800;
  color: #FFFFFF;
  margin: 0;
}

.csm-ecosystem-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
}

.csm-ecosystem-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.75rem;
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.csm-ecosystem-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.csm-card-icon-wrap {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FDE047;
}

.csm-card-content {
  flex: 1;
}

.csm-card-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0 0 0.45rem 0;
}

.csm-card-desc {
  font-size: 0.86rem;
  color: #CBD5E1;
  line-height: 1.5;
  margin: 0 0 1.25rem 0;
}

.csm-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.csm-btn-partner {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 0.6rem 1rem;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.csm-btn-partner:hover {
  background: #FFFFFF;
  color: #1C1277;
  border-color: #FFFFFF;
}

.csm-partner-arrow {
  transition: transform 0.2s ease;
}

.csm-btn-partner:hover .csm-partner-arrow {
  transform: translateX(3px);
}

/* 3. CORPO DO RODAPÉ EM 4 COLUNAS */
.csm-footer-main-strip {
  background-color: #080524;
  padding: 3.5rem 0 3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.csm-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.1fr 1.2fr;
  gap: 2.5rem;
}

.csm-footer-col-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: #FFFFFF;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 1.25rem 0;
  position: relative;
  padding-bottom: 0.6rem;
}

.csm-footer-col-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 28px;
  height: 2px;
  background-color: #FF6B00;
}

/* Coluna 1: Sobre & Social */
.csm-col-about .csm-footer-brand {
  margin-bottom: 0.85rem;
}

.csm-footer-logo {
  text-decoration: none;
  display: inline-flex;
  flex-direction: column;
}

.csm-footer-brand-title {
  font-family: var(--csm-font-sans, sans-serif);
  font-size: 1.25rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.02em;
}

.csm-footer-brand-title strong {
  font-weight: 900;
}

.csm-footer-brand-tag {
  font-size: 0.72rem;
  color: #94A3B8;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.csm-footer-desc {
  font-size: 0.85rem;
  color: #94A3B8;
  line-height: 1.6;
  margin: 0 0 1.4rem 0;
}

.csm-footer-social-title {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #CBD5E1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
}

.csm-footer-social-links {
  display: flex;
  gap: 0.75rem;
}

.csm-social-link {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #CBD5E1;
  text-decoration: none;
  transition: all 0.2s ease;
}

.csm-social-link:hover {
  background: #FFFFFF;
  transform: translateY(-2px);
}

.csm-social-facebook:hover {
  color: #1877F2;
  border-color: #1877F2;
}

.csm-social-instagram:hover {
  color: #E4405F;
  border-color: #E4405F;
}

/* Links das Colunas 2, 3 e 4 */
.csm-footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.csm-footer-links li {
  margin-bottom: 0.65rem;
}

.csm-footer-links li a {
  color: #CBD5E1;
  font-size: 0.88rem;
  text-decoration: none;
  transition: color 0.15s ease, padding-left 0.15s ease;
  display: inline-block;
}

.csm-footer-links li a:hover {
  color: #FFFFFF;
  padding-left: 4px;
}

/* Coluna 4: Contato & Redação */
.csm-footer-contact-block {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.csm-contact-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.45rem;
}

.csm-contact-email {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #38BDF8;
  font-size: 0.84rem;
  word-break: break-all;
  text-decoration: none;
  transition: color 0.15s ease;
}

.csm-contact-email:hover {
  color: #7DD3FC;
  text-decoration: underline;
}

/* 4. SUB-STRIP INFERIOR (COMPLIANCE, CNPJ & DISCLAIMER) */
.csm-footer-bottom-strip {
  background-color: #050319;
  padding: 1.75rem 0 2rem;
  font-size: 0.78rem;
  color: #64748B;
}

.csm-footer-bottom-inner {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.csm-footer-legal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.csm-footer-legal-copy {
  color: #94A3B8;
}

.csm-footer-legal-copy strong {
  color: #CBD5E1;
}

.csm-footer-sep {
  margin: 0 0.5rem;
  color: rgba(255, 255, 255, 0.2);
}

.csm-footer-cnpj {
  color: #94A3B8;
  font-weight: 500;
}

.csm-footer-policy-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.csm-footer-policy-nav a {
  color: #94A3B8;
  text-decoration: none;
  transition: color 0.15s ease;
}

.csm-footer-policy-nav a:hover {
  color: #FFFFFF;
  text-decoration: underline;
}

.csm-footer-dot {
  color: rgba(255, 255, 255, 0.2);
}

.csm-footer-disclaimer p {
  margin: 0;
  line-height: 1.6;
  font-size: 0.74rem;
  color: #64748B;
}

/* ==========================================================================
   RESPONSIVIDADE DO RODAPÉ (MOBILE & TABLET)
   ========================================================================== */
@media (max-width: 991px) {
  .csm-newsletter-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.75rem;
  }
  .csm-newsletter-action {
    max-width: 100%;
  }
  .csm-ecosystem-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .csm-footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  .csm-col-about {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .csm-footer-newsletter {
    padding: 2rem 0;
  }
  .csm-newsletter-title {
    font-size: 1.25rem;
  }
  .csm-newsletter-input-wrap {
    flex-direction: column;
    padding: 6px;
    gap: 6px;
  }
  .csm-button-newsletter {
    padding: 0.75rem 1rem;
    justify-content: center;
  }
  .csm-footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .csm-col-about {
    grid-column: span 1;
  }
  .csm-ecosystem-card {
    flex-direction: column;
    padding: 1.25rem;
  }
  .csm-footer-legal-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .csm-footer-policy-nav {
    flex-wrap: wrap;
  }
}

/* ==========================================================================
   Botão Flutuante Voltar ao Topo (Scroll to Top)
   ========================================================================== */
.csm-back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1C1277;
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(12, 10, 80, 0.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.csm-back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.csm-back-to-top:hover {
  background-color: #FF6B00;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(255, 107, 0, 0.38);
}

.csm-back-to-top:focus-visible {
  outline: 2px solid #FF6B00;
  outline-offset: 3px;
}

.csm-back-to-top svg {
  display: block;
  transition: transform 0.15s ease;
}

.csm-back-to-top:hover svg {
  transform: translateY(-2px);
}

@media (max-width: 640px) {
  .csm-back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }
}
