/* Shifa Clinic - mobile enhancements
   Menu, tap targets and readability below 1024px. Desktop is untouched. */

.shifa-burger { display: none; }
.shifa-ov { display: none; }

@media (max-width: 1024px) {

  /* ---------- compact sticky header bar ---------- */
  .elementor > .e-con.shifa-header {
    position: sticky;
    top: 0;
    z-index: 9990;
    background: #fff;
    box-shadow: 0 1px 0 rgba(19, 32, 57, .09);
  }
  body.admin-bar .elementor > .e-con.shifa-header { top: 32px; }

  .shifa-row {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    padding-top: 9px !important;
    padding-bottom: 9px !important;
  }
  .shifa-row > .shifa-logo {
    margin: 0 !important;
    width: auto !important;
    max-width: none !important;
    flex: 0 0 auto !important;
  }
  .shifa-row > .shifa-logo img {
    height: 50px !important;
    width: auto !important;
    max-width: none !important;
  }
  .shifa-row > .shifa-hide { display: none !important; }

  /* ---------- hamburger ---------- */
  .shifa-burger {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    margin: 0;
    padding: 0;
    border: 1px solid #DCE3EC;
    border-radius: 13px;
    background: #fff;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .shifa-burger:focus-visible { outline: 2px solid #0F428A; outline-offset: 2px; }
  .shifa-burger i {
    position: relative;
    display: block;
    width: 19px;
    height: 2px;
    border-radius: 2px;
    background: #0F428A;
    transition: background .18s ease;
  }
  .shifa-burger i::before,
  .shifa-burger i::after {
    content: "";
    position: absolute;
    left: 0;
    width: 19px;
    height: 2px;
    border-radius: 2px;
    background: #0F428A;
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
  }
  .shifa-burger i::before { top: -6px; }
  .shifa-burger i::after  { top: 6px; }
  .shifa-burger[aria-expanded="true"] i { background: transparent; }
  .shifa-burger[aria-expanded="true"] i::before { transform: translateY(6px) rotate(45deg); }
  .shifa-burger[aria-expanded="true"] i::after  { transform: translateY(-6px) rotate(-45deg); }

  /* ---------- dropdown sheet ---------- */
  .shifa-ov {
    display: block;
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 99990;
    visibility: hidden;
  }
  .shifa-ov-back {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(19, 32, 57, .45);
    opacity: 0;
    transition: opacity .3s ease;
  }
  .shifa-ov-panel {
    position: absolute;
    top: 0; left: 0; right: 0;
    max-height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 18px 44px rgba(19, 32, 57, .20);
    padding: 12px 20px calc(24px + env(safe-area-inset-bottom, 0px));
    transform: translateY(-102%);
    transition: transform .38s cubic-bezier(.32, .72, 0, 1);
  }
  .shifa-ov-panel:focus { outline: none; }
  body.admin-bar .shifa-ov-panel { top: 32px; }

  html.shifa-open .shifa-ov { visibility: visible; }
  html.shifa-open .shifa-ov-back { opacity: 1; }
  html.shifa-open .shifa-ov-panel { transform: translateY(0); }
  html.shifa-open, html.shifa-open body { overflow: hidden; }

  .shifa-ov-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 8px;
  }
  .shifa-ov-top img { height: 50px; width: auto; display: block; }
  .shifa-x {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #DCE3EC;
    border-radius: 13px;
    background: #fff;
    color: #0F428A;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
  }
  .shifa-x:focus-visible { outline: 2px solid #0F428A; outline-offset: 2px; }

  .shifa-ov-nav { display: block; margin: 0; padding: 0; }
  .shifa-ov-nav a {
    display: block;
    padding: 15px 2px;
    font-family: "Poppins", Sans-serif;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    color: #132039;
    text-decoration: none;
    border-bottom: 1px solid #EDF1F6;
  }
  .shifa-ov-nav a[aria-current="page"] { color: #0F428A; }

  .shifa-ov-cta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 16px;
  }
  .shifa-ov-cta a {
    display: block;
    text-align: center;
    padding: 15px 18px;
    border-radius: 999px;
    font-family: "Poppins", Sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
  }
  .shifa-ov-cta .shifa-book { background: #0F428A; color: #fff; }
  .shifa-ov-cta .shifa-call { border: 1px solid #0F428A; color: #0F428A; }
  .shifa-ov-cta .shifa-em   { border: 1px solid #E02B2F; color: #E02B2F; }
}

@media (max-width: 767px) {

  /* readable minimum for the small labels */
  .shifa-min { font-size: 13.5px !important; line-height: 1.55 !important; }

  /* comfortable tap targets */
  .elementor .elementor-button.elementor-size-sm {
    font-size: 14px !important;
    padding-top: 9px !important;
    padding-bottom: 9px !important;
  }
  .elementor .elementor-button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .elementor a.doc-more { padding: 9px 0 !important; }
  .elementor .elementor-widget-heading .elementor-heading-title a {
    display: inline-block;
    padding: 6px 0;
  }

  /* large card grids go two-up instead of one very long column */
  .shifa-grid {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
    gap: 14px !important;
  }
  .shifa-grid > .e-con {
    width: calc(50% - 7px) !important;
    flex: 0 0 calc(50% - 7px) !important;
    max-width: calc(50% - 7px) !important;
  }
  .shifa-grid > .e-con > .e-con:first-child {
    min-height: 0 !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
  }
}
