/* سوئیچر زیرسایت‌ها + هم‌سان‌سازی سرچ با قالب گرگان */

.parsysm-subsite-switcher {
  position: relative;
  z-index: 40;
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(16rem, 42vw);
}

.parsysm-subsite-switcher__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 100%;
  min-height: 1.85rem;
  padding: 0.2rem 0.65rem;
  border: 1px solid hsla(0, 0%, 100%, 0.28);
  border-radius: 0;
  background: hsla(0, 0%, 100%, 0.08);
  color: #fff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.parsysm-subsite-switcher__btn:hover,
.parsysm-subsite-switcher__btn:focus-visible,
.parsysm-subsite-switcher.is-open .parsysm-subsite-switcher__btn {
  background: hsla(0, 0%, 100%, 0.16);
  border-color: hsla(0, 0%, 100%, 0.45);
  outline: none;
}

.parsysm-subsite-switcher__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 9.5rem;
}

.parsysm-subsite-switcher__caret {
  font-size: 0.62rem;
  opacity: 0.75;
  transition: transform 0.18s ease;
}

.parsysm-subsite-switcher.is-open .parsysm-subsite-switcher__caret {
  transform: rotate(180deg);
}

.parsysm-subsite-switcher__panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  inset-inline-start: 0;
  width: min(22rem, 88vw);
  padding: 0.55rem;
  background: #fff;
  border: 1px solid rgba(15, 95, 82, 0.14);
  box-shadow: 0 16px 40px rgba(8, 40, 34, 0.18);
  color: #1a2e2a;
  z-index: 80;
}

.parsysm-subsite-switcher__search {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.65rem;
  margin-bottom: 0.45rem;
  border: 1px solid #e4e4e4;
  background: #f8faf9;
}

html.parsysm-subportal-root:not([data-theme="dark"]) .parsysm-subsite-switcher__search {
  border: 1px solid #e4e4e4;
  background: #f8faf9;
}

.parsysm-subsite-switcher__search i {
  color: var(--parsysm-primary, #157c6a);
  font-size: 0.78rem;
}

.parsysm-subsite-switcher__input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.84rem;
  color: inherit;
  outline: none;
}

.parsysm-subsite-switcher__list {
  max-height: 16rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.parsysm-subsite-switcher__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  text-align: right;
  cursor: pointer;
  text-decoration: none;
}

.parsysm-subsite-switcher__option:hover,
.parsysm-subsite-switcher__option:focus-visible {
  background: color-mix(in srgb, var(--parsysm-primary, #157c6a) 10%, #fff);
  color: var(--parsysm-primary-deep, #0a4a40);
  outline: none;
}

.parsysm-subsite-switcher__option.is-current {
  background: color-mix(in srgb, var(--parsysm-primary, #157c6a) 14%, #fff);
  color: var(--parsysm-primary-deep, #0a4a40);
  box-shadow: inset 3px 0 0 var(--parsysm-primary, #157c6a);
}

.parsysm-subsite-switcher__empty {
  padding: 0.85rem 0.5rem;
  text-align: center;
  font-size: 0.82rem;
  color: #6b7c78;
}

/* سرچ زیرسایت = ظاهر گرگان (نه دکمه دایره نارنجی) — فقط لایت */
html.parsysm-subportal-root:not([data-theme="dark"]) .header-search {
  display: flex !important;
  align-items: center;
  padding: 0.75rem 1.25rem 0.625rem 0.775rem !important;
  border: 1px solid #e4e4e4 !important;
  border-radius: 3px !important;
  background-color: #fff !important;
  box-shadow: none !important;
}

html.parsysm-subportal-root:not([data-theme="dark"]) .header-search:focus-within {
  border-color: var(--parsysm-primary, #157c6a) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--parsysm-primary, #157c6a) 16%, transparent) !important;
}

html.parsysm-subportal-root .header-search {
  display: flex !important;
  align-items: center;
  padding: 0.75rem 1.25rem 0.625rem 0.775rem !important;
  border-radius: 3px !important;
}

html.parsysm-subportal-root .header-search__btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

html.parsysm-subportal-root:not([data-theme="dark"]) .header-search__btn {
  color: #222 !important;
}

html.parsysm-subportal-root .header-search__btn:hover,
html.parsysm-subportal-root .header-search__btn:focus-visible {
  background: transparent !important;
  color: var(--parsysm-primary, #157c6a) !important;
}

html.parsysm-subportal-root .header-search__btn svg,
html.parsysm-subportal-root .header-search__btn use {
  fill: currentColor;
  color: inherit;
}

html.parsysm-subportal-root .header-search__input {
  border: 0 !important;
  background: transparent !important;
  margin-right: 15px;
  outline: none;
}

html.parsysm-subportal-root:not([data-theme="dark"]) .header-search__input {
  color: #222 !important;
}

html.parsysm-subportal-root .header-desk__start {
  flex: 0 0 auto;
  min-width: 0;
}

html.parsysm-subportal-root .btn-address-pick {
  color: var(--parsysm-primary, #157c6a) !important;
  border-color: var(--parsysm-primary, #157c6a) !important;
  background: #fff !important;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

html.parsysm-subportal-root .btn-address-pick .address-icon,
html.parsysm-subportal-root .btn-address-pick .dropdown-icon {
  flex-shrink: 0;
}

@media (max-width: 991px) {
  .parsysm-subsite-switcher {
    max-width: min(12rem, 48vw);
  }
  .parsysm-subsite-switcher__label {
    max-width: 6.5rem;
  }
  html.parsysm-subportal-root .header-desk__start {
    display: none;
  }
}
