/* V51: corrige jerarquía del encabezado, anclas y estados vacíos. */
:root {
  --v51-header-offset: calc(var(--v47-header-height, 74px) + 16px);
  scroll-padding-top: var(--v51-header-offset);
}

#siteHeader {
  background: rgba(255, 253, 248, .99);
  isolation: isolate;
}

#siteHeader .nav {
  min-height: 72px;
  flex-wrap: nowrap;
}

#siteHeader .nav-actions {
  min-width: 0;
  max-width: 100%;
  flex-wrap: nowrap;
  gap: clamp(5px, .7vw, 10px);
}

#siteHeader .nav-actions > * {
  flex-shrink: 0;
}

#siteHeader .header-assistant,
#siteHeader #menu {
  width: 46px;
  min-width: 46px;
  min-height: 46px;
}

main > section[id],
#directorio,
#marketplace,
#comunidad,
#accesibilidad {
  scroll-margin-top: var(--v51-header-offset);
}

.v51-auth-notice {
  position: relative;
  z-index: 110;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  width: min(100% - 32px, 1180px);
  margin: 12px auto 0;
  padding: 14px 16px;
  border: 1px solid #e7c58b;
  border-radius: 16px;
  background: #fff7e8;
  color: #573d20;
  box-shadow: 0 8px 22px rgba(79, 47, 37, .08);
  font-size: 14px;
  line-height: 1.5;
}

.v51-auth-notice strong { display: block; margin-bottom: 2px; }
.v51-auth-notice p { margin: 0; }
.v51-auth-notice button {
  flex: 0 0 40px;
  width: 40px;
  min-height: 40px;
  border: 1px solid #e7c58b;
  border-radius: 12px;
  background: #fffdf8;
  color: inherit;
  font-size: 22px;
  cursor: pointer;
}

.v51-market-empty {
  grid-column: 1 / -1;
  display: grid;
  justify-items: start;
  gap: 7px;
  min-height: 190px;
  align-content: center;
  padding: clamp(20px, 4vw, 34px);
  border: 1px dashed #d7c4b2;
  border-radius: 22px;
  background: rgba(255, 253, 248, .92);
  color: var(--mocha, #56382c);
}

.v51-market-empty-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  margin-bottom: 3px;
  border-radius: 15px;
  background: #eaf5f1;
  color: #0f655b;
  font-size: 22px;
}

.v51-market-empty h3 { margin: 0; font-size: clamp(18px, 2vw, 23px); }
.v51-market-empty p { max-width: 58ch; margin: 0; color: var(--muted, #78675d); line-height: 1.55; }

@media (max-width: 960px) {
  :root { --v51-header-offset: calc(var(--v47-header-height, 64px) + 12px); }
  #siteHeader { box-shadow: 0 5px 18px rgba(79, 47, 37, .09); }
  #siteHeader .nav { min-height: 64px; }
  #siteHeader .nav-actions { gap: 7px; }
  #siteHeader #headerAssistant { display: none !important; }
  .v51-auth-notice { margin-top: 8px; padding: 12px; font-size: 13px; }
}

@media (max-width: 620px) {
  .v51-market-empty { min-height: 160px; border-radius: 18px; }
  .v51-market-empty p { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  #siteHeader *, .v51-auth-notice *, .v51-market-empty * { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
