/*
 * SMTF Del Mar — Comprehensive Mobile Fixes
 * Version: 1.0.0
 * Date: March 17, 2026
 * 
 * Fixes mobile alignment issues across all pages.
 * All rules use !important to override inline styles.
 * Loaded sitewide via functions.php enqueue.
 */

/* ============================================
   GLOBAL — Prevent horizontal overflow
   ============================================ */
html, body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
}

*, *::before, *::after {
  box-sizing: border-box !important;
}

img, video, iframe, embed, object {
  max-width: 100% !important;
  height: auto !important;
}


/* ============================================
   TABLET BREAKPOINT — 900px
   ============================================ */
@media screen and (max-width: 900px) {

  /* --- HEADER: Tablet size reduction --- */
  #smtf-simple-header .smtf-header-row {
    padding: 12px 20px !important;
    min-height: 70px !important;
  }
  #smtf-simple-header .smtf-logo-center img {
    height: 60px !important;
  }
  #smtf-simple-header.scrolled .smtf-header-row {
    padding: 8px 20px !important;
    min-height: 50px !important;
  }
  #smtf-simple-header.scrolled .smtf-logo-center img {
    height: 45px !important;
  }
  .smtf-cta-btn {
    padding: 10px 18px !important;
    font-size: 12px !important;
  }

  /* --- Q&A PAGE: Hero --- */
  .smtf-qa-page h1 {
    font-size: clamp(2.5rem, 8vw, 5rem) !important;
    padding: 0 10px !important;
  }

  /* --- Q&A PAGE: Stats bar — reduce gap --- */
  .smtf-qa-page > div:nth-child(2) {
    gap: 30px !important;
    padding: 40px 20px !important;
  }
  .smtf-qa-page > div:nth-child(2) > div {
    min-width: 120px !important;
  }
  .smtf-qa-page > div:nth-child(2) > div > div:first-child {
    font-size: 3rem !important;
  }

  /* --- Q&A PAGE: Service grids — 2 columns at tablet --- */
  .smtf-qa-page div[style*="grid-template-columns: repeat(3"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
  }

  /* --- Q&A PAGE: Section headings --- */
  .smtf-qa-page h2 {
    font-size: clamp(2rem, 5vw, 3rem) !important;
  }

  /* --- Q&A PAGE: FAQ padding --- */
  .smtf-qa-page details summary {
    padding: 24px 20px !important;
  }
  .smtf-qa-page details summary > span:first-child {
    font-size: 1.15rem !important;
  }
  .smtf-qa-page details > div {
    padding: 0 20px 24px 20px !important;
    font-size: 1.1rem !important;
  }

  /* --- Q&A PAGE: CTA section --- */
  .smtf-qa-page div[style*="padding: 80px 50px"] {
    padding: 50px 24px !important;
  }
  .smtf-qa-page div[style*="padding: 80px 50px"] h2 {
    font-size: 2.5rem !important;
  }

  /* --- VIP PAGE: Pricing table — stack columns --- */
  .smtf-vip-page table {
    display: block !important;
    width: 100% !important;
  }
  .smtf-vip-page table > tbody {
    display: block !important;
  }
  .smtf-vip-page table > tbody > tr {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    width: 100% !important;
  }
  .smtf-vip-page table > tbody > tr > td {
    display: block !important;
    width: 100% !important;
    margin-bottom: 0 !important;
  }
  .smtf-vip-page table[style*="border-spacing"] {
    border-spacing: 0 !important;
    border-collapse: separate !important;
  }

  /* --- VIP PAGE: Pricing card font sizes --- */
  .smtf-vip-page td div[style*="font-size: 56px"] {
    font-size: 44px !important;
  }

  /* --- HOMEPAGE: Footer grid with inline flex gap:60px --- */
  .smtf-footer div[style*="gap: 60px"] {
    gap: 30px !important;
    flex-wrap: wrap !important;
  }
  .smtf-footer div[style*="flex: 1.5"],
  .smtf-footer div[style*="flex: 1.3"],
  .smtf-footer div[style*="flex: 1"] {
    flex: 1 1 45% !important;
    min-width: 200px !important;
  }

  /* --- HOMEPAGE: Trust badges --- */
  .smtf-footer div[style*="gap: 50px"] {
    gap: 20px !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
  }

  /* --- CONTACT PAGE: Cards row — wrap on tablet --- */
  .smtf-cards {
    flex-direction: column !important;
    align-items: center !important;
  }
  .smtf-card {
    width: 100% !important;
    max-width: 400px !important;
  }
}


/* ============================================
   MOBILE BREAKPOINT — 768px
   ============================================ */
@media screen and (max-width: 768px) {

  /* --- GLOBAL: Section padding --- */
  .smtf-qa-page > div,
  .smtf-vip-page > div,
  .smtf-contact-page section,
  .smtf-section {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* --- Q&A PAGE: Hero section --- */
  .smtf-qa-page > div:first-child {
    padding: 60px 16px !important;
  }
  .smtf-qa-page > div:first-child h1 {
    font-size: 2.5rem !important;
    word-break: break-word !important;
  }
  .smtf-qa-page > div:first-child p {
    font-size: 1.1rem !important;
  }

  /* --- Q&A PAGE: Stats bar — 2x2 grid on mobile --- */
  .smtf-qa-page > div:nth-child(2) {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
    padding: 30px 16px !important;
  }
  .smtf-qa-page > div:nth-child(2) > div > div:first-child {
    font-size: 2.5rem !important;
  }
  .smtf-qa-page > div:nth-child(2) > div > div:last-child {
    font-size: 0.85rem !important;
  }

  /* --- Q&A PAGE: Main content padding --- */
  .smtf-qa-page div[style*="padding: 100px 30px"] {
    padding: 40px 16px !important;
  }

  /* --- Q&A PAGE: Section header flex alignment --- */
  .smtf-qa-page div[style*="display: flex"][style*="gap: 20px"][style*="margin-bottom: 50px"] {
    gap: 12px !important;
    margin-bottom: 30px !important;
  }
  .smtf-qa-page div[style*="display: flex"][style*="gap: 20px"][style*="margin-bottom: 50px"] > div:first-child {
    width: 5px !important;
    height: 40px !important;
  }
  .smtf-qa-page div[style*="display: flex"][style*="gap: 20px"][style*="margin-bottom: 50px"] h2 {
    font-size: 1.8rem !important;
  }

  /* --- Q&A PAGE: Service grids — single column on mobile --- */
  .smtf-qa-page div[style*="grid-template-columns: repeat(3"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    margin-bottom: 40px !important;
  }
  .smtf-qa-page div[style*="grid-template-columns: repeat(3"] > div {
    padding: 24px !important;
  }

  /* --- Q&A PAGE: FAQ items — reduce padding --- */
  .smtf-qa-page details summary {
    padding: 18px 16px !important;
  }
  .smtf-qa-page details summary > span:first-child {
    font-size: 1rem !important;
    padding-right: 10px !important;
  }
  .smtf-qa-page details summary > span:last-child {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    font-size: 22px !important;
  }
  .smtf-qa-page details > div {
    padding: 0 16px 20px 16px !important;
    font-size: 1rem !important;
    line-height: 1.7 !important;
  }

  /* --- Q&A PAGE: CTA section --- */
  .smtf-qa-page div[style*="padding: 80px 50px"] {
    padding: 40px 20px !important;
  }
  .smtf-qa-page div[style*="padding: 80px 50px"] h2 {
    font-size: 2rem !important;
  }
  .smtf-qa-page div[style*="padding: 80px 50px"] p {
    font-size: 1.1rem !important;
  }
  .smtf-qa-page div[style*="padding: 80px 50px"] div[style*="display: flex"] {
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
  }
  .smtf-qa-page div[style*="padding: 80px 50px"] a {
    width: 100% !important;
    max-width: 300px !important;
    text-align: center !important;
    justify-content: center !important;
    padding: 18px 30px !important;
    font-size: 1rem !important;
  }

  /* --- VIP PAGE: Hero --- */
  .smtf-vip-page > div:first-child {
    padding: 0 16px 40px !important;
  }
  .smtf-vip-page h1 {
    font-size: clamp(28px, 8vw, 64px) !important;
  }

  /* --- VIP PAGE: Pricing cards spacing --- */
  .smtf-vip-page table > tbody > tr > td {
    padding: 28px 20px !important;
    border-radius: 16px !important;
  }
  .smtf-vip-page td div[style*="font-size: 56px"] {
    font-size: 40px !important;
  }

  /* --- VIP PAGE: Benefits table cells full-width --- */
  .smtf-vip-page table[style*="border-spacing: 20px"] {
    border-spacing: 0 10px !important;
  }
  .smtf-vip-page td[style*="width:50%"] {
    width: 100% !important;
    display: block !important;
  }

  /* --- VIP PAGE: Sections padding --- */
  .smtf-vip-page div[style*="padding:60px 24px"] {
    padding: 40px 16px !important;
  }

  /* --- VIP PAGE: Form container --- */
  .smtf-vip-form {
    padding: 24px 16px !important;
  }
  .smtf-vip-form div[style*="padding:40px"] {
    padding: 24px 16px !important;
  }

  /* --- CONTACT PAGE: Hero padding --- */
  .smtf-contact-hero {
    padding-top: 160px !important;
  }

  /* --- CONTACT PAGE: Grid and form --- */
  .smtf-contact-page .smtf-grid {
    gap: 24px !important;
  }
  .smtf-form-box {
    padding: 24px 16px !important;
  }

  /* --- HOMEPAGE: Hero buttons --- */
  .smtf-hero-buttons {
    flex-direction: column !important;
    gap: 12px !important;
  }
  .smtf-hero-buttons .smtf-btn {
    width: 100% !important;
  }

  /* --- HOMEPAGE: Section containers --- */
  .smtf-section {
    padding: 40px 16px !important;
  }
  .smtf-section-container {
    padding: 0 !important;
  }

  /* --- HOMEPAGE: Stat cards text --- */
  .smtf-stat-number {
    font-size: clamp(24px, 6vw, 36px) !important;
  }
  .smtf-stat-label {
    font-size: 12px !important;
  }

  /* --- HOMEPAGE: Path cards — stack --- */
  .smtf-paths-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* --- HOMEPAGE: Footer — full stack --- */
  .smtf-footer div[style*="gap: 60px"] {
    flex-direction: column !important;
    gap: 30px !important;
  }
  .smtf-footer div[style*="flex: 1.5"],
  .smtf-footer div[style*="flex: 1.3"],
  .smtf-footer div[style*="flex: 1"] {
    flex: none !important;
    width: 100% !important;
  }
  .smtf-footer div[style*="gap: 50px"] {
    flex-direction: column !important;
    gap: 16px !important;
    align-items: center !important;
  }

  /* --- HEADER: Adjust for mobile --- */
  #smtf-simple-header .smtf-header-row {
    padding: 10px 16px !important;
    min-height: 60px !important;
  }
  #smtf-simple-header .smtf-logo-center img {
    height: 50px !important;
  }
  #smtf-simple-header.scrolled .smtf-logo-center img {
    height: 38px !important;
  }
  #smtf-simple-header.scrolled .smtf-header-row {
    min-height: 50px !important;
    padding: 8px 16px !important;
  }
  .smtf-hamburger {
    width: 40px !important;
    height: 40px !important;
    gap: 5px !important;
  }
  .smtf-hamburger span {
    width: 20px !important;
    height: 2px !important;
  }
  .smtf-cta-btn {
    padding: 10px 14px !important;
    font-size: 11px !important;
  }
  .smtf-phone {
    display: none !important;
  }

  /* --- OLD THEME: Trainer category cards --- */
  .tax-trainer_category article {
    width: 100% !important;
    float: none !important;
  }

  /* --- OLD THEME: Header/infobar --- */
  .infobar .container {
    flex-direction: column !important;
    text-align: center !important;
  }
  .site-header__logos {
    float: none !important;
    margin: 0 auto !important;
    text-align: center !important;
  }
  .site-header__cta {
    float: none !important;
    margin: 0 auto !important;
    text-align: center !important;
  }

  /* --- BLOG: Cards and text --- */
  .smtf-blog-card {
    flex-direction: column !important;
  }
  .smtf-blog-card img {
    width: 100% !important;
    max-height: 200px !important;
    object-fit: cover !important;
  }
}


/* ============================================
   SMALL MOBILE BREAKPOINT — 480px
   ============================================ */
@media screen and (max-width: 480px) {

  /* --- Q&A PAGE: Stats bar — still 2x2 but tighter --- */
  .smtf-qa-page > div:nth-child(2) {
    gap: 12px !important;
    padding: 20px 12px !important;
  }
  .smtf-qa-page > div:nth-child(2) > div > div:first-child {
    font-size: 2rem !important;
  }

  /* --- Q&A PAGE: Hero --- */
  .smtf-qa-page > div:first-child h1 {
    font-size: 2rem !important;
  }
  .smtf-qa-page > div:first-child p {
    font-size: 1rem !important;
  }

  /* --- Q&A PAGE: Section headings smaller --- */
  .smtf-qa-page div[style*="display: flex"][style*="gap: 20px"][style*="margin-bottom: 50px"] h2 {
    font-size: 1.5rem !important;
  }

  /* --- Q&A PAGE: Service cards tighter --- */
  .smtf-qa-page div[style*="grid-template-columns: repeat(3"] > div {
    padding: 20px !important;
  }
  .smtf-qa-page h4 {
    font-size: 1.3rem !important;
  }

  /* --- VIP PAGE: Pricing font --- */
  .smtf-vip-page td div[style*="font-size: 56px"] {
    font-size: 36px !important;
  }
  .smtf-vip-page td div[style*="font-size: 56px"] sup {
    font-size: 18px !important;
  }

  /* --- VIP PAGE: Benefits card flex --- */
  .smtf-vip-page td div[style*="display:flex"][style*="gap:20px"] {
    flex-direction: column !important;
    gap: 12px !important;
  }

  /* --- HOMEPAGE: Stats grid — 2x2 --- */
  .smtf-stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  .smtf-stat-card {
    padding: 16px 12px !important;
  }

  /* --- HOMEPAGE: Benefits grid --- */
  .smtf-benefits-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* --- HOMEPAGE: Services grid --- */
  .smtf-services-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* --- HEADER: Extra small --- */
  #smtf-simple-header .smtf-logo-center img {
    height: 42px !important;
  }
  #smtf-simple-header.scrolled .smtf-logo-center img {
    height: 32px !important;
  }
  .smtf-cta-btn {
    padding: 8px 12px !important;
    font-size: 10px !important;
  }

  /* --- CONTACT PAGE: Hero text --- */
  .smtf-contact-hero h1 {
    font-size: clamp(24px, 7vw, 48px) !important;
  }
  .smtf-contact-hero p {
    font-size: 14px !important;
  }

  /* --- GLOBAL: Button sizing --- */
  .smtf-btn {
    padding: 12px 20px !important;
    font-size: 14px !important;
  }

  /* --- GLOBAL: Ensure all inline flex gaps are safe --- */
  div[style*="gap: 80px"] { gap: 16px !important; }
  div[style*="gap: 60px"] { gap: 20px !important; }
  div[style*="gap: 50px"] { gap: 16px !important; }
  div[style*="gap: 48px"] { gap: 16px !important; }

  /* --- GLOBAL: Large inline paddings --- */
  div[style*="padding: 100px"] { padding: 30px 16px !important; }
  div[style*="padding: 80px"] { padding: 30px 16px !important; }
  div[style*="padding:80px"] { padding: 30px 16px !important; }

  /* --- Q&A PAGE: CTA buttons --- */
  .smtf-qa-page div[style*="padding: 80px 50px"] a {
    padding: 16px 24px !important;
    font-size: 0.9rem !important;
  }
}


/* ============================================
   TINY SCREENS — 360px and below
   ============================================ */
@media screen and (max-width: 360px) {

  .smtf-qa-page > div:first-child h1 {
    font-size: 1.7rem !important;
  }

  .smtf-qa-page details summary > span:first-child {
    font-size: 0.9rem !important;
  }

  .smtf-qa-page details > div {
    font-size: 0.9rem !important;
  }

  #smtf-simple-header .smtf-logo-center img {
    height: 45px !important;
  }

  .smtf-cta-btn {
    padding: 6px 10px !important;
    font-size: 9px !important;
    letter-spacing: 0 !important;
  }

  .smtf-hamburger {
    width: 36px !important;
    height: 36px !important;
  }
}


/* ============================================
   FLOATING CTA — Already responsive but ensure
   ============================================ */
.smtf-floating-cta,
.smtf-floating-btn {
  max-width: calc(100vw - 32px) !important;
}


/* ============================================
   FIX: Old theme deprecated max-device-width
   Override with standard max-width
   ============================================ */
@media screen and (max-width: 480px) {
  .profile-info {
    float: left !important;
    width: 70% !important;
    padding: 10px 15px !important;
  }
}


/* ============================================
   FIX: Trainer profile page form
   ============================================ */
@media screen and (max-width: 600px) {
  #trainerPage-form .form-row {
    flex-direction: column !important;
  }
  #trainerPage-form .form-row div {
    margin-right: 0 !important;
    margin-bottom: 10px !important;
  }
  .trainerForm-container {
    width: 95% !important;
  }
}


/* ============================================
   FIX: Wellness Studios page (if using same
   inline grid patterns as Q&A)
   ============================================ */
@media screen and (max-width: 768px) {
  .page-template-page-wellness-studios div[style*="grid-template-columns: repeat(3"],
  .page-template-page-wellness-studios div[style*="grid-template-columns: repeat(2"] {
    grid-template-columns: 1fr !important;
  }
}


/* ============================================
   FIX: Find Trainers page (page-id-556)
   Sidebar + content forced to 25%/75% by
   glassmorphic CSS at all sizes. Must override.
   ============================================ */
@media screen and (max-width: 991px) {
  /* Stack columns vertically */
  body.page-id-556 .page-content > .container > .row > [class*="col-"] {
    float: none !important;
    width: 100% !important;
    clear: both !important;
  }

  body.page-id-556 .page-content > .container > .row > .col-lg-3 {
    width: 100% !important;
    padding-top: 120px !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
  }

  body.page-id-556 .page-content > .container > .row > .col-lg-9,
  body.page-id-556 .page-content > .container > .row > .col-lg-8 {
    width: 100% !important;
  }

  body.page-id-556 .page-content > .container > .row {
    display: flex !important;
    flex-direction: column !important;
  }

  /* Put the trainers content FIRST, sidebar SECOND */
  body.page-id-556 .page-content > .container > .row > .col-lg-9,
  body.page-id-556 .page-content > .container > .row > .col-lg-8 {
    order: 1 !important;
  }
  body.page-id-556 .page-content > .container > .row > .col-lg-3 {
    order: 2 !important;
    padding-top: 20px !important;
  }

  /* Trainer section — reduce top padding since no overlap now */
  body.page-id-556 .smtf-trainers-section {
    padding-top: 140px !important;
  }

  /* Sidebar widget styling for mobile */
  body.page-id-556 .widget-area {
    padding: 0 !important;
  }

  body.page-id-556 .widget {
    margin-bottom: 12px !important;
  }

  /* Tag cloud / category list — horizontal scroll or wrap */
  body.page-id-556 .tagcloud,
  body.page-id-556 .widget_tag_cloud {
    max-height: none !important;
  }

  body.page-id-556 .tagcloud li,
  body.page-id-556 .widget ul li {
    display: inline-block !important;
    width: auto !important;
    margin: 3px !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
  }

  body.page-id-556 .tagcloud ul,
  body.page-id-556 .widget ul {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    justify-content: center !important;
  }

  body.page-id-556 .widget ul li {
    flex: 0 0 auto !important;
  }
}

@media screen and (max-width: 768px) {

  /* Trainer grid — force single column */
  .smtf-trainers-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    padding: 0 !important;
  }

  /* Trainer section padding */
  body.page-id-556 .smtf-trainers-section {
    padding-top: 100px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  body.page-id-556 .smtf-trainers-container {
    padding: 0 8px !important;
  }

  /* Trainer card info */
  .smtf-trainer-info {
    padding: 16px !important;
  }

  .smtf-trainer-info h3 {
    font-size: 16px !important;
    margin-bottom: 8px !important;
  }

  /* Trainer notice box */
  .smtf-trainers-container > div[style*="text-align:center"][style*="max-width:700px"] {
    max-width: 100% !important;
    margin: 0 0 20px !important;
    padding: 16px !important;
  }

  /* Load more button */
  #load-more-class {
    width: 100% !important;
    max-width: 300px !important;
    margin: 20px auto !important;
    display: block !important;
  }

  /* Sidebar category heading */
  body.page-id-556 .widget-title {
    font-size: 14px !important;
    text-align: center !important;
  }

  /* Category tags — smaller on mobile */
  body.page-id-556 .tagcloud li,
  body.page-id-556 .widget ul li {
    padding: 5px 10px !important;
    font-size: 11px !important;
  }
}

@media screen and (max-width: 480px) {
  .smtf-trainers-grid {
    gap: 12px !important;
  }

  .smtf-trainer-card {
    border-radius: 14px !important;
  }

  .smtf-trainer-info {
    padding: 14px !important;
  }

  .smtf-trainer-info h3 {
    font-size: 15px !important;
  }

  body.page-id-556 .smtf-trainers-section {
    padding-top: 80px !important;
  }
}


/* ============================================
   FIX: Trainer Profile Pages (single-iw_teacher)
   Gallery card and form card overflow viewport
   ============================================ */
@media screen and (max-width: 900px) {
  .smtf-trainer-page {
    overflow-x: hidden !important;
  }

  .smtf-trainer-hero {
    padding: 140px 16px 30px !important;
  }

  .smtf-container {
    max-width: 100% !important;
    overflow: hidden !important;
  }

  .smtf-trainer-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  .smtf-gallery-card {
    max-width: 100% !important;
    width: 100% !important;
  }

  .smtf-gallery-main {
    max-width: 100% !important;
  }

  .smtf-form-card {
    max-width: 100% !important;
    overflow: hidden !important;
  }

  .smtf-trainer-name {
    font-size: clamp(20px, 5vw, 32px) !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }

  .smtf-share-bar {
    flex-wrap: wrap !important;
    gap: 12px !important;
    padding: 16px !important;
    max-width: 100% !important;
  }

  .smtf-share-icons {
    flex-wrap: wrap !important;
  }

  .smtf-cta-banner h3 {
    font-size: 18px !important;
    word-break: break-word !important;
  }
}

@media screen and (max-width: 480px) {
  .smtf-trainer-hero {
    padding: 100px 12px 20px !important;
  }

  .smtf-gallery-main {
    aspect-ratio: 3/4 !important;
  }

  .smtf-trainer-name {
    font-size: 18px !important;
  }

  .smtf-form-card {
    padding: 16px !important;
  }

  .smtf-form-card .smtf-cta-banner {
    padding: 14px !important;
  }

  .smtf-trainer-badge {
    font-size: 12px !important;
  }

  /* Trainer bio sections */
  .smtf-trainer-bio {
    padding: 16px !important;
  }

  .smtf-trainer-bio h2,
  .smtf-trainer-bio h3 {
    font-size: 18px !important;
    word-break: break-word !important;
  }
}


/* ============================================
   FIX: Trainer Category Taxonomy Pages
   Same sidebar issue as page-556 but uses
   body class tax-trainer_category
   ============================================ */
@media screen and (max-width: 991px) {
  body.tax-trainer_category .col-lg-3,
  body.tax-trainer_category .col-md-4 {
    float: none !important;
    width: 100% !important;
    clear: both !important;
    padding-top: 20px !important;
  }

  body.tax-trainer_category .col-lg-9,
  body.tax-trainer_category .col-lg-8,
  body.tax-trainer_category .col-md-8 {
    float: none !important;
    width: 100% !important;
    clear: both !important;
  }

  body.tax-trainer_category .container > .row {
    display: flex !important;
    flex-direction: column !important;
  }

  /* Content first, sidebar second */
  body.tax-trainer_category .col-lg-9,
  body.tax-trainer_category .col-lg-8,
  body.tax-trainer_category .col-md-8 {
    order: 1 !important;
  }

  body.tax-trainer_category .col-lg-3,
  body.tax-trainer_category .col-md-4 {
    order: 2 !important;
  }

  /* Trainer cards — single column */
  .tax-trainer_category article {
    width: 100% !important;
    float: none !important;
  }

  .tax-trainer_category article .blog-item {
    height: auto !important;
  }
}


/* ============================================
   FIX: Find Trainers page grid
   ============================================ */
@media screen and (max-width: 768px) {
  #our-trainers.our-trainers {
    height: auto !important;
    position: relative !important;
  }
  .our-trainers > .row > .element-item {
    position: relative !important;
    width: 100% !important;
    float: none !important;
  }
}


/* ============================================
   PRINT: Keep things readable
   ============================================ */
@media print {
  .smtf-floating-cta,
  .smtf-floating-btn,
  #smtf-simple-header,
  .smtf-hamburger {
    display: none !important;
  }
}
