/* ==========================================================================
   header.css — top info bar + main header, search modal, cart drawer
   ========================================================================== */
.header {
  position: relative;
  z-index: 40;
  background: #fff;
  flex: 0 0 auto;
}

/* ---- top info bar (34px, #f5f5f5) ---- */
.top-info-bar {
  background: var(--c-topbar);
  color: #333;
  font-size: 11.9px;
  font-weight: 500;
  line-height: 1.4;
}
.top-info-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px var(--page-pad);
  min-height: 34px;
}
.top-info-bar__links {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.top-info-bar__item + .top-info-bar__item::before {
  content: '|';
  margin: 0 8px;
  opacity: 0.55;
}
.top-info-bar__link {
  cursor: pointer;
  white-space: nowrap;
}
.top-info-bar__link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---- main row (70px) ---- */
.header__row {
  background: #fff;
}
.header__columns {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 11px var(--page-pad);
  min-height: var(--header-main-h);
}
.header__col {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}
.header__col--left {
  flex: 1 1 0;
}
.header__col--center {
  flex: 0 1 auto;
}
.header__col--right {
  flex: 1 1 0;
  justify-content: flex-end;
}
.header-logo {
  display: inline-flex;
  align-items: center;
  height: 48px;
}
.header-logo img {
  width: 68px;
  height: auto;
  display: block;
}
.header-menu {
  display: flex;
  align-items: center;
}
.header-menu__inner {
  display: flex;
  align-items: center;
  gap: 0;
}
.menu-list__link {
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 12.4px;
  font-family: var(--font-inter);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: #000;
  white-space: nowrap;
  position: relative;
}
.menu-list__link:hover::after {
  content: '';
  position: absolute;
  left: 12.4px;
  right: 12.4px;
  bottom: 8px;
  height: 1px;
  background: currentColor;
}
/* the reference header does not underline the active item */

/* search pill */
.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.search-pill-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 2px 12px 2px 8px;
  border-radius: var(--rad-pill);
  background: var(--c-search-pill);
  font-size: 14px;
  color: #000;
  transition: background 0.2s ease;
}
.search-pill-button:hover {
  background: #e6e6e6;
}
.search-pill-button svg {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
}
.search-pill-label {
  padding-right: 12px;
  white-space: nowrap;
}
.header-actions__icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--rad-pill);
  position: relative;
  transition: background 0.2s ease;
}
.header-actions__icon:hover {
  background: #f2f2f2;
}
.header-actions__icon svg {
  width: 21px;
  height: 21px;
}
.cart-count {
  position: absolute;
  top: 6px;
  right: 5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font-family: var(--font-inter);
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  display: none;
}
.cart-count[data-count]:not([data-count='0']) {
  display: block;
}
.header__menu-btn {
  display: none;
}

/* mobile */
@media (max-width: 899.98px) {
  .top-info-bar {
    display: none;
  }
  .header__columns {
    padding: 8px var(--page-pad-m);
    min-height: var(--header-main-h-m);
    gap: 8px;
  }
  .header__col--left {
    gap: 12px;
  }
  .header-menu,
  .search-pill-label,
  .header__col--center {
    display: none;
  }
  .header__col--right {
    flex: 0 1 auto;
  }
  .header__col--left {
    flex: 1 1 auto;
  }
  .header-logo {
    height: 44px;
  }
  .header-logo img {
    width: 48px;
  }
  .header__menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-right: -8px;
  }
  .header__menu-btn svg {
    width: 22px;
    height: 22px;
  }
  .search-pill-button {
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
    background: transparent;
  }
  .search-pill-button svg {
    width: 24px;
    height: 24px;
  }
  .header-actions__icon {
    width: 40px;
    height: 40px;
  }
  .header-actions {
    gap: 0;
  }
}

/* ==========================================================================
   search modal (540x540 at desktop, centred)
   ========================================================================== */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
}
.search-modal[open] {
  display: block;
}
.search-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
}
.search-modal__panel {
  position: relative;
  width: min(680px, calc(100vw - 32px));
  max-height: min(540px, calc(100vh - 80px));
  margin: 104px auto 0;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.search-modal__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid #ececec;
}
.search-modal__head svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}
.search-modal__input {
  flex: 1;
  border: 0;
  outline: 0;
  font-size: 16px;
  padding: 4px 0;
  background: transparent;
}
.search-modal__close {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.search-modal__close:hover {
  background: #f2f2f2;
}
.search-modal__body {
  padding: 18px 22px 24px;
  overflow-y: auto;
}
.search-modal__label {
  font-family: var(--font-inter);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
}
.search-results {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.search-result {
  display: block;
}
.search-result__media {
  aspect-ratio: 1 / 1;
  background: #f7f7f7;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.search-result__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.search-result__name {
  font-size: 13px;
  margin-top: 8px;
}
.search-result__price {
  font-family: var(--font-inter);
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
}
.search-modal__empty {
  font-size: 14px;
  color: var(--c-muted);
  padding: 12px 0 4px;
}
@media (max-width: 749.98px) {
  .search-modal__panel {
    width: calc(100vw - 24px);
    margin-top: 20px;
    max-height: calc(100vh - 40px);
  }
  .search-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ==========================================================================
   cart drawer (480px wide)
   ========================================================================== */
.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: none;
}
.cart-drawer[open] {
  display: block;
}
.cart-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
}
.cart-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(480px, 100vw);
  background: #fff;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 360ms cubic-bezier(0.32, 0.72, 0.29, 1);
}
.cart-drawer[open] .cart-drawer__panel {
  transform: translateX(0);
}
.cart-drawer__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}
.cart-drawer__close:hover {
  background: #f2f2f2;
}
.cart-drawer__close svg {
  width: 26px;
  height: 26px;
  stroke: #999;
}
.cart-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 76px 24px 24px;
}
.cart-empty {
  text-align: center;
  padding-top: 186px;
}
.cart-empty__title {
  font-family: var(--font-inter);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.4px;
}
.cart-empty__note {
  margin-top: 4px;
  font-size: 14px;
}
.cart-empty__note a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cart-empty__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 28px;
  padding: 15px 44px;
  background: #000;
  color: #fff;
  font-size: 14px;
}
.cart-lines {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cart-line {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid #ececec;
}
.cart-line__media img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  background: #f7f7f7;
}
.cart-line__name {
  font-size: 14px;
  font-weight: 600;
}
.cart-line__meta {
  font-size: 12px;
  color: var(--c-muted);
  margin-top: 2px;
}
.cart-line__qty {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  border: 1px solid #dfdfdf;
  height: 34px;
}
.cart-line__qty button {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.cart-line__qty span {
  min-width: 18px;
  text-align: center;
  font-size: 13px;
}
.cart-line__price {
  font-family: var(--font-inter);
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}
.cart-line__remove {
  display: block;
  margin-top: 10px;
  font-size: 11px;
  color: var(--c-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cart-foot {
  border-top: 1px solid #ececec;
  padding: 18px 24px 24px;
}
.cart-foot__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 14px;
}
.cart-foot__row strong {
  font-family: var(--font-inter);
  font-size: 16px;
  font-weight: 700;
}
.cart-foot__btn {
  width: 100%;
  height: 52px;
  background: #000;
  color: #fff;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.cart-foot__btn:hover {
  background: #1a1a1a;
}
.cart-foot__note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--c-muted);
  text-align: center;
}

/* mobile menu (hamburger) */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: none;
}
.mobile-menu[open] {
  display: block;
}
.mobile-menu__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
}
.mobile-menu__panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(320px, 84vw);
  background: #fff;
  padding: 64px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transform: translateX(-100%);
  transition: transform 320ms cubic-bezier(0.32, 0.72, 0.29, 1);
}
.mobile-menu[open] .mobile-menu__panel {
  transform: translateX(0);
}
.mobile-menu__close {
  position: absolute;
  top: 14px;
  right: 10px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mobile-menu__close svg {
  width: 22px;
  height: 22px;
}
.mobile-menu__link {
  font-family: var(--font-inter);
  font-size: 17px;
  font-weight: 600;
  padding: 13px 0;
  border-bottom: 1px solid #f0f0f0;
}
.mobile-menu__sep {
  height: 18px;
}
.mobile-menu__small {
  font-size: 13px;
  color: var(--c-muted);
}
