/* Components: botones, cards, chips, búsqueda, etc. */
.nav-link{
  display: inline-block;
  padding: 10px 12px;
  border-radius: 10px;
  color: #fff;
  text-decoration: none;
}
.nav-link:hover{ background: rgba(255,255,255,.14); text-decoration: none; }
.nav-link.is-active{ background: rgba(255,255,255,.22); }

.search{
  display: flex;
  gap: 8px;
  align-items: center;
}
.search input{
  width: min(320px, 32vw);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary{
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover{ background: var(--primary-2); }

.btn-outline{
  background: transparent;
  border-color: var(--border);
}
.btn-outline:hover{ background: var(--surface-2); }

.card{
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
}
.card h3{ margin: 0 0 8px; }
.card p{ margin: 0 0 10px; color: var(--muted); }
.card-link{ color: var(--primary); font-weight: 600; }

.card-wide{ min-height: 160px; position: relative; }
.card-badge{
  display: inline-block;
  font-size: .85rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}

.chip{
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
}
.chip:hover{ background: var(--surface-2); text-decoration: none; }

/* Selector de idioma (UI) */
.lang{
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.lang-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  min-width: 38px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.10);
  color: #fff;
  font-weight: 700;
  font-size: .82rem;
  text-decoration: none;
}
.lang-btn:hover{
  background: rgba(255,255,255,.18);
  text-decoration: none;
}

.lang-help{
  height: 30px;
  width: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.10);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.lang-help:hover{
  background: rgba(255,255,255,.18);
}
/* Dropdown con details/summary */
.nav-list--dropdown{
  align-items: center;
}

.nav-item{ position: relative; }

.nav-dd{
  position: relative;
}

summary.nav-link.is-active{
  background: rgba(255,255,255,.22);
}

.nav-dd > summary{
  list-style: none;
}
.nav-dd > summary::-webkit-details-marker{
  display: none;
}

/* Indicador de dropdown */
.nav-link--dd{
  cursor: pointer;
  position: relative;
  padding-right: 30px;
}
.nav-link--dd::after{
  content: "▾";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: .85rem;
  opacity: .9;
}

/* Panel desplegable */
.nav-panel{
  position: absolute;
  top: 100%;
  margin-top: 8px;
  left: 0;
  min-width: 260px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.18);
  background: #0a2f6f; /* tono más oscuro que la barra */
  box-shadow: 0 18px 34px rgba(0,0,0,.22);
  display: none;
  z-index: 50;
}

.nav-panel::before{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -8px;     /* mismo valor de margin-top */
  height: 8px;
}

.nav-panel a{
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
}
.nav-panel a:hover{
  background: rgba(255,255,255,.14);
}

/* Mostrar panel cuando esté abierto */
.nav-dd[open] .nav-panel{
  display: block;
}

/* Cerrar dropdown si haces clic fuera: no se puede sin JS
   pero esto mantiene buen comportamiento en teclado/móvil. */

  /* Botón hamburguesa */
.nav-toggle{
  display: none; /* solo móvil */
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0;
}

.nav-toggle__bar{
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 99px;
}

/* Móvil: ocultar nav hasta abrir */
@media (max-width: 900px){
  body.nav-open .site-nav{
    display: block;
    background: var(--primary);
    color: #fff;
    border-top: 1px solid rgba(255,255,255,.18);
  }

  body.nav-open .nav-inner{
    padding: 12px 0 14px;
  }

  .nav-list{
    flex-direction: column;
    align-items: stretch;
  }

  .nav-link{
    width: 100%;
  }

  .nav-toggle{ display: inline-flex; }

  /* el menú */
  .site-nav{
    display: none;
  }

  /* cuando está abierto */
  body.nav-open .site-nav{
    display: block;
  }

  /* menú tipo panel */
  .nav-inner{
    padding: 12px 0;
  }

  .nav-panel{
    position: static;
    box-shadow: none;
    margin-top: 8px;
    border-radius: 12px;
  }

    /* Dropdown panel dentro del menú móvil */
  .nav-panel{
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.16);
  }

}

@media (max-width: 900px){
  body.nav-open::before{
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 40;
  }
  .site-header{ position: relative; z-index: 60; }
  body.nav-open .site-nav{ position: relative; z-index: 60; }
}
/* Logo en barra guinda */
.gov-brand{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.gov-brand-logo{
  height: 24px; /* discreto, como barra superior */
  width: auto;
  display: block;
}
.header-top-bar {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  align-items: center;
  gap: 1rem 1.5rem;
  width: 100%;
}

.header-search {
  width: 100%;
  max-width: 340px;
}

.header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-width: 0;
}

.search--header {
  display: flex;
  align-items: stretch;
  width: 100%;
  border: 1px solid #cfcfcf;
  background: #ffffff;
  overflow: hidden;
  min-height: 44px;
}

.search--header input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0.7rem 0.85rem;
  font-size: 1rem;
  background: transparent;
}

.search-btn {
  border: 0;
  background: #f3f4f6;
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  font-size: 1rem;
}

.search-btn:hover {
  background: #e5e7eb;
}

.header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.header-icons,
.header-languages,
.header-accessibility {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: nowrap;
}

.tool-icon,
.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tool-icon:hover,
.lang-btn:hover,
.tool-icon:focus-visible,
.lang-btn:focus-visible {
  transform: translateY(-2px);
}

.tool-icon img,
.lang-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.acc-btn {
  border: 0;
  background: transparent;
  color: #1b396a;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  line-height: 1;
}

.acc-btn:hover,
.acc-btn:focus-visible {
  text-decoration: underline;
}

.acc-btn--icon {
  font-size: 1.35rem;
}

.translate-holder {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

body.high-contrast {
  filter: invert(1) hue-rotate(180deg);
}

body.high-contrast img,
body.high-contrast video,
body.high-contrast iframe {
  filter: invert(1) hue-rotate(180deg);
}

@media (max-width: 1100px) {
  .header-top-bar {
    grid-template-columns: 1fr;
  }

  .header-search {
    max-width: 100%;
  }

  .header-tools {
    justify-content: flex-start;
  }
}

@media (max-width: 700px) {
  .header-tools {
    gap: 0.65rem;
  }

  .header-icons,
  .header-languages,
  .header-accessibility {
    flex-wrap: wrap;
  }
}
.header-icons {
  flex-shrink: 0;
}

.header-languages {
  flex-shrink: 0;
}

.header-accessibility {
  flex-shrink: 0;
}
@media (max-width: 640px) {
  .header-tools {
    gap: 0.5rem;
  }

  .tool-icon,
  .lang-btn {
    width: 2.2rem;
    height: 2.2rem;
  }

  .acc-btn {
    font-size: 0.95rem;
  }
}
body {
  top: 0 !important;
}

.goog-te-banner-frame {
  display: none !important;
}
.site-header .header-top {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
}

.site-header .pleca,
.site-header .header-top-bar {
  width: 100%;
}

.site-header .nav-toggle {
  align-self: flex-end;
}

.site-header .pleca-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-header .pleca-link {
  flex: 0 0 auto;
}

.site-header .header-top-bar {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  align-items: center;
  gap: 1rem 1.5rem;
  width: 100%;
}

.site-header .header-search {
  width: 100%;
  max-width: 340px;
}

.site-header .header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-width: 0;
}

@media (max-width: 1100px) {
  .site-header .header-top-bar {
    grid-template-columns: 1fr;
  }

  .site-header .header-search {
    max-width: 100%;
  }

  .site-header .header-tools {
    justify-content: flex-start;
  }
}
/*Buscador*/
.header-search {
  position: relative;
}

.search-results {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  z-index: 2000;
  width: min(42rem, 95vw);
  max-height: 26rem;
  overflow: auto;
  padding: 0.5rem;
  border: 1px solid #d6d9de;
  border-radius: 0.85rem;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.search-results[hidden] {
  display: none;
}

.search-result {
  display: block;
  padding: 0.85rem 0.9rem;
  border-radius: 0.7rem;
  text-decoration: none;
  color: inherit;
}

.search-result:hover,
.search-result:focus-visible {
  background: #f5f7fb;
}

.search-result + .search-result {
  margin-top: 0.35rem;
}

.search-result__title {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  color: #1b396a;
}

.search-result__meta {
  margin: 0 0 0.3rem;
  font-size: 0.8rem;
  color: #6b7280;
}

.search-result__excerpt {
  margin: 0;
  font-size: 0.92rem;
  color: #1f2937;
}

.search-empty,
.search-loading,
.search-error {
  padding: 0.9rem;
  font-size: 0.92rem;
  color: #374151;
}

.search-result mark {
  background: #fff3a3;
  padding: 0 0.08rem;
}
/*Redes sociales*/
.social-widget {
  position: fixed;
  top: 38%;
  left: 0;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.social-widget__item {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 3.2rem;
  height: 3.2rem;
  padding: 0;
  border-radius: 0 1rem 1rem 0;
  text-decoration: none;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  transition: width 0.25s ease, transform 0.2s ease;
  width: 3.2rem;
}

.social-widget__item:hover,
.social-widget__item:focus-visible {
  width: 13.5rem;
  transform: translateX(0);
}

.social-widget__icon {
  flex: 0 0 3.2rem;
  width: 3.2rem;
  height: 3.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
}

.social-widget__label {
  white-space: nowrap;
  padding: 0 1rem 0 0.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
}

.social-widget__item--facebook {
  background: #1877f2;
}

.social-widget__item--x {
  background: #111111;
}

.social-widget__item--youtube {
  background: #ff0000;
}

.social-widget__item--facebook .social-widget__icon,
.social-widget__item--x .social-widget__icon,
.social-widget__item--youtube .social-widget__icon {
  background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 768px) {
  .social-widget {
    top: auto;
    bottom: 1rem;
    left: 0.75rem;
    right: 0.75rem;
    flex-direction: row;
    justify-content: center;
    gap: 0.6rem;
  }

  .social-widget__item {
    width: 3.2rem;
    border-radius: 999px;
  }

  .social-widget__item:hover,
  .social-widget__item:focus-visible {
    width: 3.2rem;
  }

  .social-widget__label {
    display: none;
  }
}