/* Colours come from the site's Elementor kit, with its current values as fallbacks. */
.qst-mmc {
    --qst-mmc-primary: var(--e-global-color-primary, #5377A4);
    --qst-mmc-dark: var(--e-global-color-secondary, #3F3F3F);
    --qst-mmc-accent: var(--e-global-color-accent, #FBBB1F);
    --qst-mmc-border: #EBEBF0;
    width: 100%;
    color: var(--qst-mmc-dark);
    text-align: left;
}

.qst-mmc-anchor {
    display: block;
    scroll-margin-top: 120px;
}

.qst-mmc-course {
    margin: 16px 0 24px;
}

.qst-mmc-table {
    width: 100%;
    margin: 0 0 16px;
    border-collapse: collapse;
    background: #fff;
    font-size: 15px;
}

.qst-mmc-table th,
.qst-mmc-table td {
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid var(--qst-mmc-border);
    background: #fff;
    vertical-align: middle;
    text-align: left;
}

.qst-mmc-table th {
    background: var(--qst-mmc-primary);
    color: #fff;
    font-weight: 600;
}

.qst-mmc-table small {
    display: block;
    margin-top: 2px;
    color: #6b6b6b;
    font-size: 13px;
}

.qst-mmc-table s,
.qst-mmc-price s {
    color: #6b6b6b;
    font-size: 0.9em;
}

.qst-mmc-price-cell {
    white-space: nowrap;
}

.qst-mmc-action {
    text-align: right;
    white-space: nowrap;
}

.qst-mmc-button,
.qst-mmc a.qst-mmc-button,
.qst-mmc button.qst-mmc-button {
    display: inline-block;
    padding: 10px 18px;
    border: 2px solid var(--qst-mmc-primary);
    border-radius: 4px;
    background: var(--qst-mmc-primary);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}

.qst-mmc a.qst-mmc-button:hover,
.qst-mmc a.qst-mmc-button:focus,
.qst-mmc button.qst-mmc-button:hover,
.qst-mmc button.qst-mmc-button:focus {
    border-color: var(--qst-mmc-dark);
    background: var(--qst-mmc-dark);
    color: #fff;
}

.qst-mmc a.qst-mmc-button-alt {
    background: #fff;
    color: var(--qst-mmc-primary);
}

.qst-mmc-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
}

.qst-mmc-badge-urgent {
    background: var(--qst-mmc-accent);
    color: #000;
}

.qst-mmc-badge-full {
    background: var(--qst-mmc-border);
    color: var(--qst-mmc-dark);
}

.qst-mmc-card,
.qst-mmc-empty {
    margin: 0 0 16px;
    padding: 18px;
    border: 1px solid var(--qst-mmc-border);
    background: #fff;
}

.qst-mmc-card-title {
    margin: 0 0 8px;
}

.qst-mmc-price {
    margin: 0 0 8px;
    font-size: 18px;
}

.qst-mmc-units {
    margin: 0 0 14px;
}

.qst-mmc-units summary {
    cursor: pointer;
    font-weight: 600;
}

.qst-mmc-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin: 0 0 16px;
}

.qst-mmc-filters label {
    display: flex;
    flex: 1 1 180px;
    flex-direction: column;
    gap: 4px;
    font-weight: 600;
}

.qst-mmc-filters select {
    width: 100%;
    min-height: 42px;
    padding: 8px;
    border: 1px solid #c9c9d2;
    background: #fff;
}

.qst-mmc-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.qst-mmc-pagination a {
    padding: 6px 12px;
    border: 1px solid var(--qst-mmc-border);
    text-decoration: none;
}

.qst-mmc-pagination a[aria-current="page"] {
    background: var(--qst-mmc-primary);
    color: #fff;
}

.qst-mmc-course-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.qst-mmc-course-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--qst-mmc-border);
}

@media (max-width: 700px) {
    .qst-mmc-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .qst-mmc-table,
    .qst-mmc-table tbody,
    .qst-mmc-table tr,
    .qst-mmc-table td {
        display: block;
        width: 100%;
    }

    .qst-mmc-table tr {
        margin: 0 0 14px;
        border: 1px solid var(--qst-mmc-border);
    }

    .qst-mmc-table td {
        display: flex;
        justify-content: space-between;
        gap: 14px;
        padding: 10px 12px;
        text-align: right;
    }

    .qst-mmc-table .qst-mmc-cell {
        min-width: 0;
    }

    .qst-mmc-table td[data-label]::before {
        flex: 0 0 auto;
        content: attr(data-label);
        font-weight: 600;
        text-align: left;
    }

    .qst-mmc-table td.qst-mmc-action {
        display: block;
        border-bottom: 0;
    }

    .qst-mmc-action .qst-mmc-button {
        display: block;
        text-align: center;
    }
}

/* Basket and checkout */
.qst-mmc-basket-icon {
    position: relative;
    display: inline-flex;
    color: var(--e-global-color-primary, #5377A4);
}

.qst-mmc-basket-count {
    position: absolute;
    top: -8px;
    right: -10px;
    min-width: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--e-global-color-accent, #FBBB1F);
    color: #000;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.qst-mmc-checkout {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

.qst-mmc-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
    color: #6b6b6b;
    font-size: 14px;
}

.qst-mmc-steps span {
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-right: 4px;
    border-radius: 50%;
    background: var(--qst-mmc-border);
    line-height: 24px;
    text-align: center;
}

.qst-mmc-steps .is-current {
    color: var(--qst-mmc-dark);
    font-weight: 700;
}

.qst-mmc-steps .is-current span,
.qst-mmc-steps .is-done span {
    background: var(--qst-mmc-primary);
    color: #fff;
}

.qst-mmc-notice {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-left: 4px solid var(--qst-mmc-accent);
    background: #fff8e5;
}

.qst-mmc-notice-error {
    border-left-color: #b32d2e;
    background: #fcf0f1;
}

.qst-mmc-notice ul {
    margin: 0;
    padding-left: 18px;
}

.qst-mmc-qty {
    width: 76px;
    padding: 6px;
}

.qst-mmc button.qst-mmc-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--qst-mmc-primary);
    text-decoration: underline;
    cursor: pointer;
}

.qst-mmc-totals {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 24px;
    max-width: 320px;
    margin: 20px 0 20px auto;
}

.qst-mmc-totals dt,
.qst-mmc-totals dd {
    margin: 0;
}

.qst-mmc-totals .qst-mmc-total {
    padding-top: 6px;
    border-top: 1px solid var(--qst-mmc-border);
    font-size: 18px;
    font-weight: 700;
}

.qst-mmc a.qst-mmc-next,
.qst-mmc button.qst-mmc-next {
    display: block;
    width: fit-content;
    margin-left: auto;
}

.qst-mmc-back {
    display: block;
    margin-top: 12px;
    text-align: right;
}

.qst-mmc-fieldset {
    margin: 0 0 16px;
    padding: 16px;
    border: 1px solid var(--qst-mmc-border);
    background: #fff;
}

.qst-mmc-fieldset legend {
    padding: 0 6px;
    font-weight: 700;
}

.qst-mmc-fieldset legend small {
    display: block;
    color: #6b6b6b;
    font-weight: 400;
}

.qst-mmc-grid-3,
.qst-mmc-grid-2 {
    display: grid;
    gap: 12px;
    margin-bottom: 12px;
}

.qst-mmc-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.qst-mmc-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.qst-mmc-grid-3 label,
.qst-mmc-grid-2 label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-weight: 600;
}

.qst-mmc-grid-3 input,
.qst-mmc-grid-2 input {
    width: 100%;
    min-height: 42px;
    padding: 8px;
    border: 1px solid #c9c9d2;
}

.qst-mmc-terms {
    display: flex;
    gap: 8px;
    margin: 0 0 16px;
}

@media (max-width: 700px) {
    .qst-mmc-grid-3,
    .qst-mmc-grid-2 {
        grid-template-columns: minmax(0, 1fr);
    }

    .qst-mmc a.qst-mmc-next,
    .qst-mmc button.qst-mmc-next {
        width: 100%;
        text-align: center;
    }
}

/* Date rows, grouped by month */
/* Month label: a blue band with white text above that month's dates. */
.qst-mmc-month {
    margin: 22px 0 8px;
    padding: 8px 16px;
    border-radius: 6px;
    background: var(--qst-mmc-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* Elementor's kit colours every h3 with the primary blue; keep the month white. */
.qst-mmc h3.qst-mmc-month,
.qst-mmc-dates h3.qst-mmc-month {
    color: #fff;
}

.qst-mmc-row {
    display: grid;
    grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    margin: 0 0 8px;
    padding: 14px 16px;
    border: 1px solid var(--qst-mmc-border);
    border-radius: 6px;
    background: #fff;
    color: var(--qst-mmc-dark);
    font-size: 15px;
    line-height: 1.4;
}

/* Location (or Online) as a pill in the site's accent colour, black text. */
.qst-mmc-location-pill {
    display: inline-block;
    max-width: 100%;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--qst-mmc-accent);
    color: #000;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    white-space: normal;
}

.qst-mmc-row[hidden],
.qst-mmc-month[hidden] {
    display: none;
}

.qst-mmc-row-course {
    display: block;
}

.qst-mmc-row-dates {
    display: block;
    font-weight: 600;
}

.qst-mmc-row small {
    display: block;
    color: #5f5f5f;
    font-size: 13px;
}

.qst-mmc-days summary {
    color: var(--qst-mmc-primary);
    font-size: 13px;
    cursor: pointer;
}

.qst-mmc-days ol {
    margin: 6px 0 0;
    padding-left: 18px;
    font-size: 13px;
}

.qst-mmc-row-price s {
    display: block;
    color: #5f5f5f;
    font-size: 13px;
}

.qst-mmc-row .qst-mmc-action {
    text-align: right;
}

.qst-mmc-row .qst-mmc-badge {
    margin-top: 2px;
}

/* Paging under the dates: small and quiet, 10 dates a page. */
.qst-mmc-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 18px 0 0;
}

.qst-mmc-pager[hidden] {
    display: none;
}

.qst-mmc .qst-mmc-pager-item {
    min-width: 32px;
    height: 32px;
    margin: 0;
    padding: 0 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #6b7380;
    font-size: 14px;
    font-weight: 500;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
    box-shadow: none;
    transition: background .15s, color .15s;
}

.qst-mmc .qst-mmc-pager-item:hover:not(:disabled):not(.is-current),
.qst-mmc .qst-mmc-pager-item:focus-visible {
    background: var(--qst-mmc-border);
    color: var(--qst-mmc-dark);
}

.qst-mmc .qst-mmc-pager-item.is-current {
    background: transparent;
    color: var(--qst-mmc-primary);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 4px;
    cursor: default;
}

.qst-mmc .qst-mmc-pager-item:disabled {
    opacity: .35;
    cursor: default;
}

/* The all-dates page uses real links for its pages; same look as the buttons. */
.qst-mmc a.qst-mmc-pager-item,
.qst-mmc span.qst-mmc-pager-item {
    display: inline-block;
    box-sizing: border-box;
    text-decoration: none;
}

.qst-mmc a.qst-mmc-pager-item:hover {
    background: var(--qst-mmc-border);
    color: var(--qst-mmc-dark);
}

.qst-mmc span.qst-mmc-pager-item.is-current {
    text-decoration: underline;
}

.qst-mmc .qst-mmc-pager-item.is-disabled {
    opacity: .35;
    cursor: default;
}

.qst-mmc-pager-gap {
    min-width: 20px;
    color: #9aa1ab;
    font-size: 14px;
    text-align: center;
}

.qst-mmc-date-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 12px;
    padding: 14px 16px;
    border-radius: 6px;
    background: #fff;
    color: var(--qst-mmc-dark);
}

.qst-mmc-date-filters[hidden] {
    display: none;
}

.qst-mmc-date-filters label {
    display: flex;
    flex: 1 1 160px;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
}

.qst-mmc-date-filters select {
    width: 100%;
    min-height: 40px;
    padding: 6px;
    border: 1px solid #c9c9d2;
    background: #fff;
}

.qst-mmc-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin: 0 0 14px;
    font-size: 16px;
}

.qst-mmc-showing {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 14px 0 0;
}

/* Key facts panel */
.qst-mmc-facts {
    margin: 0 0 12px;
    padding: 18px;
    border: 1px solid var(--qst-mmc-border);
    border-radius: 8px;
    background: #fff;
}

.qst-mmc-facts dl {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px 14px;
    margin: 0 0 14px;
    font-size: 14px;
}

.qst-mmc-facts dt {
    margin: 0;
    color: #5f5f5f;
    font-weight: 400;
}

.qst-mmc-facts dd {
    margin: 0;
    font-weight: 600;
    text-align: right;
}

.qst-mmc-facts .qst-mmc-button {
    display: block;
    text-align: center;
}

/* Find-a-course card */
.qst-mmc-search {
    padding: 20px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .2);
}

.qst-mmc-tabs {
    display: flex;
    gap: 4px;
    margin: 0 0 14px;
    padding: 4px;
    border-radius: 6px;
    background: #eef1f6;
}

.qst-mmc-tabs[hidden] {
    display: none;
}

.qst-mmc .qst-mmc-tabs button {
    flex: 1;
    padding: 8px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--qst-mmc-dark);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.qst-mmc .qst-mmc-tabs button[aria-selected="true"] {
    background: #fff;
}

.qst-mmc-search-form {
    display: grid;
    gap: 12px;
}

.qst-mmc-search-form[hidden],
.qst-mmc-search-list[hidden] {
    display: none;
}

.qst-mmc-search-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
}

.qst-mmc-search-form select {
    width: 100%;
    min-height: 42px;
    padding: 8px;
    border: 1px solid #c9c9d2;
    background: #fff;
}

.qst-mmc-search-form .qst-mmc-button {
    width: 100%;
}

.qst-mmc-search-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.qst-mmc-search-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--qst-mmc-border);
}

.qst-mmc-card-count {
    display: inline-block;
    margin: 4px 0 8px;
    padding: 2px 10px;
    border-radius: 999px;
    background: #eef1f6;
    color: #33415c;
    font-size: 13px;
    font-weight: 600;
}

/* Fixed bar on phones */
.qst-mmc-sticky {
    display: none;
}

@media (max-width: 767px) {
    .qst-mmc-sticky {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 9990;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 16px;
        border-top: 1px solid #dfe3ea;
        background: #fff;
        color: #3f3f3f;
        font-size: 15px;
    }

    .qst-mmc-sticky-button {
        padding: 9px 16px;
        border-radius: 4px;
        background: var(--e-global-color-primary, #5377A4);
        color: #fff !important;
        font-weight: 600;
        text-decoration: none;
    }

    body:has(.qst-mmc-sticky) {
        padding-bottom: 62px;
    }

    .qst-mmc-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px 12px;
    }

    .qst-mmc-row-main,
    .qst-mmc-row-location {
        grid-column: 1 / -1;
    }

    .qst-mmc-row .qst-mmc-action {
        grid-column: 1 / -1;
    }

    .qst-mmc-row .qst-mmc-action .qst-mmc-button {
        display: block;
        width: 100%;
        text-align: center;
    }

    .qst-mmc-row-price {
        text-align: right;
    }
}

/* Anything hidden stays hidden, whatever display a button class sets. */
.qst-mmc [hidden] {
    display: none !important;
}

.qst-mmc .qst-mmc-facts a.qst-mmc-button,
.qst-mmc.qst-mmc-facts a.qst-mmc-button {
    display: block;
    text-align: center;
}

@media (min-width: 768px) {
    .qst-mmc-row {
        grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) 130px;
    }
}

/* Lists and fields respond at once: no fades inherited from the theme. */
.qst-mmc select,
.qst-mmc input {
    transition: none !important;
    animation: none !important;
}

/* Search card: Course, Delivery, Location beside Month, then the button. */
.qst-mmc-search-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.qst-mmc-search-form > label:first-child,
.qst-mmc-search-form > .qst-mmc-segments,
.qst-mmc .qst-mmc-search-form > button.qst-mmc-button {
    grid-column: 1 / -1;
}

.qst-mmc .qst-mmc-search-form > button.qst-mmc-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.qst-mmc-segments {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.qst-mmc-segments legend {
    margin: 0 0 3px;
    padding: 0;
    font-size: 13px;
    font-weight: 600;
}

.qst-mmc-segments > div {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
    padding: 3px;
    border-radius: 6px;
    background: #eef1f6;
}

.qst-mmc-search-form .qst-mmc-segments label {
    position: relative;
    display: block;
    margin: 0;
    cursor: pointer;
}

.qst-mmc-segments input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
}

.qst-mmc-segments span {
    display: block;
    padding: 6px 2px;
    border-radius: 4px;
    color: #3f3f3f;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
}

.qst-mmc-segments input:checked + span {
    background: var(--qst-mmc-primary);
    color: #fff;
}

.qst-mmc-segments input:focus-visible + span {
    outline: 2px solid var(--qst-mmc-primary);
    outline-offset: 1px;
}

.qst-mmc-segments input:disabled + span {
    color: #8a8a8a;
    cursor: not-allowed;
}


/* Location and Month side by side, each label above its list (theme.css forces one column). */
.qst-mmc.qst-mmc-search .qst-mmc-search-form {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 20px 16px !important;
}

.qst-mmc .qst-mmc-search-form > label.qst-mmc-inline {
    grid-column: auto !important;
    min-width: 0;
}

/* Powered by Manage My Courses, under the search button. */
.qst-mmc .qst-mmc-search-form > .qst-mmc-powered {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    color: #6b6b75;
    font-size: 12px;
}

.qst-mmc .qst-mmc-powered a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: inherit;
    font-weight: 600;
    text-decoration: none;
}

.qst-mmc .qst-mmc-powered a:hover {
    text-decoration: underline;
}

.qst-mmc .qst-mmc-powered img {
    display: block;
    width: 18px;
    height: 18px;
}
