.navbar {
  height: 64px;
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-bg-card);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
}
.highlight {
  color: var(--color-brand);
}

.nav-links {
  display: flex;
  gap: var(--space-6);

  a {
    color: var(--color-text-muted);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;

    &:hover,
    &.active {
      color: var(--color-brand);
    }
  }
}

.actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.cart-trigger {
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-bg-card);
  color: var(--color-text);
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease;
}

.cart-trigger:hover,
.cart-trigger.has-items {
  border-color: rgba(16, 24, 32, 0.2);
  background: #f6f2e8;
}

.cart-badge {
  position: absolute;
  top: -0.15rem;
  right: -0.2rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--color-brand);
  color: var(--color-neutral-900);
  font-size: 0.68rem;
  font-weight: 700;
}

.lang-switch {
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 2px 22px 2px 8px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 10px) calc(50% - 2px),
    calc(100% - 5px) calc(50% - 2px);
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;

  &:hover {
    color: var(--color-text);
    border-color: var(--color-text);
  }
  &:focus-visible {
    outline: 2px solid var(--color-brand);
    outline-offset: 1px;
  }
}

.icon-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--color-neutral-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}

.cart-overlay {
  position: fixed;
  inset: 64px 0 0;
  background: rgba(16, 24, 32, 0.16);
  display: flex;
  justify-content: flex-end;
  z-index: 120;
}

.cart-panel {
  width: min(26rem, 100%);
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: var(--space-5);
  padding: var(--space-6);
  border-left: 1px solid var(--color-border);
  background: #fbfaf6;
  box-shadow: -18px 0 40px rgba(16, 24, 32, 0.08);
  overflow-y: auto;
}

.cart-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: var(--space-4);
}

.cart-panel-head h2 {
  margin: 0.2rem 0 0;
  font-size: 1.15rem;
}

.cart-panel-kicker {
  margin: 0;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
}

.cart-close,
.line-remove {
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font: inherit;
}

.cart-close {
  font-size: 1.5rem;
  line-height: 1;
}

.cart-state {
  margin: 0;
  padding: 1rem;
  border-radius: 0.9rem;
  background: rgba(16, 24, 32, 0.04);
  color: var(--color-text-muted);
}

.cart-lines {
  display: grid;
  align-content: start;
  gap: var(--space-4);
}

.cart-line {
  display: grid;
  gap: var(--space-3);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.cart-line-copy {
  display: grid;
  gap: 0.25rem;
}

.cart-line-meta,
.cart-line-color {
  color: var(--color-text-muted);
  font-size: 0.86rem;
}

.cart-line-color {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.color-dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  border: 1px solid rgba(16, 24, 32, 0.12);
}

.cart-line-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.qty-control {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: #fff;
}

.qty-control button {
  width: 1.9rem;
  height: 1.9rem;
  border: 0;
  border-radius: 50%;
  background: rgba(16, 24, 32, 0.06);
  color: var(--color-text);
  cursor: pointer;
}

.qty-control span {
  min-width: 1.4rem;
  text-align: center;
  font-weight: 600;
}

.line-total {
  white-space: nowrap;
}

.cart-totals {
  display: grid;
  gap: 0.55rem;
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.cart-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  color: var(--color-text-muted);
}

.cart-total-row-final {
  color: var(--color-text);
  font-size: 1.02rem;
}

.checkout-link {
  min-height: 3rem;
  border: 0;
  border-radius: 999px;
  background: var(--color-text);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  cursor: pointer;
  z-index: 101;

  span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: var(--color-text);
    border-radius: 2px;
    transition: all 0.3s ease;
  }

  &.active {
    span:nth-child(1) {
      transform: translateY(8px) rotate(45deg);
    }
    span:nth-child(2) {
      opacity: 0;
    }
    span:nth-child(3) {
      transform: translateY(-8px) rotate(-45deg);
    }
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .mobile-toggle {
    display: flex;
    order: 2; /* Place after actions */
    margin-left: var(--space-4);
  }

  .actions {
    order: 1; /* Place before toggle */
    margin-left: auto; /* Push to right */
  }

  .cart-overlay {
    inset: 64px 0 0;
  }

  .cart-panel {
    width: min(100%, 24rem);
  }

  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background-color: var(--color-bg-card);
    flex-direction: column;
    padding: var(--space-4);
    border-bottom: 1px solid var(--color-border);
    gap: var(--space-4);
    display: none;
    z-index: 1000;

    &.open {
      display: flex;
      animation: slideDown 0.3s ease forwards;
    }

    a {
      font-size: 1.1rem;
      padding: var(--space-2) 0;
      border-bottom: 1px solid var(--color-neutral-100);

      &:last-child {
        border-bottom: none;
      }
    }
  }

  .cart-line-actions {
    align-items: start;
    flex-direction: column;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
