/* ==========================================================================
   GFR Finance — layout: topbar, header, navigation, footer, floats
   ========================================================================== */

/* --------------------------------------------------------------- Topbar --- */

.topbar {
  background: var(--navy-900);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.4rem;
  min-height: 42px;
  padding: 0.35rem 0;
}
.topbar__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.topbar__meta li { margin: 0; position: relative; }
.topbar__meta li + li::before {
  content: "";
  position: absolute;
  left: -0.75rem;
  top: 50%;
  width: 1px;
  height: 11px;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.22);
}
.topbar a { color: rgba(255, 255, 255, 0.82); }
.topbar a:hover { color: #fff; }
.topbar__hours { color: var(--gold-400); }

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex: 0 0 auto;
}
.topbar__portal {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.7rem;
}
.topbar__portal:hover { background: rgba(255, 255, 255, 0.1); }

/* ------------------------------------------------------ Language switch --- */

.langswitch { position: relative; }
.langswitch > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.1rem;
  list-style: none;
  cursor: pointer;
  color: #fff;
  font-weight: 600;
  font-size: 0.76rem;
}
.langswitch > summary::-webkit-details-marker { display: none; }
.langswitch__code {
  padding: 0.1rem 0.35rem;
  background: var(--gold-500);
  color: #fff;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
}
.caret {
  width: 7px; height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s var(--ease);
}
details[open] > summary .caret { transform: rotate(-135deg) translateY(-2px); }

.langswitch__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.55rem);
  z-index: 120;
  width: min(560px, calc(100vw - 2rem));
  padding: 1.1rem 1.2rem 1.2rem;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}
.langswitch__title {
  margin: 0 0 0.7rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-600);
}
.langswitch__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.1rem 0.6rem;
  max-height: 340px;
  overflow-y: auto;
}
.langswitch__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.5rem;
  color: var(--body);
  font-size: 0.85rem;
  border-radius: 2px;
}
.langswitch__item:hover { background: var(--paper); color: var(--navy-800); }
.langswitch__item.is-active { background: var(--gold-soft); color: var(--navy-800); font-weight: 600; }
.langswitch__abbr {
  flex: 0 0 auto;
  width: 26px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.langswitch__item.is-active .langswitch__abbr { color: var(--gold-600); }
.langswitch__dot {
  width: 5px; height: 5px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--gold-400);
}

/* --------------------------------------------------------------- Header --- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 244, 240, 0.94);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}
.masthead.is-stuck {
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 6px 24px rgba(11, 31, 51, 0.08);
}
.masthead__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 84px;
  padding: 0.7rem 0;
}
.masthead.is-stuck .masthead__inner { min-height: 70px; }

.logo { flex: 0 0 auto; display: block; }
.logo img { height: 46px; width: auto; transition: height 0.3s var(--ease); }
.masthead.is-stuck .logo img { height: 40px; }

.mainnav {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: auto;
}
.mainnav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.6rem 0.75rem;
  border: 0;
  background: none;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
}
.mainnav__link::after {
  content: "";
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.3rem;
  height: 1.5px;
  background: var(--gold-500);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s var(--ease);
}
.mainnav__link:hover::after, .mainnav__link.is-active::after { transform: scaleX(1); }
.mainnav__link.is-active { color: var(--navy-800); }

.mainnav__group { position: relative; }

.dropdown {
  position: absolute;
  left: 50%;
  top: calc(100% + 0.5rem);
  z-index: 130;
  width: min(720px, calc(100vw - 2.5rem));
  transform: translateX(-50%) translateY(-6px);
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), visibility 0.22s;
}
.mainnav__group.is-open .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.dropdown__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 0.6rem;
}
.dropdown__item {
  display: block;
  padding: 0.6rem 0.75rem;
  border-radius: 2px;
}
.dropdown__item:hover { background: var(--paper); }
.dropdown__name {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy-800);
}
.dropdown__meta {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
}
.dropdown__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 1.3rem;
  padding: 0.85rem 1.35rem;
  background: var(--paper);
  border-top: 1px solid var(--line);
}
.dropdown__foot a {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy-800);
}
.dropdown__foot a:hover { color: var(--gold-600); }

.masthead__actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex: 0 0 auto;
}
.mainnav__mobile { display: none; }

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 40px;
  padding: 0 9px;
  background: var(--white);
  border: 1px solid var(--line);
  cursor: pointer;
}
.burger span {
  display: block;
  height: 1.5px;
  background: var(--navy-800);
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* --------------------------------------------------------------- Footer --- */

.footer {
  margin-top: auto;
  background: var(--navy-900);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.1fr;
  gap: 2.5rem;
  padding: clamp(3rem, 5vw, 4.5rem) 0 2.5rem;
}
.footer__logo { height: 44px; width: auto; margin-bottom: 1.2rem; }
.footer__text { max-width: 34ch; color: rgba(255, 255, 255, 0.66); }
.footer h3 {
  margin-bottom: 1.1rem;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.footer a { color: rgba(255, 255, 255, 0.78); }
.footer a:hover { color: var(--gold-400); }

.footer__links, .footer__facts {
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer__links li { margin-bottom: 0.5rem; font-size: 0.88rem; }
.footer__links--plain li { color: rgba(255, 255, 255, 0.66); line-height: 1.6; }
.footer__more { color: var(--gold-400) !important; font-weight: 600; }

.footer__facts { margin-top: 1.4rem; }
.footer__facts li {
  display: flex;
  gap: 0.5rem;
  font-size: 0.79rem;
  color: rgba(255, 255, 255, 0.58);
  margin-bottom: 0.35rem;
}
.footer__facts span {
  flex: 0 0 auto;
  min-width: 92px;
  color: rgba(255, 255, 255, 0.4);
}

.footer__col--brand .btn { margin-top: 1rem; }

.footer__disclaimer {
  padding-bottom: 1.6rem;
  font-size: 0.78rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.45);
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  padding-top: 1.4rem;
}

.footer__bottom { background: rgba(0, 0, 0, 0.25); }
.footer__bottom-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 1rem 0;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
}
.footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer__legal li { margin: 0; }

/* ---------------------------------------------------- Floating elements --- */

.floaters {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.floater {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--navy-800);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform 0.25s var(--ease), background 0.25s var(--ease);
}
.floater:hover { transform: scale(1.06); }
.floater svg { width: 25px; height: 25px; fill: currentColor; }
.floater--wa { background: #1f8f5f; }
.floater__pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--navy-800);
  animation: gfrPulse 2.6s ease-out infinite;
}
@keyframes gfrPulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.5); opacity: 0; }
}

.chatbox {
  position: fixed;
  right: 1.1rem;
  bottom: 5.2rem;
  z-index: 96;
  display: none;
  flex-direction: column;
  width: min(370px, calc(100vw - 1.6rem));
  height: min(520px, calc(100vh - 8rem));
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.chatbox.is-open { display: flex; }
.chatbox__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.1rem;
  background: var(--navy-800);
  color: #fff;
}
.chatbox__head strong { display: block; color: #fff; font-family: var(--font-display); font-weight: 500; font-size: 1rem; }
.chatbox__head span { font-size: 0.75rem; color: rgba(255, 255, 255, 0.65); }
.chatbox__head button {
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.chatbox__body {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  background: var(--paper);
}
.bubble {
  max-width: 84%;
  margin-bottom: 0.6rem;
  padding: 0.65rem 0.85rem;
  background: var(--white);
  border: 1px solid var(--line);
  font-size: 0.88rem;
  line-height: 1.55;
}
.bubble--mine {
  margin-left: auto;
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: #fff;
}
.bubble__time {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.68rem;
  opacity: 0.6;
}
.chatbox__form {
  display: flex;
  gap: 0.45rem;
  padding: 0.7rem;
  border-top: 1px solid var(--line);
}
.chatbox__form input { flex: 1; padding: 0.65rem 0.75rem; font-size: 0.9rem; }
.chatbox__legal {
  margin: 0;
  padding: 0.45rem 0.8rem 0.7rem;
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
}

.cookiebar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 97;
  background: var(--navy-800);
  color: rgba(255, 255, 255, 0.82);
  box-shadow: 0 -8px 30px rgba(7, 21, 35, 0.25);
}
.cookiebar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.4rem;
  padding: 0.95rem 0;
  font-size: 0.85rem;
}
.cookiebar p { margin: 0; }
.cookiebar a { color: var(--gold-400); text-decoration: underline; text-underline-offset: 3px; }

/* --------------------------------------------------------- Breakpoints ---- */

@media (max-width: 1180px) {
  .mainnav__link { padding: 0.6rem 0.55rem; font-size: 0.86rem; }
}

@media (max-width: 1024px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .topbar__meta li:nth-child(n+3) { display: none; }
}

@media (max-width: 960px) {
  .burger { display: flex; }
  .masthead__actions .btn { display: none; }
  .mainnav {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 140;
    width: min(360px, 88vw);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 5.5rem 1.4rem 2rem;
    background: var(--white);
    border-left: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform 0.32s var(--ease);
    overflow-y: auto;
  }
  .mainnav.is-open { transform: none; }
  .mainnav__link {
    padding: 0.95rem 0.2rem;
    border-bottom: 1px solid var(--line-soft);
    font-size: 1rem;
    justify-content: space-between;
  }
  .mainnav__link::after { display: none; }
  .mainnav__group { position: static; }
  .dropdown {
    position: static;
    width: auto;
    transform: none;
    opacity: 1;
    visibility: visible;
    display: none;
    border: 0;
    box-shadow: none;
    background: var(--paper);
  }
  .mainnav__group.is-open .dropdown { display: block; transform: none; }
  .dropdown__grid { grid-template-columns: 1fr; padding: 0.3rem; }
  .dropdown__foot { flex-direction: column; gap: 0.6rem; }
  .mainnav__mobile { display: grid; gap: 0.6rem; margin-top: 1.4rem; }
  body.nav-open { overflow: hidden; }
  body.nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 135;
    background: rgba(7, 21, 35, 0.5);
  }
}

@media (max-width: 720px) {
  .topbar__inner { flex-direction: column; align-items: flex-start; gap: 0.4rem; padding: 0.55rem 0; }
  .topbar__meta li:nth-child(n+2) { display: none; }
  .topbar__actions { width: 100%; justify-content: space-between; }
  .langswitch__panel { position: fixed; left: 0.8rem; right: 0.8rem; width: auto; }
  .footer__grid { grid-template-columns: 1fr; }
  .cookiebar__inner { flex-direction: column; align-items: flex-start; }
  .floaters { right: 0.75rem; bottom: 0.75rem; }
  .floater { width: 48px; height: 48px; }
  .chatbox { right: 0.75rem; left: 0.75rem; width: auto; bottom: 4.6rem; }
}
