/* ===== Global Header ===== */
:root {
  --primary: #00a2e8;
  --primary-dark: #0088c4;
  --text: #333;
  --text-muted: #666;
  --border: #ddd;
  --logo-dark: #3a3a3a;
}

.site-header {
  background: #fff;
  font-family: "Open Sans", Arial, sans-serif;
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---- Top bar ---- */
.top-bar {
  border-bottom: 1px solid var(--border);
}

.top-bar__text {
  margin: 0;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-muted);
}

.top-bar__text a {
  color: var(--primary);
  text-decoration: none;
  margin: 0 3px;
}

.top-bar__text a:hover {
  text-decoration: underline;
}

/* ---- Main bar ---- */
.main-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 90px;
  position: relative;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo__icon {
  display: block;
}

.logo__text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.logo__title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 3px;
}

.logo__test {
  color: var(--logo-dark);
}

.logo__you {
  color: var(--primary);
}

.logo__tagline {
  margin-top: 6px;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--text-muted);
}

/* Navigation */
.main-nav {
  display: flex;
  align-items: center;
}

.main-nav__list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav__list a {
  display: block;
  padding: 16px 15px;
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.main-nav__list a:hover {
  color: var(--primary);
}

.main-nav__list a.active {
  background: var(--primary);
  color: #fff;
}

/* ---- Dropdown (About Us) ---- */
.has-dropdown {
  position: relative;
  display: flex;
  align-items: stretch;
}

.has-dropdown > a {
  padding-right: 4px;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  padding: 0 10px 0 2px;
  border: 0;
  background: none;
  color: var(--text);
  cursor: pointer;
}

.dropdown-toggle svg {
  transition: transform 0.2s;
}

/* Arrow joins the blue highlight when the parent is active */
.has-dropdown > a.active + .dropdown-toggle {
  background: var(--primary);
  color: #fff;
}

.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 120;
  min-width: 190px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #fff;
  border-top: 3px solid var(--primary);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

/* Opens towards the left (for menu items near the right edge) */
.dropdown--right {
  left: auto;
  right: 0;
}

.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown,
.has-dropdown.open .dropdown {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.has-dropdown:hover .dropdown-toggle svg,
.has-dropdown.open .dropdown-toggle svg {
  transform: rotate(180deg);
}

.main-nav__list .dropdown a {
  padding: 9px 18px;
  font-size: 14px;
  white-space: nowrap;
}

.main-nav__list .dropdown a:hover,
.main-nav__list .dropdown a:focus-visible {
  background: #e6f6fd;
  color: var(--primary);
}

.main-nav__list .dropdown a.active {
  background: none;
  color: var(--primary);
  font-weight: 600;
}

/* Search */
.search {
  position: relative;
  margin-left: 30px;
}

.search__toggle {
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
  color: var(--text);
  display: flex;
}

.search__toggle:hover {
  color: var(--primary);
}

.search__form {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 100;
  background: #fff;
  padding: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.search.open .search__form {
  display: block;
}

.search__form input {
  width: 220px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  font-size: 14px;
  outline: none;
}

.search__form input:focus {
  border-color: var(--primary);
}

/* Hamburger (mobile only) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .nav-toggle {
    display: flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    border-top: 1px solid var(--border);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav__list {
    flex-direction: column;
  }

  .main-nav__list a {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
  }

  /* Dropdown opens inline below "About Us" (tap the arrow) */
  .has-dropdown {
    flex-wrap: wrap;
  }

  .has-dropdown > a {
    flex: 1;
  }

  .dropdown-toggle {
    padding: 0 18px;
    border-bottom: 1px solid #f0f0f0;
  }

  .dropdown {
    position: static;
    flex-basis: 100%;
    display: none;
    padding: 0;
    border-top: 0;
    box-shadow: none;
    background: #f7fbfd;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .has-dropdown.open .dropdown {
    display: block;
  }

  /* No hover-opening on the mobile menu */
  .has-dropdown:hover .dropdown-toggle svg {
    transform: none;
  }

  .has-dropdown.open .dropdown-toggle svg {
    transform: rotate(180deg);
  }

  .main-nav__list .dropdown a {
    padding-left: 32px;
  }

  .search {
    margin: 0;
    padding: 12px 16px;
  }

  .search__toggle {
    display: none;
  }

  .search__form {
    display: block;
    position: static;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .search__form input {
    width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  .logo__icon {
    width: 50px;
    height: auto;
  }

  .logo__title {
    font-size: 22px;
  }

  .logo__tagline {
    font-size: 10px;
  }
}
