/* ═══════════════════════════════════════════
   SMARTERSWEB PUBLIC RESPONSIVE POLISH
   Header, footer, cookie notice, mobile nav, and front-end layout safety.
═══════════════════════════════════════════ */

html,
body {
  width: 100%;
  max-width: 100%;
}

body {
  overflow-x: clip;
}

body.sw-ui-locked,
html.sw-ui-locked {
  overflow: hidden !important;
  overscroll-behavior: none;
}

.container {
  width: min(100% - clamp(1rem, 4vw, 3rem), 1200px);
  padding-left: 0;
  padding-right: 0;
}

img,
svg,
video,
iframe,
canvas {
  max-width: 100%;
}

main {
  padding-top: 6rem;
}

/* ── Header ─────────────────────────────── */
.site-header {
  width: min(calc(100% - clamp(1rem, 3vw, 2.5rem)), 1220px);
  max-width: 1220px;
  border-radius: 28px;
  z-index: 10030;
}

.nav {
  height: 62px;
  padding: 0 1.15rem;
  gap: 0.9rem;
}

.logo {
  min-width: 0;
}

.logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 10px;
  flex: 0 0 auto;
}

.logo > div {
  min-width: 0;
}

.logo-name {
  font-size: 0.92rem;
  letter-spacing: -0.015em;
}

.logo-tagline {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-links {
  flex: 1 1 auto;
  justify-content: center;
  min-width: 0;
  gap: 0.1rem;
}

.nav-link,
.nav-dropdown-toggle {
  border: 0;
  background: transparent;
  font: inherit;
}

.nav-link {
  padding: 0.42rem 0.68rem;
  font-size: 0.79rem;
}

.nav-actions {
  gap: 0.48rem;
}

.btn-nav-ghost,
.btn-nav-primary {
  min-height: 38px;
  align-items: center;
}

.nav-dropdown-menu {
  width: max-content;
  min-width: 245px;
  max-width: min(92vw, 620px);
  padding: 0.55rem;
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
}

.nav-dropdown--services .nav-dropdown-menu {
  width: min(92vw, 610px);
  display: grid;
  grid-template-columns: repeat(2, minmax(210px, 1fr));
  gap: 0.22rem;
}

.nav-dropdown--resources .nav-dropdown-menu {
  width: min(92vw, 520px);
  display: grid;
  grid-template-columns: repeat(2, minmax(200px, 1fr));
  gap: 0.22rem;
}

.nav-dropdown--more .nav-dropdown-menu {
  left: auto;
  right: 0;
  transform: translateY(-6px);
}

.nav-dropdown--more:hover .nav-dropdown-menu,
.nav-dropdown--more:focus-within .nav-dropdown-menu {
  transform: translateY(0);
}

.nav-dropdown-item {
  min-height: 42px;
  white-space: normal;
  line-height: 1.28;
}

.hamburger {
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(99, 120, 170, 0.26);
  background: rgba(255, 255, 255, 0.035);
}

.hamburger span {
  width: 19px;
}

@media (max-width: 1120px) {
  .nav-links,
  .nav-actions {
    display: none;
  }

  .hamburger {
    display: inline-flex;
  }

  .nav {
    justify-content: space-between;
  }
}

@media (max-width: 480px) {
  main {
    padding-top: 5.4rem;
  }

  .site-header {
    top: 0.5rem;
    width: calc(100% - 1rem);
    border-radius: 18px;
  }

  .site-header.scrolled {
    top: 0.35rem;
  }

  .nav {
    height: 56px;
    padding: 0 0.75rem;
  }

  .logo-img {
    width: 34px;
    height: 34px;
  }

  .logo-tagline {
    display: none;
  }

  .logo-name {
    font-size: 0.9rem;
  }
}

/* ── Mobile navigation ─────────────────── */
.mobile-nav {
  display: none;
  position: fixed;
  left: 50%;
  top: calc(0.75rem + 62px + 0.55rem);
  transform: translateX(-50%);
  width: min(calc(100% - 1rem), 620px);
  max-width: 620px;
  max-height: calc(100dvh - 5.6rem);
  background: linear-gradient(180deg, rgba(8, 12, 28, 0.985), rgba(4, 9, 22, 0.985));
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 22px;
  padding: 0;
  z-index: 10020;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.68);
  overflow: hidden;
}

.mobile-nav.open {
  display: flex;
  flex-direction: column;
}

.mobile-nav-header {
  flex: 0 0 auto;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(99, 120, 170, 0.16);
}

.mobile-nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
}

.mobile-logo-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 10px;
  flex: 0 0 auto;
}

.mobile-nav-brand strong {
  display: block;
  font-size: 0.98rem;
  line-height: 1.1;
}

.mobile-nav-brand small {
  display: block;
  margin-top: 0.15rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.mobile-nav-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.95rem 1rem;
}

.mobile-nav-section + .mobile-nav-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(99, 120, 170, 0.13);
}

.mobile-nav-heading {
  margin: 0 0 0.55rem;
  color: var(--blue-300);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.mobile-nav-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.68rem 0.78rem;
  border: 1px solid rgba(99, 120, 170, 0.17);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.28;
}

.mobile-nav-link:hover,
.mobile-nav-link:focus-visible {
  border-color: rgba(96, 165, 250, 0.44);
  background: rgba(37, 99, 235, 0.12);
  color: #fff;
  outline: none;
}

.mobile-nav-ctas {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.9rem 1rem 1rem;
  border-top: 1px solid rgba(99, 120, 170, 0.16);
  background: rgba(2, 8, 23, 0.62);
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

.mobile-nav-ctas .btn {
  width: 100%;
  min-height: 44px;
  justify-content: center;
}

@media (max-width: 480px) {
  .mobile-nav {
    top: calc(0.5rem + 56px + 0.45rem);
    width: calc(100% - 1rem);
    max-height: calc(100dvh - 4.8rem);
    border-radius: 18px;
  }

  .mobile-nav-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Footer ─────────────────────────────── */
.site-footer {
  padding: clamp(3rem, 6vw, 5rem) 0 1.4rem;
}

.footer-topline {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: end;
  padding: 0 0 2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(96, 165, 250, 0.14);
}

.footer-eyebrow {
  margin: 0 0 0.45rem;
  color: var(--green-300);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.footer-heading {
  max-width: 720px;
  margin: 0;
  color: #fff;
  font-size: clamp(1.5rem, 3vw, 2.45rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.footer-top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
}

.footer-grid {
  grid-template-columns: minmax(260px, 1.35fr) repeat(3, minmax(150px, 0.85fr));
  gap: clamp(1.5rem, 4vw, 3.5rem);
}

.footer-brand-desc {
  max-width: 28rem;
}

.footer-contact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1rem 0 0.8rem;
}

.footer-contact-list a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0.45rem 0.72rem;
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.62);
  color: #dbeafe;
  font-size: 0.82rem;
  font-weight: 700;
}

.footer-contact-list a:hover,
.footer-contact-list a:focus-visible {
  border-color: rgba(125, 211, 252, 0.55);
  color: #fff;
  outline: none;
}

.social-btn {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.footer-links a {
  width: 100%;
  max-width: 100%;
}

@media (max-width: 980px) {
  .footer-topline {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .footer-top-actions {
    justify-content: flex-start;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand-col {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .footer-top-actions,
  .footer-top-actions .btn {
    width: 100%;
  }

  .footer-top-actions .btn {
    justify-content: center;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-links {
    display: grid;
    grid-template-columns: 1fr;
  }

  .footer-bottom,
  .footer-legal {
    width: 100%;
  }

  .footer-legal {
    gap: 0.5rem;
  }
}

/* ── Cookie notice ─────────────────────── */
.cookie-consent {
  left: 50%;
  right: auto;
  bottom: max(1rem, env(safe-area-inset-bottom));
  width: min(calc(100% - 2rem), 1040px);
  transform: translateX(-50%) translateY(calc(100% + 1.5rem));
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 22px;
  padding: 1rem;
  z-index: 10010;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.58);
}

.cookie-consent.show {
  transform: translateX(-50%) translateY(0);
}

.cookie-consent-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.2rem;
  align-items: center;
}

.cookie-consent-kicker {
  margin: 0 0 0.18rem;
  color: var(--green-300);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.cookie-consent-title {
  font-size: 0.98rem;
  line-height: 1.2;
  margin-bottom: 0.32rem;
}

.cookie-consent-desc {
  max-width: 690px;
  font-size: 0.82rem;
  line-height: 1.55;
}

.cookie-consent-actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 0.6rem;
}

.cookie-btn,
.cookie-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cookie-link {
  padding: 0.5rem 0.2rem;
  white-space: nowrap;
}

@media (max-width: 820px) {
  .cookie-consent {
    width: calc(100% - 1rem);
    bottom: 0.5rem;
    border-radius: 18px;
  }

  .cookie-consent-inner {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .cookie-consent-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .cookie-link {
    grid-column: 1 / -1;
    text-align: center;
  }
}

@media (max-width: 420px) {
  .cookie-consent-actions {
    grid-template-columns: 1fr;
  }
}

/* ── General responsive layout safety ───── */
.btn {
  max-width: 100%;
}

@media (max-width: 520px) {
  .btn {
    white-space: normal;
    text-align: center;
  }

  .btn-lg,
  .btn-md,
  .btn-sm {
    width: 100%;
    justify-content: center;
  }

  .section-heading,
  .service-hero-title,
  .hero h1,
  .tm-resource-title,
  .tm-hero-title {
    word-break: normal;
    overflow-wrap: anywhere;
  }
}

.hero-shell,
.service-hero-shell,
.tm-hero-shell,
.card,
.price-card,
.sw-calendar-panel,
.modal-box {
  max-width: 100%;
}

.hero-actions,
.service-hero-actions,
.cta-band-actions,
.tm-resource-actions,
.sw-calendar-actions {
  flex-wrap: wrap;
}

@media (max-width: 700px) {
  .hero-shell,
  .service-hero-shell,
  .tm-hero-shell {
    border-radius: 22px;
    padding: 1.45rem 1rem 1.65rem;
  }

  .grid-2,
  .grid-3,
  .grid-2-asym,
  .service-fit-grid,
  .service-hero-grid,
  .tm-section-grid,
  .tm-report-grid,
  .tm-calc-grid {
    grid-template-columns: 1fr !important;
  }

  .stats-bar {
    padding: 1.25rem;
    grid-template-columns: 1fr 1fr;
  }

  .table-wrap,
  .pricing-table,
  .sw-google-appointment-frame {
    max-width: 100%;
  }
}

@media (max-width: 420px) {
  .stats-bar {
    grid-template-columns: 1fr;
  }
}

/* Forms and scheduler on phones */
@media (max-width: 700px) {
  .modal-overlay,
  .cal-overlay {
    padding: 0.5rem;
  }

  .modal-box,
  .cal-box,
  .cal-box-scheduler,
  .cal-box-appointment-embed {
    width: calc(100vw - 1rem) !important;
    max-height: calc(100dvh - 1rem) !important;
    border-radius: 18px;
  }

  .modal-box {
    padding: 1.25rem;
  }

  .field-row,
  .form-nav,
  .sw-calendar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .form-nav > *,
  .sw-calendar-actions > * {
    width: 100%;
    justify-content: center;
  }
}

/* Chat and utility widgets should not cover key mobile actions. */
@media (max-width: 768px) {
  .chatbot-window {
    width: calc(100vw - 1rem);
    right: 0.5rem;
    bottom: 4.25rem;
    height: min(640px, calc(100dvh - 6rem));
  }

  .chatbot-bubble {
    right: 0.75rem;
    bottom: 0.75rem;
  }
}
