.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  z-index: var(--z-header);
}

.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 1.5rem;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .header-inner {
    padding: 0 2rem;
  }
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-img {
  height: 48px;
  width: auto;
  object-fit: contain;
}

@media (min-width: 768px) {
  .logo-img {
    height: 56px;
  }
}

.search {
  flex: 1;
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}

.search input {
  width: 100%;
  height: 44px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0 48px 0 20px;
  color: var(--text-primary);
  font-size: 14px;
}

.search input::placeholder {
  color: var(--text-muted);
}

.search input:focus {
  outline: none;
  border-color: var(--accent);
}

.search-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: background var(--transition);
}

.search-btn:hover {
  background: var(--accent-hover);
}

.search-btn svg {
  width: 16px;
  height: 16px;
}

@media (min-width: 768px) {
  .search-btn {
    width: 36px;
    height: 36px;
  }

  .search-btn svg {
    width: 18px;
    height: 18px;
  }
}

.actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.action-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: color var(--transition), background var(--transition);
}

.action-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.action-btn svg {
  width: 20px;
  height: 20px;
}

@media (min-width: 768px) {
  .action-btn {
    width: 44px;
    height: 44px;
  }

  .action-btn svg {
    width: 22px;
    height: 22px;
  }
}

.badge {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.badge:empty {
  display: none;
}

.menu-btn {
  display: flex;
}

@media (min-width: 768px) {
  .menu-btn {
    display: none;
  }
}

.cart-dropdown {
  position: fixed;
  top: var(--header-h);
  right: 0;
  width: 100%;
  max-width: 400px;
  max-height: calc(100vh - var(--header-h));
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  z-index: var(--z-dropdown);
  transform: translateX(100%);
  transition: transform var(--transition);
  display: flex;
  flex-direction: column;
}

.cart-dropdown.open {
  transform: translateX(0);
}

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.cart-head h3 {
  font-size: 1rem;
  font-weight: 600;
}

.cart-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.cart-close:hover {
  background: rgba(255, 255, 255, 0.05);
}

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.cart-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.cart-empty svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  opacity: 0.3;
}

.cart-item {
  display: flex;
  gap: 1rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
}

.cart-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.cart-item-img {
  width: 60px;
  height: 60px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.cart-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 8px;
}

.qty-control {
  display: flex;
  align-items: center;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.qty-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.qty-btn:hover {
  color: var(--text-primary);
}

.qty-value {
  min-width: 28px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
}

.cart-item-remove {
  color: var(--text-muted);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.cart-item-remove:hover {
  color: var(--danger);
}

.cart-item-remove svg {
  width: 16px;
  height: 16px;
}

.cart-foot {
  padding: 1.25rem;
  border-top: 1px solid var(--border);
}

.cart-shipping-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 12px;
  color: var(--btn-buy);
  background: rgba(0, 170, 68, 0.08);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.cart-shipping-note svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.cart-subtotal {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.cart-subtotal span:first-child {
  color: var(--text-secondary);
  font-size: 14px;
}

.cart-subtotal span:last-child {
  font-weight: 700;
  font-size: 18px;
}

.cart-checkout-btn {
  display: block;
  width: 100%;
  height: 48px;
  background: var(--btn-buy);
  color: white;
  font-weight: 600;
  border-radius: var(--radius-md);
  text-align: center;
  line-height: 48px;
  transition: background var(--transition);
}

.cart-checkout-btn:hover {
  background: var(--btn-buy-hover);
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: calc(var(--z-dropdown) - 1);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100%;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  z-index: var(--z-overlay);
  transform: translateX(-100%);
  transition: transform var(--transition);
  display: flex;
  flex-direction: column;
}

.mobile-nav.open {
  transform: translateX(0);
}

.mobile-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.mobile-nav-head .logo-img {
  height: 32px;
}

.mobile-nav-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.mobile-nav-close:hover {
  background: rgba(255, 255, 255, 0.05);
}

.mobile-nav-links {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
}

.mobile-nav-links a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 15px;
  transition: color var(--transition), background var(--transition);
}

.mobile-nav-links a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.mobile-nav-links a svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
