/* EHBA responsive layer: 1200px, 992px, 768px, 576px, and 360px. */
html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }
img, svg, video, canvas, iframe { max-width: 100%; }
img, video, canvas { height: auto; }
.ehba-container, .ehba-card, .ehba-dashboard-card, .ehba-section-grid > *, .ehba-cards-grid > *, .ehba-card-wrapper > *, .elementor-element, .tutor-container, .tutor-row > *, .woocommerce div.product > * { min-width: 0; }
.ehba-site-header { position: sticky; top: 0; z-index: 1000; }

/* Student portal: preserve a usable, data-driven sidebar without squeezing cards. */
.ehba-student-dashboard .ehba-container { max-width: 1440px; }
.ehba-student-dashboard .ehba-dashboard-layout { grid-template-columns: minmax(232px, 264px) minmax(0, 1fr); gap: 28px; }
.ehba-dashboard-sidebar { position: sticky; top: 118px; }
.ehba-dashboard-nav { display: grid; gap: 4px; padding: 12px; }
.ehba-dashboard-nav a { display: flex; align-items: center; min-height: 42px; padding: 10px 12px; border-radius: 10px; color: var(--ehba-charcoal); text-decoration: none; font-weight: 700; }
.ehba-dashboard-nav a:hover, .ehba-dashboard-nav a:focus-visible, .ehba-dashboard-nav a.is-active { background: rgba(140,29,64,.1); color: var(--ehba-deep-burgundy); }
.ehba-dashboard-nav__divider { height: 1px; margin: 8px 4px; background: rgba(92,16,40,.12); }
.ehba-dashboard-nav .ehba-dashboard-nav__logout { color: var(--ehba-deep-burgundy); }
.ehba-dashboard-courses-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Booking is phone-only; WhatsApp remains available on every viewport. */
.ehba-mobile-action-bar { display: none; }
.ehba-whatsapp-float { display: inline-flex; }

@media (max-width: 1200px) {
  .ehba-container { padding-inline: 24px; }
  .ehba-grid, .ehba-card-wrapper { gap: 20px; }
  .ehba-header-inner { gap: 16px; }
  .ehba-header-actions { gap: 8px; }
}

@media (max-width: 992px) {
  .ehba-container { max-width: 100%; padding-inline: 24px; }
  .ehba-cards-grid, .ehba-card-wrapper, .ehba-gallery-grid, .ehba-testimonials-grid, .woocommerce ul.products, .woocommerce .products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ehba-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .ehba-col-8, .ehba-col-6 { grid-column: span 8; }
  .ehba-col-4, .ehba-col-3 { grid-column: span 4; }
  .ehba-section-grid, .ehba-course-detail-grid, .ehba-dashboard-layout, .ehba-booking-cta__panel, .ehba-conversion-panel, .woocommerce div.product { grid-template-columns: 1fr; }
  .ehba-booking-cta__highlights { justify-content: flex-start; }
  .ehba-landing-card-grid--five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ehba-landing-split, .ehba-landing-duo, .ehba-landing-founder, .ehba-location-grid { gap: 28px; }
  .woocommerce .woocommerce-ordering, .woocommerce .woocommerce-result-count { float: none; display: block; width: 100%; }
}

@media (max-width: 768px) {
  /* Keep WordPress's logged-in toolbar within the narrow viewport. */
  #wpadminbar .quicklinks #wp-admin-bar-my-account > a { max-width: 46px; overflow: hidden; }
  #wpadminbar .quicklinks #wp-admin-bar-my-account .display-name { display: none; }
  #wpadminbar .quicklinks .ab-sub-wrapper { max-width: calc(100vw - 8px); }

  .ehba-container { padding-inline: 20px; }
  .ehba-dashboard-sidebar { position: static; }
  .ehba-dashboard-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ehba-dashboard-nav__divider { display: none; }
  .ehba-top-bar .ehba-container { flex-direction: column; align-items: flex-start; gap: 8px; }
  .ehba-top-left, .ehba-top-right { width: 100%; gap: 8px 12px; flex-wrap: wrap; }
  .ehba-contact--email, .ehba-contact--email * { overflow-wrap: anywhere; }

  .ehba-header-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; }
  .ehba-branding { grid-column: 1; }
  .ehba-branding .custom-logo-link { width: clamp(130px, 42vw, 180px); }
  .ehba-mobile-toggle { display: inline-flex; grid-column: 3; }
  .ehba-primary-nav { display: none; }
  .ehba-header-actions { display: flex; grid-column: 2; margin-left: auto; gap: 6px; }
  .ehba-header-actions .ehba-academy-link, .ehba-header-actions .ehba-booking-button { display: none; }
  .ehba-cart-link { min-height: 42px; padding: 8px 10px; font-size: .875rem; }
  /* Keep the closed fixed drawer out of the document's scrollable width. */
  .ehba-mini-cart { width: min(420px, calc(100vw - 16px)); transform: none; opacity: 0; visibility: hidden; pointer-events: none; }
  .ehba-mini-cart.open { transform: none; opacity: 1; visibility: visible; pointer-events: auto; }
  .ehba-mobile-menu .ehba-container { width: min(100%, calc(100vw - 24px)); min-height: calc(100dvh - 24px); margin: 0 auto; padding: 20px; }
  .ehba-mobile-menu a { min-height: 44px; }

  .ehba-hero--home { min-height: 540px; padding-block: 64px; }
  .ehba-mini-hero { min-height: 210px; padding-block: 48px; }
  .ehba-hero .hero-content { max-width: 100%; }
  .ehba-hero .hero-cta-panel { padding: 18px 20px; }
  .ehba-hero .hero-actions, .ehba-hero .hero-actions__primary, .ehba-hero .hero-actions__secondary { flex-wrap: wrap; }
  .ehba-hero .hero-actions .ehba-button { flex: 1 1 180px; }

  .ehba-card-grid, .ehba-cards-grid, .ehba-card-wrapper, .ehba-gallery-grid, .ehba-testimonials-grid, .ehba-course-grid, .ehba-trust-grid, .ehba-related-ecosystem .ehba-card-wrapper, .ehba-grid, .ehba-section-grid, .ehba-dashboard-layout, .ehba-dashboard-summary-grid { grid-template-columns: 1fr; }
  .ehba-grid > *, .ehba-section-grid > *, .ehba-cards-grid > *, .ehba-card-wrapper > *, .ehba-col-8, .ehba-col-6, .ehba-col-4, .ehba-col-3 { grid-column: 1 / -1; }
  .ehba-footer-main .ehba-col-3, .ehba-footer-main .ehba-col-4 { margin-bottom: 28px; }
  .ehba-footer-bottom__inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .ehba-designer-credit { margin-left: 0; }
  .ehba-landing-card-grid, .ehba-landing-card-grid--five, .ehba-landing-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ehba-landing-split, .ehba-landing-duo, .ehba-landing-founder, .ehba-location-grid { grid-template-columns: 1fr; }
  .ehba-landing-founder__image { max-width: 460px; }
  .ehba-landing-actions .ehba-button { flex: 0 1 auto; }

  .ehba-form-grid, .ehba-form-row, form .ehba-form-row, .fluentform .ff-t-container, .fluentform .ff-t-cell, .ff-default .ff-el-group { grid-template-columns: 1fr; width: 100%; }
  .ehba-form input, .ehba-form select, .ehba-form textarea, .fluentform input, .fluentform select, .fluentform textarea, .woocommerce form .form-row input.input-text, .woocommerce form .form-row select, .woocommerce form .form-row textarea { width: 100%; min-width: 0; font-size: 16px; }
  .fluentform .ff-el-group { margin-bottom: 16px; }

  .woocommerce-cart table.shop_table_responsive thead, .woocommerce-checkout .shop_table thead { display: none; }
  .woocommerce-cart table.shop_table_responsive tbody tr, .woocommerce-checkout .shop_table tbody tr { display: block; margin-bottom: 16px; }
  .woocommerce-cart table.shop_table_responsive tbody td, .woocommerce-checkout .shop_table tbody td { display: block; text-align: right; }
  .woocommerce-cart table.shop_table_responsive tbody td::before, .woocommerce-checkout .shop_table tbody td::before { content: attr(data-title) ': '; float: left; font-weight: 700; color: var(--ehba-deep-burgundy); }
  .woocommerce-account .woocommerce-MyAccount-navigation, .woocommerce-account .woocommerce-MyAccount-content { width: 100%; }

  /* Tutor's column grid uses negative gutters; retain space for them on mobile. */
  .tutor-container { padding-inline: 16px; }
  .tutor-course-details-page .tutor-row { row-gap: 24px; }
  .tutor-course-details-page .tutor-col-xl-8, .tutor-course-details-page .tutor-col-xl-4 { width: 100%; }
  .tutor-btn, .tutor-button, a.tutor-btn { min-height: 44px; padding: 11px 16px; }
  .tutor-course-details-tab, .tutor-course-single-sidebar-wrapper { min-width: 0; }

  .ehba-modal .ehba-modal-dialog, .ehba-video-modal .ehba-modal-dialog { width: min(960px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; }
  .ehba-amelia-booking-shell, #amelia-app-booking, .amelia-app-booking, .amelia-v2-booking { width: 100%; max-width: 100%; min-width: 0; }
  .amelia-app-booking input, .amelia-app-booking select, .amelia-app-booking textarea, .am-fs__init-form input, .am-fs__init-form select, .am-fs__init-form textarea { font-size: 16px; }

  .ehba-site-main { padding-bottom: 32px; }
}

@media (max-width: 767px) {
  .ehba-site-main { padding-bottom: 104px; }
  .ehba-mobile-action-bar { display: block; position: fixed; right: 16px; bottom: 80px; z-index: 1300; padding: 0; }
  .ehba-mobile-action-bar__inner { display: block; }
  .ehba-mobile-action-bar__button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 18px; border: 1px solid rgba(255,255,255,.45); border-radius: 999px; background: linear-gradient(135deg, var(--ehba-burgundy), var(--ehba-deep-burgundy)); color: var(--ehba-white); box-shadow: 0 16px 34px rgba(92,16,40,.22); text-decoration: none; font-weight: 700; }
  .ehba-mobile-action-bar__button:hover, .ehba-mobile-action-bar__button:focus-visible { color: var(--ehba-white); transform: translateY(-2px); }
  .ehba-whatsapp-float { display: inline-flex; right: 16px; bottom: 16px; }
}

@media (max-width: 576px) {
  .ehba-container { padding-inline: 16px; }
  .ehba-section { padding-block: 48px; }
  h1 { font-size: clamp(2rem, 9vw, 2.75rem); }
  h2, .ehba-section-header .title { font-size: clamp(1.7rem, 7vw, 2.15rem); }
  h3 { font-size: clamp(1.25rem, 5.5vw, 1.55rem); }
  .ehba-hero--home { min-height: 500px; padding-block: 52px; }
  .ehba-mini-hero { min-height: 190px; padding-block: 42px; }
  .ehba-hero .hero-actions, .ehba-hero .hero-actions__primary, .ehba-hero .hero-actions__secondary { flex-direction: column; align-items: stretch; }
  .ehba-hero .hero-actions .ehba-button { width: 100%; }
  .ehba-landing-actions { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .ehba-landing-actions .ehba-button { width: auto; flex: 0 1 auto; }
  .ehba-card, .ehba-landing-card { padding: 20px; }
  .ehba-dashboard-nav { grid-template-columns: 1fr; }
  .ehba-dashboard-nav a { min-height: 44px; }
  .ehba-dashboard-summary-grid, .ehba-dashboard-courses-grid { grid-template-columns: 1fr; }
  .ehba-landing-card-grid, .ehba-landing-card-grid--five, .ehba-landing-gallery, .ehba-landing-programmes { grid-template-columns: 1fr; }
  .ehba-academy-landing-hero__content, .ehba-about-landing-hero__content { padding-block: 56px; }
  .ehba-academy-landing-hero h1, .ehba-about-landing-hero h1 { font-size: clamp(2.35rem, 12vw, 3.2rem); }
  .ehba-product-detail-panels, .ehba-course-detail-panels-grid { grid-template-columns: 1fr; }
  .woocommerce .button, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button { min-height: 44px; padding: 11px 16px; }
  .woocommerce div.product .summary .product_title { font-size: clamp(1.9rem, 9vw, 2.5rem); }
}

@media (max-width: 360px) {
  .ehba-container { padding-inline: 14px; }
  .ehba-branding .custom-logo-link { width: 124px; }
  .ehba-cart-label { display: none; }
  .ehba-cart-link { padding-inline: 8px; }
  .ehba-mobile-toggle { width: 42px; height: 42px; }
  .ehba-card, .ehba-landing-card { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto; } }
