/**
 * @file: mobile-menu.css
 * @description: Slide-stack мобильное меню с card grid на первом уровне
 * @dependencies: media.css, burger.js, mobile-menu.js
 * @created: 2026-06-06
 */

.header-menu--v2 {
  padding: 20px 16px 24px;
  background: #fff;
  z-index: 1100;
}

@media (max-width: 851px) {
  .header-menu--v2 {
    height: calc(100dvh - 70px - env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 70px - env(safe-area-inset-bottom, 0px));
    padding-bottom: 24px;
  }
}

.header-menu--v2 .header-menu-logoblock {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 4px;
  background: #fff;
}

.header-menu--v2 .header-menu-title {
  font-family: Circe, sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  color: #202e35;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-menu-back-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: #f4f7f4;
  color: #202e35;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.mobile-menu-back-button.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-menu-back-button:active {
  background: #e8ede8;
}

.mobile-menu-back-button svg {
  display: block;
}

.header-menu--v2 .header-menu-exit {
  justify-self: end;
}

.mobile-menu-viewport {
  overflow: hidden;
  width: 100%;
}

.mobile-menu-stack {
  display: flex;
  flex-wrap: nowrap;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.mobile-menu-panel {
  flex: 0 0 auto;
  width: var(--mobile-menu-panel-width, 100%);
  min-height: 1px;
  box-sizing: border-box;
}

.mobile-menu-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.mobile-menu-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 108px;
  padding: 14px;
  border: 1px solid #eef0ee;
  border-radius: 14px;
  background: linear-gradient(145deg, #f8faf8 0%, #f1f5f1 100%);
  color: #202e35;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-card:active,
.mobile-menu-card--has-children:active {
  transform: scale(0.98);
}

.mobile-menu-card--has-children {
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.mobile-menu-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-bottom: 10px;
}

.mobile-menu-card__icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.mobile-menu-card__title {
  display: block;
  font-family: Circe, sans-serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  padding-right: 18px;
}

.mobile-menu-card__chevron {
  position: absolute;
  right: 12px;
  bottom: 12px;
  font-size: 20px;
  line-height: 1;
  color: #5aa14d;
  font-weight: 400;
}

.mobile-menu-section {
  margin-top: 24px;
}

.mobile-menu-section__title {
  margin-bottom: 8px;
  font-family: Circe, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5c647a;
}

.mobile-menu-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mobile-menu-links li {
  border-bottom: 1px solid #eef0ee;
}

.mobile-menu-links a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 4px;
  font-family: Circe, sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #202e35;
  text-decoration: none;
}

.mobile-menu-links a:active {
  color: #5aa14d;
}

.mobile-menu-list {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  width: 100% !important;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.header-menu--v2 .mobile-menu-viewport ul {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  width: 100% !important;
}

.header-menu--v2 .mobile-menu-list > li {
  display: block !important;
  width: 100% !important;
  padding: 0;
  flex: 0 0 auto !important;
}

.header-menu--v2 .mobile-menu-panel a {
  color: #202e35;
  text-decoration: none;
}

.mobile-menu-row {
  border-bottom: 1px solid #eef0ee;
}

.mobile-menu-row__btn,
.mobile-menu-row__link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 12px 4px;
  border: none;
  background: transparent;
  color: #202e35;
  font-family: Circe, sans-serif;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-row__btn:active,
.mobile-menu-row__link:active {
  background: #f4f7f4;
}

.mobile-menu-row__icon-wrap {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #f4f7f4;
}

.mobile-menu-row__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.mobile-menu-row__title {
  flex: 1;
}

.mobile-menu-row__chevron {
  flex-shrink: 0;
  font-size: 22px;
  line-height: 1;
  color: #5aa14d;
}

.mobile-menu-loading {
  padding: 24px 4px;
  font-family: Circe, sans-serif;
  font-size: 15px;
  color: #5c647a;
}

.header-menu--v2 .header-use-list {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #eef0ee;
}

.header-menu--v2 .header-menu-info {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #eef0ee;
}

.header-menu--v2 .header-list {
  display: none !important;
}

@media (max-width: 360px) {
  .mobile-menu-card__title {
    font-size: 14px;
  }

  .mobile-menu-cards {
    gap: 8px;
  }
}
