/* V45 - Cabecera única limpia para home pública. No afecta admin. */
:root {
  --v45-max: 1080px;
  --v45-gold: #f0d77a;
  --v45-gold-2: #fff0a8;
  --v45-green: rgba(15, 48, 34, .70);
  --v45-green-2: rgba(8, 28, 21, .82);
  --v45-line: rgba(240, 215, 122, .18);
  --v45-text: #f7f0c9;
  --v45-muted: rgba(247, 240, 201, .72);
  --v45-shadow: 0 14px 42px rgba(0,0,0,.22);
  --v45-search: rgba(255,255,255,.10);
  --v45-search-line: rgba(240,215,122,.20);
  --v45-results: rgba(12, 24, 18, .97);
}

html[data-theme="light"], body.light, body[data-theme="light"] {
  --v45-gold: #8a6a16;
  --v45-gold-2: #60460f;
  --v45-green: rgba(245, 241, 215, .92);
  --v45-green-2: rgba(235, 228, 194, .94);
  --v45-line: rgba(112, 84, 20, .16);
  --v45-text: #2b2412;
  --v45-muted: rgba(43, 36, 18, .66);
  --v45-shadow: 0 12px 34px rgba(86,68,24,.12);
  --v45-search: rgba(255,255,255,.58);
  --v45-search-line: rgba(112, 84, 20, .16);
  --v45-results: rgba(255, 252, 236, .98);
}

body:not(.admin) .v16-topbar,
body:not(.admin) [data-v16-header],
body:not(.admin) .mm-top-v15,
body:not(.admin) [data-mm-header-v15],
body:not(.admin) .mm-header-clean-v14,
body:not(.admin) .mm-header-pro,
body:not(.admin) [data-header-pro-v1],
body:not(.admin) .mm-header-v17,
body:not(.admin) #mmHeaderV17Mount {
  display: none !important;
}

body:not(.admin) .mm-shell,
body:not(.admin) .mm-header-v45,
body:not(.admin) .mm-bottom-nav,
body:not(.admin) .mm-progress {
  max-width: var(--v45-max) !important;
}

body:not(.admin) .mm-shell,
body:not(.admin) .mm-header-v45 {
  width: min(var(--v45-max), calc(100% - 18px)) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.mm-header-v45 {
  position: sticky;
  top: 8px;
  z-index: 90;
  color: var(--v45-text);
  border: 1px solid var(--v45-line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 8% -40%, rgba(255, 230, 135, .16), transparent 36%),
    linear-gradient(135deg, var(--v45-green), var(--v45-green-2));
  box-shadow: var(--v45-shadow);
  backdrop-filter: blur(18px) saturate(1.2);
  overflow: visible;
  margin-top: 8px;
  margin-bottom: 14px;
}

.mm-header-v45__inner {
  min-height: 60px;
  display: grid;
  grid-template-columns: auto minmax(230px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 9px 11px 9px 18px;
}

.mm-header-v45__nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.1vw, 28px);
  white-space: nowrap;
  min-width: 0;
}

.mm-header-v45__nav a {
  color: var(--v45-gold);
  text-decoration: none;
  font-weight: 860;
  font-size: clamp(.88rem, 1.2vw, .98rem);
  letter-spacing: .015em;
  line-height: 1;
  padding: 7px 0;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  text-shadow: 0 1px 0 rgba(0,0,0,.22);
  opacity: .92;
}

.mm-header-v45__nav a:hover,
.mm-header-v45__nav a.is-active {
  color: var(--v45-gold-2);
  opacity: 1;
}

.mm-header-v45__search {
  position: relative;
  justify-self: end;
  width: min(420px, 100%);
  min-width: 220px;
}

.mm-header-v45__searchbox {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--v45-search-line);
  border-radius: 999px;
  background: var(--v45-search);
  padding: 0 11px;
  backdrop-filter: blur(14px);
}

.mm-header-v45__searchbox svg {
  width: 17px;
  height: 17px;
  color: var(--v45-muted);
  flex: 0 0 auto;
}

.mm-header-v45__searchbox input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--v45-text);
  font: inherit;
  font-weight: 700;
}

.mm-header-v45__searchbox input::placeholder { color: var(--v45-muted); }

.mm-header-v45__clear {
  display: none;
  border: 0;
  background: transparent;
  color: var(--v45-gold);
  width: 22px;
  height: 22px;
  font-size: 19px;
  cursor: pointer;
}
.mm-header-v45__clear.is-visible { display: grid; place-items: center; }

.mm-header-v45__theme {
  border: 0;
  background: transparent;
  color: var(--v45-gold);
  font-weight: 860;
  font-size: .88rem;
  padding: 6px 0;
  cursor: pointer;
  white-space: nowrap;
}

.mm-header-v45__theme:hover { color: var(--v45-gold-2); }

.mm-header-v45__results {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: none;
  width: min(560px, calc(100vw - 28px));
  max-height: min(70vh, 620px);
  overflow: auto;
  border-radius: 20px;
  border: 1px solid var(--v45-line);
  background: var(--v45-results);
  box-shadow: 0 28px 90px rgba(0,0,0,.38);
  padding: 9px;
  backdrop-filter: blur(18px);
}
.mm-header-v45__results.is-open { display: block; }

.mm-header-v45__results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--v45-muted);
  font-size: .8rem;
  font-weight: 820;
  padding: 8px 10px;
}

.mm-header-v45__result {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 10px;
  align-items: center;
  color: var(--v45-text);
  text-decoration: none;
  border-radius: 15px;
  padding: 8px;
}
.mm-header-v45__result:hover,
.mm-header-v45__result.is-selected { background: rgba(240, 215, 122, .10); }

.mm-header-v45__poster {
  width: 48px;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
  border: 1px solid var(--v45-line);
}
.mm-header-v45__poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mm-header-v45__result-title { font-weight: 900; line-height: 1.12; margin-bottom: 4px; }
.mm-header-v45__result-desc { color: var(--v45-muted); font-size: .8rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mm-header-v45__badge { color: var(--v45-gold); border: 1px solid var(--v45-line); border-radius: 999px; padding: 5px 7px; font-size: .7rem; font-weight: 900; }
.mm-header-v45__empty { color: var(--v45-muted); padding: 16px 10px; font-weight: 800; }

@media (max-width: 760px) {
  .mm-header-v45 { width: min(100% - 10px, var(--v45-max)) !important; border-radius: 20px; top: 5px; }
  .mm-header-v45__inner { grid-template-columns: 1fr auto; gap: 8px; padding: 9px; }
  .mm-header-v45__nav { grid-column: 1 / -1; justify-content: space-around; order: 2; width: 100%; gap: 8px; }
  .mm-header-v45__nav a { font-size: .84rem; }
  .mm-header-v45__search { justify-self: stretch; min-width: 0; width: 100%; }
  .mm-header-v45__theme { justify-self: end; }
  .mm-header-v45__results { position: fixed; top: 104px; left: 8px; right: 8px; width: auto; }
  body:not(.admin) .mm-shell { width: min(100% - 10px, var(--v45-max)) !important; }
}
