/* =========================================================
   KETHRON UI FIXES — V23
   2026-08-14
   - Header search is inline on desktop (no fullscreen overlay)
   - Compact header search uses a small anchored popover
   - Cart remove action has strong contrast
   - Saved-address details are readable
   - Distributor success shows a completed state, not a reset form
   ========================================================= */

:root {
  --k-v23-orange: #ef7f1a;
  --k-v23-ink: #17191e;
  --k-v23-border: #dfe3e8;
  --k-v23-danger: #cf2f2f;
}

/* ---------- Header search: direct input on desktop ---------- */
.header-btns.k-header-actions .k-header-search {
  position: relative;
  width: clamp(190px, 14vw, 238px);
  height: 42px;
  flex: 0 1 238px;
  align-items: center;
  margin: 0;
}

.header-btns.k-header-actions .k-header-search input,
.header-btns.k-header-actions .k-header-search-popover input {
  width: 100%;
  height: 42px;
  margin: 0 !important;
  padding: 0 45px 0 14px !important;
  border: 1px solid var(--k-v23-border) !important;
  border-radius: 999px !important;
  outline: none !important;
  background: #fff !important;
  color: var(--k-v23-ink) !important;
  font-family: inherit;
  font-size: 13px !important;
  font-weight: 500;
  line-height: 42px;
  box-shadow: 0 2px 8px rgba(22,25,31,.025);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.header-btns.k-header-actions .k-header-search input::placeholder,
.header-btns.k-header-actions .k-header-search-popover input::placeholder {
  color: #8a9099 !important;
  opacity: 1;
}

.header-btns.k-header-actions .k-header-search input:focus,
.header-btns.k-header-actions .k-header-search-popover input:focus {
  border-color: rgba(239,127,26,.72) !important;
  box-shadow: 0 0 0 3px rgba(239,127,26,.11), 0 8px 20px rgba(22,25,31,.06);
  background: #fff !important;
}

.header-btns.k-header-actions .k-header-search > button,
.header-btns.k-header-actions .k-header-search-popover > button {
  position: absolute;
  right: 4px;
  top: 4px;
  display: inline-flex;
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: var(--k-v23-orange) !important;
  color: #fff !important;
  font-size: 13px !important;
  line-height: 1 !important;
  box-shadow: none !important;
  cursor: pointer;
}

.header-btns.k-header-actions .k-header-search > button:hover,
.header-btns.k-header-actions .k-header-search-popover > button:hover {
  background: #dc700f !important;
  color: #fff !important;
  transform: none !important;
}

/* 992-1199px: keep the header compact, but open search below the icon. */
.k-header-search-compact {
  position: relative;
  flex: 0 0 auto;
}

.k-header-search-compact .k-header-search-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 10040;
  width: min(330px, calc(100vw - 32px));
  height: 48px;
  padding: 3px;
  margin: 0;
  border: 1px solid #e5e8ed;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(18,22,30,.16);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity .16s ease, visibility .16s ease, transform .16s ease;
}

.k-header-search-compact.is-open .k-header-search-popover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.k-header-search-compact .k-header-search-popover input {
  height: 40px;
  line-height: 40px;
  border: 0 !important;
  box-shadow: none !important;
}

.k-header-search-compact .k-header-search-popover > button {
  top: 7px;
  right: 7px;
}

.k-header-search-compact.is-open .k-header-search-toggle {
  border-color: rgba(239,127,26,.45) !important;
  background: #fff7ef !important;
  color: var(--k-v23-orange) !important;
}

/* Old fullscreen search remains disabled even if legacy markup gets reintroduced. */
.k-site-header + .popup-search-box,
body.kethron-site > .popup-search-box {
  display: none !important;
}

/* ---------- Cart remove button ---------- */
#mycart .k-cart-delete,
#mycarts .k-cart-delete {
  display: inline-flex !important;
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 1px solid #f5caca !important;
  border-radius: 11px !important;
  background: #fff0f0 !important;
  color: var(--k-v23-danger) !important;
  opacity: 1 !important;
  box-shadow: none !important;
  cursor: pointer;
}

#mycart .k-cart-delete i,
#mycarts .k-cart-delete i {
  color: var(--k-v23-danger) !important;
  font-size: 16px !important;
  line-height: 1 !important;
  opacity: 1 !important;
}

#mycart .k-cart-delete:hover,
#mycart .k-cart-delete:focus-visible,
#mycarts .k-cart-delete:hover,
#mycarts .k-cart-delete:focus-visible {
  border-color: var(--k-v23-danger) !important;
  background: var(--k-v23-danger) !important;
  color: #fff !important;
  transform: translateY(-1px);
}

#mycart .k-cart-delete:hover i,
#mycart .k-cart-delete:focus-visible i,
#mycarts .k-cart-delete:hover i,
#mycarts .k-cart-delete:focus-visible i {
  color: #fff !important;
}

/* ---------- Saved addresses: improve readability ---------- */
.k-profile-address-grid {
  gap: 16px !important;
}

.k-profile-address-card {
  padding: 18px !important;
  border-color: #e0e4e9 !important;
}

.k-profile-address-card-head {
  grid-template-columns: 40px 1fr auto !important;
  gap: 11px !important;
  padding-bottom: 13px !important;
}

.k-profile-address-card-head > span {
  width: 40px !important;
  height: 40px !important;
  font-size: 14px !important;
}

.k-profile-address-card-head small {
  color: #7d8590 !important;
  font-size: 10.5px !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  letter-spacing: .035em;
}

.k-profile-address-card-head strong {
  margin-top: 3px !important;
  color: #23272e !important;
  font-size: 14px !important;
  font-weight: 750 !important;
  line-height: 1.35 !important;
}

.k-profile-address-edit {
  min-height: 34px !important;
  padding: 0 11px !important;
  font-size: 12px !important;
}

.k-profile-address-lines {
  gap: 9px !important;
  padding-top: 13px !important;
}

.k-profile-address-lines > div {
  grid-template-columns: 20px minmax(0,1fr) !important;
  gap: 8px !important;
  color: #505965 !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
  line-height: 1.55 !important;
}

.k-profile-address-lines > div > i {
  margin-top: 3px !important;
  color: #8e97a3 !important;
  font-size: 12px !important;
}

.k-profile-address-lines > div > span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #505965 !important;
}

/* ---------- Distributor submitted state ---------- */
.k-distributor-form.is-submitted > .k-form-step {
  display: none !important;
}

.k-distributor-form.is-submitted .k-form-result {
  display: flex !important;
  min-height: 300px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 34px 24px;
  text-align: center;
}

.k-distributor-form.is-submitted .k-form-result[hidden] {
  display: none !important;
}

.k-distributor-form.is-submitted .k-form-result-icon {
  display: inline-flex;
  width: 62px;
  height: 62px;
  align-items: center;
  justify-content: center;
  margin-bottom: 17px;
  border-radius: 50%;
  background: #eaf8ef;
  color: #198754;
  font-size: 24px;
}

.k-distributor-form.is-submitted .k-form-result h3 {
  margin: 0 0 8px;
  color: #20242a;
  font-size: 24px;
}

.k-distributor-form.is-submitted .k-form-result p {
  max-width: 470px;
  margin: 0 0 20px;
  color: #626b76;
  font-size: 14px !important;
  line-height: 1.65;
}

@media (max-width: 767.98px) {
  #mycart .k-cart-delete,
  #mycarts .k-cart-delete {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
  }

  .k-profile-address-grid {
    grid-template-columns: 1fr !important;
  }

  .k-profile-address-card {
    padding: 15px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .k-header-search-compact .k-header-search-popover,
  #mycart .k-cart-delete,
  #mycarts .k-cart-delete {
    transition: none !important;
  }
}
