/**
 * InFront desktop header v2: logo, search, account + cart.
 * Layers over ift-header-account.css. Remove the <link> in
 * layout-both-columns.tpl to return to the v1 circular-icon header.
 */

#desktop-header {
  --hv2-ink: #1f2328;
  --hv2-muted: #6b7280;
  --hv2-line: #dfe2e6;
  --hv2-field: #f4f5f7;
  --hv2-bar: #2b2f36;
  --hv2-brand: #8CC63F;
  --hv2-brand-dark: #5f9424;
}

/* ---- Row ---- */
#desktop-header .header-top {
  padding: 14px 0 !important;
}

#desktop-header .col-header-left {
  padding-right: 2rem;
}

#desktop-header #desktop_logo img.logo {
  width: auto;
  height: 64px;
  max-width: none;
}

#desktop-header #desktop_logo a {
  display: block;
  line-height: 0;
}

/* ---- Search ---- */
#desktop-header .col-header-center {
  flex: 1 1 0%;
  min-width: 0;
}

#desktop-header .ift-search-widget,
#desktop-header .search-widget.ift-search-widget {
  max-width: 47rem;
}

#desktop-header .ift-search-group {
  border: 1px solid var(--hv2-line);
  background: var(--hv2-field);
  padding: 3px;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

#desktop-header .ift-search-group:hover {
  border-color: #c9cdd3;
}

#desktop-header .ift-search-group:focus-within {
  background: #fff;
  border-color: var(--hv2-brand-dark);
  box-shadow: 0 0 0 3px rgba(140, 198, 63, 0.18);
}

#desktop-header .ift-search-input.form-control,
#desktop-header .ift-search-input {
  height: 40px;
  padding-left: 1.1rem !important;
  font-size: 0.95rem;
  color: var(--hv2-ink);
}

#desktop-header .ift-search-input::placeholder {
  color: #7a808a;
}

#desktop-header .ift-search-btn.search-btn,
#desktop-header .ift-search-btn {
  width: 40px;
  min-width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--hv2-bar);
  color: #fff;
  font-size: 0.95rem;
}

#desktop-header .ift-search-btn:hover,
#desktop-header .ift-search-btn:focus {
  background: var(--hv2-brand);
  color: var(--hv2-ink);
}

#desktop-header .ift-search-btn:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--hv2-brand-dark);
}

/* ---- Account + cart ---- */
#desktop-header .col-header-right {
  padding-left: 2rem;
}

#desktop-header .ift-header-actions {
  gap: 0.25rem;
}

#desktop-header .ift-avatar-btn.header-btn,
#desktop-header .ift-cart-btn.header-cart-btn {
  gap: 0.6rem;
  height: 48px;
  padding: 0 0.8rem 0 0.6rem;
  border-radius: 10px;
  color: var(--hv2-ink);
  transition: background-color 0.15s ease;
}

#desktop-header .ift-avatar-btn.header-btn:hover,
#desktop-header .ift-avatar-btn.header-btn:focus,
#desktop-header .ift-cart-btn.header-cart-btn:hover,
#desktop-header .ift-cart-btn.header-cart-btn:focus,
#desktop-header .ift-account-dropdown.show .ift-avatar-btn,
#desktop-header #ps-shoppingcart.show .ift-cart-btn {
  background: var(--hv2-field);
  color: var(--hv2-ink);
  text-decoration: none;
  outline: none;
}

#desktop-header .ift-avatar-btn.header-btn:focus-visible,
#desktop-header .ift-cart-btn.header-cart-btn:focus-visible {
  box-shadow: 0 0 0 2px var(--hv2-brand-dark);
}

/* Icon: plain line icon, no ring */
#desktop-header .ift-avatar,
#desktop-header .ift-cart-icon-wrap {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--hv2-ink) !important;
}

#desktop-header .ift-avatar .fa,
#desktop-header .ift-cart-icon-wrap .fa {
  display: none;
}

#desktop-header .ift-hdr-ico {
  display: block;
  width: 24px;
  height: 24px;
}

/* Signed-in: initial in a small charcoal disc */
#desktop-header .ift-avatar:has(.ift-avatar__initial) {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--hv2-bar) !important;
  color: #fff !important;
}

#desktop-header .ift-avatar__initial {
  font-size: 0.85rem;
  font-weight: 700;
}

#desktop-header .ift-account-dropdown.show .ift-avatar,
#desktop-header .ift-account-dropdown .ift-avatar-btn[aria-expanded="true"] .ift-avatar,
#desktop-header .ift-avatar-btn:hover .ift-avatar,
#desktop-header .ift-avatar-btn:focus .ift-avatar,
#desktop-header .ift-cart-btn:hover .ift-cart-icon-wrap,
#desktop-header .ift-cart-btn:focus .ift-cart-icon-wrap,
#desktop-header #ps-shoppingcart.show .ift-cart-icon-wrap {
  border: 0;
  box-shadow: none !important;
}

#desktop-header .ift-cart-badge.cart-products-count-btn,
#desktop-header .ift-cart-badge {
  top: -6px;
  right: -9px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-family: Manrope, Helvetica, Arial, sans-serif;
  background: var(--hv2-brand) !important;
  color: var(--hv2-ink) !important;
  font-size: 0.68rem !important;
  font-weight: 800;
  border: 2px solid #fff;
}

#desktop-header .ift-cart-btn:hover .ift-cart-badge,
#desktop-header #ps-shoppingcart.show .ift-cart-badge {
  border-color: var(--hv2-field);
}

/* Two-line label */
#desktop-header .ift-hdr-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  white-space: nowrap;
  text-align: left;
}

#desktop-header .ift-hdr-label__sub {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--hv2-muted);
}

#desktop-header .ift-hdr-label__main {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--hv2-ink);
}

/* ---- Sticky menu bar: cart moves into the 56px slot on the dark bar ---- */
#desktop-header #sticky-cart-wrapper .ift-cart-btn.header-cart-btn {
  gap: 0;
  width: 48px;
  min-width: 48px;
  height: 40px;
  padding: 0;
  justify-content: center;
  border-radius: 8px;
  background: transparent;
}

#desktop-header #sticky-cart-wrapper .ift-hdr-label {
  display: none;
}

#desktop-header #sticky-cart-wrapper .ift-cart-icon-wrap {
  color: #fff !important;
}

#desktop-header #sticky-cart-wrapper .ift-cart-btn.header-cart-btn:hover,
#desktop-header #sticky-cart-wrapper .ift-cart-btn.header-cart-btn:focus,
#desktop-header #sticky-cart-wrapper #ps-shoppingcart.show .ift-cart-btn {
  background: rgba(255, 255, 255, 0.1);
}

#desktop-header #sticky-cart-wrapper .ift-cart-badge.cart-products-count-btn,
#desktop-header #sticky-cart-wrapper .ift-cart-badge,
#desktop-header #sticky-cart-wrapper .ift-cart-btn:hover .ift-cart-badge {
  border-color: var(--hv2-bar);
}

/* ---- Account dropdown: flat header, no gradient ---- */
#desktop-header .ift-account-menu.dropdown-menu {
  margin-top: 0.4rem !important;
  border-radius: 12px;
  border-color: var(--hv2-line);
  box-shadow: 0 14px 32px -16px rgba(31, 35, 40, 0.35);
}

#desktop-header .ift-account-menu__header {
  background: #f7f8f9;
  border-bottom-color: #eceef1;
}

#desktop-header .ift-account-menu__avatar {
  background: var(--hv2-bar);
  box-shadow: none;
}

@media (max-width: 1299.98px) {
  #desktop-header .col-header-left { padding-right: 1.25rem; }
  #desktop-header .col-header-right { padding-left: 1.25rem; }
  #desktop-header #desktop_logo img.logo { height: 58px; }
}

@media (prefers-reduced-motion: reduce) {
  #desktop-header .ift-avatar-btn.header-btn,
  #desktop-header .ift-cart-btn.header-cart-btn {
    transition: none;
  }
}
