/* Sticky footer */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main {
  flex: 1;
}

/* Header */
header {
  padding: 0;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
  transition: transform 0.3s ease;
}
header.header-hidden {
  transform: translateY(-100%);
}
header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
  opacity: 0.3;
}
header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
  text-decoration: none;
  transition: opacity 0.15s;
}
.logo:hover { opacity: 0.85; }
.logo img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
}

nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
nav a:hover {
  color: var(--text);
  background: var(--hover-bg, rgba(255, 255, 255, 0.04));
}
nav .btn {
  margin-left: 4px;
  padding: 7px 14px;
  font-size: 13px;
}
nav .btn:visited { color: inherit; }
nav .btn-primary:visited { color: #ffffff; }
@media (hover: hover) {
  nav .btn:hover {
    background: var(--accent-hover);
  }
}

/* Products dropdown */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  user-select: none;
  white-space: nowrap;
}
.nav-dropdown-trigger::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  opacity: 0.6;
  transition: transform 0.15s;
}
.nav-dropdown:hover .nav-dropdown-trigger,
.nav-dropdown.open .nav-dropdown-trigger {
  color: var(--text);
  background: var(--hover-bg, rgba(255,255,255,0.04));
}
.nav-dropdown.open .nav-dropdown-trigger::after {
  transform: rotate(180deg);
}
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: -12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  min-width: 220px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
  display: block;
}
.nav-dropdown-item {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.12s;
}
.nav-dropdown-item:hover {
  background: rgba(255,255,255,0.05);
}
.nav-dropdown-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  display: block;
}
.nav-dropdown-item-desc {
  font-size: 11px;
  color: var(--muted);
  display: block;
  margin-top: 1px;
}

.nav-burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--muted);
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.nav-burger:hover { color: var(--text); background: var(--hover-bg, rgba(255,255,255,0.04)); }

/* Footer */
footer {
  padding: 40px 0;
  margin-top: 40px;
  position: relative;
}
footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
  opacity: 0.2;
}
footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}
footer .footer-brand {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
  letter-spacing: -0.2px;
}
footer .footer-links {
  display: flex;
  gap: 8px;
}
footer .footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 5px;
  transition: color 0.15s, background 0.15s;
}
footer .footer-links a:hover {
  color: var(--text);
  background: var(--hover-bg, rgba(255, 255, 255, 0.04));
}

/* Language picker */
.lang-picker {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 14px;
  padding: 4px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.lang-picker-globe { width: 13px; height: 13px; opacity: 0.5; flex: none; }
.lang-picker .lang-on { color: var(--text); }
.lang-picker a { color: var(--muted); text-decoration: none; transition: color 0.15s ease; }
.lang-picker a:hover { color: var(--accent); }
.lang-picker .lang-div { color: var(--border-strong); font-weight: 400; }

/* Responsive */
@media (max-width: 600px) {
  header .container { height: 48px; padding-right: 16px; }
  header .container .logo { margin-right: auto; }
  .logo img { width: 40px; height: 40px; }
  .logo { font-size: 14px; }
  nav a { display: none; }
  nav .lang-toggle, nav .lang-picker { display: none; }
  nav .nav-dropdown { display: none; }
  .nav-burger { display: flex; padding-right: 0; }

  nav.nav-open {
    position: fixed;
    top: 48px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px 12px 12px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 9;
    animation: nav-slide-down 0.15s ease;
  }
  nav.nav-open a { display: block; }
  nav.nav-open .lang-toggle { display: block; padding: 6px 12px; }
  nav.nav-open .lang-toggle a { display: inline; }
  nav.nav-open .lang-picker { display: inline-flex; align-self: flex-start; width: auto; margin: 8px 12px 4px; }
  nav.nav-open .lang-picker a { display: inline; }
  nav.nav-open .btn { margin-left: 0; margin-top: 4px; text-align: center; font-size: 14px; padding: 9px 14px; }
  nav.nav-open .nav-dropdown { display: block; }
  .nav-dropdown-menu,
  .nav-dropdown:hover .nav-dropdown-menu,
  .nav-dropdown.open .nav-dropdown-menu { display: none; }
  nav.nav-open .nav-dropdown.open .nav-dropdown-menu { display: block; position: static; box-shadow: none; border: none; padding: 0 0 4px 8px; min-width: unset; background: none; }
  nav.nav-open .nav-dropdown-item { padding: 6px 10px; }
  nav.nav-open .nav-dropdown-item-desc { display: none; }
  nav.nav-open .nav-dropdown-trigger { padding: 6px 12px; font-size: 14px; }

  footer .container { flex-direction: column; gap: 12px; align-items: center; }
  footer .footer-links { flex-wrap: wrap; justify-content: center; }
}

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

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  z-index: 9999;
  text-decoration: none;
  border-radius: 0 0 6px 0;
}
.skip-link:focus { top: 0; }

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: 2px;
}
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: 2px;
  border-radius: 2px;
}
