/* ============================================================
   RESET & BASE
   ============================================================ */
.mdn-header *,
.mdn-header *::before,
.mdn-header *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.mdn-header button,
.mdn-header a {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.mdn-header {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  position: sticky;
  top: 0;
  z-index: 999999;
  background: #FFFFFF;
}

/* ============================================================
   TOP BAR (logo + nav + CTA)
   ============================================================ */
.mdn-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 24px;
  height: 80px;
}

.mdn-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mdn-logo {
  display: flex;
  align-items: center;
  height: 80px;
  flex-shrink: 0;
}

.mdn-logo img {
  height: 52px;
  width: auto;
  max-width: 182px;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}

/* Desktop nav */
.mdn-header nav {
  display: flex;
  align-items: center;
  height: 80px;
  margin: 0;
  padding: 0;
}

.mdn-nav {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none !important;
  height: 80px;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
}

.mdn-nav-item {
  position: relative;
  height: 80px;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
}

.mdn-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 18px;
  height: 80px;
  line-height: 1;
  font-size: 16px;
  font-weight: 600;
  color: #1D3557;
  text-decoration: none;
  transition: color 0.2s;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

.mdn-nav-link:hover {
  color: #C41230;
}

.mdn-nav-link:focus-visible {
  outline: 2px solid #1D3557;
  outline-offset: -2px;
  border-radius: 4px;
}

/* Chevron icon for mega menu triggers */
.mdn-nav-link svg.mdn-chevron {
  width: 12px;
  height: 12px;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.mdn-nav-item.mdn-active .mdn-nav-link svg.mdn-chevron {
  transform: rotate(180deg);
}

/* WhatsApp CTA */
.mdn-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: #C41230;
  color: #FFFFFF !important;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}

.mdn-cta:hover {
  background: #a30f28;
  transform: translateY(-1px);
}

.mdn-cta svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Calculadora CTA (navy) */
.mdn-cta.mdn-cta-calc {
  background: #1D3557 !important;
  font-size: 13px;
  padding: 9px 16px;
}

.mdn-cta.mdn-cta-calc:hover {
  background: #162b47 !important;
}

.mdn-cta-calc svg {
  width: 16px;
  height: 16px;
}

/* Mega menu highlight post (calculadora) */
.mdn-mega-post-highlight {
  background: rgba(29, 53, 87, 0.04);
  border: 1px solid rgba(29, 53, 87, 0.1) !important;
}

.mdn-mega-post-highlight:hover {
  background: rgba(29, 53, 87, 0.08);
}

.mdn-mega-post-highlight .mdn-mega-post-title {
  color: #1D3557;
}

/* Search icon + dropdown */
.mdn-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.mdn-search-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: #1D3557;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  touch-action: manipulation;
}

.mdn-search-btn:hover {
  color: #C41230;
}

.mdn-search-btn:focus-visible {
  outline: 2px solid #1D3557;
  outline-offset: 2px;
  border-radius: 4px;
}

.mdn-search-btn svg {
  width: 20px;
  height: 20px;
}

.mdn-search-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: #FFFFFF;
  border: 1px solid #E5E5E5;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  padding: 8px;
  display: none;
  align-items: center;
  gap: 8px;
  z-index: 999999;
  width: 320px;
}

.mdn-search-dropdown.mdn-search-open {
  display: flex;
}

.mdn-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: inherit;
  color: #1D3557;
  padding: 8px 12px;
  background: transparent;
}

.mdn-search-input::placeholder {
  color: #999;
}

.mdn-search-submit {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: #999;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  touch-action: manipulation;
}

.mdn-search-submit:hover {
  color: #C41230;
}

.mdn-search-submit svg {
  width: 18px;
  height: 18px;
}

.mdn-search-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #999;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  touch-action: manipulation;
}

.mdn-search-close:hover {
  color: #1D3557;
}

.mdn-search-close svg {
  width: 16px;
  height: 16px;
}

/* Hamburger (mobile only) */
.mdn-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}

.mdn-hamburger:focus-visible {
  outline: 2px solid #1D3557;
  outline-offset: 2px;
  border-radius: 4px;
}

.mdn-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #1D3557;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ============================================================
   MEGA MENU — FULL-SCREEN OVERLAY (desktop)
   ============================================================ */
.mdn-mega {
  position: fixed;
  top: 80px;
  left: 0;
  right: 0;
  bottom: 0;
  background: #FFFFFF;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 999998;
  overflow: hidden;
}

.mdn-mega.mdn-visible {
  opacity: 1;
  visibility: visible;
  overscroll-behavior: contain;
}

.mdn-mega-inner {
  display: flex;
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
}

/* Panel title (top of sidebar area) */
.mdn-mega-title {
  font-size: 28px;
  font-weight: 700;
  color: #1D3557;
  padding: 32px 28px 20px;
}

/* Close button — top right */
.mdn-mega-close {
  position: absolute;
  top: 24px;
  right: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  color: #999;
  transition: color 0.2s;
  z-index: 2;
  touch-action: manipulation;
}

.mdn-mega-close:hover {
  color: #1D3557;
}

.mdn-mega-close:focus-visible {
  outline: 2px solid #1D3557;
  outline-offset: 2px;
  border-radius: 4px;
}

.mdn-mega-close svg {
  width: 24px;
  height: 24px;
}

/* Left sidebar: categories */
.mdn-mega-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: #FFFFFF;
  border-right: 1px solid #E8E8E8;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.mdn-mega-cats {
  padding: 0 0 32px;
}

.mdn-mega-cat {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 500;
  color: #1D3557;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-family: inherit;
}

.mdn-mega-cat svg.mdn-cat-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #1D3557;
  transition: color 0.15s;
}

.mdn-mega-cat:hover {
  background: rgba(29, 53, 87, 0.04);
  color: #C41230;
}

.mdn-mega-cat:hover svg.mdn-cat-icon {
  color: #C41230;
}

.mdn-mega-cat.mdn-cat-active {
  border-left-color: #C41230;
  font-weight: 700;
  color: #C41230;
  background: #FDF6F7;
}

.mdn-mega-cat.mdn-cat-active svg.mdn-cat-icon {
  color: #C41230;
}

/* Right side: posts grid */
.mdn-mega-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mdn-mega-content {
  flex: 1;
  padding: 32px 40px 24px;
  overflow-y: auto;
}

.mdn-mega-grid {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.mdn-mega-grid.mdn-grid-active {
  display: grid;
}

.mdn-mega-post {
  text-decoration: none;
  display: block;
  padding: 16px 18px;
  border-radius: 8px;
  border-left: 3px solid transparent;
  transition: background 0.15s, border-color 0.2s;
}

.mdn-mega-post:hover {
  background: #F9F9F7;
  border-left-color: #C41230;
}

.mdn-mega-post-title {
  font-size: 16px;
  font-weight: 600;
  color: #1D3557;
  line-height: 1.4;
  margin-bottom: 6px;
}

.mdn-mega-post:hover .mdn-mega-post-title {
  color: #C41230;
}

.mdn-mega-post-desc {
  font-size: 13px;
  font-weight: 400;
  color: #666666;
  line-height: 1.5;
}

/* "Ver todos" footer link */
.mdn-mega-footer {
  padding: 16px 40px 28px;
  border-top: 1px solid #E8E8E8;
}

.mdn-mega-footer-link {
  font-size: 14px;
  font-weight: 600;
  color: #C41230;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s;
}

.mdn-mega-footer-link:hover {
  gap: 12px;
}

.mdn-mega-footer-link svg {
  transition: transform 0.2s;
}

.mdn-mega-footer-link:hover svg {
  transform: translateX(2px);
}

/* ============================================================
   MOBILE MENU
   ============================================================ */
.mdn-mobile-menu {
  display: none;
  position: fixed;
  top: 80px;
  left: 0;
  right: 0;
  bottom: 0;
  background: #FFFFFF;
  z-index: 999999;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.mdn-mobile-menu.mdn-mobile-open {
  display: block;
}

/* Level 1 */
.mdn-mobile-l1 {
  list-style: none !important;
  padding: 8px 0 !important;
  margin: 0 !important;
}

.mdn-mobile-l1-item {
  border-bottom: 1px solid #F0F0F0;
}

.mdn-mobile-l1-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 500;
  color: #1D3557;
  text-decoration: none;
  background: none;
  border: none;
  width: 100%;
  cursor: pointer;
  font-family: inherit;
}

.mdn-mobile-l1-link:active {
  background: #F5F5F5;
}

.mdn-mobile-l1-link:focus-visible {
  outline: 2px solid #1D3557;
  outline-offset: -2px;
}

.mdn-mobile-l1-link svg {
  width: 16px;
  height: 16px;
  color: #999;
  flex-shrink: 0;
}

/* Level 2 panel (drill-down) */
.mdn-mobile-l2 {
  position: fixed;
  top: 80px;
  left: 0;
  right: 0;
  bottom: 0;
  background: #FFFFFF;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 2;
}

.mdn-mobile-l2.mdn-l2-open {
  transform: translateX(0);
}

.mdn-mobile-back {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 24px;
  font-size: 14px;
  font-weight: 600;
  color: #C41230;
  background: none;
  border: none;
  border-bottom: 1px solid #F0F0F0;
  width: 100%;
  cursor: pointer;
  font-family: inherit;
}

.mdn-mobile-back svg {
  width: 14px;
  height: 14px;
}

.mdn-mobile-l2-title {
  padding: 16px 24px 8px;
  font-size: 18px;
  font-weight: 700;
  color: #1D3557;
}

/* Accordion categories */
.mdn-mobile-accordion {
  list-style: none !important;
  padding: 0 0 100px !important;
  margin: 0 !important;
}

.mdn-mobile-acc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  color: #1D3557;
  background: none;
  border: none;
  border-bottom: 1px solid #F0F0F0;
  width: 100%;
  cursor: pointer;
  font-family: inherit;
  gap: 10px;
}

.mdn-mobile-acc-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #1D3557;
}

.mdn-mobile-acc-header-text {
  flex: 1;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mdn-mobile-acc-header svg.mdn-acc-chevron {
  width: 14px;
  height: 14px;
  color: #999;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.mdn-mobile-acc-header.mdn-acc-open svg.mdn-acc-chevron {
  transform: rotate(180deg);
}

.mdn-mobile-acc-body {
  display: none;
  background: #F9F9F7;
}

.mdn-mobile-acc-body.mdn-acc-body-open {
  display: block;
}

.mdn-mobile-acc-link {
  display: block;
  padding: 14px 24px 14px 50px;
  min-height: 44px;
  text-decoration: none;
  border-bottom: 1px solid #F0F0F0;
}

.mdn-mobile-acc-link-title {
  font-size: 14px;
  font-weight: 600;
  color: #1D3557;
  line-height: 1.4;
  margin-bottom: 2px;
}

.mdn-mobile-acc-link-desc {
  font-size: 12px;
  color: #666666;
  line-height: 1.4;
}

/* Mobile CTA at bottom */
.mdn-mobile-cta-wrap {
  padding: 20px 24px;
  border-top: 1px solid #E5E5E5;
}

.mdn-mobile-cta-wrap .mdn-cta {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 14px 20px;
  font-size: 16px;
}

/* Focus visible states */
.mdn-nav-link:focus-visible,
.mdn-mega-cat:focus-visible,
.mdn-mega-post:focus-visible,
.mdn-mega-close:focus-visible,
.mdn-mobile-l1-link:focus-visible,
.mdn-mobile-acc-header:focus-visible,
.mdn-mobile-acc-link:focus-visible,
.mdn-mobile-back:focus-visible,
.mdn-cta:focus-visible,
.mdn-hamburger:focus-visible {
  outline: 2px solid #1D3557;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
/* Tela < 1050px — esconde Calculadora do TOPBAR, comprime nav */
@media (max-width: 1050px) {
  .mdn-topbar-right > .mdn-cta.mdn-cta-calc {
    display: none !important;
  }
  .mdn-header .mdn-nav-link {
    padding: 0 12px !important;
    font-size: 15px !important;
  }
}

/* Tela < 850px — esconde WhatsApp também */
@media (max-width: 850px) {
  .mdn-header .mdn-topbar-right .mdn-cta {
    display: none !important;
  }
}

/* Mobile — hamburger */
@media (max-width: 768px) {
  .mdn-nav {
    display: none !important;
  }

  .mdn-topbar-right > .mdn-cta {
    display: none !important;
  }

  .mdn-topbar {
    padding: 0 20px !important;
  }

  .mdn-logo img {
    height: 44px !important;
  }

  .mdn-topbar .mdn-cta,
  .mdn-topbar-right > .mdn-cta {
    display: none !important;
  }

  .mdn-hamburger {
    display: flex !important;
  }

  .mdn-mega {
    display: none !important;
  }

  .mdn-search-dropdown {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }
}

@media (min-width: 769px) {
  .mdn-mobile-menu {
    display: none !important;
  }

  .mdn-hamburger {
    display: none !important;
  }
}

/* Hamburger animation */
.mdn-hamburger.mdn-ham-open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mdn-hamburger.mdn-ham-open span:nth-child(2) {
  opacity: 0;
}

.mdn-hamburger.mdn-ham-open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Body scroll lock */
body.mdn-no-scroll {
  overflow: hidden;
  overscroll-behavior: contain;
}

@media (prefers-reduced-motion: reduce) {
  .mdn-header *,
  .mdn-header *::before,
  .mdn-header *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
