/**
 * Theme1 - Sistema de Layout BEM v1.0
 * 
 * Layout responsivo com nomenclatura BEM
 * Grid system customizado e componentes de layout
 * 
 * @version 1.0
 * @date 2026-01-13
 */

/* ============================================
   LAYOUT PRINCIPAL
   ============================================ */
.theme1-layout {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

@media (min-width: 992px) {
  .theme1-layout {
    flex-direction: row;
  }
}

.theme1-layout__sidebar {
  background-color: var(--theme1-nav-bg-color);
  order: 2;
  flex: 0 0 auto;
  width: 100%;
  position: relative;
}

@media (min-width: 992px) {
  .theme1-layout__sidebar {
    order: 1;
    width: 300px;
    max-width: 25%;
    min-height: 100vh;
    position: sticky;
    top: 0;
  }
}

@media (min-width: 1200px) {
  .theme1-layout__sidebar {
    width: 350px;
    max-width: 22.96%;
  }
}

.theme1-layout__content {
  flex: 1;
  background-color: var(--theme1-content-bg-color, #f7f8fb);
  order: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media (min-width: 992px) {
  .theme1-layout__content {
    order: 2;
  }
}

.theme1-layout__content-inner {
  flex: 1;
  padding: var(--theme1-spacing-lg);
}

@media (min-width: 1200px) {
  .theme1-layout__content-inner {
    padding: var(--theme1-spacing-lg) var(--theme1-spacing-xxl);
  }
}

/* ============================================
   HEADER / CABEÇALHO
   ============================================ */
.theme1-header {
  background-color: var(--theme1-nav-bg-color);
  border-bottom: 1px solid var(--theme1-nav-border-color);
}

.theme1-header__topbar {
  background-color: var(--theme1-topbar-bg-color);
  padding: var(--theme1-spacing-md);
  color: var(--theme1-topbar-text-color);
}

.theme1-header__topbar-content {
  display: flex;
  flex-wrap: wrap;
  gap: var(--theme1-spacing-lg);
  max-width: 100%;
}

.theme1-header__topbar-item {
  display: flex;
  align-items: center;
  gap: var(--theme1-spacing-sm);
  flex: 1;
  min-width: 200px;
}

.theme1-header__topbar-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--theme1-topbar-text-color);
  flex-shrink: 0;
}

.theme1-header__topbar-text {
  flex: 1;
  line-height: 1.4;
}

.theme1-header__topbar-link {
  color: var(--theme1-topbar-link-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.theme1-header__topbar-link:hover {
  color: var(--theme1-topbar-link-hover-color);
}

/* ============================================
   NAVEGAÇÃO
   ============================================ */
.theme1-nav {
  padding: 0;
  background-color: var(--theme1-nav-bg-color);
}

.theme1-nav__container {
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.theme1-nav__brand {
  background-color: var(--theme1-nav-bg-color);
  padding: var(--theme1-spacing-xl) var(--theme1-spacing-lg);
  text-align: center;
  border-bottom: 1px solid var(--theme1-nav-border-color);
  width: 100%;
}

.theme1-nav__brand-logo {
  max-width: 100%;
  max-height: 80px;
  height: auto;
}

.theme1-nav__brand-text {
  color: var(--theme1-nav-active-color);
  font-family: 'Raleway', sans-serif;
  font-size: clamp(24px, 4vw, 48px);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.2;
  margin: 0;
}

.theme1-nav__brand-subtitle {
  color: rgba(0, 0, 0, 0.35);
  font-size: clamp(12px, 2vw, 19px);
  font-weight: 400;
  letter-spacing: 1.14px;
  line-height: 1.38;
  text-transform: lowercase;
  margin-top: var(--theme1-spacing-xs);
}

.theme1-nav__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--theme1-spacing-md);
  background-color: var(--theme1-nav-bg-color);
  color: var(--theme1-nav-text-color);
  border: 1px solid var(--theme1-nav-border-color);
  border-radius: var(--theme1-border-radius-md);
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  margin: var(--theme1-spacing-md);
  transition: all 0.3s ease;
}

@media (min-width: 992px) {
  .theme1-nav__toggle {
    display: none;
  }
}

.theme1-nav__toggle:hover,
.theme1-nav__toggle:focus {
  background-color: var(--theme1-nav-hover-bg-color);
  color: var(--theme1-nav-hover-text-color);
  outline: 2px solid var(--theme1-primary-alpha-30);
  outline-offset: 2px;
}

.theme1-nav__collapse {
  background-color: var(--theme1-nav-bg-color);
  display: none;
  width: 100%;
  flex-direction: column;
}

.theme1-nav__collapse.show {
  display: flex;
}

@media (min-width: 992px) {
  .theme1-nav__collapse {
    display: flex !important;
  }
}

.theme1-nav__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.theme1-nav__item {
  width: 100%;
  border-bottom: 1px solid var(--theme1-nav-border-color);
}

.theme1-nav__item:last-child {
  border-bottom: none;
}

.theme1-nav__link {
  display: block;
  padding: var(--theme1-spacing-md) var(--theme1-spacing-lg);
  color: var(--theme1-nav-text-color);
  text-decoration: none;
  font-family: 'Yanone Kaffeesatz', sans-serif;
  font-size: 21px;
  text-transform: uppercase;
  line-height: 1.667;
  transition: all 0.3s ease;
  position: relative;
  background-color: var(--theme1-nav-bg-color);
}

.theme1-nav__link:hover {
  background-color: var(--theme1-nav-hover-bg-color);
  color: var(--theme1-nav-hover-text-color);
  transform: translateX(5px);
}

.theme1-nav__link--active {
  background-color: var(--theme1-nav-active-color);
  color: #ffffff;
  font-weight: 600;
}

.theme1-nav__link--active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: #ffffff;
}

/* ============================================
   ÁREA DE CONTEÚDO PRINCIPAL
   ============================================ */
.theme1-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.theme1-content__slider {
  order: 1;
  margin-bottom: var(--theme1-spacing-lg);
}

.theme1-content__main {
  flex: 1;
  order: 2;
  padding: 0;
}

.theme1-content__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--theme1-spacing-lg);
}

@media (max-width: 767px) {
  .theme1-content__container {
    padding: 0 var(--theme1-spacing-md);
  }
}

/* ============================================
   RODAPÉ
   ============================================ */
.theme1-footer {
  order: 3;
  margin-top: auto;
  background-color: var(--theme1-footer-bg-color);
}

.theme1-footer__widgets {
  background-color: var(--theme1-footer-bg-color);
  padding: var(--theme1-spacing-xxl) var(--theme1-spacing-lg);
  color: var(--theme1-footer-text-color);
}

.theme1-footer__widgets-container {
  max-width: 1200px;
  margin: 0 auto;
}

.theme1-footer__widgets-grid {
  display: grid;
  gap: var(--theme1-spacing-xl);
  grid-template-columns: 1fr;
}

/* Compatibilidade com Bootstrap Row */
.theme1-footer__widgets-grid.row {
  display: grid !important;
  margin: 0 !important;
}

/* Compatibilidade com Bootstrap Columns */
.theme1-footer__widgets-grid > [class*="col-"] {
  padding: 0 !important;
  max-width: none !important;
  flex: none !important;
}

@media (min-width: 768px) {
  .theme1-footer__widgets-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .theme1-footer__widgets-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.theme1-footer__widget {
  color: var(--theme1-footer-text-color);
}

.theme1-footer__widget-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: var(--theme1-spacing-md);
  color: var(--theme1-footer-text-color);
}

.theme1-footer__widget-content {
  line-height: 1.6;
}

.theme1-footer__widget-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.theme1-footer__widget-list-item {
  margin-bottom: var(--theme1-spacing-sm);
}

.theme1-footer__widget-link {
  color: var(--theme1-footer-link-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.theme1-footer__widget-link:hover {
  color: var(--theme1-footer-link-hover-color);
}

.theme1-footer__bottom {
  background-color: var(--theme1-footer-bottom-bg-color);
  padding: var(--theme1-spacing-lg);
  text-align: center;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.theme1-footer__bottom-text {
  margin: 0;
  font-size: 14px;
  color: var(--theme1-footer-text-color);
  line-height: 1.5;
}

/* ============================================
   GRID SYSTEM CUSTOMIZADO
   ============================================ */
.theme1-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--theme1-spacing-lg);
}

.theme1-container--fluid {
  max-width: 100%;
}

.theme1-row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 calc(-1 * var(--theme1-spacing-md));
}

.theme1-col {
  flex: 1;
  padding: 0 var(--theme1-spacing-md);
  min-width: 0; /* Previne overflow */
}

.theme1-col--auto {
  flex: 0 0 auto;
  width: auto;
}

/* Colunas responsivas */
.theme1-col-1 { flex: 0 0 8.33333%; max-width: 8.33333%; }
.theme1-col-2 { flex: 0 0 16.66667%; max-width: 16.66667%; }
.theme1-col-3 { flex: 0 0 25%; max-width: 25%; }
.theme1-col-4 { flex: 0 0 33.33333%; max-width: 33.33333%; }
.theme1-col-5 { flex: 0 0 41.66667%; max-width: 41.66667%; }
.theme1-col-6 { flex: 0 0 50%; max-width: 50%; }
.theme1-col-7 { flex: 0 0 58.33333%; max-width: 58.33333%; }
.theme1-col-8 { flex: 0 0 66.66667%; max-width: 66.66667%; }
.theme1-col-9 { flex: 0 0 75%; max-width: 75%; }
.theme1-col-10 { flex: 0 0 83.33333%; max-width: 83.33333%; }
.theme1-col-11 { flex: 0 0 91.66667%; max-width: 91.66667%; }
.theme1-col-12 { flex: 0 0 100%; max-width: 100%; }

@media (max-width: 767px) {
  .theme1-col-1,
  .theme1-col-2,
  .theme1-col-3,
  .theme1-col-4,
  .theme1-col-5,
  .theme1-col-6,
  .theme1-col-7,
  .theme1-col-8,
  .theme1-col-9,
  .theme1-col-10,
  .theme1-col-11,
  .theme1-col-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* ============================================
   UTILITÁRIOS DE LAYOUT
   ============================================ */
.theme1-d-none { display: none !important; }
.theme1-d-block { display: block !important; }
.theme1-d-inline { display: inline !important; }
.theme1-d-inline-block { display: inline-block !important; }
.theme1-d-flex { display: flex !important; }
.theme1-d-grid { display: grid !important; }

.theme1-justify-start { justify-content: flex-start !important; }
.theme1-justify-center { justify-content: center !important; }
.theme1-justify-end { justify-content: flex-end !important; }
.theme1-justify-between { justify-content: space-between !important; }
.theme1-justify-around { justify-content: space-around !important; }

.theme1-align-start { align-items: flex-start !important; }
.theme1-align-center { align-items: center !important; }
.theme1-align-end { align-items: flex-end !important; }
.theme1-align-stretch { align-items: stretch !important; }

.theme1-flex-column { flex-direction: column !important; }
.theme1-flex-row { flex-direction: row !important; }
.theme1-flex-wrap { flex-wrap: wrap !important; }
.theme1-flex-nowrap { flex-wrap: nowrap !important; }

.theme1-text-left { text-align: left !important; }
.theme1-text-center { text-align: center !important; }
.theme1-text-right { text-align: right !important; }

.theme1-w-100 { width: 100% !important; }
.theme1-h-100 { height: 100% !important; }

/* Espaçamentos */
.theme1-m-0 { margin: 0 !important; }
.theme1-m-1 { margin: var(--theme1-spacing-xs) !important; }
.theme1-m-2 { margin: var(--theme1-spacing-sm) !important; }
.theme1-m-3 { margin: var(--theme1-spacing-md) !important; }
.theme1-m-4 { margin: var(--theme1-spacing-lg) !important; }
.theme1-m-5 { margin: var(--theme1-spacing-xl) !important; }

.theme1-p-0 { padding: 0 !important; }
.theme1-p-1 { padding: var(--theme1-spacing-xs) !important; }
.theme1-p-2 { padding: var(--theme1-spacing-sm) !important; }
.theme1-p-3 { padding: var(--theme1-spacing-md) !important; }
.theme1-p-4 { padding: var(--theme1-spacing-lg) !important; }
.theme1-p-5 { padding: var(--theme1-spacing-xl) !important; }

/* Margens e paddings direcionais */
.theme1-mt-0 { margin-top: 0 !important; }
.theme1-mt-1 { margin-top: var(--theme1-spacing-xs) !important; }
.theme1-mt-2 { margin-top: var(--theme1-spacing-sm) !important; }
.theme1-mt-3 { margin-top: var(--theme1-spacing-md) !important; }
.theme1-mt-4 { margin-top: var(--theme1-spacing-lg) !important; }
.theme1-mt-5 { margin-top: var(--theme1-spacing-xl) !important; }

.theme1-mb-0 { margin-bottom: 0 !important; }
.theme1-mb-1 { margin-bottom: var(--theme1-spacing-xs) !important; }
.theme1-mb-2 { margin-bottom: var(--theme1-spacing-sm) !important; }
.theme1-mb-3 { margin-bottom: var(--theme1-spacing-md) !important; }
.theme1-mb-4 { margin-bottom: var(--theme1-spacing-lg) !important; }
.theme1-mb-5 { margin-bottom: var(--theme1-spacing-xl) !important; }

/* Widgets específicos da sidebar */
.theme1-layout__sidebar .theme1-widget,
.theme1-layout__sidebar .calendar,
.theme1-layout__sidebar .cotacao-container,
.menu-sidebar .theme1-widget,
.menu-sidebar .calendar,
.menu-sidebar .cotacao-container {
  background-color: transparent;
  border: none;
  box-shadow: none;
  margin-bottom: var(--theme1-spacing-lg);
}

.theme1-layout__sidebar .theme1-widget__header,
.menu-sidebar .theme1-widget__header {
  background-color: transparent;
  border-bottom: 1px solid var(--theme1-nav-border-color);
  margin-bottom: var(--theme1-spacing-md);
  padding-bottom: var(--theme1-spacing-sm);
}

.theme1-layout__sidebar .theme1-widget__title,
.menu-sidebar .theme1-widget__title {
  color: var(--theme1-topo-text, var(--theme1-nav-text-color));
  font-size: 16px;
  font-weight: 600;
}

/* ============================================
   RESPONSIVIDADE GLOBAL DO LAYOUT
   ============================================ */
@media (max-width: 991px) {
  .theme1-layout {
    flex-direction: column;
  }
  
  .theme1-layout__sidebar {
    order: 1;
    width: 100%;
    position: relative;
  }
  
  .theme1-layout__content {
    order: 2;
  }
  
  .theme1-nav__brand {
    padding: var(--theme1-spacing-lg);
  }
  
  .theme1-nav__link {
    font-size: 18px;
    padding: var(--theme1-spacing-sm) var(--theme1-spacing-lg);
  }
}

@media (max-width: 767px) {
  .theme1-content__container {
    padding: 0 var(--theme1-spacing-sm);
  }
  
  .theme1-footer__widgets {
    padding: var(--theme1-spacing-xl) var(--theme1-spacing-md);
  }
  
  .theme1-footer__widgets-grid {
    grid-template-columns: 1fr;
    gap: var(--theme1-spacing-lg);
  }
  
  .theme1-header__topbar-content {
    flex-direction: column;
    gap: var(--theme1-spacing-md);
  }
  
  .theme1-header__topbar-item {
    min-width: 100%;
  }
}