/* Header: sticky translucent cream bar, brand (left), nav + cart (right), language switcher slot, icon. */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  /* Solid light bar with a hairline and a soft shadow so it sits above the cream body. */
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 10px 30px -18px rgb(58 44 35 / 0.35);
}

/* Keep the sticky bar below the WordPress admin bar for logged-in staff. */
.admin-bar .site-header {
  top: var(--wp-admin--admin-bar--height, 32px);
}

@media (max-width: 600px) {
  .admin-bar .site-header {
    top: 0;
  }
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  min-height: var(--header-height);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--control-height);
  margin-right: auto;
  color: var(--color-text);
  text-decoration: none;
}

.brand__logo {
  width: 3rem;
  height: 3rem;
  object-fit: contain;
  transition: transform var(--transition-base);
}

.brand:hover .brand__logo {
  transform: rotate(-8deg);
}

.brand__name {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-heading);
  white-space: nowrap;
}

.brand:hover {
  color: var(--color-primary);
}

/* Full name by default; the short one ("Hạt điều CĐ") only where the header gets crowded. */
.brand__name-short {
  display: none;
}

@media (max-width: 1100px) and (min-width: 900px), (max-width: 420px) {
  .site-header .brand__name-full {
    display: none;
  }

  .site-header .brand__name-short {
    display: inline;
  }
}

.nav__list {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-height);
  padding-inline: var(--space-3);
  border-radius: var(--radius-pill);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  white-space: nowrap;
}

/* Underline that grows from the centre on hover / marks the current page. */
.nav__link:not(.nav__link--cart)::after {
  content: '';
  position: absolute;
  left: var(--space-3);
  right: var(--space-3);
  bottom: 0.55rem;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transition: transform var(--transition-base);
}

.nav__link:hover,
.nav__link[aria-current='page'] {
  color: var(--color-primary);
}

.nav__link:hover::after,
.nav__link[aria-current='page']::after {
  transform: scaleX(1);
}

.nav__link--cart {
  margin-left: var(--space-2);
  padding-inline: var(--space-4);
  border: 1px solid var(--button-secondary-border);
  background: var(--button-secondary-bg);
  color: var(--button-secondary-text);
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.nav__link--cart:hover,
.nav__link--cart[aria-current='page'] {
  border-color: var(--button-secondary-hover-bg);
  background: var(--button-secondary-hover-bg);
  color: var(--button-secondary-hover-text);
}

.cart-badge {
  min-width: 1.35rem;
  height: 1.35rem;
  padding-inline: 0.35rem;
  border-radius: var(--radius-pill);
  background: var(--button-text); /* light chip inside the cart button (same colour as the button) */
  color: var(--button-bg);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  line-height: 1.35rem;
  text-align: center;
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Custom logo uploaded via the Customizer (core markup). */
.custom-logo-link {
  display: inline-flex;
  margin-right: auto;
}

.custom-logo {
  width: auto;
  max-height: 2.5rem;
}
