/*
 * Cuba Health Assist — minimum touch target, v3.2.7
 *
 * Project standard: every interactive control must present at least a 44x44 CSS-pixel
 * hit area. Several controls are deliberately small on screen — social icons, the
 * language switcher, carousel dots, checkboxes — and must stay that size visually.
 * Those get an invisible centred overlay that grows the hit area without moving a
 * single pixel of layout. Controls that are simply short (text link rows, legal
 * links) get a real min-height instead, since growing them is harmless.
 *
 * Loaded after the design system so it can raise a target the base sheet left small,
 * and scoped tightly so it never inflates buttons that are already compliant.
 */

/* ---------------------------------------------------------------
   1. Small controls: keep the visual, grow the hit area
   --------------------------------------------------------------- */
.cha-tap-overlay,
.cha-site-footer a[aria-label],
.cha-lang-switch a,
.cha-lang-switch button,
[data-cha-carousel-dot],
button.h-2.rounded-full,
a.w-9.h-9 {
  position: relative;
}

.cha-tap-overlay::after,
.cha-site-footer a[aria-label]::after,
.cha-lang-switch a::after,
.cha-lang-switch button::after,
[data-cha-carousel-dot]::after,
button.h-2.rounded-full::after,
a.w-9.h-9::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  transform: translate(-50%, -50%);
  background: transparent;
  pointer-events: auto;
}

input[type="checkbox"],
input[type="radio"] {
  min-width: 18px;
  min-height: 18px;
}

label:has(> input[type="checkbox"]),
label:has(> input[type="radio"]),
.chk-row,
.cha-case-center__label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

/* Auth controls must meet the same floor even on fine-pointer browser/device
   combinations. The legacy auth sheet renders the eye button at 32x32 and the
   forgot-password button as a text link; neither is an acceptable phone target. */
.cha-signin-page .eye-btn {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
}

.cha-signin-page .link-primary,
.cha-signin-page button.link-primary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-block: 8px;
}

/* ---------------------------------------------------------------
   2. Short interactive rows: raise the real height
   --------------------------------------------------------------- */
.cha-editorial-read,
.cha-corporate-notice__legal,
.cha-card-link,
.cw-table a[href]:not(.cha-inline-text-link),
.cw-actions a[href],
.cw-actions button,
.cha-pagination a,
.cha-pagination button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.cw-table td .cw-button,
.cw-table td .cw-link,
.cw-table td button {
  min-height: 44px;
}

.cw-quick-links a,
.cw-context-action {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* ---------------------------------------------------------------
   3. Dialog and panel controls
   --------------------------------------------------------------- */
.cha-modal__close,
.cw-modal__close,
[data-cha-dialog-close],
[data-cha-notification-close],
.cw-notification__close {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------------------------------------------------------------
   4. Pointer-coarse hardening
   --------------------------------------------------------------- */
@media (pointer: coarse) {
  button:not([disabled]),
  [role="button"],
  a.btn,
  a.cw-button,
  .cw-button,
  .btn,
  select,
  input[type="submit"],
  input[type="button"],
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="date"],
  input[type="password"],
  input[type="search"],
  input[type="number"] {
    min-height: 44px;
  }

  .cw-toast__cta {
    min-height: 44px;
  }

  .cw-toast__close {
    min-width: 44px;
    min-height: 44px;
  }

  .cw-quick-links a,
  .cw-search input {
    min-height: 44px;
  }

  .cw-quick-links a {
    display: inline-flex;
    align-items: center;
  }
}

.cha-no-tap-overlay::after {
  content: none;
}

@media (pointer: coarse) and (min-width: 1024px) {
  .cw-sidebar a,
  .cw-sidebar button {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* Localized legacy public chrome can exceed the available width as Tailwind's
   lg breakpoint activates at exactly 1024px. Keep the desktop navigation itself
   visible, but defer secondary top-strip copy and the long header application CTA
   until the viewport has enough horizontal room. */
@media (min-width: 1024px) and (max-width: 1100px) {
  body > .min-h-dvh > .bg-primary .hidden.lg\:flex,
  body > div.min-h-dvh > .bg-primary .hidden.lg\:flex {
    display: none !important;
  }

  body > .min-h-dvh > .bg-primary .hidden.lg\:inline,
  body > div.min-h-dvh > .bg-primary .hidden.lg\:inline {
    display: none !important;
  }

  header#top > .container-page > .relative {
    gap: 10px !important;
  }

  header#top nav.hidden.lg\:flex {
    gap: 10px !important;
    margin-left: 6px !important;
    margin-right: 6px !important;
  }

  header#top nav.hidden.lg\:flex > a {
    font-size: 12.5px !important;
  }

  header#top a.hidden.md\:inline-flex[href*="/apply/"] {
    display: none !important;
  }
}
