/**
 * InFront header account avatar + dropdown.
 * Same structure as Sintech; lime/charcoal brand colours.
 */

:root {
  --ift-header-brand: #8CC63F;
  --ift-header-brand-dark: #6fa82e;
  --ift-header-ink: #1a1a1a;
  --ift-header-muted: #6b7280;
  --ift-header-line: #e5e7eb;
  --ift-header-wash: #f3f4f6;
  --ift-header-control: 42px;
  --ift-header-radius: 999px;
}

/* ---- Desktop search pill ---- */
#desktop-header .ift-search-widget,
#desktop-header .search-widget.ift-search-widget {
  width: 100%;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

#desktop-header .ift-search-group {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  margin: 0;
  border: 1.5px solid var(--ift-header-line);
  border-radius: var(--ift-header-radius);
  background: #fff;
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

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

#desktop-header .ift-search-input.form-control,
#desktop-header .ift-search-input {
  flex: 1 1 auto;
  height: var(--ift-header-control);
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 0.25rem 0 1.15rem !important;
  font-size: 0.95rem;
  color: var(--ift-header-ink);
}

#desktop-header .ift-search-input::placeholder {
  color: var(--ift-header-muted);
  opacity: 1;
}

#desktop-header .ift-search-btn.search-btn,
#desktop-header .ift-search-btn {
  flex: 0 0 auto;
  width: 48px;
  min-width: 48px;
  height: var(--ift-header-control);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ift-header-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

#desktop-header .ift-search-btn:hover,
#desktop-header .ift-search-btn:focus {
  color: var(--ift-header-brand-dark);
  background: rgba(140, 198, 63, 0.12);
  outline: none;
}

/* Keep the account/cart cluster above the megamenu (~97–100) */
#desktop-header .col-header-right {
  flex: 0 0 auto;
  max-width: none;
  position: relative;
  z-index: 110;
}

#desktop-header .col-header-right:has(.dropdown.show),
#desktop-header .col-header-right:has(.ift-account-dropdown.show),
#desktop-header .col-header-right:has(#ps-shoppingcart.show) {
  z-index: 1200;
}

#desktop-header .ift-header-actions {
  gap: 0.5rem;
  flex-wrap: nowrap;
}

#desktop-header .ift-header-user,
#desktop-header #ps-shoppingcart-wrapper {
  flex: 0 0 auto;
  padding-left: 0.1rem;
  padding-right: 0.1rem;
}

/* ---- Circular avatar ---- */
#desktop-header .ift-avatar-btn.header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--ift-header-control);
  height: var(--ift-header-control);
  padding: 0;
  border: 0;
  background: transparent;
  text-decoration: none;
  line-height: 1;
}

#desktop-header .ift-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--ift-header-control);
  height: var(--ift-header-control);
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid #d1d5db;
  color: var(--ift-header-ink);
  font-size: 1.1rem;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

#desktop-header .ift-avatar__initial {
  font-size: 0.95rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

#desktop-header .ift-avatar-btn:hover .ift-avatar,
#desktop-header .ift-avatar-btn:focus .ift-avatar {
  border-color: var(--ift-header-brand);
  background: rgba(140, 198, 63, 0.12);
  color: var(--ift-header-brand-dark);
}

#desktop-header .ift-avatar-label,
#desktop-header .ift-avatar-btn .title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#desktop-header .ift-avatar-btn > .fa.icon {
  display: none !important;
}

/* ---- Account dropdown ---- */
#desktop-header .ift-account-dropdown {
  position: relative;
  z-index: 1;
}

#desktop-header .ift-account-dropdown.show {
  z-index: 2;
}

#desktop-header .ift-account-dropdown.show .ift-avatar,
#desktop-header .ift-account-dropdown .ift-avatar-btn[aria-expanded="true"] .ift-avatar {
  border-color: var(--ift-header-brand);
  background: rgba(140, 198, 63, 0.14);
  color: var(--ift-header-brand-dark);
  box-shadow: 0 0 0 3px rgba(140, 198, 63, 0.22);
}

#desktop-header .ift-account-menu.dropdown-menu {
  min-width: 280px;
  max-width: min(320px, calc(100vw - 1.5rem));
  margin-top: 0.65rem !important;
  padding: 0;
  border: 1px solid rgba(31, 41, 55, 0.08);
  border-radius: 16px;
  background: #fff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 18px 40px -18px rgba(31, 41, 55, 0.35);
  overflow: hidden;
  z-index: 1050;
}

#desktop-header .ift-account-dropdown.show > .ift-account-menu.dropdown-menu {
  display: block;
}

#desktop-header .ift-account-menu__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  background: linear-gradient(135deg, rgba(140, 198, 63, 0.18) 0%, rgba(111, 168, 46, 0.06) 55%, #fff 100%);
  border-bottom: 1px solid rgba(31, 41, 55, 0.06);
}

#desktop-header .ift-account-menu__avatar {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #8CC63F, #6fa82e);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  box-shadow: 0 6px 14px -8px rgba(111, 168, 46, 0.85);
}

#desktop-header .ift-account-menu__who {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

#desktop-header .ift-account-menu__name {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#desktop-header .ift-account-menu__email {
  display: block;
  font-size: 0.78rem;
  line-height: 1.3;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#desktop-header .ift-account-menu__links {
  padding: 0.45rem 0.4rem;
}

#desktop-header .ift-account-menu__link.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0.1rem 0;
  padding: 0.62rem 0.7rem;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: #1f2937;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

#desktop-header .ift-account-menu__link.dropdown-item .fa {
  width: 1.15rem;
  text-align: center;
  color: #9ca3af;
  font-size: 0.95rem;
  transition: color 0.15s ease;
}

#desktop-header .ift-account-menu__link.dropdown-item:hover,
#desktop-header .ift-account-menu__link.dropdown-item:focus {
  background: rgba(140, 198, 63, 0.12);
  color: #111827;
}

#desktop-header .ift-account-menu__link.dropdown-item:hover .fa,
#desktop-header .ift-account-menu__link.dropdown-item:focus .fa {
  color: var(--ift-header-brand-dark);
}

#desktop-header .ift-account-menu__footer {
  padding: 0.35rem 0.4rem 0.45rem;
  border-top: 1px solid rgba(31, 41, 55, 0.07);
  background: #fafafa;
}

#desktop-header .ift-account-menu__link--logout.dropdown-item {
  color: #4b5563;
}

#desktop-header .ift-account-menu__link--logout.dropdown-item .fa {
  color: #6b7280;
}

#desktop-header .ift-account-menu__link--logout.dropdown-item:hover,
#desktop-header .ift-account-menu__link--logout.dropdown-item:focus {
  background: rgba(140, 198, 63, 0.16);
  color: #1a1a1a;
}

/* ---- Circular cart ---- */
#desktop-header .ift-cart-btn.header-cart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--ift-header-control);
  height: var(--ift-header-control);
  padding: 0;
  text-decoration: none;
  position: relative;
}

#desktop-header .ift-cart-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--ift-header-control);
  height: var(--ift-header-control);
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid #d1d5db;
  color: var(--ift-header-ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

#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-color: var(--ift-header-brand);
  background: rgba(140, 198, 63, 0.12);
  color: var(--ift-header-brand-dark);
}

#desktop-header #ps-shoppingcart.show .ift-cart-icon-wrap {
  box-shadow: 0 0 0 3px rgba(140, 198, 63, 0.22);
}

#desktop-header .ift-cart-icon-wrap .icon,
#desktop-header .ift-cart-icon-wrap .fa {
  font-size: 1.05rem;
  margin: 0;
  line-height: 1;
}

#desktop-header .ift-cart-badge.cart-products-count-btn,
#desktop-header .ift-cart-badge {
  position: absolute !important;
  top: -4px;
  right: -4px;
  left: auto !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--ift-header-brand) !important;
  color: #fff !important;
  font-size: 0.65rem !important;
  font-weight: 700;
  line-height: 1;
  border: 2px solid #fff;
  box-shadow: none;
}

#desktop-header .ift-cart-badge.d-none {
  display: none !important;
}

#desktop-header .ift-cart-info {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

/* ---- Mobile header icon row ---- */
#mobile-header .row-mobile-header {
  flex-wrap: nowrap;
  align-items: center;
}

#mobile-header .col-mobile-logo {
  min-width: 0;
  flex: 1 1 auto;
}

#mobile-header .col-mobile-logo img.logo,
#mobile-header .col-mobile-logo .logo {
  max-height: 44px !important;
  max-width: 148px !important;
  width: auto !important;
  height: auto !important;
}

#mobile-header .col-mobile-btn {
  flex: 0 0 auto;
  width: auto;
  padding-left: 0;
  padding-right: 0;
}

#mobile-header .col-mobile-btn .m-nav-btn {
  display: inline-flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  padding: 0.15rem 0 !important;
  margin: 0;
  color: var(--ift-header-ink);
  text-decoration: none;
}

#mobile-header .col-mobile-btn .m-nav-btn > span:not(.ift-mobile-avatar):not(.ift-mobile-cart-icon-wrap):not(.ift-cart-icon-wrap):not(.ift-cart-badge):not(.cart-products-count):not(.cart-products-count-btn) {
  display: none !important;
}

#mobile-header .col-mobile-btn .m-nav-btn > i,
#mobile-header .col-mobile-btn .m-nav-btn > .fa,
#mobile-header .col-mobile-btn .m-nav-btn .ift-mobile-avatar,
#mobile-header .col-mobile-btn .ift-mobile-cart-icon-wrap {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0 !important;
  border-radius: 50%;
  background: var(--ift-header-wash);
  border: 1.5px solid var(--ift-header-line);
  font-size: 1rem !important;
  font-weight: 700;
  line-height: 1;
  color: var(--ift-header-ink);
  text-transform: uppercase;
}

#mobile-header .col-mobile-btn-cart .ift-mobile-cart-icon-wrap {
  position: relative;
  flex-shrink: 0;
}

#mobile-header .col-mobile-btn-cart .ift-mobile-cart-icon-wrap .fa {
  width: auto;
  height: auto;
  border: 0;
  background: transparent;
  font-size: 1rem !important;
  line-height: 1;
  margin: 0;
}

#mobile-header .col-mobile-btn-cart #mobile-cart-products-count,
#mobile-header .col-mobile-btn-cart .ift-mobile-cart-icon-wrap .ift-cart-badge {
  position: absolute !important;
  top: -4px !important;
  right: -4px !important;
  left: auto !important;
  bottom: auto !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px !important;
  border-radius: 999px;
  background: var(--ift-header-brand) !important;
  color: #fff !important;
  font-size: 0.65rem !important;
  font-weight: 700;
  line-height: 1 !important;
  text-align: center;
  border: 2px solid #fff;
  box-sizing: border-box;
  pointer-events: none;
}

#mobile-header .col-mobile-btn-cart .ift-cart-badge.d-none,
#mobile-header .col-mobile-btn-cart #mobile-cart-products-count.d-none {
  display: none !important;
}

#mobile-header #search-widget-mobile .ift-search-group,
#search-widget-mobile .ift-search-group {
  border: 1.5px solid var(--ift-header-line);
  border-radius: var(--ift-header-radius);
  background: #fff;
  overflow: hidden;
}

#mobile-header #search-widget-mobile .ift-search-group:focus-within,
#search-widget-mobile .ift-search-group:focus-within {
  border-color: var(--ift-header-brand);
  box-shadow: 0 0 0 3px rgba(140, 198, 63, 0.22);
}

#mobile-header #search-widget-mobile .ift-search-input,
#search-widget-mobile .ift-search-input {
  border: 0 !important;
  box-shadow: none !important;
  height: 42px;
  padding-left: 1rem !important;
  background: transparent !important;
}

#mobile-header #search-widget-mobile .ift-search-btn,
#search-widget-mobile .ift-search-btn {
  width: 46px;
  height: 42px;
  border: 0;
  background: transparent;
  color: var(--ift-header-ink);
}

/* ---- Search suggestions panel ---- */
.search-widget.ift-search-has-ac,
#search_widget.ift-search-has-ac {
  position: relative;
  z-index: 1205;
}

#search-widget-mobile.ift-search-has-ac,
#mobile-header #search-widget-mobile,
#mobile-header #search-widget-mobile.dropdown-menu {
  position: absolute !important;
  z-index: 1205;
}

.search-widget.ift-search-has-ac form,
#search_widget.ift-search-has-ac form {
  position: relative;
  overflow: visible;
}

.autocomplete-suggestions.ift-ac-menu {
  top: calc(100% + 0.45rem);
  left: 0;
  right: 0;
  width: 100%;
  min-width: 100%;
  max-width: none;
  max-height: min(72vh, 640px);
  padding: 0.4rem 0 0;
  border: 1px solid rgba(31, 41, 55, 0.08);
  border-radius: 16px;
  background: #fff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 18px 40px -18px rgba(31, 41, 55, 0.35);
  overflow-x: hidden;
  overflow-y: auto;
  z-index: 1210;
}

#desktop-header .col-header-center {
  overflow: visible;
}

.ift-ac-heading {
  padding: 0.55rem 0.9rem 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7280;
}

.ift-ac-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.55rem;
}

.ift-ac-product.autocomplete-suggestion {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.45rem 0.5rem;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
}

.ift-ac-product.autocomplete-suggestion:hover,
.ift-ac-product.autocomplete-suggestion.selected {
  background: rgba(140, 198, 63, 0.1);
}

.ift-ac-thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.ift-ac-thumb--empty {
  display: block;
}

.ift-ac-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.ift-ac-name {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.3;
  color: #111827;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ift-ac-meta {
  font-size: 0.75rem;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ift-ac-prices {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}

.ift-ac-price {
  font-size: 0.95rem;
  font-weight: 800;
  color: #111827;
}

.ift-ac-price-was {
  font-size: 0.78rem;
  color: #9ca3af;
  text-decoration: line-through;
}

.ift-ac-action {
  flex: 0 0 auto;
  padding-right: 0.25rem;
}

.ift-ac-add,
.ift-ac-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 5.5rem;
  min-height: 2.25rem;
  padding: 0.4rem 0.75rem;
  border: 0;
  border-radius: 999px;
  background: #1a1a1a;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.ift-ac-add:hover,
.ift-ac-add:focus,
.ift-ac-view:hover,
.ift-ac-view:focus {
  background: var(--ift-header-brand);
  color: #1a1a1a;
  outline: none;
  text-decoration: none;
}

.ift-ac-add.is-processing {
  opacity: 0.65;
  pointer-events: none;
}

.ift-ac-add.is-added {
  background: var(--ift-header-brand);
  color: #1a1a1a;
}

.autocomplete-suggestion-show-all.ift-ac-all {
  margin: 0.35rem 0.55rem 0.55rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border-top: 0;
  background: #f8fafc;
  font-weight: 800;
  color: #1a1a1a;
  text-align: center;
}

.autocomplete-suggestion-show-all.ift-ac-all:hover,
.autocomplete-suggestion-show-all.ift-ac-all.selected {
  background: rgba(140, 198, 63, 0.14);
}

@media (max-width: 767.98px) {
  .autocomplete-suggestions.ift-ac-menu {
    max-height: min(65vh, 520px);
  }

  .ift-ac-thumb {
    flex-basis: 56px;
    width: 56px;
    height: 56px;
  }

  .ift-ac-add,
  .ift-ac-view {
    min-width: 4.4rem;
    padding: 0.35rem 0.6rem;
  }
}
