/* =========================
   HEADER
========================= */

* {
  box-sizing: border-box;
}

html {
  margin-top: 0 !important;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: #1f2937;
  background: #ffffff;
}

.container {
  width: min(1400px, 96%);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

body.admin-bar .site-header {
  top: 32px;
}

.top-bar {
  background: #0b8aa5;
  color: #ffffff;
  font-size: 13px;
  padding: 8px 0;
  line-height: 1;
}

.top-bar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  text-align: center;
  font-weight: 600;
}

.top-bar .separator {
  opacity: 0.8;
}

.top-bar a {
  color: #f2c55c;
  text-decoration: none;
  font-weight: 700;
}

.main-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 12px 0;
}

.main-header-inner {
  display: grid;
  grid-template-columns: 250px minmax(320px, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.site-logo img {
  max-height: 58px;
  width: auto;
  display: block;
}

.header-search form {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 10px;
  width: 100%;
  align-items: center;
}

.header-search input[type="search"] {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border: 3px solid #e5e7eb;
  border-radius: 12px;
  font-size: 14px;
  color: #475569;
  outline: none;
  background: #ffffff;
}

.header-search button,
.header-search input[type="submit"] {
  width: 100%;
  height: 38px;
  border: none;
  border-radius: 10px;
  background: #0b8aa5;
  color: #ffffff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: background 0.2s ease;
  padding: 0 12px;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  white-space: nowrap;
}

.header-actions a {
  text-decoration: none;
  color: #111827;
  font-weight: 500;
  font-size: 14px;
}

.account-link,
.cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: #111827;
  flex-shrink: 0;
}

.action-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.cart-link {
  padding-right: 18px;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #f2a900;
  color: #111827;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.gamma-link,
.gamma-link.small,
.gamma-link:hover,
.gamma-link:focus,
.gamma-link:active,
.nav-right .gamma-link,
.nav-right .gamma-link:hover {
  text-decoration: none !important;
}

.gamma-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0b8aa5;
  color: #ffffff !important;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  transition: background 0.2s ease;
  text-align: center;
  line-height: 1.2;
}

.gamma-link.small {
  padding: 10px 16px;
  min-width: 150px;
}

.main-nav-wrapper {
  background: #f5f7fa;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
}

.main-nav {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
  min-height: 54px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-menu a {
  text-decoration: none;
  color: #64748b;
  font-weight: 600;
  font-size: 14px;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.nav-menu a:hover,
.header-actions a:hover {
  color: #0b8aa5;
}

.nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.site-footer {
  margin-top: 40px;
  padding: 24px 0;
  border-top: 1px solid #eee;
  background: #fafafa;
}

main {
  display: block;
}

@media (max-width: 1280px) {
  .main-header-inner {
    grid-template-columns: 210px minmax(300px, 1fr) auto;
    gap: 14px;
  }

  .site-logo img {
    max-height: 56px;
  }

  .header-actions {
    gap: 14px;
  }

  .header-actions a {
    font-size: 13px;
  }

  .gamma-link {
    padding: 10px 14px;
    font-size: 13px;
  }

  .gamma-link.small {
    min-width: 130px;
  }

  .nav-menu {
    gap: 18px;
  }
}

@media (max-width: 1100px) {
  .main-header-inner {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .site-logo {
    justify-content: center;
  }

  .header-actions {
    justify-content: center;
    flex-wrap: wrap;
  }

  .main-nav {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 14px 0;
    min-height: auto;
  }

  .nav-right {
    justify-content: flex-start;
  }
}

@media (max-width: 782px) {
  body.admin-bar .site-header {
    top: 46px;
  }
}

@media (max-width: 640px) {
  .top-bar {
    font-size: 12px;
    line-height: 1.4;
  }

  .top-bar-inner {
    gap: 8px;
  }

  .header-search form {
    grid-template-columns: 1fr;
  }

  .header-search button,
  .header-search input[type="submit"] {
    height: 42px;
  }

  .nav-menu a {
    font-size: 14px;
  }
}