/* Push footer to bottom on short pages */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ==================== Desktop Header ==================== */

.header {
  width: 100%;
  height: 3.75rem;
  display: flex;
  flex-wrap: nowrap;
  flex-direction: column;
  background: var(--header-color);
  flex-shrink: 0;
}

.header .container {
  display: flex;
  flex-wrap: nowrap;
  flex-direction: column;
  flex-grow: 1;
}

.header__content {
  flex-grow: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header__logo img {
  width: 7.925rem;
  display: block;
}

.header__right {
  display: flex;
  align-items: center;
  gap: 1.15rem;
}

.pack_category {
  padding-top: 3.7rem;
}

.header__right .btn {
  min-width: 7.5rem;
  width: auto;
  min-height: unset;
  font-weight: 600;
  height: 2rem;
  border-radius: .5rem;
}

/* ==================== Back button (desktop + mobile) ==================== */

.go-back {
  display: flex;
  align-items: center;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
}

.go-back img {
  width: 1.2rem;
  height: 1.2rem;
  display: block;
}

/* ==================== Settings / profile icon ==================== */

.go-settings {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
}

.go-settings img {
  width: 100%;
  height: 100%;
  display: block;
}

/* ==================== Mobile Header ==================== */

.headerMob {
  display: none;
}

/* ==================== Settings modal ==================== */

.settings-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 999;
  align-items: center;
  justify-content: center;
}

.settings-overlay.open {
  display: flex;
}

.settings-panel {
  position: relative;
  max-width: 20rem;
  width: 50%;
  /*width: min(calc(100% - 2rem), 22rem);*/
  background: var(--mobile-background-color);
  overflow: hidden;
  animation: anvil 0.3s cubic-bezier(0.38, 0.1, 0.36, 0.9) forwards;
}

.settings-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.2rem 0.5rem;
  padding-bottom: 0;
}

/* titleH2 в хедере настроек — сбрасываем margin, т.к. titleH2 глобально может иметь отступы */
.settings-panel__title.titleH2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.22;
}

.settings-panel__close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  width: 1rem;
  height: 1rem;
}

.settings-panel__close img {
  width: 100%;
  height: 100%;
}

.settings-panel__nav {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 0 1.2rem 0.8rem;
  gap: 0.3rem;
}

.settings-nav__item {
  color: var(--Blue);
  font-size: 0.65rem;
  text-decoration: none;
  padding: 0.3rem 0;
}

.settings-nav__item:hover {
  text-decoration: underline;
}

.settings-panel__body {
  padding: 0 1.2rem 4rem;
}

.modal__content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.modal-title {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
  margin-top: 2rem;
  margin-bottom: 0.3rem;
}

.modal-text {
  color: var(--White);
  font-size: 26px;
  font-weight: 500;
}

.modal-success {
  color: #17C964;
  font-size: 0.75rem;
  font-weight: 500;
}


.modal-error {
  color: #FF3B30;
  font-size: 26px;
  font-weight: 500;
}

.modal__content .btn {
  max-width: 275px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 767px) {
  .settings-overlay {
    align-items: stretch;
  }

  .settings-panel {
    width: 100%;
    max-width: 100%;
    height: 100%;
    border-radius: 0;
  }
}

/* ==================== Logout confirmation overlay ==================== */

.logout-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1100;
  align-items: center;
  justify-content: center;
}

.logout-overlay.open {
  display: flex;
}

.logout-panel {
  position: relative;
  width: min(calc(100% - 2rem), 22rem);
  background: var(--mobile-background-color);
  border-radius: 1rem;
  max-width: 520px;
  padding: 2rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  animation: anvil 0.3s cubic-bezier(0.38, 0.1, 0.36, 0.9) forwards;
}

.logout-panel__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
}

.logout-panel__close img {
  width: 16px;
  height: 16px;
}

.logout-panel__logo img {
  width: 7rem;
  display: block;
}

.logout-panel__title {
  color: var(--White);
  font-size: 1rem;
  opacity: .8;
  font-weight: 600;
  text-align: center;
  max-width: 351px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.4;
}

.logout-panel__buttons {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0;
  max-width: 312px;
  margin-left: auto;
  margin-right: auto;
}

.logout-panel__buttons .btn {
  width: 100%;
  text-align: center;
  text-decoration: none;
}

/* ==================== Cancel subscription overlay (Модал 1) ==================== */

.cancel-sub-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1100;
  align-items: center;
  justify-content: center;
}

.cancel-sub-overlay.open {
  display: flex;
}

.cancel-sub-panel {
  position: relative;
  width: min(calc(100% - 2rem), 22rem);
  max-width: 520px;
  background: var(--mobile-background-color);
  border-radius: 1rem;
  padding: 1.2rem 1.2rem 2.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  animation: anvil 0.3s cubic-bezier(0.38, 0.1, 0.36, 0.9) forwards;
}

.cancel-sub-panel__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
}

.cancel-sub-panel__close img {
  width: 24px;
  height: 24px;
}

.cancel-sub-panel__logo img {
  width: 7rem;
  display: block;
}

.cancel-sub-panel__title {
  color: hsla(0,0%,100%,.8);
  font-size: 1rem;
  font-weight: 700;
  max-width: 351px;
  text-align: center;
  line-height: 1.4;
}

.cancel-sub-panel__text {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.55rem;
  max-width: 351px;
  text-align: center;
  line-height: 1.4;
}

.cancel-sub-panel__buttons {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
  max-width: 312px;
  margin-left: auto;
  margin-right: auto;
}

.cancel-sub-panel__buttons .btn {
  width: 100%;
  text-align: center;
  font-weight: 600;

}

/* ==================== Cancel subscription success overlay (Модал 2) ==================== */

.cancel-sub-done-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1100;
  align-items: center;
  justify-content: center;
}

.cancel-sub-done-overlay.open {
  display: flex;
}

.cancel-sub-done-panel {
  position: relative;
  width: min(calc(100% - 2rem), 22rem);
  background: var(--mobile-background-color);
  border-radius: 1rem;
  padding: 2rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  animation: anvil 0.3s cubic-bezier(0.38, 0.1, 0.36, 0.9) forwards;
}

.cancel-sub-done-panel__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
}

.cancel-sub-done-panel__close img {
  width: 16px;
  height: 16px;
}

.cancel-sub-done-panel__icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cancel-sub-done-panel__title {
  color: var(--White);
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
}

.cancel-sub-done-panel__text {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.5;
}

.cancel-sub-done-panel__buttons {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.cancel-sub-done-panel__buttons .btn {
  width: 100%;
  text-align: center;
}

/* Anvil animation */
@keyframes anvil {
  0%   { transform: scale(0.92); opacity: 0.5; }
  100% { transform: scale(1);    opacity: 1;   }
}

/* ==================== Mobile (≤ 800px) ==================== */

@media (max-width: 800px) {
  .header {
    display: none;
  }

  .landing .title-text {
    font-size: 14px!important;
  }

  .pack_category {
    padding-top: 2.3rem;
  }

  .headerMob {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--header-color);
    height: 3rem;
    flex-shrink: 0;
  }

  .headerMob__content {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    height: 100%;
  }

  .headerMob__left {
    min-width: 1.5rem;
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }

  .go-back {
    display: flex;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
  }

  .go-back img {
    width: 1.2rem;
    height: 1.2rem;
    display: block;
  }

  .headerMob__center {
    flex-grow: 1;
    padding-left: 0.3rem;
  }

  .titleH2 {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--White);
    line-height: 1;
  }

  .headerMob .titleH2 {
    font-size: 20px;
  }
  .pack_category {
    padding-top: 1rem;
  }
  .headerMob__right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }

  .headerMob__right .btn {
    display: none;
  }

  .headerMob .container {
    padding: 0 12px;
  }

  .go-settings {
    width: 1.2rem;
    height: 1.2rem;
  }
}

/* ==================== Mobile Bottom Navigation ==================== */

.mob-bottom-nav {
  display: none;
}

@media (max-width: 800px) {
  .mob-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 76px;
    background: var(--header-color);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .mob-bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--Light-grey);
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    width: 25%;
    justify-content: center;
  }

  .mob-bottom-nav__item.active {
    color: var(--Grey);
  }

  .mob-bottom-nav__item svg {
    width: 22px;
    height: 22px;
  }
}


#cancel-sub-btn {
  color: #fff;
  border-color: #fff;
}