/* Site styles live in Bootstrap's "custom" cascade layer: they override
   Bootstrap's components, while Bootstrap utilities (.d-none, .mb-3, ...)
   still win, like they did with Bootstrap 4's !important utilities. */
@layer custom {
    body {
        background-color: #FCFCFC;
    }

    .footer-bg {
        background-color: #f5f5f5;
    }

    .footer-links a {
        display: inline-block;
        padding: .25rem .75rem;
    }

    .footer-social a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.5rem;
        height: 2.5rem;
    }

    /* Keep phone headings from wrapping awkwardly */
    @media (max-width: 767.98px) {
        #content h1:not(.display-2) {
            font-size: 1.75rem;
        }

        #content h2 {
            font-size: 1.4rem;
        }
    }
    /* CSS targeting screen smaller than lg (992px) */
    @media (max-width: 991.98px) {
        #cart {
          margin-right: .5rem; /* added mr-2 equivalent */
        }
      }

    /* The header navbar sizes to its content, so it can't be a size container
       (which Bootstrap 6 uses for .navbar-expand). Expand it at lg with a
       viewport media query instead. */
    .main-navbar {
        container-type: normal;
    }

    .main-navbar .navbar-nav {
        --nav-gap: 0;
        --nav-link-border-width: 0;
        --nav-link-padding-y: .5rem;
        --nav-link-padding-x: 0;
    }

    .main-navbar .navbar-toggler {
        --btn-min-height: 0;
        --btn-padding-y: .25rem;
        --btn-padding-x: .75rem;
        --btn-font-size: 1.25rem;
        --btn-line-height: 1;
        --btn-color: var(--navbar-color);
        --btn-hover-color: var(--navbar-color);
        --btn-hover-bg: transparent;
        --btn-border-color: var(--navbar-toggler-border-color);
        --btn-hover-border-color: var(--navbar-toggler-border-color);
        display: inline-block;
        vertical-align: baseline;
    }

    .main-navbar .navbar-toggler-icon {
        vertical-align: middle;
    }

    @media (max-width: 991.98px) {
        .main-navbar {
            display: block !important;
        }
    }

    @media (min-width: 992px) {
        .main-navbar .navbar-nav {
            flex-direction: row;
            --nav-link-padding-x: .5rem;
        }
    }

    /* Bootstrap 6 spaces button contents with a flex gap; match the text space
       Bootstrap 4 had between the cart icon, label and caret */
    #cart {
        --btn-gap: .25rem;
    }

    /* Bootstrap 6 dropped the automatic dropdown caret */
    .menu-caret::after {
        display: inline-block;
        margin-left: .255em;
        vertical-align: .255em;
        content: "";
        border-top: .3em solid;
        border-right: .3em solid transparent;
        border-bottom: 0;
        border-left: .3em solid transparent;
    }

    #home-search-bar {
        /* At least 16px so iPhones don't zoom in when the field is tapped */
        font-size: max(1rem, calc(0.3rem + 2vmin));
    }

    .border-2 {
        border-width: 2px !important;
    }

    .course-count[data-count]:after {
        position: absolute;
        right: 0%;
        top: -20%;
        content: attr(data-count);
        font-size: 90%;
        padding: .3em;
        border-radius: 20%;
        line-height: 1em;
        color: #fcfcfc;
        background: rgba(27, 26, 26, 0.85);
        text-align: center;
        min-width: 1em;
    }

    /* No badge on an empty cart */
    .course-count[data-count="0"]:after {
        display: none;
    }

    .navbar-brand {
        display: inline-block;
        font-family: merienda one, cursive;
    }

    header.masthead {
        padding-top: 10%;
    }

    input.homepage-search {
        height: calc(1.5em + 2rem + 2px);
    }

    /* Size the cart to its table; Floating UI positions it near the right
       edge, which would otherwise shrink it to a narrow column */
    .menu.selected-courses {
        width: max-content;
        max-width: calc(100vw - 1rem);
    }

    div.menu.selected-courses.show {
        height: auto;
        max-height: 400px;
        overflow-x: hidden;
    }

    .menu.selected-courses {
        --menu-padding-x: .5rem;
        min-width: 18rem;
    }

    .selected-courses .table {
        --table-cell-padding-y: .5rem;
        --table-cell-padding-x: .5rem;
        --table-cell-vertical-align: middle;
        margin-bottom: .5rem;
    }

    .selected-courses thead th {
        padding-top: .25rem;
        font-size: .75rem;
        font-weight: 600;
        color: #6c757d;
        text-transform: uppercase;
        letter-spacing: .04em;
        border-top: 0;
        border-bottom-width: 1px;
    }

    .selected-courses tbody tr:last-child td {
        border-bottom: 0;
    }

    .selected-courses [id^="cart-crn-"] {
        color: #6c757d;
        font-variant-numeric: tabular-nums;
    }

    .selected-courses [id^="cart-code-"] {
        font-weight: 600;
        white-space: nowrap;
    }

    .selected-courses [id^="cart-title-"] {
        max-width: 16rem;
    }

    /* Empty cart: a friendly note instead of the column headings and button */
    .selected-courses:has(.empty-cart:not(.d-none)) :is(thead, #review-order) {
        display: none;
    }

    .selected-courses .empty-cart td {
        padding: 1.25rem 1rem;
        color: #6c757d;
        border-width: 0;
    }

    .selected-courses .empty-cart .fa-shopping-cart {
        display: block;
        margin-bottom: .75rem;
        color: #ced4da;
    }

    .selected-courses .empty-cart strong {
        display: block;
        margin-bottom: .25rem;
        color: #212529;
    }

    .selected-courses #review-order {
        gap: .5rem;
    }

    td[colspan]:not([colspan="1"]) {
        text-align: center;
    }

    /* Roomier result rows on wider screens, as Tablesaw had them */
    @media (min-width: 40em) {
        .search-results-table tbody td {
            line-height: 2;
        }
    }

    /* "Columns" menu checkboxes on the search results table */
    .columns-menu .menu-item {
        display: flex;
        gap: .625rem;
        align-items: center;
        width: 100%;
        cursor: pointer;
    }

    .columns-menu .menu-item:focus-visible {
        background-color: #e9ecef;
    }

    /* Checkbox drawn for the menuitemcheckbox buttons */
    .columns-check {
        display: inline-flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        width: 1.125rem;
        height: 1.125rem;
        border: 1px solid #adb5bd;
        border-radius: .25rem;
    }

    .columns-menu [aria-checked="true"] .columns-check {
        background-color: #007bff;
        border-color: #007bff;
    }

    .columns-menu [aria-checked="true"] .columns-check::after {
        width: .3125rem;
        height: .5625rem;
        margin-top: -.125rem;
        content: "";
        border: solid #fff;
        border-width: 0 2px 2px 0;
        transform: rotate(45deg);
    }

    #main-header {
        background-color: #2874f0;
        color: #FFFFFF;
    }

    /* Trash-can buttons in the course cart */
    .remove-course {
        padding: .25rem .5rem;
        margin: -.25rem 0;
        line-height: 1;
        border-radius: 50rem;
    }

    .remove-course:hover,
    .remove-course:focus-visible {
        background-color: #fbe4df;
    }

    /* Home page headline sized for phones */
    @media (max-width: 575.98px) {
        .masthead .display-2 {
            font-size: 3rem;
        }
    }

    .add-to-course-cart {
        white-space: nowrap;
    }

    /* 404 and 500 pages */
    .error-page {
        max-width: 38rem;
        padding: 1.5rem 0 2rem;
        margin: 0 auto;
        text-align: center;
    }

    .error-illustration {
        display: block;
        width: 200px;
        max-width: 55%;
        height: auto;
        margin: 0 auto 1.25rem;
    }

    .error-code {
        display: inline-block;
        padding: .25rem .875rem;
        margin-bottom: 1rem;
        font-size: .8125rem;
        font-weight: 700;
        color: #1e7e34;
        text-transform: uppercase;
        letter-spacing: .08em;
        background-color: #d4edda;
        border-radius: 50rem;
    }

    .error-code-server {
        color: #8a4b08;
        background-color: #fde3c4;
    }

    .error-page h1,
    .error-page .lead {
        text-wrap: balance;
    }

    .error-page h1 {
        margin-bottom: .75rem;
    }

    .error-page .lead {
        margin-bottom: 2rem;
        color: #495057;
    }

    .error-actions {
        display: flex;
        flex-wrap: wrap;
        gap: .75rem;
        justify-content: center;
        margin-bottom: 2rem;
    }

    .error-help {
        margin-bottom: 0;
        font-size: .9375rem;
        color: #6c757d;
    }

    /* No search results: one line of tips, then a prominent way to ask us */
    .search-tips {
        margin-bottom: 2rem;
    }

    .search-help {
        padding: 1.5rem;
        background-color: #eef4fe;
        border-radius: .75rem;
    }

    .search-help p {
        margin-bottom: 1rem;
    }

    /* About page (and other reading pages): a comfortable line length */
    .page-narrow {
        max-width: 45rem;
        margin: 0 auto;
    }

    .page-narrow h2 {
        margin-top: 2.5rem;
        margin-bottom: 1rem;
    }

    .page-narrow .lead {
        margin-bottom: 2rem;
    }

    /* .lead is light (300), so plain <strong> would barely show */
    .page-narrow .lead strong {
        font-weight: 600;
    }

    .about-steps {
        display: grid;
        gap: 1rem;
        padding: 0;
        margin: 0;
        list-style: none;
    }

    @media (min-width: 768px) {
        .about-steps {
            grid-template-columns: repeat(3, 1fr);
        }
    }

    /* Phones: icon beside the text; from md up: icon on top */
    .about-steps li {
        display: grid;
        grid-template-columns: 2.25rem 1fr;
        column-gap: .75rem;
        align-items: start;
        padding: 1rem 1.25rem;
        background-color: #fff;
        border: 1px solid #dee2e6;
        border-radius: .75rem;
    }

    .about-steps .fas,
    .about-steps .far {
        grid-row: span 2;
        padding-top: .125rem;
        font-size: 1.75rem;
        color: #2874f0;
        text-align: center;
    }

    .about-steps span {
        color: #495057;
    }

    @media (min-width: 768px) {
        .about-steps li {
            grid-template-columns: 1fr;
            row-gap: .25rem;
            padding: 1.25rem;
        }

        .about-steps .fas,
        .about-steps .far {
            grid-row: auto;
            padding-top: 0;
            margin-bottom: .5rem;
            text-align: left;
        }
    }

    .about-plans .card-header {
        text-align: center;
    }

    .about-plans .card-body {
        text-align: center;
    }

    .about-plan-icon {
        color: #2874f0;
    }

    .about-reasons {
        padding: 0;
        list-style: none;
    }

    /* Checkmark hangs in the left margin so wrapped lines stay aligned */
    .about-reasons li {
        position: relative;
        padding: .25rem 0 .25rem 1.75rem;
    }

    .about-reasons .fa-check {
        position: absolute;
        top: .55rem;
        left: 0;
        color: #28a745;
    }

    .about-faqs details {
        background-color: #fff;
        border: 1px solid #dee2e6;
        border-radius: .75rem;
    }

    .about-faqs details + details {
        margin-top: .75rem;
    }

    .about-faqs summary {
        display: flex;
        gap: 1rem;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 1.25rem;
        font-weight: 600;
        cursor: pointer;
        list-style: none;
    }

    .about-faqs summary::-webkit-details-marker {
        display: none;
    }

    /* Chevron that flips when the answer is open */
    .about-faqs summary::after {
        flex: 0 0 auto;
        width: .5rem;
        height: .5rem;
        margin-top: -.25rem;
        content: "";
        border: solid #6c757d;
        border-width: 0 2px 2px 0;
        transform: rotate(45deg);
        transition: transform .15s;
    }

    .about-faqs details[open] summary::after {
        margin-top: .25rem;
        transform: rotate(-135deg);
    }

    .about-faqs summary:focus-visible {
        border-radius: .75rem;
        outline: 2px solid #2874f0;
        outline-offset: 2px;
    }

    .about-faqs details p {
        padding: 0 1.25rem 1rem;
        margin: 0;
    }

    .about-cta {
        padding: 1.75rem 1.5rem;
        margin-top: 3rem;
        text-align: center;
        background-color: #eef4fe;
        border-radius: .75rem;
    }

    .page-narrow .about-cta h2 {
        margin-top: 0;
        margin-bottom: .5rem;
    }

    .about-cta-actions {
        display: flex;
        flex-wrap: wrap;
        gap: .75rem;
        justify-content: center;
        margin: 1.25rem 0 .75rem;
    }

    .about-disclaimer {
        margin: 1.5rem 0 0;
        font-size: .875rem;
        color: #6c757d;
        text-align: center;
    }

    /* ---- Look carried over from the multi-school branch ---- */

    /* Dev-mode header: maroon instead of bright red */
    #main-header.debug-header {
        background-color: #8a1818;
    }

    /* Brighter header links (the drawer styles them separately) */
    .main-navbar .main-nav-links .nav-link {
        font-weight: 500;
        color: rgb(255 255 255 / 88%);
    }

    .main-navbar .main-nav-links .nav-link.active,
    .main-navbar .main-nav-links .nav-link:hover,
    .main-navbar .main-nav-links .nav-link:focus-visible {
        color: #fff;
    }

    .footer-bg {
        border-top: 1px solid #e5e5e5;
    }

    /* Search results: compact uppercase headings, light zebra rows */
    .search-results-table {
        font-size: .94rem;
    }

    .search-results-table thead th {
        font-size: .75rem;
        color: #6c757d;
        text-transform: uppercase;
        background: #f8f9fa;
        border-top: 0;
    }

    .search-results-table tbody td {
        vertical-align: middle;
    }

    .search-results-table tbody tr:nth-child(even) > td {
        background: #fcfcfc;
    }

    .search-results-table tbody tr:hover > td {
        background: #f5f9ff;
    }

    .search-results-table .add-to-course-cart {
        min-width: 6.4rem;
    }

    /* Order page: the cart, the two choices and the forms as white cards */
    .page-notifications .course-cart,
    .page-notifications #choose-notifications .card,
    .page-notifications #email-form,
    .page-notifications #text-form {
        background: #fff;
        border: 1px solid #e5e5e5;
        border-radius: .75rem;
        box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .04);
    }

    .page-notifications .course-cart {
        margin-bottom: 1.5rem;
        overflow: hidden;
    }

    .page-notifications .course-cart .table {
        margin-bottom: 0;
    }

    .page-notifications .course-cart th,
    .page-notifications .course-cart td {
        padding: .75rem 1rem;
        vertical-align: middle;
    }

    .page-notifications .course-cart thead th {
        background: #f8f9fa;
        border-top: 0;
    }

    .page-notifications .course-cart tbody tr:last-child td {
        border-bottom: 0;
    }

    .page-notifications .course-cart td:last-child,
    .page-notifications .course-cart th:last-child {
        width: 3.5rem;
        text-align: right;
    }

    .page-notifications #choose-notifications .card-header {
        background: #f8f9fa;
    }

    .notification-option-icon {
        color: #2874f0;
    }

    /* The form card hugs its fields instead of spanning the page */
    .page-notifications #email-form,
    .page-notifications #text-form {
        max-width: 34rem;
        padding: 1.25rem;
        margin-top: 1rem;
    }

    .page-notifications #email-form .row > *,
    .page-notifications #text-form .row > * {
        flex: 1 0 0;
        width: 100%;
        max-width: 100%;
    }

    @media (max-width: 767.98px) {
        .page-notifications .course-cart th,
        .page-notifications .course-cart td {
            padding: .625rem .5rem;
        }

        .page-notifications .course-cart td:first-child,
        .page-notifications .course-cart th:first-child {
            padding-left: .875rem;
        }

        .page-notifications .course-cart [id^="code-"] {
            white-space: nowrap;
        }
    }

    /* ---- Cart: sticky header, checkout bar, add/remove toggle ---- */

    /* On wide screens the header (search box and cart menu) stays put; on
       phones it scrolls away and the checkout bar takes over */
    @media (min-width: 992px) {
        #main-header {
            position: sticky;
            top: 0;
            z-index: 1030;
            box-shadow: 0 2px 10px rgb(0 0 0 / 15%);
        }
    }

    /* Column headings stay visible down a long results list */
    /* Sticky cells lose their collapsed borders, so draw the rule as a shadow */
    .search-results-table thead th {
        position: sticky;
        top: 0;
        z-index: 2;
        border-bottom: 0;
        box-shadow: inset 0 -1px 0 #dee2e6;
    }

    @media (min-width: 992px) {
        .search-results-table thead th {
            top: var(--header-height, 0);
        }
    }

    /* A scroll box would trap the sticky headings, so only scroll sideways
       when the columns don't fit */
    .table-responsive:not(.is-scrollable) {
        overflow: visible;
    }

    /* "Add to Cart" / "In Cart" (hover or keyboard focus: "Remove") */
    .add-to-course-cart :is(.cart-btn-added, .cart-btn-remove),
    .add-to-course-cart.in-cart .cart-btn-add {
        display: none;
    }

    .add-to-course-cart.in-cart .cart-btn-added {
        display: inline;
    }

    .search-results-table .add-to-course-cart.in-cart {
        --btn-bg: #e6f4ea;
        --btn-color: #1e7b34;
        --btn-border-color: #b7dfc2;
        --btn-hover-bg: #fdecea;
        --btn-hover-color: #b02a37;
        --btn-hover-border-color: #f1b8bd;
        --btn-active-bg: #fdecea;
        --btn-active-color: #b02a37;
        --btn-active-border-color: #f1b8bd;
        --btn-disabled-bg: #e6f4ea;
        --btn-disabled-color: #1e7b34;
        --btn-disabled-border-color: #b7dfc2;
    }

    /* Right after an add the pointer is still on the button; don't greet the
       user with "Remove" until it moves off */
    .search-results-table .add-to-course-cart.in-cart.just-added {
        --btn-hover-bg: #e6f4ea;
        --btn-hover-color: #1e7b34;
        --btn-hover-border-color: #b7dfc2;
    }

    .add-to-course-cart.in-cart:not(.just-added):focus-visible .cart-btn-added {
        display: none;
    }

    .add-to-course-cart.in-cart:not(.just-added):focus-visible .cart-btn-remove {
        display: inline;
    }

    @media (hover: hover) {
        .add-to-course-cart.in-cart:not(.just-added):hover .cart-btn-added {
            display: none;
        }

        .add-to-course-cart.in-cart:not(.just-added):hover .cart-btn-remove {
            display: inline;
        }
    }

    /* Floating checkout bar */
    .checkout-bar {
        position: fixed;
        z-index: 1040;
        display: flex;
        align-items: center;
        color: #fff;
        background: #1f2328;
        box-shadow: 0 .75rem 2rem rgb(0 0 0 / 25%);
        visibility: hidden;
        transform: translateY(calc(100% + 2rem));
        transition: transform .3s cubic-bezier(.2, .8, .2, 1), visibility 0s .3s;
    }

    .checkout-bar.show {
        visibility: visible;
        transform: none;
        transition: transform .3s cubic-bezier(.2, .8, .2, 1);
    }

    /* The link fills the bar, so the whole bar (bar the Undo button) is one tap target */
    .checkout-bar-link {
        display: flex;
        flex: 1;
        gap: .875rem;
        align-items: center;
        min-width: 0;
        color: inherit;
        text-decoration: none;
        border-radius: inherit;
    }

    .checkout-bar-link:hover,
    .checkout-bar-link:focus-visible {
        color: inherit;
    }

    .checkout-bar-icon {
        position: relative;
        font-size: 1.25rem;
        line-height: 1;
    }

    .checkout-bar-count {
        position: absolute;
        top: -.6rem;
        right: -.7rem;
        display: grid;
        place-items: center;
        min-width: 1.2rem;
        height: 1.2rem;
        padding: 0 .3rem;
        font-size: .72rem;
        font-weight: 700;
        background: #28a745;
        border-radius: 50rem;
    }

    .checkout-bar-count[hidden] {
        display: none;
    }

    .checkout-bar-text {
        flex: 1;
        overflow: hidden;
        font-weight: 600;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .checkout-bar.notice .checkout-bar-text {
        color: #8fe3a5;
    }

    .checkout-bar.notice-removed .checkout-bar-text {
        color: inherit;
    }

    .checkout-bar.notice:not(.notice-removed) .checkout-bar-text::before {
        margin-right: .4rem;
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
        content: "\f00c";
    }

    .checkout-bar-cta,
    .checkout-bar-undo {
        padding: .55rem 1.1rem;
        font-weight: 600;
        line-height: 1.5;
        white-space: nowrap;
        border-radius: 50rem;
        transition: background-color .15s;
    }

    .checkout-bar-cta {
        color: #fff;
        background: #28a745;
    }

    .checkout-bar-link:hover .checkout-bar-cta {
        background: #218838;
    }

    /* After a removal, offer Undo in place of the Review button */
    .checkout-bar-undo {
        display: none;
        flex-shrink: 0;
        /* 1px less padding than the Review button to make room for the border */
        padding: calc(.55rem - 1px) calc(1.1rem - 1px);
        color: inherit;
        background: transparent;
        border: 1px solid rgb(255 255 255 / 45%);
    }

    .checkout-bar-undo:hover {
        background: rgb(255 255 255 / 12%);
    }

    .checkout-bar.notice-removed .checkout-bar-undo {
        display: block;
    }

    .checkout-bar.notice-removed .checkout-bar-cta {
        display: none;
    }

    @media (max-width: 991.98px) {
        .checkout-bar {
            right: .75rem;
            bottom: calc(.75rem + env(safe-area-inset-bottom));
            left: .75rem;
            /* Stays phone-sized and centred on tablets rather than stretching across */
            max-width: 30rem;
            margin-inline: auto;
            border-radius: 1rem;
        }

        .checkout-bar-link {
            padding: .625rem .625rem .625rem 1.25rem;
        }

        .checkout-bar.notice-removed .checkout-bar-link {
            padding-right: .75rem;
        }

        /* Same inset as the Review button gets from the link's padding */
        .checkout-bar-undo {
            margin: .625rem .625rem .625rem 0;
        }
    }

    /* Wide screens already show the cart button in the sticky header, so the
       bar becomes a small card that drops in below it after each change.
       It's kept compact because it sits over the top of the results. */
    @media (min-width: 992px) {
        .checkout-bar {
            top: calc(var(--header-height, 88px) + .5rem);
            right: var(--cart-right, 1.5rem);
            font-size: .9375rem;
            color: #212529;
            background: #fff;
            border: 1px solid rgb(0 0 0 / 10%);
            border-radius: .75rem;
            box-shadow: 0 .5rem 1.5rem rgb(0 0 0 / 15%);
            opacity: 0;
            transform: translateY(-.5rem);
            transition: opacity .2s, transform .2s, visibility 0s .2s;
        }

        .checkout-bar-link {
            gap: 1rem;
            padding: .375rem .375rem .375rem .875rem;
        }

        .checkout-bar.notice-removed .checkout-bar-link {
            padding-right: .5rem;
        }

        .checkout-bar.show {
            visibility: hidden;
            transform: translateY(-.5rem);
        }

        .checkout-bar.show.notice,
        .checkout-bar.show:focus-within {
            visibility: visible;
            opacity: 1;
            transform: none;
            transition: opacity .2s, transform .25s cubic-bezier(.2, .8, .2, 1);
        }

        .checkout-bar.notice:not(.notice-removed) .checkout-bar-text {
            color: #1e7b34;
        }

        .checkout-bar-icon {
            display: none;
        }

        .checkout-bar-cta {
            padding: .3rem .9rem;
        }

        .checkout-bar-undo {
            padding: calc(.3rem - 1px) calc(.9rem - 1px);
            margin: .375rem .375rem .375rem 0;
            border-color: rgb(0 0 0 / 20%);
        }

        .checkout-bar-undo:hover {
            background: rgb(0 0 0 / 5%);
        }
    }

    /* The header cart badge pops when a class is added */
    @keyframes cart-bump {
        40% { transform: scale(1.25); }
    }

    #cart.bump .course-count {
        animation: cart-bump .35s ease-out;
    }

    @media (max-width: 575.98px) {
        .checkout-bar-cta-long {
            display: none;
        }
    }

    /* Room to scroll the last rows out from under the bar */
    @media (max-width: 991.98px) {
        body:has(.checkout-bar.show) {
            padding-bottom: 5.5rem;
        }
    }

    @media (prefers-reduced-motion: reduce) {
        .checkout-bar,
        .checkout-bar.show,
        .checkout-bar.show.notice {
            transition: none;
        }

        #cart.bump .course-count {
            animation: none;
        }
    }
}

/* Phone menu: a Bootstrap 6 drawer in the header blue */
.main-nav-drawer {
    --drawer-bg: #2874f0;
    --drawer-color: #fff;
    --drawer-width: 300px;
    color: #fff;
}

.main-nav-drawer:focus {
    outline: 0;
}

/* A plain white X; Bootstrap 6's filled-square icon reads as a pale box on blue.
   The X is drawn on ::before so the button's own focus outline isn't clipped by
   the icon mask, and the button keeps a ~40px tap target. */
.main-nav-drawer .btn-close {
    --btn-close-size: 1rem;
    --btn-close-opacity: .85;
    --btn-close-hover-opacity: 1;
    --btn-close-focus-opacity: 1;
    --btn-close-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414'/%3e%3c/svg%3e");
    position: relative;
    box-sizing: content-box;
    padding: .75rem;
    margin: -.75rem -.75rem -.75rem auto;
    color: #fff;
    background-color: transparent;
    mask: none;
}

.main-nav-drawer .btn-close::before {
    position: absolute;
    inset: .75rem;
    content: "";
    background-color: currentcolor;
    mask: var(--btn-close-icon) center / contain no-repeat;
}

.main-nav-drawer .btn-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -2px;
}

/* Drawer-only extras, hidden when the links sit inline on desktop */
.main-nav-links .nav-icon,
.main-nav-links .nav-cart-count,
.main-nav-footer {
    display: none;
}

@media (width < 992px) {
    .main-nav-drawer .drawer-header {
        padding-bottom: .75rem;
        border-bottom: 1px solid rgb(255 255 255 / 20%);
    }

    .main-nav-drawer .drawer-body {
        display: flex;
        flex-direction: column;
        padding-top: .75rem;
    }

    .main-nav-links {
        --nav-gap: .25rem;
        --nav-link-padding-y: .75rem;
        --nav-link-padding-x: 1rem;
        font-size: 1.125rem;
    }

    .main-nav-links .nav-link {
        justify-content: flex-start;
        gap: .875rem;
        color: #fff;
        border-radius: .75rem;
    }

    .main-nav-links .nav-link:hover,
    .main-nav-links .nav-link:focus-visible {
        color: #fff;
        background-color: rgb(255 255 255 / 12%);
    }

    .main-nav-links .nav-link.active {
        font-weight: 600;
        color: #fff;
        background-color: rgb(255 255 255 / 22%);
    }

    .main-nav-links .nav-icon {
        display: inline-block;
        opacity: .85;
    }

    .main-nav-links .nav-cart-count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 1.5rem;
        height: 1.5rem;
        padding: 0 .5rem;
        margin-left: auto;
        font-size: .875rem;
        font-weight: 700;
        line-height: 1;
        color: #2874f0;
        text-align: center;
        background-color: #fff;
        border-radius: 50rem;
    }

    .main-nav-links .nav-cart-count.d-none {
        display: none;
    }

    .main-nav-footer {
        display: flex;
        flex-direction: column;
        gap: .25rem;
        /* Full-width divider, matching the one under the drawer header */
        padding: 1rem var(--drawer-padding-x) 0;
        margin: auto calc(-1 * var(--drawer-padding-x)) 0;
        border-top: 1px solid rgb(255 255 255 / 20%);
    }

    .main-nav-footer a {
        padding: .5rem 1rem;
        color: rgb(255 255 255 / 85%);
        text-decoration: none;
    }

    .main-nav-footer a[aria-current="page"] {
        font-weight: 600;
        color: #fff;
    }

    .main-nav-footer a:hover {
        color: #fff;
        text-decoration: underline;
    }
}

/* On desktop, show the drawer's links inline in the navbar. Bootstrap's
   .lg:navbar-expand does this with a container query, which this
   content-sized navbar can't use. */
@media (width >= 992px) {
    .main-navbar #MainNav {
        position: static !important;
        display: flex !important;
        width: auto !important;
        max-width: none !important;
        height: auto !important;
        max-height: none !important;
        padding: 0;
        margin: 0;
        overflow: visible !important;
        visibility: visible !important;
        background: transparent !important;
        border: 0 !important;
        transform: none !important;
        box-shadow: none;
    }

    .main-navbar #MainNav .drawer-header {
        display: none !important;
    }

    .main-navbar #MainNav .drawer-body {
        display: flex;
        padding: 0;
    }
}
