/**
 * Caduceus — mobile / responsive overrides (theme chrome)
 * Loaded after motion.css
 */

/* Prevent horizontal scroll from ambient orb, marquees, Elementor wrappers */
html {
  overflow-x: clip;
}

body.caduceus-theme,
.cad-page {
  overflow-x: clip;
  max-width: 100%;
}

.relative {
  overflow-x: clip;
}

/* Tighter shell on phones */
@media (max-width: 479px) {
  .cad-shell {
    padding-inline: 1rem;
  }

  .cad-main {
    padding-top: 1.25rem;
    padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
  }

  .cad-logo {
    font-size: 1.05rem;
    max-width: calc(100% - 3.5rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .cad-logo__mark {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
  }

  .cad-logo__mark--full {
    width: auto;
    height: 34px;
    max-width: min(150px, 52vw);
  }

  .cad-logo__mark--with-name {
    height: 32px;
    max-width: min(108px, 40vw);
  }

  .cad-header .cad-logo__mark,
  .cad-mobile-nav .cad-logo__mark {
    width: 30px;
    height: 30px;
    max-width: none;
  }

  .cad-header .cad-logo__mark--full,
  .cad-mobile-nav .cad-logo__mark--full {
    height: 34px;
    max-width: min(150px, 52vw);
  }

  .cad-header .cad-logo__mark--with-name,
  .cad-mobile-nav .cad-logo__mark--with-name {
    height: 32px;
    max-width: min(108px, 40vw);
  }

  .cad-footer .cad-logo__mark {
    width: 30px;
    height: 30px;
    max-width: none;
  }

  .cad-footer .cad-logo__mark--full {
    height: 34px;
    max-width: min(150px, 52vw);
  }

  .cad-footer .cad-logo__mark--with-name {
    height: 32px;
    max-width: min(108px, 40vw);
  }

  .cad-logo__name {
    font-size: 1.05rem;
  }

  .cad-header__inner {
    padding-block: 1rem;
    gap: 0.75rem;
  }

  .cad-ambient {
    width: 18rem;
    height: 18rem;
    top: -5rem;
    left: -4rem;
    filter: blur(64px);
  }
}

@media (min-width: 480px) and (max-width: 767px) {
  .cad-shell {
    padding-inline: 1.25rem;
  }

  .cad-main {
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  }
}

/* Sticky CTA + WhatsApp — safe areas (notched phones) */
.cad-sticky-cta {
  padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
  padding-left: calc(var(--space-2) + env(safe-area-inset-left, 0px));
  padding-right: calc(var(--space-2) + env(safe-area-inset-right, 0px));
}

.cad-whatsapp {
  right: calc(var(--space-2) + env(safe-area-inset-right, 0px));
  bottom: calc(var(--mobile-cta-height) + var(--space-2) + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 768px) {
  .cad-whatsapp {
    bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
    right: calc(var(--space-3) + env(safe-area-inset-right, 0px));
  }
}

/* Modal — stay usable on short mobile viewports */
@media (max-width: 767px) {
  .cad-modal {
    padding: var(--space-1);
    align-items: flex-end;
  }

  .cad-modal__dialog {
    width: 100%;
    max-height: min(92vh, 720px);
    border-radius: 1.25rem 1.25rem 0 0;
    padding: 1.25rem;
  }

  .cad-mobile-nav {
    padding: 1.25rem;
    padding-top: calc(1.25rem + env(safe-area-inset-top, 0px));
  }
}

/* Footer — avoid cramped columns on tablets */
@media (max-width: 899px) {
  .cad-footer {
    padding-bottom: calc(var(--mobile-cta-height) + 1.5rem + env(safe-area-inset-bottom, 0px));
  }
}

@media (min-width: 768px) {
  .cad-footer {
    padding-bottom: 2.5rem;
  }
}
