/**
 * Fisco Integra — capa visual premium (WPCode CSS).
 * Identidad: #8FA2AC #202F3B #F5F2EC #263A48 #B6A07A
 */

:root {
  --fi-radius: 14px;
  --fi-radius-sm: 10px;
  --fi-gold-glow: 0 10px 40px rgba(182, 160, 122, 0.28);
  --fi-depth: 0 18px 50px rgba(32, 47, 59, 0.18);
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(1200px 600px at 8% -10%, rgba(182, 160, 122, 0.09), transparent 55%),
    var(--fi-marfil);
}

.fi-wrap {
  width: min(1180px, 92vw);
}

/* —— Logo: RGBA con alpha real (sin lienzo negro). Footer conserva screen legacy. —— */
.fi-site-header .fi-logo .custom-logo {
  mix-blend-mode: normal;
  filter: contrast(1.06) brightness(1.08) saturate(1.02);
}

.fi-site-footer .custom-logo {
  mix-blend-mode: screen;
  filter: contrast(1.12) brightness(1.18) saturate(0.92);
}

/* —— Top bar —— */
.fi-topbar {
  background: linear-gradient(90deg, #1a2732 0%, #202f3b 50%, #1a2732 100%);
  border-bottom: 1px solid rgba(197, 210, 216, 0.22);
  color: var(--fi-azul-elefante);
  overflow: hidden;
  max-width: 100%;
  max-height: 36px;
  transition: max-height 0.35s ease, opacity 0.35s ease, border 0.35s ease;
}

.fi-topbar-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  min-height: 34px;
}

.fi-topbar p {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
}

.fi-topbar-motto {
  color: var(--fi-champan);
}

.fi-topbar-rail {
  display: none;
}

/*
 * Track en absolute: width:max-content + translateX del marquee NO debe
 * entrar al scrollWidth del documento (bug típico iOS / WebKit).
 */
.fi-topbar-rail-track {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 2.5rem;
  height: 100%;
  width: max-content;
  max-width: none;
  padding-left: 4vw;
  color: var(--fi-champan);
  font-family: var(--fi-font-display);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  animation: fi-marquee 28s linear infinite;
  will-change: transform;
  pointer-events: none;
}

.fi-site-header.is-scrolled .fi-topbar {
  max-height: 0;
  opacity: 0;
  border-bottom-width: 0;
}

@media (max-width: 899px) {
  .fi-topbar {
    max-height: 40px;
    background: rgba(14, 22, 29, 0.92);
    border-bottom: 1px solid rgba(182, 160, 122, 0.32);
    backdrop-filter: blur(12px);
  }

  .fi-topbar-inner--static {
    display: none;
  }

  .fi-topbar-rail {
    display: block;
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 40px;
    overflow: hidden;
    contain: paint;
  }

  .fi-site-header.is-scrolled .fi-topbar {
    max-height: 40px;
    opacity: 1;
    border-bottom-width: 1px;
  }

  .fi-site-header {
    overflow-x: clip;
    max-width: 100%;
  }
}

@media (min-width: 900px) {
  .fi-topbar-rail {
    display: none !important;
  }
}

/* —— Header glass —— */
.fi-site-header {
  background: linear-gradient(180deg, rgba(26, 39, 50, 0.94) 0%, rgba(32, 47, 59, 0.88) 100%);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  height: auto;
  min-height: 0;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.fi-site-header.is-scrolled {
  height: auto;
  min-height: 0;
  background: rgba(26, 39, 50, 0.92);
}

.fi-header-goldline {
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, #b6a07a 18%, #e8d7b0 50%, #b6a07a 82%, transparent);
  opacity: 0.85;
}

/* Padding reducido para dar altura al logo sin crecer el bloque cintilla→Hero */
.fi-header-inner {
  padding: 0.28rem 0;
}

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

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

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

/* Nav underline gold */
.fi-menu-primary > li > .fi-nav-link {
  position: relative;
}

.fi-menu-primary > li > .fi-nav-link::after {
  content: "";
  position: absolute;
  left: 0.65rem;
  right: 0.65rem;
  bottom: 0.28rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--fi-champan), transparent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.28s ease;
}

.fi-menu-primary > li > .fi-nav-link:hover::after,
.fi-menu-primary > li.current-menu-item > .fi-nav-link::after,
.fi-menu-primary > li.current-menu-ancestor > .fi-nav-link::after,
.fi-nav-link[aria-expanded="true"]::after {
  transform: scaleX(1);
}

.fi-megamenu,
.fi-submenu {
  background: rgba(22, 33, 43, 0.96);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(182, 160, 122, 0.28);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(245, 242, 236, 0.04) inset;
}

.fi-mega-card:hover {
  background: linear-gradient(180deg, rgba(182, 160, 122, 0.14), rgba(182, 160, 122, 0.04));
}

.fi-mega-icon {
  width: 2.2rem;
  height: 2.2rem;
  padding: 0.35rem;
  border-radius: 8px;
  background: rgba(182, 160, 122, 0.12);
  border: 1px solid rgba(182, 160, 122, 0.28);
  box-shadow: 0 0 16px rgba(182, 160, 122, 0.12);
}

/* —— Buttons metallic —— */
.fi-btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--fi-radius-sm);
  letter-spacing: 0.02em;
  transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}

.fi-btn--cta,
.fi-btn:not(.fi-btn--ghost):not(.fi-btn--ghost-light) {
  background: linear-gradient(180deg, #dcc9a3 0%, #b6a07a 48%, #9a825c 100%);
  border-color: #c4b08a;
  color: #1a2732 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 8px 22px rgba(182, 160, 122, 0.32);
}

.fi-btn--cta::before,
.fi-btn:not(.fi-btn--ghost):not(.fi-btn--ghost-light)::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.42) 48%, transparent 66%);
  transform: translateX(-120%);
  animation: fi-btn-shine 3.4s ease-in-out infinite;
  z-index: 0;
}

.fi-btn--cta:hover,
.fi-btn:not(.fi-btn--ghost):not(.fi-btn--ghost-light):hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 14px 28px rgba(182, 160, 122, 0.4);
}

.fi-btn > * {
  position: relative;
  z-index: 1;
}

.fi-btn--ghost,
.fi-btn--ghost-light {
  background: rgba(245, 242, 236, 0.04);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px rgba(182, 160, 122, 0.35);
}

.fi-btn--ghost-light:hover,
.fi-btn--ghost:hover {
  background: rgba(182, 160, 122, 0.12);
  transform: translateY(-2px);
}

/* —— Grain / atmosphere —— */
.fi-grain {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.fi-section-atmosphere {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--fi-atmosphere);
  background-size: cover;
  background-position: center;
  opacity: 0.08;
  filter: saturate(0.45);
  transform: translate3d(0, calc(var(--fi-hero, 0) * -18px), 0);
  mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
}

.fi-section-mist {
  position: absolute;
  inset: auto 0 0 0;
  height: 40%;
  z-index: 0;
  background: radial-gradient(70% 80% at 80% 100%, rgba(182, 160, 122, 0.12), transparent 70%);
  pointer-events: none;
}

.fi-tone-dark {
  background:
    radial-gradient(900px 420px at 90% 0%, rgba(182, 160, 122, 0.12), transparent 50%),
    linear-gradient(180deg, #1c2a36 0%, #202f3b 40%, #182430 100%);
}

.fi-tone-light {
  background:
    radial-gradient(800px 380px at 0% 0%, rgba(182, 160, 122, 0.1), transparent 55%),
    var(--fi-marfil);
}

.fi-section > .fi-wrap,
.fi-section > .fi-hero-layout {
  position: relative;
  z-index: 3;
}

/* —— Hero living: sin caja de vidrio, sin orbes genéricos —— */
.fi-hero {
  min-height: min(64vh, 680px);
  max-height: 720px;
}

.fi-hero-kicker {
  color: var(--fi-muted, #5a6f7a);
}

.fi-hero-panel {
  padding: 0;
  max-width: 38rem;
  background: none;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  border-radius: 0;
}

.fi-hero h1 {
  text-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.fi-hero .fi-brand-line {
  display: inline-block;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(182, 160, 122, 0.5);
}

.fi-header-goldline {
  transform: scaleX(calc(0.35 + var(--fi-p, 0) * 0.65));
  transform-origin: center;
}

@keyframes fi-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes fi-btn-shine {
  0%, 55% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

@keyframes fi-icon-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(182, 160, 122, 0.16); }
  50% { box-shadow: 0 0 22px 2px rgba(182, 160, 122, 0.34); }
}

/* —— Media frames —— */
.fi-media-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--fi-radius);
  box-shadow: var(--fi-depth), 0 0 0 1px rgba(182, 160, 122, 0.22);
}

.fi-media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(245, 242, 236, 0.12), transparent 28%, transparent 72%, rgba(32, 47, 59, 0.18));
  mix-blend-mode: soft-light;
}

.fi-media-frame img {
  transform: translate3d(0, calc(var(--fi-shift, 0) * 1px), 0) scale(1.08);
  will-change: transform;
}

/* —— Cards / quotes / values —— */
.fi-service-card,
.fi-valor,
.fi-modalidad,
.fi-teaser,
.fi-quienes-panel,
.fi-solucion-copy,
.fi-form-notice {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
}

.fi-form-notice--ok {
  background: rgba(143, 162, 172, 0.22);
  border-left: 2px solid var(--fi-champan);
  color: var(--fi-azul-noche);
}

.fi-form-notice--err {
  background: rgba(180, 60, 60, 0.1);
  border-left: 2px solid #a04848;
  color: #5a2a2a;
}

.fi-contacto-form,
.fi-pull-quote {
  border-radius: var(--fi-radius);
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.fi-service-card {
  background:
    linear-gradient(180deg, rgba(245, 242, 236, 0.05), transparent 30%),
    rgba(28, 42, 54, 0.72);
  border: 1px solid rgba(182, 160, 122, 0.28);
  box-shadow: inset 0 1px 0 rgba(245, 242, 236, 0.08), 0 16px 40px rgba(0, 0, 0, 0.16);
}

.fi-service-card:hover,
.fi-valor:hover,
.fi-modalidad:hover,
.fi-teaser:hover {
  transform: translateY(-6px);
  box-shadow: var(--fi-gold-glow), 0 22px 50px rgba(0, 0, 0, 0.22);
  border-color: rgba(182, 160, 122, 0.55);
}

.fi-servicios-grid,
.fi-valores {
  perspective: 1100px;
}

[data-fi-tilt] {
  transform-style: preserve-3d;
}

.fi-service-card--featured {
  background:
    radial-gradient(80% 80% at 100% 0%, rgba(182, 160, 122, 0.18), transparent 55%),
    rgba(22, 33, 43, 0.9);
}

.fi-service-icon,
.fi-valor-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(232, 215, 176, 0.2), rgba(182, 160, 122, 0.06));
  border: 1px solid rgba(182, 160, 122, 0.4);
  animation: fi-icon-glow 4.5s ease-in-out infinite;
}

.fi-service-icon svg,
.fi-valor-icon svg {
  width: 26px;
  height: 26px;
}

.fi-pull-quote {
  position: relative;
  box-shadow: var(--fi-depth);
}

.fi-pull-quote::before {
  content: "“";
  position: absolute;
  top: 0.15rem;
  right: 1.1rem;
  font-family: var(--fi-font-display);
  font-size: 4rem;
  line-height: 1;
  color: rgba(182, 160, 122, 0.35);
}

.fi-valores {
  gap: 1rem;
  background: transparent;
  border: 0;
}

.fi-valor {
  border: 1px solid rgba(182, 160, 122, 0.22);
  background: linear-gradient(180deg, rgba(245, 242, 236, 0.04), rgba(22, 33, 43, 0.55));
  box-shadow: inset 0 1px 0 rgba(245, 242, 236, 0.06);
}

.fi-solucion-copy {
  border-radius: var(--fi-radius);
  box-shadow: var(--fi-depth);
}

.fi-modalidad {
  border-left: 0;
  border: 1px solid rgba(182, 160, 122, 0.28);
  box-shadow: var(--fi-depth);
  background:
    linear-gradient(180deg, #fff, #f7f4ee);
}

.fi-modalidad-mark {
  color: var(--fi-champan);
  font-size: 0.95rem;
}

.fi-teaser {
  padding: 0.35rem 0.35rem 1.15rem;
  background: linear-gradient(180deg, rgba(245, 242, 236, 0.05), rgba(22, 33, 43, 0.4));
  border: 1px solid rgba(182, 160, 122, 0.22);
}

.fi-teaser-media {
  border-radius: 12px;
}

.fi-form-notice {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
}

.fi-form-notice--ok {
  background: rgba(143, 162, 172, 0.22);
  border-left: 2px solid var(--fi-champan);
  color: var(--fi-azul-noche);
}

.fi-form-notice--err {
  background: rgba(180, 60, 60, 0.1);
  border-left: 2px solid #a04848;
  color: #5a2a2a;
}

.fi-contacto-form {
  box-shadow:
    0 28px 70px rgba(32, 47, 59, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.fi-form input:focus,
.fi-form select:focus,
.fi-form textarea:focus {
  box-shadow: 0 0 0 4px rgba(182, 160, 122, 0.18);
}

/* —— Reveal bidireccional (sube y baja) —— */
[data-fi-reveal] {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: no-preference) {
  [data-fi-reveal] {
    opacity: calc(0.18 + (var(--fi-vis, 0) * 0.82));
    transform: translate3d(0, calc((1 - var(--fi-vis, 0)) * 36px), 0);
    filter: saturate(calc(0.7 + var(--fi-vis, 0) * 0.3));
    will-change: transform, opacity;
  }

  [data-fi-reveal][data-fi-tilt] {
    transform: none;
  }
}

/* —— Footer —— */
.fi-site-footer {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(700px 280px at 80% 0%, rgba(182, 160, 122, 0.16), transparent 60%),
    #161f28;
}

.fi-footer-glow {
  position: absolute;
  inset: 0;
  background-image: var(--fi-atmosphere);
  background-size: cover;
  opacity: 0.12;
  pointer-events: none;
}

.fi-footer-inner {
  position: relative;
  z-index: 1;
  grid-template-columns: 1.25fr 1fr 0.95fr;
  padding: 3.5rem 0 2rem;
  gap: 2rem 2.5rem;
}

.fi-site-footer .custom-logo {
  max-height: 76px;
}

.fi-footer-kicker {
  margin: 0 0 0.85rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fi-champan);
  font-weight: 600;
}

.fi-footer-media {
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 1rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.fi-footer-media img {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.fi-footer-nav .fi-menu-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.fi-menu-footer a:hover {
  color: var(--fi-champan);
  border-bottom-color: rgba(182, 160, 122, 0.45);
}

.fi-footer-aside-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.fi-footer-legal {
  grid-column: 1 / -1;
  border-top-color: rgba(182, 160, 122, 0.22);
}

@media (max-width: 899px) {
  .fi-footer-inner {
    grid-template-columns: 1fr;
  }

  .fi-hero {
    min-height: min(72svh, 600px);
    max-height: 640px;
  }

  .fi-hero-layout {
    align-items: start !important;
    padding-top: 0.85rem !important;
  }

  .fi-hero-panel {
    max-width: min(17.5rem, 62%);
    padding: 0;
    justify-content: flex-start !important;
  }

  .fi-hero .fi-brand-line,
  .fi-hero-kicker {
    display: none !important;
  }

  .fi-hero-rail {
    display: none !important;
  }

  .fi-hero-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
    margin-top: 1rem !important;
  }

  .fi-hero-actions .fi-btn {
    min-height: 44px;
    padding: 0.55rem 1.1rem;
    font-size: 0.88rem;
  }

  .fi-hero-actions .fi-btn--ghost-light {
    background: transparent;
    border-width: 1px;
    box-shadow: none;
    padding-inline: 0.15rem;
    min-height: auto;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 0.2em;
    border-color: transparent;
  }

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

@media (max-width: 480px) {
  .fi-header-cta--bar {
    display: none;
  }

  .fi-logo {
    max-width: calc(100vw - 4.25rem);
    flex: 0 1 auto;
    align-self: center;
    margin-right: auto;
  }

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

  /* Header logo: tamaño móvil, pegado a la izquierda */
  .fi-site-header .fi-header-inner {
    min-height: 3.75rem;
    padding-block: 0.4rem;
    align-items: center;
  }

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

  /* Footer logo: −15%, centered ink, tighter top + gap to brand line */
  .fi-site-footer .fi-footer-inner {
    padding-top: 28px;
  }

  .fi-site-footer .fi-footer-brand > .custom-logo-link {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
    line-height: 0;
  }

  .fi-site-footer .fi-footer-brand .custom-logo {
    display: block;
    max-height: 65px;
    margin-bottom: 22px;
  }

  .fi-hero-panel {
    max-width: min(16rem, 58%);
  }

  .fi-hero h1 {
    font-size: clamp(1.55rem, 6.8vw, 1.95rem);
    line-height: 1.12;
  }

  .fi-hero-panel .fi-lead {
    font-size: 0.88rem;
    line-height: 1.45;
    max-width: 22ch;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fi-hero-rail-track,
  .fi-service-icon,
  .fi-valor-icon,
  .fi-btn--cta::before {
    animation: none !important;
  }

  .fi-btn:hover,
  .fi-service-card:hover,
  .fi-valor:hover,
  .fi-modalidad:hover,
  .fi-teaser:hover {
    transform: none;
  }
}
