:root {
  --mgs-obh-red: #ad013f;
  --mgs-obh-content: 1500px;
}

.mgs-obh-root,
.mgs-obh-root * {
  box-sizing: border-box;
}

.mgs-obh-root {
  width: 100%;
  max-width: none !important;
  margin: 0;
  padding: 0 !important;
  overflow: hidden;
  direction: rtl;
  background: var(--mgs-obh-red);
}

.mgs-obh-root > .e-con-inner,
.mgs-obh-header > .e-con-inner {
  display: block !important;
  width: 100%;
  max-width: none !important;
  margin: 0;
  padding: 0 !important;
}

.mgs-obh-header {
  position: relative;
  width: 100%;
  max-width: none !important;
  padding: 0 !important;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 115%, #cc0751 0, #b90045 42%, #960035 100%);
}

.mgs-obh-slot {
  position: relative;
  z-index: 4;
  margin: 0;
  padding: 0 !important;
}

.mgs-obh-hero {
  z-index: 0;
  width: 100%;
  min-height: 280px;
  aspect-ratio: 24 / 7;
  overflow: hidden;
  background-color: var(--mgs-obh-red);
  background-image: url("../images/open-box-header.webp");
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: 100% auto;
}

.mgs-obh-hero > .e-con-inner {
  width: 100%;
  height: 100%;
  max-width: none !important;
  padding: 0 !important;
}

.mgs-obh-slot--logo,
.mgs-obh-slot--account,
.mgs-obh-slot--cart {
  position: absolute !important;
  top: 38px;
  min-height: 56px;
  border-radius: 12px;
}

.mgs-obh-slot--logo {
  right: max(24px, calc((100% - var(--mgs-obh-content)) / 2));
  width: 170px;
  min-height: 72px;
}

.mgs-obh-slot--account {
  left: max(90px, calc((100% - var(--mgs-obh-content)) / 2 + 66px));
  width: 164px;
}

.mgs-obh-slot--cart {
  left: max(24px, calc((100% - var(--mgs-obh-content)) / 2));
  width: 56px;
}

.mgs-obh-slot--logo img,
.mgs-obh-slot--account img,
.mgs-obh-slot--cart img {
  display: block;
  max-width: 100%;
  max-height: 72px;
  object-fit: contain;
}

.elementor-editor-active .mgs-obh-slot {
  outline: 2px dashed rgba(255, 255, 255, 0.82);
  outline-offset: -2px;
  background: rgba(255, 255, 255, 0.08);
}

.elementor-editor-active .mgs-obh-slot:not(:has(.elementor-element))::before {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: max-content;
  max-width: calc(100% - 14px);
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.92);
  color: #8f0034;
  font: 700 11px/1.5 Tahoma, Arial, sans-serif;
  text-align: center;
  pointer-events: none;
}

.elementor-editor-active .mgs-obh-slot--logo:not(:has(.elementor-element))::before { content: "لوگو"; }
.elementor-editor-active .mgs-obh-slot--account:not(:has(.elementor-element))::before { content: "ورود / ثبت‌نام"; }
.elementor-editor-active .mgs-obh-slot--cart:not(:has(.elementor-element))::before { content: "سبد"; }

@media (max-width: 767px) {
  .mgs-obh-header {
    background:
      radial-gradient(circle at 50% 105%, #cb074f 0, #b60042 48%, #8f0032 100%);
  }

  .mgs-obh-hero {
    width: 100%;
    min-height: 0;
    aspect-ratio: 2.05 / 1;
    background-size: 100% auto;
    background-position: center bottom;
  }

  .mgs-obh-slot--logo,
  .mgs-obh-slot--account,
  .mgs-obh-slot--cart {
    top: 10px;
    min-height: 40px;
    border-radius: 9px;
  }

  .mgs-obh-slot--logo {
    right: 12px;
    width: 88px;
    min-height: 42px;
  }

  .mgs-obh-slot--account {
    left: 59px;
    width: 108px;
  }

  .mgs-obh-slot--cart {
    left: 12px;
    width: 40px;
  }

  .elementor-editor-active .mgs-obh-slot:not(:has(.elementor-element))::before {
    padding: 4px 5px;
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mgs-obh-root *,
  .mgs-obh-root *::before,
  .mgs-obh-root *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
