/**
 * HostStack Mobile-First Responsive System
 * Loaded globally after hs-design-system.css — optimizes 320px → desktop.
 */

html.hs-theme-cyber {
  --hs-mobile-touch: 2.75rem;
  --hs-mobile-touch-lg: 3rem;
  --hs-mobile-gutter: clamp(1rem, 4.2vw, 1.25rem);
  --hs-mobile-dock-h: 4.25rem;
  --hs-mobile-nav-h: 72px;
  --hs-mobile-chrome-top: var(--hs-main-pad-top, 108px);
  --hs-text-mobile-body: clamp(0.9375rem, 2.8vw, 1rem);
  --hs-text-mobile-h1: clamp(1.75rem, 6.5vw, 2.5rem);
  --hs-text-mobile-h2: clamp(1.35rem, 5vw, 1.85rem);
  --hs-text-mobile-lead: clamp(0.9375rem, 3.2vw, 1.0625rem);
}

/* --- Mobile-first base (default = phone) --- */
html.hs-theme-cyber body {
  font-size: var(--hs-text-mobile-body);
  -webkit-tap-highlight-color: rgba(56, 189, 248, 0.15);
  touch-action: manipulation;
}

html.hs-theme-cyber main h1:not(.hs-ent-hero__title),
html.hs-theme-cyber main .hs-h1 {
  font-size: var(--hs-text-mobile-h1);
  max-width: 20ch;
}

html.hs-theme-cyber main h2,
html.hs-theme-cyber main .hs-h2 {
  font-size: var(--hs-text-mobile-h2);
}

html.hs-theme-cyber .hs-sub-landing-hero,
html.hs-theme-cyber .hs-ent-hero {
  padding-block: clamp(1.75rem, 5vw, 2.75rem);
}

html.hs-theme-cyber .hs-sub-landing-hero__lead,
html.hs-theme-cyber .hs-ent-hero__lead {
  font-size: var(--hs-text-mobile-lead);
  max-width: 38ch;
}

html.hs-theme-cyber .hs-container,
html.hs-theme-cyber .hs-sub-landing-hero__inner {
  padding-inline: var(--hs-mobile-gutter);
}

html.hs-theme-cyber .hs-section {
  padding-block: clamp(2rem, 6vw, 3rem);
}

/* Thumb-friendly tap targets (interactive controls only) */
html.hs-theme-cyber a.hs-btn,
html.hs-theme-cyber a.hs-layout-cta,
html.hs-theme-cyber a.hs-layout-mobile-cta,
html.hs-theme-cyber a.hs-layout-cta-compact,
html.hs-theme-cyber a.btn-order,
html.hs-theme-cyber a.hs-gh-order,
html.hs-theme-cyber .hs-ft__links a,
html.hs-theme-cyber .hs-ft__bottom-nav a,
html.hs-theme-cyber .hs-ft__trust-link,
html.hs-theme-cyber .hs-ft__office-map {
  min-height: unset;
}
html.hs-theme-cyber .hs-mobile-nav-group__links a,
html.hs-theme-cyber button,
html.hs-theme-cyber summary,
html.hs-theme-cyber [role="button"] {
  min-height: 44px;
}

html.hs-theme-cyber .hs-btn,
html.hs-theme-cyber .hs-in-btn-primary,
html.hs-theme-cyber .hs-layout-cta,
html.hs-theme-cyber .hs-layout-mobile-cta {
  min-height: var(--hs-mobile-touch-lg);
  padding-inline: 1.15rem !important;
  font-size: 0.9375rem !important;
}

html.hs-theme-cyber .hs-cta-row {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}

html.hs-theme-cyber .hs-cta-row .hs-btn {
  width: 100%;
  justify-content: center;
}

/* Compact nav CTA — mobile header only */
.hs-layout-cta-compact {
  display: none;
  min-height: 2.5rem;
  padding: 0.45rem 0.85rem !important;
  font-size: 0.8125rem !important;
  font-weight: 700 !important;
  border-radius: var(--hs-radius-md, 0.75rem) !important;
  background: linear-gradient(180deg, #4cc9ff 0%, var(--cyan, #38bdf8) 100%) !important;
  color: #020913 !important;
  text-decoration: none !important;
  white-space: nowrap;
  flex-shrink: 0;
}

.hs-hide-mobile-sm {
  display: none !important;
}

@media (max-width: 899px) {
  .hs-layout-cta-compact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .hs-layout-login,
  .hs-layout-nav-actions > .hs-layout-cta {
    display: none !important;
  }

  .hs-layout-nav-actions > .hs-ccy-global {
    display: none !important;
  }

  .hs-announcement-bar {
    padding: 8px 2.75rem 8px 0.85rem !important;
    font-size: 0.78rem !important;
    min-height: 40px;
  }

  .hs-announcement-inner {
    gap: 0.35rem 0.5rem;
    line-height: 1.35;
  }

  .hs-announce-code {
    font-size: 0.72em !important;
  }

  .hs-layout-nav {
    height: 56px;
    padding-inline: var(--hs-mobile-gutter);
  }

  .hs-layout-brand {
    font-size: 1.05rem;
  }

  :root {
    --hs-main-pad-top: 96px;
  }

  body.hs-bar-dismissed {
    --hs-main-pad-top: 56px;
  }
}

@media (min-width: 900px) {
  .hs-hide-mobile-sm {
    display: revert !important;
  }

  .hs-layout-login {
    display: inline !important;
  }

  .hs-layout-nav-actions > .hs-layout-cta {
    display: inline-flex !important;
  }
}

/* --- Mobile drawer (slide-in panel) --- */
.hs-mobile-drawer {
  position: fixed;
  inset: 0;
  top: var(--hs-mobile-chrome-top, var(--hs-main-pad-top, 108px));
  z-index: 1004;
  display: none;
  flex-direction: column;
  background: rgba(2, 9, 19, 0.98);
  border-top: 1px solid var(--border, rgba(56, 189, 248, 0.14));
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  visibility: hidden;
  pointer-events: none;
  overscroll-behavior: contain;
}

.hs-mobile-drawer.is-open,
.hs-mobile-drawer:not(.hidden):not([hidden]) {
  display: flex;
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

body.hs-bar-dismissed .hs-mobile-drawer {
  top: 56px;
}

.hs-mobile-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem var(--hs-mobile-gutter);
  border-bottom: 1px solid rgba(56, 189, 248, 0.1);
  flex-shrink: 0;
}

.hs-mobile-drawer__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text, #e8f4ff);
}

.hs-mobile-drawer__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text, #e8f4ff);
  cursor: pointer;
}

.hs-mobile-drawer__quick {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  padding: 0.85rem var(--hs-mobile-gutter);
  border-bottom: 1px solid rgba(56, 189, 248, 0.08);
  flex-shrink: 0;
}

.hs-mobile-drawer__quick .hs-btn {
  min-height: 2.65rem !important;
  padding: 0.5rem 0.35rem !important;
  font-size: 0.75rem !important;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
}

.hs-mobile-drawer__scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.5rem var(--hs-mobile-gutter) calc(1rem + env(safe-area-inset-bottom, 0));
}

.hs-mobile-nav-group {
  border-bottom: 1px solid rgba(56, 189, 248, 0.08);
}

.hs-mobile-nav-group > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0.25rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text, #e8f4ff);
  cursor: pointer;
  user-select: none;
}

.hs-mobile-nav-group > summary::-webkit-details-marker {
  display: none;
}

.hs-mobile-nav-group > summary::after {
  content: "▾";
  font-size: 0.75rem;
  color: var(--cyan, #38bdf8);
  transition: transform 0.2s ease;
}

.hs-mobile-nav-group[open] > summary::after {
  transform: rotate(180deg);
}

.hs-mobile-nav-group__links {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0 0 0.75rem 0.5rem;
}

.hs-mobile-nav-group__links a {
  display: flex !important;
  align-items: center;
  min-height: 44px !important;
  padding: 0.55rem 0.65rem !important;
  border-radius: 0.65rem !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  color: var(--text2, #94a3b8) !important;
  text-decoration: none !important;
}

.hs-mobile-nav-group__links a:hover,
.hs-mobile-nav-group__links a:focus-visible {
  background: rgba(56, 189, 248, 0.08) !important;
  color: var(--cyan, #38bdf8) !important;
}

.hs-mobile-nav-group__links--flat {
  padding: 0.35rem 0 0.75rem;
  border-bottom: 1px solid rgba(56, 189, 248, 0.08);
}

.hs-mobile-nav-group__links--flat a {
  font-weight: 600 !important;
}

.hs-mobile-drawer__footer {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(56, 189, 248, 0.1);
}

.hs-mobile-drawer__footer a {
  min-height: 44px !important;
  padding: 0.65rem 0.75rem !important;
  border-radius: 0.65rem !important;
  font-size: 0.875rem !important;
}

.hs-mobile-drawer__footer .hs-layout-mobile-cta {
  margin-top: 0.35rem;
  width: 100%;
}

.hs-layout-nav-backdrop {
  position: fixed;
  inset: 0;
  top: var(--hs-mobile-chrome-top, var(--hs-main-pad-top, 108px));
  z-index: 1003;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(4px);
  background: rgba(0, 0, 0, 0.45);
}

.hs-layout-nav-backdrop.is-open,
body.hs-mobile-nav-open .hs-layout-nav-backdrop:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

body.hs-mobile-nav-open {
  overflow: hidden !important;
  touch-action: none;
}

@media (max-width: 899px) {
  .hs-layout-nav-mobile.hs-mobile-drawer.is-open,
  .hs-layout-nav-mobile.hs-mobile-drawer:not(.hidden):not([hidden]) {
    position: fixed !important;
    inset: 0 !important;
    top: var(--hs-mobile-chrome-top, 96px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-height: none !important;
    height: auto !important;
    bottom: 0 !important;
    padding: 0 !important;
    border-bottom: none !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    overflow: hidden !important;
  }

  .hs-layout-nav-mobile.hs-mobile-drawer.hidden,
  .hs-layout-nav-mobile.hs-mobile-drawer[hidden] {
    display: none !important;
  }

  .hs-layout-nav-backdrop {
    top: var(--hs-mobile-chrome-top, 96px) !important;
  }

  body.hs-bar-dismissed .hs-layout-nav-backdrop {
    top: 56px !important;
  }
}

/* Legacy flat mobile nav — hide if drawer present */
#hs-layout-nav-mobile:not(.hs-mobile-drawer) {
  /* fallback */
}

/* --- Sticky mobile conversion dock --- */
.hs-mobile-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 960;
  display: none;
  padding: 0.55rem var(--hs-mobile-gutter) calc(0.55rem + env(safe-area-inset-bottom, 0));
  background: rgba(2, 9, 19, 0.97);
  border-top: 1px solid rgba(56, 189, 248, 0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
}

.hs-mobile-dock__inner {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
  max-width: 32rem;
  margin-inline: auto;
}

.hs-mobile-dock__copy {
  min-width: 0;
}

.hs-mobile-dock__title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--hs-ink, #e8f4ff);
}

.hs-mobile-dock__sub {
  margin: 0.15rem 0 0;
  font-size: 0.6875rem;
  line-height: 1.3;
  color: var(--hs-ink-muted, #8bacc8);
}

.hs-mobile-dock__actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.hs-mobile-dock .hs-btn {
  min-height: 2.5rem !important;
  padding: 0.45rem 0.75rem !important;
  font-size: 0.8125rem !important;
}

@media (max-width: 899px) {
  .hs-mobile-dock:not([hidden]) {
    display: block;
  }

  body.hs-mobile-dock-on {
    padding-bottom: calc(var(--hs-mobile-dock-h) + env(safe-area-inset-bottom, 0)) !important;
  }

  body.hs-mobile-dock-on #hs-whatsapp-btn {
    bottom: calc(var(--hs-mobile-dock-h) + 0.65rem + env(safe-area-inset-bottom, 0)) !important;
  }

  body.hs-enterprise-home.hs-sticky-safe.hs-mobile-dock-on .hs-ent-sticky {
    display: none;
  }
}

@media (min-width: 900px) {
  .hs-mobile-dock {
    display: none !important;
  }
}

/* --- Mobile tables (pricing / comparison) --- */
.hs-table-wrap {
  position: relative;
  margin-inline: calc(var(--hs-mobile-gutter) * -0.15);
  border-radius: var(--hs-radius-lg, 1rem);
}

.hs-table-wrap::after {
  content: "Swipe →";
  position: absolute;
  right: 0.65rem;
  bottom: 0.5rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hs-ink-muted, #8bacc8);
  background: rgba(2, 9, 19, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.2);
  pointer-events: none;
  opacity: 0.9;
}

.hs-table-wrap.hs-table-scrolled::after {
  opacity: 0;
}

@media (min-width: 768px) {
  .hs-table-wrap::after {
    display: none;
  }

  .hs-table-wrap {
    margin-inline: 0;
  }
}

.hs-table th:first-child,
.hs-table td:first-child,
.plans-table th:first-child,
.plans-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: rgba(6, 18, 38, 0.98);
  box-shadow: 4px 0 12px rgba(0, 0, 0, 0.15);
}

/* --- Mobile pricing cards --- */
@media (max-width: 639px) {
  .hs-pg-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .hs-pg-card,
  .hs-ent-price-card,
  .plan-card {
    padding: 1.15rem !important;
  }

  .hs-ent-metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .hs-ent-metric {
    padding: 0.75rem 0.6rem;
  }

  .hs-ent-metric strong {
    font-size: 0.95rem;
  }

  .hs-ent-grid--4 {
    grid-template-columns: 1fr;
  }

  .hs-ent-infra-viz {
    min-height: auto;
    padding: 1rem;
  }

  .hs-ent-node-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Footer: see assets/hs-footer.css --- */

@media (min-width: 900px) {
  .hs-mobile-drawer,
  .hs-layout-nav-backdrop {
    display: none !important;
  }
}

/* --- FAQ mobile --- */
.hs-in-faq-summary,
details.hs-in-faq-det > summary {
  min-height: 48px;
  padding-block: 0.75rem;
  font-size: 0.9375rem !important;
  line-height: 1.4;
}

.hs-in-faq-ans {
  font-size: 0.9375rem !important;
  line-height: 1.65 !important;
}

/* --- Performance: below-fold sections --- */
@media (max-width: 899px) {
  main > section:nth-child(n + 3),
  .hs-ent-section:nth-child(n + 3) {
    content-visibility: auto;
    contain-intrinsic-size: auto 480px;
  }
}

/* --- Tablet upward enhancements --- */
@media (min-width: 640px) {
  html.hs-theme-cyber .hs-cta-row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  html.hs-theme-cyber .hs-cta-row .hs-btn {
    width: auto;
  }

  html.hs-theme-cyber main h1,
  html.hs-theme-cyber main .hs-h1 {
    max-width: none;
  }
}

@media (min-width: 768px) {
  html.hs-theme-cyber .hs-section {
    padding-block: var(--hs-section-y, clamp(2.5rem, 5vw, 4.5rem));
  }
}

@media (min-width: 1024px) {
  html.hs-theme-cyber .hs-mobile-drawer__quick {
    display: none;
  }
}
