.mag-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  padding: 10px 18px;
  background: rgba(20, 26, 19, 0.86);
  border-radius: 12px;
  color: #e9e4d3;
  backdrop-filter: blur(3px);
  position: relative;
  z-index: 1000;
}

.mag-marca {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
}

.mag-marca img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.5);
  flex-shrink: 0;
}

.mag-marca strong {
  color: #e9e4d3;
  font-size: 15px;
  font-weight: bold;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mag-btn-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid rgba(233, 228, 211, 0.35);
  color: #e9e4d3;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  cursor: pointer;
}

.mag-btn-menu svg {
  width: 24px;
  height: 24px;
}

.mag-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 18px;
  min-width: 230px;
  max-width: min(85vw, 300px);
  background: rgba(20, 26, 19, 0.97);
  border: 1px solid rgba(233, 228, 211, 0.2);
  border-radius: 12px;
  padding: 8px;
  flex-direction: column;
  gap: 4px;
  z-index: 1001;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.mag-menu.abierto {
  display: flex;
}

.mag-menu a {
  color: #d8e3d7;
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  border: 0;
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.mag-menu a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.mag-menu .mag-avatar {
  justify-content: flex-start;
}

.mag-avatar-img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1c231b;
  font-weight: bold;
  font-size: 13px;
  border: 2px solid rgba(212, 175, 55, 0.6);
  flex-shrink: 0;
}

.mag-menu .mag-donar {
  display: block;
  text-align: center;
  justify-content: center;
  margin: 4px 0 0;
  background: #009ee3;
  color: #fff;
  font-weight: bold;
}

.mag-menu .mag-donar:hover {
  background: #008ac7;
  color: #fff;
}

@media (max-width: 640px) {
  .mag-topbar {
    padding: 8px 12px;
  }
}
