:root {
  --ibc-header-navy: #1e3a44;
  --ibc-header-paper: #f6efe0;
  --ibc-header-gold: #c99a3e;
  --ibc-header-line: rgba(30, 58, 68, .14);
}

.ibc-global-header {
  position: sticky !important;
  top: 0;
  z-index: 1030;
  width: 100%;
  color: var(--ibc-header-navy) !important;
  border: 0 !important;
  border-bottom: 1px solid var(--ibc-header-line) !important;
  background: #f7f8f8 !important;
  box-shadow: 0 2px 8px rgba(20, 42, 50, .07) !important;
}

.ibc-global-header-desktop > .container-fluid {
  width: 100%;
  max-width: none;
  padding: 7px 14px !important;
}

.ibc-global-header-desktop .ibc-global-toolbar {
  min-height: 44px;
  display: grid !important;
  grid-template-columns: 44px minmax(220px, 250px) minmax(80px, 1fr) minmax(210px, 260px) minmax(80px, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.ibc-global-header .ibc-global-logo {
  width: 44px;
  height: 44px;
  padding: 5px !important;
  display: grid !important;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--ibc-header-line);
  border-radius: 10px;
  background: #fff;
}

.ibc-global-header .ibc-global-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ibc-global-header-desktop .ibc-global-logo { grid-column: 1; }

.ibc-global-back {
  position: static !important;
  inset: auto !important;
  z-index: auto !important;
  grid-column: 2;
  width: 100%;
  height: 44px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ibc-header-line);
  border-radius: 10px;
  color: var(--ibc-header-navy) !important;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  text-decoration: none !important;
  transition: border-color .18s ease, background-color .18s ease;
}

.ibc-global-header .nav-link,
.ibc-global-header a:not(.dropdown-item) {
  color: var(--ibc-header-navy) !important;
}

.ibc-global-back:hover {
  border-color: rgba(30, 58, 68, .32);
  background: var(--ibc-header-paper);
}

.ibc-global-primary-nav {
  grid-column: 3;
  min-width: 0;
  overflow: hidden;
}

.ibc-global-context {
  grid-column: 4;
  height: 44px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(30, 58, 68, .11);
  border-radius: 10px;
  color: var(--ibc-header-navy);
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ibc-global-profile-zone {
  grid-column: 6;
  min-width: max-content;
  margin-left: 0 !important;
  gap: 8px;
}

.ibc-global-header-desktop .ibc-global-profile-zone button {
  min-height: 44px;
  border: 1px solid var(--ibc-header-line) !important;
  border-radius: 10px !important;
  color: var(--ibc-header-navy) !important;
  background: #fff !important;
  white-space: nowrap;
}

.ibc-global-header-desktop .ibc-global-profile-zone button span {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.ibc-global-studio-header > .container-xl,
.ibc-global-studio-header > .container-fluid {
  width: 100%;
  max-width: none !important;
  padding: 7px 14px !important;
}

.ibc-global-studio-toolbar {
  min-height: 44px;
  color: var(--ibc-header-navy);
}

.ibc-global-studio-header img.logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ibc-global-studio-toolbar button,
.ibc-global-studio-toolbar a {
  border-radius: 10px !important;
}

.ibc-global-header-mobile {
  min-height: 52px;
  padding: 7px 8px !important;
  color: var(--ibc-header-navy) !important;
}

.ibc-global-header-mobile .ibc-global-logo {
  width: 38px;
  height: 38px;
  padding: 4px !important;
  border-radius: 9px;
}

.ibc-global-header-mobile button {
  width: 38px;
  height: 38px;
  padding: 0 !important;
  border: 1px solid var(--ibc-header-line) !important;
  border-radius: 9px !important;
  color: var(--ibc-header-navy) !important;
  background: #fff !important;
}

.ibc-global-header a:focus-visible,
.ibc-global-header button:focus-visible {
  outline: 3px solid rgba(201, 154, 62, .55) !important;
  outline-offset: 2px;
}

@media (min-width: 768px) and (max-width: 1099px) {
  .ibc-global-header-desktop .ibc-global-toolbar {
    grid-template-columns: 44px 150px minmax(20px, 1fr) minmax(170px, 220px) minmax(20px, 1fr) auto;
    gap: 8px;
  }

  .ibc-global-back { font-size: 0; }
  .ibc-global-back::before { content: '← Volver'; font-size: 12px; }
}

@media (max-width: 767px) {
  .ibc-global-header-desktop { display: none !important; }
  .ibc-global-context { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ibc-global-back { transition: none; }
}