/* ===== Header: layout ===== */

header {
  margin-top: 4rem;
  margin-bottom: 2rem;
}

.header__logo {
  width: 20.9rem;
}

.header__logo img {
  width: 100%;
}

.header__container {
  position: relative;
  width: 100%;
  height: 12rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--block-padding);
  background-color: var(--light-bg);
  border-radius: 2.4rem;
}

.header__main {
  display: flex;
  gap: 6rem;
  align-items: center;
}

.header__nav {
  display: flex;
  gap: 4rem;
}

.header__nav-btn {
  font-size: var(--p1-font-size);
  font-weight: 700;
  color: var(--accent);
}

.header__nav-btn:hover {
  color: var(--text-color);
}

/*
 * Hover bridge: invisible zone that appears ONLY while the button is already hovered.
 * It fills the gap from button bottom to dropdown top so the cursor stays inside
 * button :hover while traveling downward — without ever triggering on idle movement.
 *
 * Height covers: half of 12rem container + 1.2rem gap + safety margin ≈ 8rem.
 */
.header__nav-btn--products {
  position: relative;
}

.header__nav-btn--products:hover::after {
  content: '';
  position: absolute;
  top: 100%;
  left: -1rem;
  right: -1rem;
  height: 8rem;
  z-index: 3;
}


/* ===== Header: product dropdown ===== */

@keyframes dropdown-enter {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header__container:has(.header__nav-btn--products:hover) .header__dropdown,
.header__container:has(.header__dropdown:hover) .header__dropdown {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0s;
  animation: dropdown-enter 200ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.header__main:has(~ .header__dropdown.active) .header__nav-btn--products {
  color: var(--pressed-color);
}

.header__dropdown {
  position: absolute;
  width: 100%;
  min-width: 900px;
  top: calc(100% + 1.2rem);
  left: 0;
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.04), 0 24px 64px rgba(0, 0, 0, 0.10);
  padding: 36px 40px 0 40px;
  opacity: 0;
  transform: translateY(-8px);
  z-index: 4;
  visibility: hidden;
  overflow: hidden;
  transition: opacity 200ms cubic-bezier(0.4, 0, 0.2, 1),
              transform 200ms cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0s linear 0.4s;
}

.header__dropdown.active {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  transition-delay: 0s;
}

/* Columns grid */

.header__dropdown-columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
}

.header__dropdown-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 36px;
  padding-bottom: 28px;
}

.header__dropdown-group:first-child {
  padding-left: 4px;
}

.header__dropdown-group:last-child {
  padding-right: 0;
}

.header__dropdown-group + .header__dropdown-group {
  border-left: 1px solid #F0F1F3;
}

/* Category header (desktop mega-menu) */

.header__dropdown.mega-menu .header__dropdown-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 12px;
  text-decoration: none;
}

.header__dropdown.mega-menu .header__dropdown-title:hover .header__dropdown-label {
  color: #4A5CE8;
}

/*
 * Desktop mega-menu typography: base.css sets html { font-size: 8.5px }, so 1rem ≈ 8.5px.
 * Nav uses var(--p1-font-size) (= 2rem ≈ 17px). The dropdown previously used sub-1rem
 * values (~8–10px). rem always resolves against html, not a parent — so this panel gets
 * font-size: 16px for em/inheritance context, category labels in px, and product links use
 * var(--p1-font-size) to match ".header__nav-btn" / global link scale (not transform: scale).
 */
.header__dropdown.mega-menu {
  font-size: 16px;
}

.header__dropdown.mega-menu .header__dropdown-icon-wrap {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(74, 92, 232, 0.08);
  border-radius: 10px;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.header__dropdown.mega-menu .header__dropdown-icon,
.header__dropdown.mega-menu .header__dropdown-icon-wrap img {
  width: 24px;
  height: 24px;
  display: block;
}

.header__dropdown.mega-menu .header__dropdown-label,
.header__dropdown.mega-menu .header__dropdown-label.category-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: #111827;
  text-transform: uppercase;
  margin-bottom: 16px;
  transition: color 0.15s ease;
}

.header__dropdown.mega-menu .header__dropdown-link {
  font-size: var(--p1-font-size);
  line-height: 1.3;
  color: #1F2937;
  font-weight: 400;
  padding: 11px 14px;
  border-radius: 8px;
  margin: 0 -12px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.header__dropdown.mega-menu .header__dropdown-link:hover {
  background: #F0F1FF;
  color: #4A5CE8;
  font-weight: 500;
}

.header__dropdown.mega-menu .header__dropdown-arrow {
  width: 16px;
  height: 16px;
  margin-left: auto;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  flex-shrink: 0;
  color: #4A5CE8;
}

.header__dropdown.mega-menu .header__dropdown-link:hover .header__dropdown-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* Bottom contact strip */

.header__dropdown-contact {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 -40px;
  padding: 18px 40px;
  background: #F9FAFB;
  border-radius: 0 0 20px 20px;
  border-top: 1px solid #F0F1F3;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease;
}

.header__dropdown-contact:hover {
  background: #F0F1FF;
}

.header__dropdown.mega-menu .header__dropdown-contact:hover .header__dropdown-contact-title {
  color: #4A5CE8;
}

.header__dropdown.mega-menu .header__dropdown-contact-icon {
  color: #6B7280;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.header__dropdown.mega-menu .header__dropdown-contact-title {
  font-size: var(--p1-font-size);
  color: #374151;
  font-weight: 500;
  transition: color 0.15s ease;
}

.header__dropdown.mega-menu .header__dropdown-contact-sub {
  font-size: 15px;
  color: #9CA3AF;
  margin-left: auto;
}

/* ===== Header: actions bar (auth) ===== */

.header__actions {
  display: flex;
  gap: var(--gap);
}

.header .btn--primary,
.header__backoffice-btn {
  transition-delay: 0.25s;
}

.header .btn--primary img {
  width: 2.4rem;
}

.header .enter {
  transition-delay: 0s;
}

.header .quit {
  width: 10rem;
  background-color: var(--extra-light-card);
  transition-delay: unset;
}

.header .quit:hover {
  transition-delay: unset;
}

.header__backoffice-btn {
  width: 5.6rem;
  min-width: 5.6rem;
  height: 5.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}

.header__backoffice-btn img {
  width: 2.4rem;
  height: 2.4rem;
  display: block;
}

/* ===== Header: language switcher ===== */

.header__lang {
  position: relative;
}

.header__lang-btn {
  height: 5.6rem;
  width: 6.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hover-color);
  border-radius: 1.6rem;
  font-weight: 600;
  color: var(--grey);
  text-transform: capitalize;
  transition: var(--quad);
}

.header__lang-btn:hover {
  background-color: var(--light-bg-2);
  color: var(--blue);
}

.header__lang-dropdown {
  position: absolute;
  top: calc(100% + 0.8rem);
  background-color: #fff;
  width: 100%;
  border-radius: 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  visibility: hidden;
  opacity: 0;
  transition: var(--quad);
  z-index: 4;
}

.header__lang-dropdown.active {
  visibility: visible;
  opacity: 1;
}

.header__lang-option {
  width: 100%;
  height: 4.6rem;
  font-size: var(--small-font-size);
  font-weight: 600;
  color: #7f7f7f;
}

.header__lang-option:hover {
  color: var(--blue);
}

.header__lang-option.active {
  color: var(--text-color);
  pointer-events: none;
}

.header__lang-divider {
  width: 80%;
  height: 1px;
  background-color: var(--disabled);
}

/* ===== Header: burger (mobile trigger) ===== */

.header__burger {
  display: none;
}

/* ===== Header: mobile overrides ===== */

@media (max-width: 768px) {
  .header {
    overflow: hidden;
    width: 100%;
    margin-top: 0;
    background-color: var(--light-bg);
  }

  .header__container {
    height: 8.8rem;
    padding: 0 0;
    border-radius: 0;
  }

  .header__nav,
  .header__actions {
    display: none;
  }

  .header__burger {
    display: flex;
    width: 6.4rem;
    height: 6.4rem;
  }

  .header__burger img {
    width: 100%;
    height: 100%;
  }
}

/* ===== Mobile menu ===== */

.mob-menu {
  display: none;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--bg-color);
  z-index: 99;
  transition: var(--quad);
  transform: translate(10rem, 0);
}

.mob-menu__head {
  background-color: var(--light-bg);
  height: 8.8rem;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.6rem;
}

.mob-menu .header__nav,
.mob-menu .header__actions {
  display: flex;
}

.mob-menu .header__actions {
  width: auto;
}

.mob-menu .header__logo {
  width: 12rem;
  height: 100%;
  display: flex;
  align-items: center;
}

.mob-menu .header__lang-dropdown {
  position: absolute;
  top: calc(100% + 0.8rem);
  background-color: #fff;
  width: 100%;
  border-radius: 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  visibility: hidden;
  opacity: 0;
  transition: var(--quad);
  z-index: 4;
}

.mob-menu .header__lang-dropdown.active {
  visibility: visible;
  opacity: 1;
}

.mob-menu .header__lang-option {
  width: 100%;
  height: 4.6rem;
  font-size: 1.6rem;
  font-weight: 600;
  color: #7f7f7f;
}

.mob-menu .header__lang-option:hover {
  color: var(--blue);
}

.mob-menu .header__lang-option.active {
  color: var(--text-color);
  pointer-events: none;
}

.mob-menu .header__lang-divider {
  width: 80%;
  height: 1px;
  background-color: var(--disabled);
}

.mob-menu .header__lang-btn {
  font-size: 1.6rem;
  width: 5.6rem;
}

.mob-menu__body {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding: 2.4rem 1.6rem;
  overflow: auto;
}

.mob-menu__close {
  width: 5.6rem;
  height: 5.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mob-menu .btn--primary {
  width: 100%;
  flex-shrink: 0;
}

.mob-menu__section {
  padding: var(--block-padding);
  background-color: var(--light-bg);
  border-radius: var(--border-radius);
}

/* ===== Mobile products block ===== */

.mob-products {
  width: 100%;
  background: #ffffff;
  border-radius: var(--border-radius);
  overflow: hidden;
}

.mob-products__header {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0F1117;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #F0F1F3;
}

.mob-products__group {
  display: flex;
  flex-direction: column;
}

.mob-products__category {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 10px;
  text-decoration: none;
}

.mob-products__icon-wrap {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(74, 92, 232, 0.08);
  border-radius: 8px;
}

.mob-products__icon {
  width: 18px;
  height: 18px;
  display: block;
}

.mob-products__label {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0F1117;
}

.mob-products__divider {
  height: 1px;
  background: #F5F6F7;
  margin: 0 20px;
}

.mob-products__link {
  display: flex;
  align-items: center;
  padding: 13px 20px 13px 68px;
  font-size: 1rem;
  color: #374151;
  text-decoration: none;
  border-bottom: 1px solid #F9FAFB;
  transition: background 0.15s ease, color 0.15s ease;
}

.mob-products__link:hover,
.mob-products__link:active {
  background: #F5F6FF;
  color: #4A5CE8;
}

.mob-products__chevron {
  margin-left: auto;
  flex-shrink: 0;
  color: #D1D5DB;
}

.mob-products__link:hover .mob-products__chevron,
.mob-products__link:active .mob-products__chevron {
  color: #4A5CE8;
}

.mob-products__contact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  background: #F9FAFB;
  border-top: 1px solid #F0F1F3;
  text-decoration: none;
  transition: background 0.15s ease;
}

.mob-products__contact:hover,
.mob-products__contact:active {
  background: #F0F1FF;
}

.mob-products__contact-icon {
  color: #6B7280;
  flex-shrink: 0;
}

.mob-products__contact-title {
  font-size: 1rem;
  font-weight: 500;
  color: #374151;
  transition: color 0.15s ease;
}

.mob-products__contact:hover .mob-products__contact-title,
.mob-products__contact:active .mob-products__contact-title {
  color: #4A5CE8;
}

.mob-products__contact-chevron {
  margin-left: auto;
  flex-shrink: 0;
  color: #D1D5DB;
}

.mob-menu__title {
  font-size: 2.4rem;
  font-weight: 500;
  color: var(--pressed-color);
  width: 100%;
  display: flex;
  margin-bottom: 1.2rem;
}

.mob-menu .mob-menu__section.mob-menu__title {
  margin-bottom: 0;
}

.mob-menu__body > .mob-products {
  margin: 0 -1.6rem;
}

/* ===== Mobile menu: responsive ===== */

@media (max-width: 768px) {
  .mob-menu {
    display: flex;
    transform: translate(100%, 0);
  }

  .mob-menu.active {
    transform: translate(0%, 0);
  }
}

/* ===== Auth modal ===== */

.auth-modal .popup-container {
  width: 51rem;
  background-color: var(--light-bg);
  border-radius: var(--border-radius);
  padding: var(--block-padding);
  margin: auto;
  overflow: hidden;
}

.auth-modal .popup-container h3 {
  text-align: center;
}

.auth-modal .popup-container .auth-modal__slider {
  padding: 0 var(--block-padding);
}

.auth-modal .popup-container .auth-modal__slider .swiper-slide {
  height: auto;
}

.auth-modal .popup-container .auth-modal__tabs {
  width: 100%;
  height: 4rem;
  border-radius: 24px;
  background-color: rgba(20, 22, 21, 0.03);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--block-padding);
  overflow: hidden;
}

.auth-modal .popup-container .auth-modal__tab {
  width: 50%;
  height: 100%;
  font-size: var(--small-font-size);
  color: #263361;
}

.auth-modal .popup-container .auth-modal__tab.active {
  background-color: rgba(20, 22, 21, 0.03);
}

.auth-modal .popup-container .auth-modal__field {
  margin-bottom: 1.2rem;
}

.auth-modal .popup-container .auth-modal__field:last-of-type {
  margin-bottom: 0;
}

.auth-modal .popup-container .auth-modal__label {
  font-size: var(--small-font-size);
  color: var(--grey);
}

.auth-modal .popup-container .auth-modal__input-wrap {
  position: relative;
  margin-top: 0.6rem;
}

.auth-modal .popup-container .auth-modal__input-wrap input {
  width: 100%;
}

.auth-modal .popup-container .auth-modal__toggle-pwd {
  position: absolute;
  height: 100%;
  width: 6rem;
  right: 0;
}

.auth-modal .popup-container .auth-modal__toggle-pwd svg path {
  transition: var(--quad);
}

.auth-modal .popup-container .auth-modal__toggle-pwd:hover svg path {
  fill-opacity: 1;
  fill: var(--grey);
}

.auth-modal #loginForm {
  padding-top: var(--block-padding);
}

.auth-modal .auth-modal__form {
  display: flex;
  flex-direction: column;
}

.auth-modal__social {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  margin-top: auto;
  margin-bottom: var(--gap);
}

.auth-modal__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 5.7rem;
  width: 5.7rem;
  border: 1px solid var(--hover-color);
  border-radius: var(--border-radius-small);
}

.auth-modal__social a svg {
  width: 2.4rem;
}

.auth-modal__social a svg path {
  transition: var(--quad);
}

.auth-modal__social a:hover {
  background-color: var(--hover-color);
}

.auth-modal__social a:hover svg path {
  fill: var(--light-bg);
}

.auth-modal #forgot-password {
  color: var(--accent);
  font-size: var(--p1-font-size);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0;
  margin-top: 2.5rem;
  margin-bottom: var(--block-padding);
  width: 100%;
  text-align: center;
}
