/* Keep the document as the vertical touch-scroll surface on mobile browsers. */
@media (max-width: 900px) {
  html {
    min-height: 100%;
    overflow-x: clip;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y pinch-zoom;
  }

  body {
    min-height: 100%;
    height: auto !important;
    overflow-x: clip;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y pinch-zoom;
  }

  #root {
    min-height: 100dvh;
    height: auto !important;
    overflow: visible !important;
    touch-action: pan-y pinch-zoom;
  }

  #root div:has(> button[aria-label="انتخاب پوسته"]) {
    right: auto !important;
    left: max(10px, env(safe-area-inset-left)) !important;
    bottom: max(12px, env(safe-area-inset-bottom)) !important;
  }

  #root div:has(> button[aria-label="انتخاب پوسته"]) > button {
    width: 48px !important;
    height: 48px !important;
  }
}

@supports not (overflow: clip) {
  @media (max-width: 900px) {
    html, body { overflow-x: hidden; }
  }
}

/* Mobile and tablet layout for the live VIP pricing section. */
@media (min-width: 561px) and (max-width: 900px) {
  #pricing > div {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: stretch;
    gap: 18px !important;
    width: 100%;
  }

  #pricing > div > .premium-card {
    width: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 28px 22px !important;
  }
}

@media (max-width: 560px) {
  #pricing {
    width: 100% !important;
    padding: 52px clamp(12px, 4vw, 18px) !important;
    scroll-margin-top: 70px;
  }

  #pricing > h2 {
    margin-bottom: 10px !important;
    font-size: clamp(1.45rem, 6.2vw, 1.9rem) !important;
    line-height: 1.55 !important;
    overflow-wrap: anywhere;
  }

  #pricing > p {
    max-width: 42rem;
    margin: 0 auto 24px !important;
    padding-inline: 3px;
    font-size: clamp(.82rem, 3.7vw, .95rem);
    line-height: 1.9;
    text-wrap: pretty;
  }

  #pricing > div {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    justify-items: center;
    gap: 14px !important;
    width: 100% !important;
    padding: 0 !important;
  }

  #pricing > div > .premium-card {
    width: 100% !important;
    max-width: 460px;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 22px clamp(16px, 5vw, 22px) !important;
    border-radius: 19px !important;
    transform: none !important;
  }

  #pricing > div > .premium-card h3 {
    margin-bottom: 10px !important;
    font-size: clamp(1.08rem, 4.6vw, 1.35rem) !important;
    line-height: 1.65 !important;
    overflow-wrap: anywhere;
  }

  #pricing > div > .premium-card .glow-text {
    margin-bottom: 16px !important;
    font-size: clamp(1.45rem, 7.2vw, 1.85rem) !important;
    line-height: 1.55 !important;
    overflow-wrap: anywhere;
  }

  #pricing > div > .premium-card ul[data-ng-plan-features] {
    gap: 9px !important;
    font-size: clamp(.82rem, 3.7vw, .9rem) !important;
    line-height: 1.8;
  }

  #pricing > div > .premium-card ul[data-ng-plan-features] li {
    display: grid !important;
    grid-template-columns: 16px minmax(0, 1fr);
    align-items: start !important;
    gap: 7px !important;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  #pricing > div > .premium-card ul[data-ng-plan-features] li > span {
    line-height: 1.8;
  }

  #pricing > div > .premium-card > button {
    width: 100% !important;
    min-height: 48px;
    margin-top: 19px !important;
    padding: 11px 14px !important;
    border-radius: 12px;
    font-size: clamp(.86rem, 3.8vw, .98rem) !important;
    line-height: 1.65;
    white-space: normal;
    touch-action: manipulation;
  }
}

@media (max-width: 360px) {
  #pricing > div > .premium-card {
    padding: 20px 15px !important;
  }

  #pricing > div > .premium-card .glow-text {
    font-size: clamp(1.35rem, 7vw, 1.6rem) !important;
  }
}

@media (max-width: 900px) {
  #root .ng-theme-picker-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(8px);
  }
}
