:root {
  --os-header-bg: #ffffff;
  --os-header-text: #10243f;
  --os-header-muted: #666666;
  --os-header-accent: #d0121a;
  --os-header-dark: #10243f;
  --os-header-border: #ebebeb;
  --os-header-height: 94px;
}

.os-header {
  position: relative;
  z-index: 1030;
}

.os-header .nav-scroll {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1030;
  background: var(--os-header-bg);
  border-bottom: 1px solid var(--os-header-border);
  display: flex;
  justify-content: center;
}

.os-header.is-menu-open .nav-scroll {
  z-index: 30050;
}

.os-header-spacer {
  height: var(--os-header-height);
}

.os-header .os-navbar.navbar.container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1440px;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 1.1rem 24px;
  min-height: var(--os-header-height);
  box-sizing: border-box;
  float: none !important;
  background: transparent;
  position: relative;
}

.os-header .logo {
  flex: 0 0 auto;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  text-indent: 0;
}

.os-header .logo a {
  display: flex;
  align-items: center;
  height: auto;
  width: auto;
  margin: 0;
  padding: 0;
  text-indent: 0;
}

.os-header .logo img {
  display: block;
  height: 56px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
}

.os-header #menu {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: auto;
  min-width: 0;
  height: auto;
  position: relative;
  margin-left: 1.5rem;
}

.os-header .sidebar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 0.75rem 1rem;
  flex: 1 1 auto;
  width: auto;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.os-header .sidebar > h5,
.os-header .os-sidebar-top {
  display: none;
}

.os-header .os-sidebar-cta {
  display: flex;
  align-items: center;
  order: 2;
  margin-left: auto;
}

/* Login na barra: só mobile (desktop usa o CTA do sidebar) */
.os-header .os-header-login {
  display: none;
}

.os-header .os-sidebar-footer {
  display: contents;
}

.os-header .nav-menu {
  order: 1;
}

.os-header .nav-actions {
  order: 3;
}

.os-header .nav-menu__row {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.os-header .nav-accordion-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.os-header .nav-accordion-btn:hover,
.os-header .nav-accordion-btn:focus {
  color: var(--os-header-accent);
  outline: none;
}

/* ---- Nav links (centro-direita, como no Guia) ---- */
.os-header .nav-menu {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.15rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.os-header .nav-menu__item {
  position: relative;
  margin: 0;
  list-style: none;
}

.os-header .nav-menu__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0;
  color: var(--os-header-text);
  font-family: 'Open Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  text-transform: none;
  text-shadow: none;
  white-space: nowrap;
  border-radius: 0;
  background: transparent;
  transition: color 0.15s ease;
}

.os-header .nav-menu__link:hover,
.os-header .nav-menu__link:focus {
  color: var(--os-header-accent);
  background: transparent;
  text-decoration: none;
}

/* Chevron */
.os-header .nav-chevron {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-top: -2px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.18s ease;
  flex: 0 0 auto;
}

.os-header .nav-menu__item.is-open .nav-chevron,
.os-header .nav-menu__item:hover .nav-chevron,
.os-header .nav-menu__item:focus-within .nav-chevron {
  transform: rotate(225deg);
  margin-top: 2px;
}

/* Dropdown panel (Institucional e listagens curtas) */
.os-header .nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 280px;
  padding-top: 12px; /* ponte de hover */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 1200;
}

.os-header .nav-menu__item.is-open > .nav-dropdown,
.os-header .nav-menu__item:hover > .nav-dropdown,
.os-header .nav-menu__item:focus-within > .nav-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.os-header .nav-dropdown__inner {
  background: #fff;
  border: 1px solid var(--os-header-border);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.os-header .nav-dropdown__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--os-header-border);
  background: #faf9f7;
}

.os-header .nav-dropdown__head strong {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--os-header-text);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.os-header .nav-dropdown__head a {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--os-header-accent);
  text-decoration: none;
}

.os-header .nav-dropdown__head a:hover {
  text-decoration: underline;
}

.os-header .sub-navigation {
  list-style: none;
  margin: 0;
  padding: 0.4rem 0;
}

.os-header .sub-navigation li {
  margin: 0;
  border: 0;
}

.os-header .sub-navigation a {
  display: block;
  padding: 0.65rem 1.1rem;
  color: var(--os-header-text);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  white-space: normal;
  line-height: 1.3;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.os-header .sub-navigation a:hover,
.os-header .sub-navigation a:focus {
  background: #f7f4ef;
  color: var(--principal, var(--os-header-accent));
  border-bottom-color: var(--principal, var(--os-header-accent));
  text-decoration: none;
}

/* Mega menu (> 7 opções em Cursos Online) */
.os-header .nav-menu__item.is-mega {
  position: static;
}

.os-header .nav-dropdown--mega {
  left: 0;
  right: 0;
  width: 100%;
  min-width: 0;
  padding-top: 10px;
}

.os-header .nav-dropdown--mega .nav-dropdown__inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

.os-header .sub-navigation--mega {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.15rem 0.35rem;
  padding: 0.65rem;
  max-height: min(420px, 60vh);
  overflow-y: auto;
}

.os-header .sub-navigation--mega a {
  padding: 0.75rem 0.9rem;
  border-radius: 0;
  background: transparent;
  border-bottom: 2px solid transparent;
}

.os-header .sub-navigation--mega a:hover,
.os-header .sub-navigation--mega a:focus {
  background: transparent;
  color: var(--principal, var(--os-header-accent));
  border-bottom-color: var(--principal, var(--os-header-accent));
}

@media (min-width: 1200px) {
  .os-header .sub-navigation--mega {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ---- Área do Aluno (botão sólido, como no Guia) ---- */
.os-header .nav-menu-login {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.os-header .nav-menu-login > li {
  margin: 0;
  list-style: none;
}

.os-header .nav-menu-login__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.72rem 1.1rem;
  background: var(--os-header-dark);
  color: #fff !important;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  border-radius: 5px;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.os-header .nav-menu-login__link i {
  font-size: 0.85rem;
}

.os-header .nav-menu-login__link:hover,
.os-header .nav-menu-login__link:focus {
  background: var(--os-header-accent);
  color: #fff !important;
  text-decoration: none;
}

/* ---- Busca + carrinho ---- */
.os-header .nav-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.os-header .search-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--os-header-text);
  font-size: 1.05rem;
  cursor: pointer;
  border-radius: 0;
}

.os-header .search-action:hover {
  color: var(--os-header-accent);
}

.os-header .search-p {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.os-header .basket {
  display: flex;
  align-items: center;
}

.os-header .basket a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--os-header-text);
  text-decoration: none;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.os-header .basket a:hover {
  color: var(--os-header-accent);
  text-decoration: none;
}

.os-header .basket-icon {
  display: inline-block;
  width: 20px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.os-header .basket p {
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
}

/* ---- Busca desktop (padrão Guia: barra full-width sob o header) ---- */
.os-header .search-box {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  margin: 0;
  overflow: hidden;
  z-index: 1200;
  pointer-events: none;
}

.os-header #search {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 1rem;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 1.35rem 1.75rem;
  background: var(--os-header-dark);
  border: 0;
  border-radius: 0;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-100%);
  transition: transform 0.35s ease, opacity 0.35s ease, visibility 0.35s;
  pointer-events: none;
}

.os-header #search.search-show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.os-header #search label {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
  color: #fff;
  font-family: 'Open Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
}

.os-header #search input {
  flex: 0 1 520px;
  width: 100%;
  max-width: 520px;
  min-width: 0;
  height: 44px;
  margin: 0;
  padding: 0 1rem;
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: var(--os-header-text);
  box-shadow: none;
  font-size: 1rem;
}

.os-header #search input::placeholder {
  color: #888;
}

.os-header #search input:focus {
  outline: 2px solid var(--os-header-accent);
  outline-offset: 1px;
}

.os-header #search button[type="submit"] {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: var(--os-header-accent);
  color: #fff;
  cursor: pointer;
}

.os-header #search button[type="submit"]:hover {
  filter: brightness(1.08);
}

.os-header #search .close-icon {
  position: relative;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  margin: 0 0 0 0.25rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
}

.os-header #search .close-icon:hover {
  background: rgba(255, 255, 255, 0.4);
}

.os-header #search .close-icon::before,
.os-header #search .close-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 14px;
  background: #fff;
}

.os-header #search .close-icon::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.os-header #search .close-icon::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.os-header #hamburguer,
.os-header hamburguer-menu {
  display: none;
}

/* Desktop only: reforça disposição Guia */
@media (min-width: 992px) {
  .os-header #hamburguer,
  .os-header hamburguer-menu {
    display: none !important;
  }

  .os-header .sidebar > h5,
  .os-header .nav-actions > h5 {
    display: none !important;
  }
}

/* Evita regressão do Bootstrap legado */
.os-header .navbar,
.os-header .navbar-inner,
.os-header .navbar-inverse {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  filter: none !important;
  margin: 0 !important;
  min-height: 0 !important;
}

.os-header .btn-navbar {
  display: none !important;
}

.os-checkout-brand {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.25rem 1rem;
  background: #fff;
  border-bottom: 1px solid var(--os-header-border);
}

.os-checkout-brand__link {
  display: inline-flex;
}

.os-checkout-brand img {
  display: block;
  height: 48px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

.os-header ~ .header.header-big,
body .header.header-big:empty {
  display: none;
}

.os-header .logo,
.os-header .logo a {
  text-indent: 0 !important;
  height: auto !important;
  width: auto !important;
  background: none !important;
  float: none !important;
}

body > .accounts,
#top_page.accounts {
  display: none !important;
}
