/**
 * Fisco Integra — navegación global (D1–D7).
 * Breakpoint panel/acordeón: max-width 1023px.
 */

:root {
  --fi-header-h: 96px;
  --fi-header-h-compact: 60px;
  --fi-nav-bp: 1024px;
  --fi-cta-h: 48px;
  --fi-radius: 14px;
  --fi-focus: #b6a07a;
}

@media (min-width: 1024px) {
  :root {
    --fi-header-h: 100px;
  }
}

/* —— Screen reader —— */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background: var(--fi-marfil);
  clip: auto !important;
  clip-path: none;
  color: var(--fi-azul-noche);
  display: block;
  font-size: 0.875rem;
  height: auto;
  left: 0.5rem;
  line-height: normal;
  padding: 0.75rem 1rem;
  text-decoration: none;
  top: 0.5rem;
  width: auto;
  z-index: 100000;
}

.skip-link:focus {
  z-index: 100001;
}

/* —— Focus / hover: color champán, sin recuadro —— */
.fi-site-header a:focus-visible,
.fi-site-footer a:focus-visible,
.fi-site-header a:hover,
.fi-site-footer a:hover {
  outline: none;
  color: var(--fi-champan) !important;
  background: transparent !important;
  box-shadow: none !important;
}

.fi-nav-toggle:focus-visible,
.fi-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 1px rgba(182, 160, 122, 0.55);
}

/* —— Header sticky —— */
.fi-site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--fi-azul-noche);
  color: var(--fi-marfil);
  transition: box-shadow 0.25s ease;
  box-sizing: border-box;
}

.fi-site-header.is-scrolled {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
}

.fi-site-header.is-scrolled .fi-header-inner {
  padding-block: 0.22rem;
}

.fi-site-header.is-scrolled .fi-logo .custom-logo {
  max-height: 46px !important;
}

@media (prefers-reduced-motion: reduce) {
  .fi-site-header,
  .fi-site-header .fi-logo .custom-logo,
  .fi-nav-panel,
  .fi-submenu,
  .fi-nav-chevron,
  .fi-nav-toggle-bar {
    transition: none !important;
  }
}

.fi-header-inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.4rem 0;
  height: 100%;
  min-height: inherit;
  box-sizing: border-box;
}

/* —— Logo —— */
.fi-logo {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(260px, calc(100vw - 14rem));
  align-self: center;
}

.fi-logo .custom-logo-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  line-height: 0;
  max-width: 100%;
}

.fi-site-header .fi-logo .custom-logo {
  display: block;
  width: auto;
  height: auto;
  max-height: 60px !important;
  max-width: min(240px, 100%) !important;
  object-fit: contain;
  transition: max-height 0.25s ease;
}

/* Desktop: do not flex-shrink the logo under the nav — keep max-height effective */
@media (min-width: 1024px) {
  .fi-logo {
    flex: 0 0 auto;
    max-width: 260px;
    align-self: center;
  }

  .fi-site-header .fi-logo .custom-logo {
    max-height: 60px !important;
    max-width: 240px !important;
  }
}

.fi-brand-mark {
  font-family: var(--fi-font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--fi-marfil);
  text-decoration: none;
}

/* Header: logo + CTA + hamburger only — free vertical space for logo */
.fi-site-header .fi-brand-line {
  display: none !important;
}

.fi-brand-line {
  margin: 0;
  font-family: var(--fi-font-body);
  font-size: 0.65rem;
  line-height: 1.3;
  letter-spacing: 0.02em;
  color: var(--fi-azul-elefante);
  opacity: 0.95;
}

/* —— CTA —— */
.fi-btn--cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--fi-cta-h);
  padding: 0.65rem 1.35rem;
  border-radius: var(--fi-radius);
  border: 1px solid var(--fi-champan);
  background: var(--fi-champan);
  color: var(--fi-azul-noche) !important;
  font-family: var(--fi-font-display);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.fi-btn--cta:hover {
  background: #c4b08c;
}

.fi-header-cta {
  margin: 0;
  flex-shrink: 0;
}

.fi-header-cta--bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Enlace compacto en barra PC; en móvil va en el hamburguesa. */
.fi-header-meet {
  font-family: var(--fi-font-body);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--fi-champan);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.fi-header-meet:hover,
.fi-header-meet:focus-visible {
  color: var(--fi-marfil);
}

.fi-header-cta--panel {
  display: none;
}

/* No aprieta la barra: oculto en PC; visible en panel móvil. */
@media (min-width: 1024px) {
  .fi-menu-primary > .fi-nav-meet {
    display: none !important;
  }
}

@media (max-width: 1023px) {
  .fi-header-meet {
    display: none;
  }
}

/* —— Hamburger —— */
.fi-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(143, 162, 172, 0.45);
  border-radius: 8px;
  background: transparent;
  color: var(--fi-marfil);
  cursor: pointer;
  flex-shrink: 0;
}

.fi-nav-toggle-box {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 20px;
  height: 14px;
}

.fi-nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.fi-site-header.is-nav-open .fi-nav-toggle-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.fi-site-header.is-nav-open .fi-nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.fi-site-header.is-nav-open .fi-nav-toggle-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* —— Desktop nav —— */
.fi-nav-panel {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.fi-nav {
  min-width: 0;
}

.fi-menu-primary {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.15rem 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.fi-menu-primary > li {
  position: relative;
}

.fi-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.65rem;
  font-family: var(--fi-font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fi-marfil);
  text-decoration: none;
  border-radius: 6px;
  white-space: nowrap;
}

.fi-nav-link:hover,
.fi-nav-link[aria-expanded="true"],
.fi-menu-primary > li.current-menu-item > .fi-nav-link,
.fi-menu-primary > li.current-menu-ancestor > .fi-nav-link {
  color: var(--fi-champan);
}

.fi-nav-chevron {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0.75;
  transition: transform 0.2s ease;
}

.fi-nav-link[aria-expanded="true"] .fi-nav-chevron {
  transform: rotate(225deg) translateY(-1px);
}

/* —— Dropdowns (desktop) —— */
.fi-submenu {
  list-style: none;
  margin: 0;
  padding: 0.5rem;
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 14rem;
  background: #1a2732;
  border: 1px solid rgba(143, 162, 172, 0.25);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 1100;
}

.fi-has-children.is-open > .fi-submenu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.fi-submenu .fi-nav-link {
  display: block;
  width: 100%;
  padding: 0.6rem 0.75rem;
  white-space: normal;
  border-radius: 6px;
}

.fi-submenu .fi-nav-link:hover,
.fi-submenu .fi-nav-link:focus-visible {
  background: rgba(143, 162, 172, 0.12);
}

/* —— Megamenu Servicios —— */
.fi-megamenu {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  width: min(36rem, calc(100vw - 2rem));
  left: 50%;
  transform: translate(-50%, 4px);
  padding: 0.75rem;
}

.fi-has-megamenu.is-open > .fi-megamenu {
  transform: translate(-50%, 0);
}

.fi-mega-card {
  display: flex !important;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem !important;
  white-space: normal;
}

.fi-mega-icon {
  flex: 0 0 1.5rem;
  width: 1.5rem;
  height: 1.5rem;
  color: var(--fi-champan);
  margin-top: 0.1rem;
}

.fi-mega-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.fi-mega-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.fi-mega-title {
  font-family: var(--fi-font-display);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--fi-marfil);
  line-height: 1.25;
}

.fi-mega-desc {
  font-family: var(--fi-font-body);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--fi-azul-elefante);
}

.fi-mega-card:hover .fi-mega-title,
.fi-mega-card:focus-visible .fi-mega-title {
  color: var(--fi-champan);
}

/* —— Tablet / mobile panel (≤1023px) —— */
@media (max-width: 1023px) {
  /* Use nearly full viewport so logo can grow without horizontal overflow */
  .fi-site-header .fi-header-inner.fi-wrap {
    width: min(1120px, calc(100vw - 0.75rem));
    gap: 0.4rem 0.5rem;
  }

  .fi-nav-toggle {
    display: inline-flex;
    order: 3;
  }

  .fi-header-cta--bar {
    order: 2;
    margin-left: auto;
  }

  .fi-header-cta--bar .fi-btn--cta {
    min-height: 48px;
    padding-inline: 0.65rem;
    font-size: 0.8rem;
  }

  .fi-logo {
    order: 1;
    flex: 0 1 auto;
    min-width: 0;
    max-width: min(240px, calc(100vw - 4.5rem));
    align-self: center;
    margin-right: auto;
  }

  .fi-logo .custom-logo-link {
    align-self: flex-start;
  }

  .fi-site-header .fi-logo .custom-logo {
    max-height: 52px !important;
    max-width: min(220px, 100%) !important;
    margin-left: 0 !important;
  }

  .fi-nav-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    max-height: min(75vh, calc(100dvh - var(--fi-header-h-compact)));
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #1a2732;
    border-top: 1px solid rgba(143, 162, 172, 0.2);
    padding: 0.5rem 0 1rem;
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.25);
  }

  .fi-site-header.is-nav-open .fi-nav-panel {
    display: flex;
  }

  .fi-nav {
    width: 100%;
  }

  .fi-menu-primary {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0 4vw;
  }

  .fi-menu-primary > li {
    border-bottom: 1px solid rgba(143, 162, 172, 0.15);
  }

  .fi-nav-link {
    width: 100%;
    justify-content: space-between;
    padding: 0.9rem 0.25rem;
    white-space: normal;
  }

  .fi-submenu {
    position: static;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    display: none;
    width: 100%;
    min-width: 0;
    box-shadow: none;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0 0 0.5rem 0.75rem;
  }

  .fi-has-children.is-open > .fi-submenu {
    display: block;
  }

  .fi-megamenu {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 100%;
    left: auto;
    transform: none;
    padding: 0 0 0.5rem 0.5rem;
  }

  .fi-has-megamenu.is-open > .fi-megamenu {
    transform: none;
  }

  .fi-mega-card {
    padding: 0.65rem 0.25rem !important;
  }

  .fi-header-cta--panel {
    display: block;
    padding: 1rem 4vw 0.25rem;
  }

  .fi-header-cta--panel .fi-btn--cta {
    width: 100%;
  }

}

@media (max-width: 420px) {
  .fi-header-cta--bar .fi-btn--cta {
    padding-inline: 0.5rem;
    font-size: 0.75rem;
  }

  .fi-logo {
    max-width: min(320px, calc(100vw - 11rem));
  }
}

/* —— Body lock when mobile nav open —— */
body.fi-nav-locked {
  overflow: hidden;
}

/* —— Footer —— */
.fi-site-footer {
  background: var(--fi-azul-noche);
  color: var(--fi-marfil);
  margin-top: 0;
}

.fi-footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  padding: 2.75rem 0 2rem;
}

.fi-footer-brand .custom-logo {
  max-height: 72px;
  width: auto;
  margin-bottom: 0.85rem;
}

.fi-footer-name,
.fi-footer-brand .fi-brand-mark {
  margin: 0 0 0.35rem;
  font-family: var(--fi-font-display);
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 0.95rem;
}

.fi-footer-brand p {
  margin: 0 0 0.75rem;
  max-width: 36rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: rgba(245, 242, 236, 0.88);
}

.fi-footer-brand .fi-brand-line {
  color: var(--fi-azul-elefante);
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

.fi-footer-tagline {
  color: var(--fi-marfil) !important;
}

.fi-menu-footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.fi-menu-footer a {
  display: inline-block;
  padding: 0.45rem 0;
  font-size: 0.92rem;
  text-decoration: none;
  color: var(--fi-plata, #e4ebef);
  border-bottom: 1px solid rgba(197, 210, 216, 0.12);
}

.fi-menu-footer a:hover,
.fi-footer-legal a:hover {
  color: var(--fi-champan);
}

.fi-footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1.5rem;
  border-top: 1px solid rgba(143, 162, 172, 0.25);
  padding-top: 1.15rem;
}

.fi-footer-legal__links {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem;
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: rgba(197, 210, 216, 0.78);
}

.fi-footer-legal__links a {
  color: rgba(197, 210, 216, 0.78);
  text-decoration: none;
  transition: color 0.2s ease;
}

.fi-footer-legal__links a:hover,
.fi-footer-legal__links a:focus-visible {
  color: var(--fi-champan);
}

.fi-footer-sep {
  margin: 0 0.35rem;
  opacity: 0.55;
}

.fi-footer-credit {
  margin: 0;
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.4;
  text-align: right;
  color: rgba(197, 210, 216, 0.62);
  white-space: nowrap;
}

.fi-footer-credit__copy {
  color: rgba(197, 210, 216, 0.62);
}

.fi-footer-credit__label {
  margin-right: 0.28rem;
}

.fi-footer-credit__brand {
  color: rgba(182, 160, 122, 0.88);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-bottom: 1px solid rgba(182, 160, 122, 0.28);
  padding-bottom: 0.05rem;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.fi-footer-credit__brand:hover,
.fi-footer-credit__brand:focus-visible {
  color: var(--fi-champan);
  border-bottom-color: rgba(182, 160, 122, 0.65);
}

@media (max-width: 599px) {
  .fi-footer-legal {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .fi-footer-credit {
    margin-left: 0;
    text-align: right;
    padding-top: 0.15rem;
    border-top: 1px solid rgba(143, 162, 172, 0.12);
    padding-top: 0.75rem;
  }
}

@media (min-width: 768px) {
  .fi-footer-inner {
    grid-template-columns: 1.2fr 1fr 0.95fr;
    align-items: start;
  }

  .fi-footer-legal {
    grid-column: 1 / -1;
  }
}
