/* Navbar – Minimalist Design */
@import url("variables.css");

.navbar {
  width: 100%;
  background: var(--bg-white);
  border-bottom: 1px solid var(--divider-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: box-shadow 0.2s ease;
}

/* Layout */
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.nav-left,
.nav-center,
.nav-right {
  display: flex;
  align-items: center;
}

.nav-left {
  flex: 1;
  min-width: 0;
}

.nav-center {
  flex: 2;
  justify-content: center;
  min-width: 0;
}

.nav-right {
  flex: 1;
  justify-content: flex-end;
}

/* Brand */
.brand {
  font-size: 1.125rem;
  font-weight: var(--font-bold);
  color: var(--primary-color);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.brand:hover {
  opacity: 0.85;
}

/* Search */
.nav-search {
  width: 360px;
  max-width: 100%;
  padding: 0.625rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.9375rem;
  background: var(--surface-muted);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.nav-search::placeholder {
  color: var(--text-tertiary);
}

.nav-search:hover {
  background: var(--bg-white);
  border-color: var(--primary-light);
}

.nav-search:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  background: var(--bg-white);
}

/* Account / Menu */
.nav-account {
  position: relative;
}

.account-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;

  background: var(--bg-white);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 24px;

  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: var(--font-medium);
  cursor: pointer;
  white-space: nowrap;

  transition: all 0.2s ease;
}

.account-btn::after {
  content: "▾";
  font-size: 0.75rem;
  margin-left: 0.125rem;
  transition: transform 0.2s ease;
}

.account-btn[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.account-btn:hover {
  background: var(--surface-muted);
  border-color: var(--primary-light);
  color: var(--primary-color);
}

.account-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

/* Dropdown Menu */
.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  min-width: 240px;

  background: var(--bg-white);
  border: 1px solid var(--divider-color);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);

  padding: 0.5rem;
  display: none;
  flex-direction: column;
  gap: 0.125rem;
  z-index: 1000;
}

.account-menu:not([hidden]) {
  display: flex;
  opacity: 0;
  transform: translateY(-8px);
  animation: menuSlideIn 0.2s ease forwards;
}

@keyframes menuSlideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.account-menu .menu-item {
  padding: 0.625rem 1rem;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 6px;
  border: none;
  background: transparent;
  text-align: left;
  transition: all 0.15s ease;
}

.account-menu .menu-item:hover {
  background: var(--surface-muted);
  color: var(--text-primary);
}

.account-menu .menu-item.highlight {
  color: var(--primary-color);
  font-weight: var(--font-semibold);
  background: rgba(102, 126, 234, 0.05);
}

.account-menu .menu-item.highlight:hover {
  background: rgba(102, 126, 234, 0.1);
}

.account-menu .menu-item.danger {
  color: var(--status-sold-text);
}

.account-menu .menu-item.danger:hover {
  background: rgba(239, 68, 68, 0.08);
}

.account-menu .menu-item.disabled,
.account-menu .menu-item[data-disabled="true"] {
  color: var(--text-tertiary);
  cursor: not-allowed;
  opacity: 0.6;
}

.account-menu .menu-item.disabled:hover,
.account-menu .menu-item[data-disabled="true"]:hover {
  background: transparent;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 1rem;
    gap: 1rem;
  }

  .nav-left,
  .nav-right {
    flex: none;
  }

  .nav-left {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
  }

  .brand {
    font-size: 1rem;
  }

  .nav-center {
    order: 3;
    flex: none;
    width: 100%;
  }

  .nav-search {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }

  .nav-right {
    order: 2;
    position: absolute;
    right: 1rem;
    top: 0.75rem;
  }

  .account-menu {
    min-width: 200px;
  }
}