/* ke-mobile-unify-20261130
   KE Leaders — one consistent mobile layout plus leftover-blue retints.
   Colour retints apply at all widths. Layout rules are mobile-only
   (@media max-width: 767px). Desktop layout is unchanged.
   Does not touch .top-slider-wrapper, #courseSlider / .hs-* hero slides,
   menus, or page content. Off switch: wp-content/uploads/ke-fixes/MOBILE-UNIFY-OFF
*/

/* =====================================================================
   Colour retints — all widths
   Plum #3D2438, deep #24141E, gold #7A5420, champagne #D4B483,
   ivory #FBF7F0, page #F6F0E8, text #1F161A. Key pairs meet WCAG AA.
   Does not target .top-slider-wrapper (handled by a separate pack).
   ===================================================================== */

/* Fixed mobile header (navy #0f2a5c) */
.ke-mobile-topbar {
  background: #3D2438 !important;
  color: #ffffff !important;
}

.ke-mobile-main-menu li > a:hover,
.ke-mobile-main-menu .sub-menu li > a:hover {
  color: #3D2438 !important;
  background: #FBF7F0 !important;
}

.ke-mobile-main-menu .current-menu-item > a,
.ke-mobile-main-menu .current-menu-ancestor > a {
  color: #3D2438 !important;
  background: #F6F0E8 !important;
  font-weight: 600;
}

/* WooCommerce product cards and add-to-cart
   Titles/buttons were #0f2a5c / #163d85 / #1a73e8 / #183574 / #203F8A */
.woocommerce ul.products li.product h2,
.woocommerce ul.products li.product h2.woocommerce-loop-product__title,
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  color: #3D2438 !important;
}

.woocommerce ul.products li.product .price,
.woocommerce ul.products li.product .price .amount,
.woocommerce ul.products li.product .price ins,
.woocommerce div.product p.price,
.woocommerce div.product span.price {
  color: #7A5420 !important;
}

.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product a.button,
.woocommerce ul.products li.product a.button.product_type_simple,
.single_add_to_cart_button,
.woocommerce div.product form.cart .button {
  background: #3D2438 !important;
  background-color: #3D2438 !important;
  color: #ffffff !important;
  border-color: #3D2438 !important;
}

.woocommerce ul.products li.product .button:hover,
.woocommerce ul.products li.product a.button:hover,
.woocommerce ul.products li.product a.button:focus,
.single_add_to_cart_button:hover,
.single_add_to_cart_button:focus,
.woocommerce div.product form.cart .button:hover,
.woocommerce div.product form.cart .button:focus {
  background: #24141E !important;
  background-color: #24141E !important;
  color: #ffffff !important;
  border-color: #24141E !important;
}

/* WPForms submit (was #066aab). Field/button height is handled in the mobile block. */
html {
  --wpforms-button-background-color: #3D2438;
  --wpforms-button-border-color: #3D2438;
  --wpforms-button-text-color: #ffffff;
  --wpforms-page-break-color: #3D2438;
}

.wpforms-form button[type="submit"],
.wpforms-form .wpforms-submit,
.wpforms-submit,
button.wpforms-submit {
  background: #3D2438 !important;
  background-color: #3D2438 !important;
  color: #ffffff !important;
  border-color: #3D2438 !important;
}

.wpforms-form button[type="submit"]:hover,
.wpforms-form button[type="submit"]:focus,
.wpforms-form .wpforms-submit:hover,
.wpforms-form .wpforms-submit:focus,
.wpforms-submit:hover,
.wpforms-submit:focus,
button.wpforms-submit:hover,
button.wpforms-submit:focus {
  background: #24141E !important;
  background-color: #24141E !important;
  color: #ffffff !important;
  border-color: #24141E !important;
}

/* Side TranslatePress language tab (was #203F8A) */
.trp-language-switcher,
.trp-language-switcher-container .trp-language-switcher,
nav.trp-language-switcher.trp-floating-switcher {
  background: #3D2438 !important;
  background-color: #3D2438 !important;
  border-color: #3D2438 !important;
}

.trp-language-switcher:hover,
.trp-language-switcher:focus-within {
  background: #24141E !important;
  background-color: #24141E !important;
  box-shadow: 0 6px 24px rgba(36, 20, 30, 0.24), 0 2px 6px rgba(36, 20, 30, 0.10) !important;
}

html[lang^="ar"] .trp-language-switcher,
html[lang="ar"] .trp-language-switcher,
[dir="rtl"] .trp-language-switcher {
  border-right: 1px solid #3D2438 !important;
}

html[lang^="en"] .trp-language-switcher,
[dir="ltr"] .trp-language-switcher {
  border-color: #3D2438 !important;
}

.bottom-menu-item:focus-visible {
  outline-color: #3D2438 !important;
}

/* Shopify-style mobile bottom nav — leftover blue theme tokens */
:root {
  --bmm-blue: #3D2438;
  --bmm-blue-dark: #24141E;
  --bmm-blue-light: #FBF7F0;
  --bmm-blue-soft: #F6F0E8;
}

.shopify-mobile-bottom-menu .bmi-icon-raised,
.shopify-mobile-bottom-menu .bmi-icon-wrap.bmi-icon-raised,
.bmi-icon-raised {
  background: #3D2438 !important;
  background-color: #3D2438 !important;
}

.shopify-mobile-bottom-menu .bmi-live-dot:not(.bmi-schedule-dot) {
  background: #3D2438 !important;
}

.shopify-mobile-bottom-menu {
  border-top-color: rgba(61, 36, 56, 0.10);
  box-shadow: 0 -4px 20px rgba(36, 20, 30, 0.08);
}

/* Inner-page CIPS / locations band was leftover navy #0B1F3A; homepage already uses deep. */
.ke-bottom-band {
  background: #24141E;
  color: #F6F0E8;
  border-top-color: rgba(212, 180, 131, 0.35);
}

.ke-loc-label,
.ke-cips-dates-kicker,
.ke-cips-date-month {
  color: #D4B483;
}

.ke-cips-btn {
  background: #D4B483;
  color: #24141E !important;
}

.ke-cips-btn:hover,
.ke-cips-btn:focus {
  background: #e0c59a;
  color: #24141E !important;
}

/* =====================================================================
   Mobile layout only — do not change desktop
   ===================================================================== */
@media (max-width: 767px) {

  :root {
    --ke-m-gutter: 20px;
    --ke-m-gutter-sm: 16px;
    --ke-m-section: 40px;
    --ke-m-header: 56px;
    --ke-m-tap: 44px;
    --ke-m-logo: 40px;
    --header-h: 56px;
    --bottom-bar: 132px;
    --wpforms-button-size-height: 44px;
    --wpforms-field-size-input-height: 44px;
  }

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

  body {
    font-size: 1rem;
    line-height: 1.55;
    color: #1F161A;
    /* Call/WhatsApp bar sits above the 68px utility nav. */
    padding-bottom: calc(68px + 64px + 56px + 12px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Pages that use the shared site-header already zero the leftover 82px
     top padding from the old navy top bar. Keep that. Pages that still
     show .ke-mobile-topbar keep a matching offset. */
  body.ke-home-v10,
  body.ke-home-v11 {
    padding-top: 0 !important;
  }

  body:not(.ke-home-v10):not(.ke-home-v11) {
    padding-top: 82px !important;
  }

  /* ----- Type scale (content). Leave homepage hero slider typography alone. ----- */
  h1,
  .entry-title,
  .ka-hero h1,
  .kb-post-hero h1,
  .kb-card-featured h3, /* featured title only sized below as h1-adjacent? skip - keep as h3 */
  .kei-hero-band h1,
  .kc-hero h1,
  .kc2-hero h1,
  .woocommerce-products-header h1,
  .product_title,
  .ke-course h1 {
    font-size: 1.75rem !important;
    line-height: 1.2 !important;
    letter-spacing: -0.02em;
  }

  /* Homepage opening title is already close; keep it in the same scale. */
  #ke-home .hero h1 {
    font-size: 1.75rem !important;
    line-height: 1.2 !important;
  }

  h2,
  .section-head h2,
  .section h2,
  .kb-content h2,
  .kei-block > h2,
  .kei-section-h,
  .kei-detail h2,
  .kei-enquiry-panel h2,
  .kc-form-card h2,
  .ke-cips-card h2,
  .ke-course h2 {
    font-size: 1.35rem !important;
    line-height: 1.3 !important;
  }

  h3,
  .section h3,
  .kb-content h3,
  .kc-card h2,
  .ka-person h2 {
    font-size: 1.15rem !important;
    line-height: 1.35 !important;
  }

  /* Footer and kicker labels stay small */
  footer.site h3,
  .site h3,
  #ke-home footer.site h3,
  .kei-detail h3,
  .cips-slim h2,
  .ke-loc-label,
  .ke-cips-dates-kicker,
  .ke-cips-date-month {
    font-size: 0.75rem !important;
    line-height: 1.3 !important;
    letter-spacing: 0.08em;
  }

  /* Course / blog card titles — readable, not section-sized */
  .card h3,
  .kf-grid .card h3,
  .kb-card h3,
  .date-card h3,
  .ke-card h3,
  .kei-card h2,
  .why-card h3 {
    font-size: 1rem !important;
    line-height: 1.35 !important;
  }

  /* ----- Gutters and section padding ----- */
  .wrap,
  .ast-container,
  .site-header .wrap,
  .kei-wrap,
  .ka-wrap,
  .kb-wrap,
  .kc-wrap,
  .kf-wrap,
  .ke-course .wrap,
  .ke-training {
    padding-inline: var(--ke-m-gutter);
  }

  .section,
  .reviews-strip,
  .ka-panel,
  .kb-section,
  .kc-section,
  .kei-section,
  .ke-course-section {
    padding-top: var(--ke-m-section);
    padding-bottom: var(--ke-m-section);
  }

  /* ----- Header and hamburger ----- */
  .site-header {
    min-height: var(--ke-m-header);
  }

  .site-header .header-inner,
  .header-inner {
    min-height: var(--ke-m-header);
    gap: 10px;
  }

  .site-header .logo img,
  .logo img {
    width: var(--ke-m-logo) !important;
    height: var(--ke-m-logo) !important;
    max-width: var(--ke-m-logo);
    object-fit: contain;
  }

  .ke-mobile-topbar .ke-center-logo,
  .ke-mobile-row-2 img.ke-center-logo,
  .ke-mobile-row-2 img {
    height: 36px !important;
    width: auto !important;
    max-height: 36px;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--ke-m-tap);
    min-height: var(--ke-m-tap);
    padding: 8px 12px;
    color: #1F161A;
    border: 1px solid rgba(31, 22, 26, 0.22);
    border-radius: 10px;
    background: transparent;
  }

  .ke-mobile-menu-button {
    width: var(--ke-m-tap) !important;
    height: var(--ke-m-tap) !important;
    min-width: var(--ke-m-tap) !important;
    min-height: var(--ke-m-tap) !important;
    top: 6px !important;
    right: 8px !important;
    left: auto !important;
    gap: 5px;
  }

  [dir="rtl"] .ke-mobile-menu-button,
  html[lang^="ar"] .ke-mobile-menu-button {
    right: auto !important;
    left: 8px !important;
  }

  /* ----- Buttons and tap targets (not hero-slider chrome) ----- */
  a.btn,
  .btn,
  .header-cta,
  .btn-primary,
  .btn-outline,
  .btn-dark,
  .btn-whatsapp,
  .btn-ghost,
  .ke-cips-btn,
  .elementor-button,
  .woocommerce a.button,
  .woocommerce button.button,
  .woocommerce input.button,
  input[type="submit"],
  input[type="button"],
  button[type="submit"],
  .wpforms-submit {
    min-height: var(--ke-m-tap);
    min-width: var(--ke-m-tap);
    padding: 12px 16px;
    box-sizing: border-box;
  }

  .mobile-bar .btn,
  .mobile-bar a.btn {
    min-height: var(--ke-m-tap);
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    padding: 12px 10px;
  }

  /* ----- Forms ----- */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="search"],
  input[type="url"],
  input[type="number"],
  input[type="date"],
  select,
  textarea,
  .wpforms-form input,
  .wpforms-form select,
  .wpforms-form textarea,
  .form-box input,
  .form-box select,
  .form-box textarea {
    max-width: 100%;
    font-size: 16px !important; /* prevents iOS zoom */
    min-height: var(--ke-m-tap);
    box-sizing: border-box;
  }

  textarea {
    min-height: 88px;
  }

  .wpforms-form,
  .form-box,
  .hero-form .wpforms-form,
  .kei-enquiry-panel,
  .kc-form-card {
    max-width: 100%;
  }

  .wpforms-form input,
  .wpforms-form select,
  .wpforms-form textarea,
  .form-box input,
  .form-box select,
  .form-box textarea {
    width: 100%;
  }

  /* ----- Cards and grids ----- */
  .cards,
  .dates,
  .why-grid,
  .foot-grid,
  .trust-grid,
  .kf-grid,
  .kb-grid,
  .woocommerce ul.products,
  .kei-grid,
  .ka-hero-grid,
  .ke-training__grid,
  .reviews-line,
  .ke-cips-dates {
    grid-template-columns: 1fr !important;
  }

  .cat-grid,
  .city-grid,
  .stats,
  .ke-cips-dates {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px;
  }

  .woocommerce ul.products {
    display: block;
    padding-inline: 0 !important;
    margin: 0 !important;
  }

  .woocommerce ul.products li.product {
    width: 100% !important;
    max-width: 100%;
    margin: 0 0 16px 0 !important;
    box-sizing: border-box;
  }

  .woocommerce ul.products li.product img {
    width: 100% !important;
    height: auto !important;
    max-height: 200px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
  }

  .card,
  .why-card,
  .date-card,
  .kb-card,
  .kei-card,
  .kc-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .card img,
  .kb-card img,
  .date-card img,
  .ke-training__frame img,
  .woocommerce div.product div.images img,
  .wp-post-image,
  img.attachment-woocommerce_thumbnail {
    max-width: 100%;
    height: auto;
  }

  /* ----- Footer ----- */
  footer.site,
  .site .foot-grid,
  .ke-bottom-band {
    padding-inline: var(--ke-m-gutter);
  }

  .ke-bottom-band {
    padding-top: 22px;
    padding-bottom: 28px;
  }

  .legal {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  /* ----- Sticky Call/WhatsApp bar + utility nav: no overlap ----- */
  .shopify-mobile-bottom-menu {
    z-index: 80;
    height: auto;
    min-height: 68px;
  }

  .mobile-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    z-index: 75;
    background: #FBF7F0;
    border-top: 1px solid #E5D8C8;
    padding: 8px 12px;
    gap: 8px;
    box-shadow: 0 -8px 24px rgba(36, 20, 30, 0.08);
  }

  /* If a page has no utility nav, keep the call bar on the bottom edge. */
  body:not(:has(.shopify-mobile-bottom-menu)) .mobile-bar {
    bottom: 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }

  body:not(:has(.shopify-mobile-bottom-menu)) {
    padding-bottom: calc(64px + 56px + 12px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Floating language tab stays mid-side, clear of both bars */
  nav.trp-language-switcher.trp-floating-switcher,
  .trp-language-switcher {
    bottom: auto !important;
  }

  /* KE Autoreply Chat bubble (#ke-ar-root) already clears the 72px call bar
     at 96px; raise it further so it clears the 68px utility nav as well. */
  #ke-ar-root {
    bottom: calc(68px + 64px + 16px + env(safe-area-inset-bottom, 0px)) !important;
  }
  #ke-ar-root[data-open="1"] {
    bottom: calc(68px + 64px + 8px + env(safe-area-inset-bottom, 0px)) !important;
  }
  body:not(:has(.shopify-mobile-bottom-menu)) #ke-ar-root,
  body:not(:has(.shopify-mobile-bottom-menu)) #ke-ar-root[data-open="1"] {
    bottom: calc(64px + 16px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* ----- No clipped text, no horizontal scroll ----- */
  img, video, iframe, svg {
    max-width: 100%;
  }

  /* Keep header logo and small icons at their set size */
  .site-header .logo img,
  .logo img,
  .ke-mobile-row-2 img,
  .trp-flag-image,
  .bmi-icon-wrap svg,
  .city-tile .flag {
    max-width: none;
  }

  .site-header .logo img,
  .logo img {
    max-width: var(--ke-m-logo);
  }

  table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }

  pre, code {
    max-width: 100%;
    overflow-x: auto;
  }

  .hs-slide img,
  #courseSlider img {
    max-width: 100%;
    height: auto;
  }
}

@media (max-width: 360px) {
  :root {
    --ke-m-gutter: 16px;
  }

  h1,
  .entry-title,
  .ka-hero h1,
  .kb-post-hero h1,
  .kei-hero-band h1,
  #ke-home .hero h1,
  .product_title {
    font-size: 1.6rem !important;
  }

  .cat-grid,
  .city-grid,
  .stats,
  .ke-cips-dates {
    grid-template-columns: 1fr !important;
  }

  .mobile-bar .btn,
  .mobile-bar a.btn {
    font-size: 0.82rem;
    padding-inline: 8px;
  }

  body:not(.ke-home-v10):not(.ke-home-v11) {
    padding-top: 76px !important;
  }
}

/* RTL: use logical sides; hamburger already flipped above. */
@media (max-width: 767px) {
  [dir="rtl"] body,
  html[lang^="ar"] body {
    text-align: start;
  }

  [dir="rtl"] .legal,
  html[lang^="ar"] .legal {
    align-items: flex-start;
  }

}
