/* Final mobile flow rules, including restored course action buttons. */
@media (max-width: 700px) {
  .course,
  .direction-course,
  .direction-course-body,
  .result-content,
  .collection,
  .about-card {
    min-width: 0 !important;
    box-sizing: border-box;
  }
  .course h3,
  .course p,
  .direction-course h3,
  .direction-course p,
  .result-card h4,
  .result-card p,
  .modal-body h3,
  #modalText,
  .onsite-program {
    overflow-wrap: anywhere;
    word-break: normal;
  }
  .course-bottom,
  .modal-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    height: auto !important;
    align-items: stretch !important;
  }
  .course-bottom > * {
    position: static !important;
    max-width: 100% !important;
    box-sizing: border-box;
    white-space: normal !important;
    line-height: 1.4 !important;
  }
  .course-bottom .course-more,
  .course-bottom .course-enroll,
  .modal-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    white-space: normal !important;
    text-align: center;
    box-sizing: border-box;
    max-width: 100%;
    line-height: 1.4 !important;
  }
  .course-modal {
    padding: 10px !important;
    box-sizing: border-box;
  }
  .course-modal-card {
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(100vh - 20px) !important;
    max-height: calc(100dvh - 20px) !important;
    overflow: auto !important;
    overscroll-behavior: contain;
    box-sizing: border-box;
  }
  .modal-body {
    padding: 24px 18px !important;
    min-width: 0;
  }
  .course-modal .modal-image {
    height: 210px !important;
    height: min(210px, 32svh) !important;
    max-width: 100% !important;
    object-fit: cover !important;
  }
  .modal-actions > * {
    flex: 1 1 130px !important;
    min-width: 0 !important;
  }
  .direction-course-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .about-lead {
    height: auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .about-lead-stat {
    position: relative !important;
    left: auto !important;
    bottom: auto !important;
    margin-top: 24px !important;
    padding-top: 0 !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
  }
  .about-lead p,
  .about-lead strong {
    height: auto !important;
    max-width: 100% !important;
    overflow-wrap: anywhere;
  }
  .collections-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .collection {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    height: auto !important;
    min-height: 0 !important;
  }
  .collection h3,
  .collection p {
    height: auto !important;
    width: auto !important;
    max-width: 100% !important;
    overflow-wrap: anywhere;
  }
  .collection .btn {
    position: static !important;
    max-width: 100% !important;
    white-space: normal !important;
    line-height: 1.4 !important;
    min-height: 44px !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
  }
  .collection .collection-icon {
    position: static !important;
    align-self: flex-end !important;
    margin: 18px 0 0 !important;
    max-width: 100% !important;
    flex-shrink: 0 !important;
  }
  .contacts a,
  footer a {
    overflow-wrap: anywhere;
  }
  .search-filters,
  .tool-row {
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
  }
  .search-filters input,
  .search-filters select,
  .tool-row input,
  .tool-row select {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
}
@media (max-width: 380px) {
  .course-bottom > * {
    flex: 1 1 100% !important;
    width: 100% !important;
  }
  .modal-actions > * {
    flex-basis: 100% !important;
  }
  .modal-body h3 {
    font-size: 24px !important;
    line-height: 1.25 !important;
  }
}
