/* HEADER RESPONSIVE MOTOR AL DÍA */
.mald-header {
  --mald-bg: #101010;
  --mald-fg: #f8f8f8;
  --mald-muted: #c9c9c9;
  --mald-accent: #ed171f;
  position: relative;
  z-index: 1000;
  width: 100%;
  color: var(--mald-fg);
  background: var(--mald-bg);
  border-bottom: 1px solid #303030;
  font-family: inherit;
}

.mald-header,
.mald-header * { box-sizing: border-box; }

.mald-header__bar {
  width: 100%;
  min-height: 94px;
  padding: 12px clamp(16px, 3vw, 54px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 280px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(16px, 2vw, 36px);
}

.mald-desktop-nav {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(13px, 1.65vw, 30px);
  min-width: 0;
}

.mald-desktop-nav a,
.mald-mobile-nav a {
  position: relative;
  color: var(--mald-fg);
  text-decoration: none;
  font-size: clamp(13px, .95vw, 16px);
  font-weight: 650;
  white-space: nowrap;
  transition: color .18s ease;
}

.mald-desktop-nav a { padding: 12px 0; }

.mald-desktop-nav a:hover,
.mald-mobile-nav a:hover,
.mald-desktop-nav a[aria-current="page"] { color: var(--mald-accent); }

.mald-desktop-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3px;
  height: 3px;
  background: var(--mald-accent);
  border-radius: 2px;
}

.mald-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  width: 100%;
  max-width: 270px;
  text-decoration: none;
}

.mald-logo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 70px;
  object-fit: contain;
  /* El logo rojo funciona sobre la cabecera negra; evita deformarlo. */
}

.mald-header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.8vw, 28px);
}

.mald-icon-link,
.mald-icon-button {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px;
  color: var(--mald-fg);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  text-decoration: none;
}

.mald-icon-link:hover,
.mald-icon-button:hover,
.mald-menu-toggle:hover { color: var(--mald-accent); }

.mald-icon-link svg,
.mald-icon-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mald-menu-toggle {
  display: none;
  justify-self: start;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border: 0;
  color: var(--mald-fg);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
}

.mald-burger {
  display: flex;
  width: 25px;
  flex-direction: column;
  gap: 5px;
}

.mald-burger span {
  width: 25px;
  height: 1.5px;
  display: block;
  background: currentColor;
  transition: transform .2s ease, opacity .2s ease;
}

.mald-menu-toggle[aria-expanded="true"] .mald-burger span:first-child {
  transform: translateY(6.5px) rotate(45deg);
}
.mald-menu-toggle[aria-expanded="true"] .mald-burger span:nth-child(2) {
  opacity: 0;
}
.mald-menu-toggle[aria-expanded="true"] .mald-burger span:last-child {
  transform: translateY(-6.5px) rotate(-45deg);
}

.mald-mobile-nav {
  padding: 8px clamp(18px, 4vw, 36px) 18px;
  border-top: 1px solid #303030;
  background: var(--mald-bg);
}

.mald-mobile-nav a {
  display: block;
  padding: 14px 2px;
  border-bottom: 1px solid #292929;
  font-size: 16px;
}
.mald-mobile-nav a:last-child { border-bottom: 0; }

.mald-search {
  padding: 18px clamp(18px, 4vw, 36px) 20px;
  border-top: 1px solid #303030;
  background: #181818;
}
.mald-search label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}
.mald-search__row {
  display: flex;
  gap: 8px;
  max-width: 760px;
}
.mald-search input {
  min-width: 0;
  flex: 1;
  padding: 12px;
  color: #161616;
  background: #fff;
  border: 1px solid #bcbcbc;
  border-radius: 5px;
  font: inherit;
}
.mald-search button {
  padding: 12px 18px;
  border: 0;
  border-radius: 5px;
  color: #fff;
  background: var(--mald-accent);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.mald-search p {
  margin: 8px 0 0;
  color: var(--mald-muted);
  font-size: 12px;
}
.mald-header [hidden] { display: none !important; }

.mald-header a:focus-visible,
.mald-header button:focus-visible,
.mald-header input:focus-visible {
  outline: 2px solid #ff5258;
  outline-offset: 3px;
}

/* Tableta y móvil: reemplaza enlaces horizontales por el mismo botón MENÚ */
@media (max-width: 980px) {
  .mald-header__bar {
    min-height: 78px;
    grid-template-columns: minmax(0, 1fr) minmax(110px, 210px) minmax(0, 1fr);
    gap: 10px;
    padding: 10px 16px;
  }
  .mald-desktop-nav { display: none; }
  .mald-menu-toggle { display: inline-flex; }
  .mald-logo { grid-column: 2; max-width: 210px; }
  .mald-logo img { max-height: 58px; }
  .mald-header-actions { grid-column: 3; }
}

@media (max-width: 430px) {
  .mald-header__bar {
    min-height: 68px;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    padding: 8px 9px;
    gap: 4px;
  }
  .mald-menu-toggle { gap: 7px; }
  .mald-menu-toggle__label { font-size: 12px; }
  .mald-burger, .mald-burger span { width: 22px; }
  .mald-logo { width: min(36vw, 145px); }
  .mald-logo img { max-height: 44px; }
  .mald-header-actions { gap: 0; }
  .mald-icon-link, .mald-icon-button { width: 34px; height: 36px; padding: 5px; }
  .mald-icon-link svg, .mald-icon-button svg { width: 21px; height: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  .mald-header *, .mald-header *::before, .mald-header *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
