.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.85);
    color: #1E2C74;
    padding: 20px 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    font-family: var(--main-font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* backdrop-filter: blur(8px); Removed for performance - causes jank on scroll */
    position: sticky;
    top: 0;
    z-index: 2000;
    /* Hardware acceleration for sticky navbar */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
}

.navbar-spacer {
    display: none;
    width: 100%;
    flex: 0 0 auto;
}

.navbar-left .logo {
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: 2px;
    color: #1E2C74;
    text-transform: uppercase;
    font-family: var(--main-font);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
}

.navbar-right a,
.dropbtn {
    color: #1E2C74;
    text-decoration: none;
    padding: 0;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: none;
    border: none;
    border-radius: 4px;
    font-family: var(--main-font);
    transition: color 0.3s;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    cursor: pointer;
    position: relative;
    outline: none;
}

.navbar-right a::after,
.dropbtn::after {
    content: '';
    display: block;
    position: absolute;
    left: 50%;
    bottom: -6px;
    width: 0;
    height: 3px;
    background: #EC1C24;
    border-radius: 2px;
    opacity: 0;
    transition: width 0.3s cubic-bezier(.4,0,.2,1), left 0.3s cubic-bezier(.4,0,.2,1), opacity 0.2s;
}

.navbar-right a:hover::after,
.navbar-right a:focus::after,
.dropbtn:hover::after,
.dropbtn:focus::after {
    width: 100%;
    left: 0;
    opacity: 1;
}

.navbar-right a:hover,
.navbar-right a:active,
.dropbtn:hover,
.dropbtn:active {
    color: #EC1C24;
    background: none;
}

.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background: rgba(255,255,255,0.95);
    min-width: 140px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    z-index: 1100;
    border-radius: 0 0 6px 6px;
    overflow: hidden;
}

.dropdown-content a {
    color: #1E2C74;
    padding: 0.7rem 1rem;
    display: block;
    text-align: left;
    text-decoration: none;
    background: none;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: var(--main-font);
    transition: color 0.3s;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

.dropdown-content a::after {
    content: '';
    display: block;
    position: absolute;
    left: 50%;
    bottom: 6px;
    width: 0;
    height: 3px;
    background: #EC1C24;
    border-radius: 2px;
    opacity: 0;
    transition: width 0.3s cubic-bezier(.4,0,.2,1), left 0.3s cubic-bezier(.4,0,.2,1), opacity 0.2s;
}

.dropdown-content a:hover::after,
.dropdown-content a:focus::after {
    width: 100%;
    left: 0;
    opacity: 1;
}

.dropdown-content a:hover,
.dropdown-content a:active {
    color: #EC1C24;
    background: none;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown .dropbtn::after {
    bottom: -6px;
}

.navbar-language-selector {
    margin-left: 20px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-lang-link {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e2c74;
    background: rgba(215,38,61,0.1);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.navbar-lang-link:hover,
.navbar-lang-link.active {
    background: #d7263d;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(215,38,61,0.3);
}

.navbar-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: 12px;
  z-index: 1200;
}
.navbar-toggle .bar {
  width: 26px;
  height: 3px;
  background: #1E2C74;
  margin: 4px 0;
  border-radius: 2px;
  transition: all 0.3s;
}

@media (max-width: 900px) {
  .navbar-toggle {
    display: flex;
  }
  .navbar-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100vw;
    max-width: 100vw;
    background: #fff;
    box-shadow: 0 4px 24px rgba(30,44,116,0.08);
    border-radius: 0 0 12px 12px;
    z-index: 1100;
    padding: 1.2rem 0.8rem 1.2rem 0.8rem;
    padding-right: 1rem;
    overflow-x: hidden;
  }
  .navbar-menu.show {
    display: block;
  }
  .navbar-right {
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    padding: 0 0.5rem;
    word-break: break-word;
  }
  .navbar-right a, .dropdown-content a, .dropbtn {
    word-break: break-word;
    max-width: 96vw;
    box-sizing: border-box;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  .dropdown-content {
    min-width: 140px;
    max-width: 96vw;
    left: 0;
    right: auto;
    overflow-x: hidden;
    border-radius: 0 0 6px 6px;
  }
  .navbar-language-selector {
    width: 100%;
    max-width: 96vw;
    box-sizing: border-box;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    justify-content: center;
  }
  .navbar {
    flex-wrap: wrap;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    flex-direction: row;
    padding: calc(0.55rem + var(--safe-area-top)) 0.75rem 0.55rem;
    background: rgba(255,255,255,0.96);
    border-bottom: 1px solid rgba(30,44,116,0.08);
    box-shadow: 0 16px 40px rgba(30,44,116,0.18);
    min-height: var(--mobile-navbar-height);
    /* backdrop-filter: blur(12px); Removed for performance */
  }
  .navbar-spacer {
    display: block;
    height: calc(var(--mobile-navbar-height) + var(--safe-area-top));
    flex: 0 0 calc(var(--mobile-navbar-height) + var(--safe-area-top));
  }
  .navbar-toggle {
    margin-left: auto;
    height: 38px;
    width: 38px;
    align-self: center;
    border-radius: 8px;
    margin-right: 0.5rem;
  }
  .navbar-toggle .bar {
    width: 22px;
    height: 3px;
  }
}

@media (max-width: 700px) {
    .navbar {
        flex-direction: row;
        align-items: flex-start;
        padding: 1rem 0.9rem;
        z-index: 2000;
    }
    .navbar-right {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        width: 100%;
    }
    .dropdown-content {
        right: auto;
        left: 0;
    }
} 

:root {
    --font-title: 'Caveat', cursive, Arial, sans-serif;
    --mobile-navbar-height: 64px;
    --safe-area-top: env(safe-area-inset-top, 0);
}

@supports (padding: constant(safe-area-inset-top)) {
    :root {
        --safe-area-top: constant(safe-area-inset-top, 0);
    }
}

.navbar,
.navbar-left .logo,
.navbar-right a,
.dropbtn,
.dropdown-content a {
    font-family: var(--font-title);
} 