/* =========================================================
   APC HEADER GLOBAL — ABOGADAS PERÚ · V5.0.1
========================================================= */

/* Oculta headers anteriores del tema/Elementor SOLO cuando v5 está activo. */
body.apgh5-header-active #site-header,
body.apgh5-header-active header.site-header:not(.apgh5-header),
body.apgh5-header-active #masthead,
body.apgh5-header-active .elementor-location-header,
body.apgh5-header-active .hfe-site-header,
body.apgh5-header-active .ehf-header,
body.apgh5-header-active [data-elementor-type="header"] {
  display: none !important;
}

#ap-global-header-v5,
#ap-global-header-v5 * {
  box-sizing: border-box;
}

#ap-global-header-v5 {
  --apgh5-red: #c82026;
  --apgh5-text: #111111;
  --apgh5-muted: #67676b;
  --apgh5-border: #e7e7e9;
  --apgh5-topbar: #eeeeef;
  --apgh5-max: 1380px;

  width: 100%;
  position: relative;
  z-index: 999999;
  color: var(--apgh5-text);
  font-family: Arial, Helvetica, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

#ap-global-header-v5 a {
  color: inherit;
  text-decoration: none;
}

#ap-global-header-v5 button {
  font: inherit;
  cursor: pointer;
}

#ap-global-header-v5 img,
#ap-global-header-v5 svg {
  display: block;
}

#ap-global-header-v5 .apgh5-shell {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  position: sticky;
  top: 0;
  z-index: 999999;
  background: #ffffff;
  box-shadow: 0 7px 30px rgba(0, 0, 0, 0.07);
}

body.admin-bar #ap-global-header-v5 .apgh5-shell {
  top: 32px;
}

#ap-global-header-v5 .apgh5-container {
  width: min(var(--apgh5-max), calc(100% - 34px));
  margin-inline: auto;
}

/* =========================
   FRANJA SUPERIOR
========================= */
#ap-global-header-v5 .apgh5-topbar {
  background: var(--apgh5-topbar);
  border-bottom: 1px solid #dddddf;
}

#ap-global-header-v5 .apgh5-topbar-inner {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

#ap-global-header-v5 .apgh5-topbar-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #3f3f42;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

#ap-global-header-v5 a.apgh5-topbar-item {
  transition: color .2s ease;
}

#ap-global-header-v5 a.apgh5-topbar-item:hover,
#ap-global-header-v5 a.apgh5-topbar-item:focus-visible {
  color: var(--apgh5-red);
}

#ap-global-header-v5 .apgh5-phone strong {
  font-size: 12.5px;
  letter-spacing: .02em;
}

#ap-global-header-v5 .apgh5-topbar-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  display: grid;
  place-items: center;
  color: #747477;
}

#ap-global-header-v5 .apgh5-topbar-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#ap-global-header-v5 .apgh5-topbar-separator {
  width: 1px;
  height: 16px;
  background: #c8c8cb;
}

/* =========================
   CABECERA BLANCA
========================= */
#ap-global-header-v5 .apgh5-header {
  height: 84px;
  position: relative;
  z-index: 5;
  background: rgba(255, 255, 255, .985);
  border-bottom: 1px solid var(--apgh5-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

#ap-global-header-v5 .apgh5-header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

#ap-global-header-v5 .apgh5-logo {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

#ap-global-header-v5 .apgh5-logo img {
  width: 172px;
  height: auto;
}

/* =========================
   NAVEGACIÓN ESCRITORIO
========================= */
#ap-global-header-v5 .apgh5-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
}

#ap-global-header-v5 .apgh5-nav-list {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 1px;
  list-style: none;
}

#ap-global-header-v5 .apgh5-nav-list > li {
  position: relative;
}

#ap-global-header-v5 .apgh5-nav-link {
  min-height: 44px;
  padding: 11px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--apgh5-text);
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  transition: background-color .18s ease, color .18s ease;
}

#ap-global-header-v5 .apgh5-nav-link:hover,
#ap-global-header-v5 .apgh5-nav-link:focus-visible,
#ap-global-header-v5 .apgh5-specialties.is-open > .apgh5-nav-link {
  background: #f3f3f4;
  color: var(--apgh5-red);
}

#ap-global-header-v5 .apgh5-specialties-trigger svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s ease;
}

#ap-global-header-v5 .apgh5-specialties.is-open .apgh5-specialties-trigger svg {
  transform: rotate(180deg);
}

/* Dropdown simple: sin tarjetas, sin slider. */
#ap-global-header-v5 .apgh5-specialties-menu {
  width: 220px;
  padding: 7px;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 30;
  border: 1px solid #e5e5e7;
  border-radius: 11px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(17, 17, 17, .12);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 7px);
  transition: opacity .17s ease, visibility .17s ease, transform .17s ease;
}

#ap-global-header-v5 .apgh5-specialties.is-open .apgh5-specialties-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

#ap-global-header-v5 .apgh5-specialties-menu a {
  min-height: 42px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  border-radius: 7px;
  color: #252527;
  font-size: 13px;
  font-weight: 500;
  transition: background-color .16s ease, color .16s ease;
}

#ap-global-header-v5 .apgh5-specialties-menu a + a {
  border-top: 1px solid #f0f0f1;
}

#ap-global-header-v5 .apgh5-specialties-menu a:hover,
#ap-global-header-v5 .apgh5-specialties-menu a:focus-visible {
  background: #f5f5f6;
  color: var(--apgh5-red);
}

/* =========================
   GOOGLE REVIEWS
========================= */
#ap-global-header-v5 .apgh5-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

#ap-global-header-v5 .apgh5-google-trust {
  min-width: 174px;
  padding: 7px 10px;
  display: grid;
  grid-template-columns: 32px auto;
  grid-template-areas:
    "mark stars"
    "mark meta"
    "mark verified";
  column-gap: 9px;
  row-gap: 1px;
  align-items: center;
  border: 1px solid #e3e4e7;
  border-radius: 13px;
  background: #ffffff;
  box-shadow: 0 5px 16px rgba(0, 0, 0, .06);
  transition: transform .18s ease, box-shadow .18s ease;
}

#ap-global-header-v5 .apgh5-google-trust:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .10);
}

#ap-global-header-v5 .apgh5-google-mark {
  grid-area: mark;
  width: 30px;
  height: 30px;
}

#ap-global-header-v5 .apgh5-google-stars {
  grid-area: stars;
  color: #f4b400;
  font-size: 11px;
  line-height: 1;
  letter-spacing: .05em;
  white-space: nowrap;
}

#ap-global-header-v5 .apgh5-google-meta {
  grid-area: meta;
  display: flex;
  align-items: baseline;
  gap: 6px;
  line-height: 1.05;
  white-space: nowrap;
}

#ap-global-header-v5 .apgh5-google-meta strong {
  color: #202124;
  font-size: 14px;
}

#ap-global-header-v5 .apgh5-google-meta span {
  color: #5f6368;
  font-size: 10px;
  font-weight: 700;
}

#ap-global-header-v5 .apgh5-google-verified {
  grid-area: verified;
  color: #777b80;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.05;
  white-space: nowrap;
}

/* =========================
   BOTÓN MÓVIL
========================= */
#ap-global-header-v5 .apgh5-menu-button {
  width: 46px;
  height: 46px;
  padding: 0;
  position: relative;
  display: none;
  border: 1px solid #d8d9dc;
  border-radius: 12px;
  background: #ffffff;
}

#ap-global-header-v5 .apgh5-menu-button span,
#ap-global-header-v5 .apgh5-menu-button::before,
#ap-global-header-v5 .apgh5-menu-button::after {
  content: "";
  width: 22px;
  height: 2px;
  position: absolute;
  left: 11px;
  background: var(--apgh5-text);
  transition: opacity .2s ease, top .2s ease, transform .2s ease;
}

#ap-global-header-v5 .apgh5-menu-button span { top: 21px; }
#ap-global-header-v5 .apgh5-menu-button::before { top: 14px; }
#ap-global-header-v5 .apgh5-menu-button::after { top: 28px; }

#ap-global-header-v5 .apgh5-menu-button[aria-expanded="true"] span { opacity: 0; }
#ap-global-header-v5 .apgh5-menu-button[aria-expanded="true"]::before { top: 21px; transform: rotate(45deg); }
#ap-global-header-v5 .apgh5-menu-button[aria-expanded="true"]::after { top: 21px; transform: rotate(-45deg); }

/* =========================
   MENÚ MÓVIL
========================= */
#ap-global-header-v5 .apgh5-mobile-menu {
  display: none;
  max-height: calc(100vh - 120px);
  padding: 14px 18px 24px;
  overflow-y: auto;
  border-top: 1px solid var(--apgh5-border);
  background: #ffffff;
}

#ap-global-header-v5 .apgh5-mobile-menu.is-open {
  display: block;
  animation: apgh5MenuOpen .22s ease both;
}

@keyframes apgh5MenuOpen {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

#ap-global-header-v5 .apgh5-mobile-menu > a,
#ap-global-header-v5 .apgh5-mobile-specialties > summary {
  min-height: 53px;
  padding: 13px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #ededed;
  color: var(--apgh5-text);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.3;
}

#ap-global-header-v5 .apgh5-mobile-specialties > summary {
  cursor: pointer;
  list-style: none;
}

#ap-global-header-v5 .apgh5-mobile-specialties > summary::-webkit-details-marker {
  display: none;
}

#ap-global-header-v5 .apgh5-mobile-specialties[open] > summary {
  color: var(--apgh5-red);
}

#ap-global-header-v5 .apgh5-mobile-specialties > summary span {
  font-size: 21px;
  transition: transform .2s ease;
}

#ap-global-header-v5 .apgh5-mobile-specialties[open] > summary span {
  transform: rotate(45deg);
}

#ap-global-header-v5 .apgh5-mobile-specialties-list {
  padding: 4px 0 9px 14px;
  border-bottom: 1px solid #ededed;
}

#ap-global-header-v5 .apgh5-mobile-specialties-list a {
  min-height: 45px;
  padding: 0 8px 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-left: 2px solid #e2e2e4;
  color: #454548;
  font-size: 14px;
}

#ap-global-header-v5 .apgh5-mobile-specialties-list a + a {
  border-top: 1px solid #f1f1f2;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 1120px) {
  #ap-global-header-v5 .apgh5-nav-link {
    padding-right: 7px;
    padding-left: 7px;
    font-size: 13px;
  }

  #ap-global-header-v5 .apgh5-google-trust {
    min-width: 158px;
  }
}

@media (max-width: 1050px) {
  #ap-global-header-v5 .apgh5-nav {
    display: none;
  }

  #ap-global-header-v5 .apgh5-menu-button {
    display: block;
  }
}

@media (max-width: 782px) {
  body.admin-bar #ap-global-header-v5 .apgh5-shell {
    top: 46px;
  }
}

@media (max-width: 680px) {
  #ap-global-header-v5 .apgh5-container {
    width: calc(100% - 28px);
  }

  #ap-global-header-v5 .apgh5-topbar-inner {
    min-height: 48px;
    justify-content: space-between;
    gap: 8px;
  }

  #ap-global-header-v5 .apgh5-topbar-item {
    font-size: 10.3px;
  }

  #ap-global-header-v5 .apgh5-address {
    min-width: 0;
    flex: 1 1 auto;
    white-space: normal;
  }

  #ap-global-header-v5 .apgh5-phone {
    flex: 0 0 auto;
  }

  #ap-global-header-v5 .apgh5-phone strong {
    font-size: 10.3px;
  }

  #ap-global-header-v5 .apgh5-topbar-separator {
    display: none;
  }

  #ap-global-header-v5 .apgh5-header {
    height: 76px;
  }

  #ap-global-header-v5 .apgh5-logo img {
    width: 130px;
  }

  #ap-global-header-v5 .apgh5-google-trust {
    min-width: 126px;
    padding: 5px 6px;
    grid-template-columns: 24px auto;
    column-gap: 6px;
    border-radius: 10px;
  }

  #ap-global-header-v5 .apgh5-google-mark {
    width: 23px;
    height: 23px;
  }

  #ap-global-header-v5 .apgh5-google-stars { font-size: 9px; }
  #ap-global-header-v5 .apgh5-google-meta { gap: 4px; }
  #ap-global-header-v5 .apgh5-google-meta strong { font-size: 12px; }
  #ap-global-header-v5 .apgh5-google-meta span { font-size: 8px; }
  #ap-global-header-v5 .apgh5-google-verified {
    max-width: 76px;
    overflow: hidden;
    font-size: 7px;
    text-overflow: ellipsis;
  }

  #ap-global-header-v5 .apgh5-menu-button {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
  }

  #ap-global-header-v5 .apgh5-menu-button span,
  #ap-global-header-v5 .apgh5-menu-button::before,
  #ap-global-header-v5 .apgh5-menu-button::after {
    left: 9px;
  }
}

@media (max-width: 430px) {
  #ap-global-header-v5 .apgh5-topbar-inner {
    min-height: 53px;
  }

  #ap-global-header-v5 .apgh5-topbar-item {
    font-size: 9.5px;
    gap: 5px;
  }

  #ap-global-header-v5 .apgh5-phone strong {
    font-size: 9.5px;
  }

  #ap-global-header-v5 .apgh5-address {
    max-width: 220px;
  }

  #ap-global-header-v5 .apgh5-google-trust {
    display: none;
  }
}
