/* دکمه سبد خرید هدر — دسکتاپ + موبایل */

.kharid-header-cart {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 56px;
  height: 56px;
  padding: 0 12px;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid #0984e3;
  background: #e8f4ff;
  color: #0984e3;
  text-decoration: none !important;
  -webkit-tap-highlight-color: transparent;
}

.kharid-header-cart:hover,
.kharid-header-cart:focus {
  background: #d6ecff;
  color: #066bb8;
}

.kharid-header-cart__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.kharid-header-cart__icon svg {
  display: block;
  width: 30px;
  height: 30px;
}

.kharid-header-cart__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35em;
  padding: 0 4px;
  font-family: IRANSans, Tahoma, sans-serif;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  color: #e74c3c;
}

.kharid-header-cart__badge[hidden] {
  display: none !important;
}

.site-topbar .logobar {
  position: relative;
}

/* فضای خالی سمت چپ برای دکمه سبد در دسکتاپ */
.site-topbar .logobar:has(.kharid-header-cart) {
  padding-left: 84px;
  box-sizing: border-box;
}

html.kharid-phone .site-topbar .logobar,
body.kharid-phone .site-topbar .logobar,
html.cc-phone .site-topbar .logobar {
  padding-left: 310px !important;
  padding-right: 18px !important;
  justify-content: flex-end !important;
  direction: ltr !important;
}

html.kharid-phone .kharid-header-cart,
body.kharid-phone .kharid-header-cart,
html.cc-phone .kharid-header-cart {
  left: 210px !important;
  right: auto !important;
  width: 88px !important;
  min-width: 88px !important;
  height: 72px !important;
  padding: 0 !important;
  border: 1px solid #0984e3 !important;
  background: #74b9ff !important;
  color: #fff !important;
  border-radius: 8px !important;
  gap: 0 !important;
}

html.kharid-phone .kharid-header-cart__icon svg,
body.kharid-phone .kharid-header-cart__icon svg,
html.cc-phone .kharid-header-cart__icon svg {
  width: 41px !important;
  height: 41px !important;
  color: #fff !important;
  fill: #fff !important;
}

@media (pointer: coarse), (hover: none) {
  html.kharid-phone .site-topbar .logobar,
  body.kharid-phone .site-topbar .logobar,
  html.cc-phone .site-topbar .logobar {
    padding-left: 310px !important;
    padding-right: 18px !important;
    justify-content: flex-end !important;
    direction: ltr !important;
  }

  html.kharid-phone .kharid-header-cart,
  body.kharid-phone .kharid-header-cart,
  html.cc-phone .kharid-header-cart {
    left: 210px !important;
    right: auto !important;
    width: 88px !important;
    min-width: 88px !important;
    height: 72px !important;
    padding: 0 !important;
    border: 1px solid #0984e3 !important;
    background: #74b9ff !important;
    color: #fff !important;
    border-radius: 8px !important;
    gap: 0 !important;
  }

  html.kharid-phone .kharid-header-cart__icon svg,
  body.kharid-phone .kharid-header-cart__icon svg,
  html.cc-phone .kharid-header-cart__icon svg {
    width: 41px !important;
    height: 41px !important;
    color: #fff !important;
    fill: #fff !important;
  }

  html.kharid-phone .kharid-header-cart__badge,
  body.kharid-phone .kharid-header-cart__badge,
  html.cc-phone .kharid-header-cart__badge {
    position: absolute;
    top: 4px;
    right: 6px;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e74c3c;
    color: #fff !important;
    font-size: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  }
}
