:root {
  --blue: #2f6fed;
  --blue-dark: #1d4fbf;
  --text: #1a2233;
  --muted: #6b7280;
  --line: #e6e9ef;
  --bg-top: #eef2f7;
  --red: #e53950;
  --radius: 999px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

html,
body {
  overflow-x: hidden;
  width: 100%;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
}

body {
  margin: 0;
  font-family: "Poppins", Arial, Helvetica, sans-serif;
  color: var(--text);
  background: #fff;
}

.topbar {
  background: var(--bg-top);
  border-bottom: 2px solid #0e1420;
  font-size: 13px;
}

.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-links {
  display: flex;
  gap: 22px;
}

.topbar-links a {
  color: var(--muted);
  text-decoration: none;
}

.topbar-links a:hover {
  color: var(--text);
}

.topbar-right {
  display: flex;
  gap: 18px;
}

.lang-select {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #374151;
  cursor: pointer;
}

.lang-select svg {
  width: 12px;
  height: 12px;
}

.header {
  background: var(--bg-top);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo svg {
  width: 34px;
  height: 34px;
}

.logo span {
  font-size: 26px;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: -0.5px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #374151;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.garage {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.garage-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.garage-text .label {
  font-size: 12px;
  color: var(--muted);
}

.garage-text .value {
  font-size: 14px;
  font-weight: 700;
}

.search {
  flex: 1;
  max-width: 820px;
  position: relative;
}

.search input {
  width: 100%;
  padding: 13px 48px 13px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  font-size: 14px;
  outline: none;
  background: #fff;
}

.search input::placeholder {
  color: #9aa2b1;
}

.search input:focus {
  border-color: var(--blue);
}

.search button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1a2233;
  cursor: pointer;
}

.search button svg {
  width: 19px;
  height: 19px;
}

.account {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.account-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.account-text .label {
  font-size: 12px;
  color: var(--muted);
}

.account-text .value {
  font-size: 14px;
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.badge-wrap {
  position: relative;
}

.badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.icon-group {
  display: contents;
}

.navbar {
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.all-cats {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 400;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
  padding-right: 24px;
  border-right: 1px solid var(--line);
}

.all-cats svg {
  width: 20px;
  height: 20px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}

.nav-links a {
  text-decoration: none;
  color: var(--text);
  font-weight: 400;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.nav-links a svg {
  width: 14px;
  height: 14px;
}

.nav-links a:hover {
  color: var(--blue);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
}

.nav-right svg {
  width: 18px;
  height: 18px;
}

.sale-tag {
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 5px;
}

.nav-links {
  transition: max-height .25s ease;
}

@media (max-width: 1180px) {
  .nav-links {
    gap: 20px;
  }

  .header-inner {
    gap: 16px;
  }

  .search {
    max-width: none;
  }
}

@media (max-width: 1024px) and (min-width: 861px) {

  .garage-text,
  .account-text {
    display: none;
  }

  .nav-inner {
    gap: 20px;
  }

  .nav-links {
    gap: 16px;
  }
}

@media (max-width: 860px) {
  .topbar-links {
    gap: 14px;
    font-size: 12px;
  }

  .topbar-inner {
    padding: 8px 16px;
    flex-wrap: wrap;
    row-gap: 6px;
  }

  .garage-text,
  .account-text {
    display: none;
  }

  .header-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "logo   garage"
      "icons  icons"
      "search search";
    align-items: center;
    row-gap: 14px;
    column-gap: 12px;
    padding: 14px 16px;
  }

  .logo {
    grid-area: logo;
  }

  .garage {
    grid-area: garage;
    justify-self: end;
  }

  .icon-group {
    grid-area: icons;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
  }

  .header-actions {
    order: 1;
  }

  .account {
    order: 2;
  }

  .search {
    grid-area: search;
    max-width: none;
  }

  .nav-right span:not(.sale-tag) {
    display: none;
  }

  .nav-right svg {
    display: none;
  }

  .nav-inner {
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
  }

  .all-cats {
    border-right: none;
    padding-right: 0;
    cursor: pointer;
  }

  .nav-right {
    margin-left: auto;
  }

  .nav-links {
    order: 10;
    flex-basis: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    max-height: 0;
    overflow: hidden;
  }

  .nav-links.open {
    max-height: 400px;
    padding-top: 8px;
  }

  .nav-links li {
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 520px) {
  .topbar-right {
    gap: 10px;
  }

  .topbar-links {
    gap: 10px;
  }

  .topbar-links a:nth-child(3) {
    display: none;
  }

  .logo span {
    font-size: 22px;
  }

  .logo svg {
    width: 28px;
    height: 28px;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
  }

  .icon-btn svg {
    width: 17px;
    height: 17px;
  }

  .header-actions {
    gap: 6px;
  }

  .icon-group {
    gap: 6px;
  }

  .garage .icon-btn,
  .account .icon-btn {
    width: 38px;
    height: 38px;
  }

  .nav-right {
    font-size: 0;
    gap: 8px;
  }

  .sale-tag {
    font-size: 11px;
  }

  .search input {
    padding: 11px 44px 11px 14px;
    font-size: 13px;
  }
}

@media (max-width: 380px) {
  .header-inner {
    padding: 12px;
    row-gap: 10px;
  }

  .logo span {
    font-size: 20px;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
  }

  .badge {
    min-width: 16px;
    height: 16px;
    font-size: 10px;
  }

  .nav-inner {
    padding: 10px 12px;
    gap: 8px;
  }

  .all-cats {
    font-size: 14px;
  }
}

.garage-form {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
  position: relative;
}

.branch-dropdown {
  position: relative;
}

.branch-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  font-weight: 500;
  font-size: 16px;
  color: #1a1a2e;
  cursor: pointer;
  padding: 0;
  outline: none;
  font-family: inherit;
}

.branch-trigger .chevron {
  width: 14px;
  height: 14px;
  color: #666;
  transition: transform 0.15s ease;
}

.branch-dropdown.open .branch-trigger .chevron {
  transform: rotate(180deg);
}

.branch-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 200px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  z-index: 50;
  display: none;
  max-height: 260px;
  overflow-y: auto;
  border-radius: 15px;
}

.branch-dropdown.open .branch-menu {
  display: block;
}

.branch-option {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  color: #1a1a2e;
  cursor: pointer;
  font-family: inherit;
}

.branch-option:not(:last-child) {
  border-bottom: 1px solid #eee;
}

.branch-option:hover {
  background: #f2f2f2;
}

.branch-option.selected {
  color: var(--blue, #1a56db);
}

.branch-loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}

.branch-loader-overlay.active {
  opacity: 1;
  visibility: visible;
}

.branch-loader-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.branch-loader-dots {
  display: flex;
  gap: 8px;
}

.branch-loader-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue, #1a56db);
  animation: branchDotPulse 1.4s ease-in-out infinite;
}

.branch-loader-dots .dot:nth-child(2) {
  animation-delay: 0.15s;
}

.branch-loader-dots .dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes branchDotPulse {

  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.4;
  }

  40% {
    transform: scale(1.1);
    opacity: 1;
  }
}

.branch-loader-text {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a2e;
}

/* Hide All Categories on desktop */
@media (min-width: 861px) {
  .all-cats {
    display: none;
  }
}