/* ==========================================================
   XTC Responsive — tablet/mobile adjustments
   ========================================================== */

@media (max-width: 900px) {
  body {
    padding-bottom: 112px;
  }

  .xtc-floating-cta {
    display: none;
  }

  #masthead.site-header {
    width: calc(100% - 32px);
    padding: 10px 12px;
    min-height: 64px;
    gap: 14px;
  }

  #masthead .site-branding {
    max-width: 168px;
  }

  #masthead .custom-logo-link img {
    max-height: 50px;
  }

  #site-navigation .menu {
    gap: 4px;
  }

  #site-navigation .menu > li > a {
    min-height: 38px;
    padding: 0 10px;
    font-size: 0.92rem;
  }

  .xtc-grid,
  .xtc-metrics,
  .xtc-steps,
  .xtc-link-grid,
  .xtc-contact-strip {
    gap: 14px;
    margin-top: 18px;
  }

  /* Hero — stack columns */
  .xtc-shell--home-refined .xtc-hero--home {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .xtc-shell--home-refined .xtc-hero__aside {
    position: static;
  }

  .xtc-shell--home-refined .xtc-quick-actions__grid,
  .xtc-shell--home-refined .xtc-grid--services,
  .xtc-shell--home-refined .xtc-trust-grid,
  .xtc-shell--home-refined .xtc-article-grid,
  .xtc-shell--home-refined .xtc-link-grid--cards {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Social proof — 2 col */
  .xtc-social-proof__reviews {
    grid-template-columns: repeat(2, 1fr);
  }

  .xtc-mobile-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: auto;
    max-width: calc(100% - 16px);
  }

  .xtc-back-top {
    right: 16px;
    bottom: 142px;
  }

  .xtc-site-footer__inner {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 18px 16px;
  }

  #site-navigation .sub-menu {
    min-width: 180px;
  }

  /* Cookie consent: full-width card on tablet */
  .xtc-cookie-consent {
    right: 12px;
    left: 12px;
    bottom: 88px;
    width: auto;
  }

  .xtc-cookie-consent__card {
    max-width: 100%;
    border-radius: var(--xtc-radius-sm);
  }

  .xtc-cookie-consent__actions {
    gap: 6px;
  }
}

@media (max-width: 640px) {
  body {
    padding-bottom: 108px;
  }

  #masthead.site-header {
    flex-wrap: wrap;
    align-items: center;
  }

  #masthead.site-header {
    width: calc(100% - 32px);
    padding: 10px 11px;
    min-height: 60px;
    gap: 10px;
  }

  #masthead .site-branding {
    max-width: 142px;
  }

  #masthead .custom-logo-link img {
    max-height: 44px;
  }

  #masthead .menu-toggle {
    display: inline-flex;
    min-width: 40px;
    min-height: 40px;
  }

  #site-navigation {
    display: block;
    flex: 0 0 100%;
    width: 100%;
    margin-left: 0;
    padding-top: 8px;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition:
      max-height 0.24s ease,
      opacity 0.18s ease,
      transform 0.18s ease,
      visibility 0s linear 0.24s;
  }

  #masthead.is-menu-open #site-navigation {
    max-height: 80vh;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition:
      max-height 0.24s ease,
      opacity 0.18s ease,
      transform 0.18s ease;
  }

  #site-navigation .menu {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  #site-navigation .menu > li {
    width: 100%;
  }

  #site-navigation .menu > li > a {
    min-height: 36px;
    width: 100%;
    padding: 0 9px;
    font-size: 0.9rem;
    justify-content: flex-start;
  }

  #site-navigation .menu-item-has-children {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }

  #site-navigation .xtc-submenu-toggle {
    display: inline-flex;
  }

  #site-navigation .menu-item-has-children > a {
    flex: 1 1 auto;
    min-width: 0;
  }

  #site-navigation .menu-item-has-children > .sub-menu {
    position: static;
    flex: 0 0 100%;
    margin-top: 6px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    display: none;
    box-shadow: none;
  }

  #site-navigation .menu-item-has-children.is-open > .sub-menu {
    display: block;
  }

  .xtc-shell h1 {
    font-size: clamp(1.72rem, 6vw, 2rem);
  }

  .xtc-shell h2 {
    font-size: clamp(1.28rem, 4.5vw, 1.45rem);
  }

  .xtc-shell h3 {
    font-size: clamp(1rem, 3.5vw, 1.08rem);
  }

  .xtc-shell p,
  .xtc-shell li,
  .xtc-lead,
  .xtc-section__intro p {
    font-size: 0.96rem;
    line-height: 1.62;
  }

  /* Hero — full stack, reduced padding */
  .xtc-shell--home-refined .xtc-hero--home {
    gap: 20px;
  }

  .xtc-shell--home-refined .xtc-hero--home h1 {
    font-size: clamp(1.75rem, 6vw, 2.1rem);
    max-width: none;
  }

  .xtc-shell--home-refined .xtc-quick-actions__grid,
  .xtc-shell--home-refined .xtc-grid--services,
  .xtc-shell--home-refined .xtc-trust-grid,
  .xtc-shell--home-refined .xtc-article-grid,
  .xtc-shell--home-refined .xtc-link-grid--cards {
    grid-template-columns: 1fr;
  }

  /* Social proof — single col */
  .xtc-social-proof__reviews {
    grid-template-columns: 1fr;
  }

  /* Home teaser header stack */
  .xtc-home-teaser__header {
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
  }

  /* Blog hub */
  .xtc-blog-hub__title {
    font-size: clamp(1.3rem, 5vw, 1.6rem);
  }

  .xtc-btn,
  .xtc-contact-form__submit,
  .xtc-newsletter-form__submit {
    min-height: 42px;
    padding: 0 16px;
    font-size: 0.92rem;
  }

  .xtc-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    min-width: 0;
  }

  .xtc-actions .xtc-btn {
    width: 100%;
    max-width: 100%;
    min-height: 46px;
    min-width: 0;
    justify-content: center;
    text-align: center;
  }

  .xtc-mobile-bar {
    left: 8px;
    right: 8px;
    bottom: 8px;
    box-sizing: border-box;
    gap: 8px;
    padding: 8px;
  }

  .xtc-mobile-bar a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 44px;
    padding: 0 10px;
    font-size: 0.9rem;
    line-height: 1.1;
    text-align: center;
  }

  .xtc-back-top {
    right: 14px;
    bottom: 138px;
    width: 40px;
    height: 40px;
  }

  .xtc-site-footer__inner {
    padding: 16px 14px;
    gap: 16px;
  }

  /* Cookie consent: compact on mobile */
  .xtc-cookie-consent {
    right: 8px;
    left: 8px;
    bottom: 88px;
    width: auto;
  }

  .xtc-cookie-consent__card {
    padding: 14px 16px;
  }

  .xtc-cookie-consent__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .xtc-cookie-consent__button {
    justify-content: center;
    width: 100%;
  }

  .xtc-cookie-consent__button--ghost {
    width: auto;
    align-self: center;
  }

  /* Contact form: single-column on mobile */
  .xtc-contact-form__row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .xtc-shell--contact-page .xtc-contact-form,
  .xtc-shell--contact-page .wp-block-jetpack-contact-form {
    padding: 18px 16px;
  }

  .xtc-contact-form input,
  .xtc-contact-form textarea,
  .xtc-shell .wp-block-jetpack-contact-form input,
  .xtc-shell .wp-block-jetpack-contact-form textarea {
    font-size: 1rem;
  }

  .xtc-shell--contact-page .xtc-contact-form,
  .xtc-shell--contact-page .wp-block-jetpack-contact-form {
    gap: 14px;
  }

  .xtc-shell--contact-page .xtc-contact-form label,
  .xtc-shell--contact-page .wp-block-jetpack-contact-form label {
    gap: 5px;
    line-height: 1.28;
  }

  .xtc-shell--contact-page .xtc-contact-form textarea,
  .xtc-shell--contact-page .wp-block-jetpack-contact-form textarea {
    min-height: 148px;
  }

  .xtc-contact-form__submit,
  .xtc-shell .wp-block-jetpack-contact-form .wp-block-button__link {
    width: 100%;
  }

  label.xtc-contact-form__consent {
    gap: 9px;
  }

  .xtc-contact-form__consent input[type="checkbox"] {
    margin-top: 2px;
  }

  /* Dropdown: wider on narrow screens */
  #site-navigation .sub-menu {
    min-width: 160px;
    padding: 6px;
  }
}
