.type-Cart, .type-cart-view { /* stylelint-disable selector-class-pattern */
    h1 {
        margin-bottom: 0;
    }
}

.cart {
    // Cart navigation menu
    @at-root #{&}__nav {
        display: flex;
        justify-content: flex-start;
        height: 24px;
        fill: white;

        @media screen and (min-width: $screen-md-min) {
            justify-content: space-between;
        }

        &-icon {
            flex: 0 0 24px;
            width: 24px;
            height: 24px;

            @media screen and (min-width: $screen-md-min) {
                flex-basis: 16px;
                width: 16px;
                height: 16px;
            }

            &--empty {
                flex: 0 0 24px;
                width: 24px;
                height: 24px;
            }
        }

        &-count {
            flex: 0 1 24px;
            margin-left: 5px;
            text-align: center;
            padding: 0 4px;
            font-size: 0.8rem;
            font-weight: bold;
            border-radius: 1.4rem;
            background-color: green;
            height: 24px;
            line-height: 24px;
            animation: none;
            align-self: flex-end;

            @media screen and (min-width: $screen-md-min) {
                flex: 1 0 16px;
                margin-left: -5px;
                height: 16px;
                line-height: 16px;
            }
        }

        &-spinner {
            flex: 0 0 24px;
            margin-left: 5px;
            height: 24px;
            align-self: flex-end;
            background-color: #f80;
            border-radius: 1.4rem;
            animation: rotating 600ms linear infinite;

            @media screen and (min-width: $screen-md-min) {
                flex-basis: 16px;
                margin-left: -5px;
                height: 16px;
            }

            .svg-icon-spinner {
                position: absolute;
            }
        }

        @keyframes rotating {
            from {
                transform: rotate(0deg);
            }

            to {
                transform: rotate(360deg);
            }
        }
    }

    // Indicates if item has been saved.
    @at-root #{&}__saved-status {
        display: inline-block;
        width: 10px;
        height: 16px;
        line-height: 16px;

        svg {
            display: block;
            fill: #cc0700;
        }
    }

    // Heading for cart page panel
    @at-root #{&}__heading {
        text-align: center;

        @media screen and (min-width: $screen-sm-min) {
            display: flex;
            justify-content: space-between;
        }
    }

    // Warning about losing cart items
    @at-root #{&}__loss-warning {
        font-style: italic;
        text-align: center;

        @media screen and (min-width: $screen-sm-min) {
            flex: 0 1 auto;
            text-align: left;
        }
    }

    @at-root #{&}__save-button {
        margin-top: 10px;

        @media screen and (min-width: $screen-sm-min) {
            flex: 0 1 auto;
            margin: -5px;
        }
    }

    // Checkbox block in search results
    @at-root #{&}__search-controls {
        display: flex;
        justify-content: flex-end;
        padding: 5px;
        text-align: right;
        border-width: 1px 1px 0 1px;
        border-color: #ccc;
        border-style: solid;
        background-color: #d8d8d8;

        > button {
            display: inline-block;
            margin-left: 5px;
        }
    }

    @at-root #{&}__empty-message {
        margin: 30px 0;
        text-align: center;
        font-style: italic;
        font-size: 1.2rem;
    }

    // Cart control (add/remove) button
    @at-root #{&}__control-button {
        @at-root #{&}--inline {
            display: inline-block;
            margin-right: 5px;
            height: 28px;
        }
    }

    @at-root #{&}__missing-items {
        border-top: 1px solid #a0a0a0;
        background-color: #f0f0f0;

        @media screen and (min-width: $screen-sm-min) {
            display: flex;
            flex-wrap: wrap;

            p {
                flex: 0 1 100%;
            }
        }
    }

    @at-root #{&}__missing-item {
        @media screen and (min-width: $screen-sm-min) {
            flex: 0 1 50%;
        }

        @media screen and (min-width: $screen-md-min) {
            flex: 0 1 33.33%;
        }

        @media screen and (min-width: $screen-lg-min) {
            flex: 0 1 25%;
        }
    }

    // Cart result table item count
    @at-root #{&}__element-count {
        padding: 2px 0;
        text-align: center;
        border-top: 1px solid #ddd;
        border-bottom: 1px solid #ddd;
    }

    @at-root #{&}__facet-disabled-overlay {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        padding: 10px;
        background-color: rgba(255, 255, 255, 0.7);
        z-index: 1;
    }

    @at-root #{&}__batch-download-warning {
        margin: 1rem 0;
        padding: 5px 10px;
        color: #fff;
        font-weight: bold;
        background-color: $brand-danger;
    }

    @at-root #{&}__batch-download-note {
        margin: 1rem 0;
        padding: 5px 10px;
        color: #000;
        background-color: #e0e0e0;
    }

    @at-root #{&}__share-url {
        display: flex;
        flex-wrap: nowrap;
        align-items: stretch;
        margin-bottom: 1em;

        > input {
            flex: 1 1 auto;
            margin: 0;
            height: auto;
            border-top-right-radius: 0;
            border-bottom-right-radius: 0;
        }

        > .btn {
            flex: 0 1 auto;
            margin: 0;
            height: auto;
            border-left: none;
            border-top-left-radius: 0;
            border-bottom-left-radius: 0;

            .svg-icon-clipboard {
                height: 18px;
                fill: transparent;
                stroke-width: 20px;
                stroke: #000;
            }
        }
    }
}

.cart__batch-download-dataset-type-selector {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: 10px auto 0;
    gap: 5px;
    font-weight: 600;
}

.panel-heading {
    &.cart__header {
        display: block;
        padding-top: 5px;
        padding-bottom: 5px;

        @media screen and (min-width: $screen-md-min) {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
    }
}

// Cart add/remove toggle button
.cart-toggle {
    display: flex;
    height: 30px;
    align-items: center;
    -webkit-appearance: none; // Avoid apparent chrome bug

    button {
        width: 30px;
        height: 100%;
        border: 1px solid;
        border-color: rgb(216, 216, 216) rgb(209, 209, 209) rgb(186, 186, 186);
        border-radius: 5px;
        background-color: transparent;

        &:hover {
            background-color: #e0e0e0;

            &:disabled {
                background-color: #fff;
            }
        }
    }

    svg {
        display: block;
        stroke: #000;
        stroke-width: 0.5px;
        fill: #000;
        fill-opacity: 0;
    }

    &:disabled {
        cursor: default;
        stroke: #a0a0a0;
        fill: #a0a0a0;
    }

    &--in-cart {
        svg {
            stroke-width: 0;
            fill-opacity: 1;

            &:disabled {
                stroke: #a0a0a0;
                fill: #a0a0a0;
            }
        }
    }

    &__name {
        font-weight: bold;
        margin-right: 5px;
        color: #808080;
    }

    .item-accessories & {
        display: inline-block;
        margin-left: 5px;
        height: 100%;
        vertical-align: top;
    }
}

// "Add all items to cart" button.
.cart-add-all {
    display: flex;
    align-items: center;
}

.cart-tools {
    display: block;

    @media screen and (min-width: $screen-md-min) {
        display: flex;
        flex: 0 1 auto;
        align-items: center;
    }
}

// Cart button in navigation bar
.navbar__nav .dropdown .dropdown__toggle.cart__nav-button {
    padding: 8px 15px;
}

// Search-result-like file facet and results display.
.cart__display {
    display: block;

    @media screen and (min-width: $screen-sm-min) {
        display: flex;
    }

    &-facets {
        @media screen and (min-width: $screen-sm-min) {
            flex: 0 0 300px;
            width: 300px;
            margin-right: 20px;
        }

        position: relative;
        padding: 0 10px 23px;
        z-index: 0;
        border: 1px solid #ccc;

        progress {
            width: 100%;
        }
    }

    .cart__display-content {
        overflow: hidden;
        border: 1px solid #ccc;

        @media screen and (min-width: $screen-sm-min) {
            flex: 1 1 auto;
        }

        .result-table {
            border: none;
        }

        &.cart__display-content--static {
            border: none;

            .tab-nav {
                display: flex;
                justify-content: space-between;
            }

            .cart-search-results-controls {
                justify-content: flex-end;
            }
        }
    }
}

// Adjusts message if no file count header exists in the facet.
.cart-facet-standin-message {
    padding: 10px;
}

// Defines check boxes and radio button on the cart facets.
$cart-facet-check-box-size: 18px;
%facet-term-control {
    display: flex;
    flex: 0 0 $cart-facet-check-box-size;
    width: $cart-facet-check-box-size;
    height: $cart-facet-check-box-size;
    border: 1px solid #c0c0c0;
    justify-content: center;
    align-items: center;
}

// Facets for the cart-view page.
$icon-visualizable-color: #396492;
$cart-facet-visualizable-size: 18px;
$cart-facet-visualizable-padding: 2px;

.cart-facet {
    margin-top: 0;
    padding: 0;

    // Button to expand or collapse a facet
    @at-root #{&}__expander {
        display: flex;
        align-items: center;
        width: 100%;
        padding: 10px 0;
        margin: 0;
        border-bottom: 1px solid #c0c0c0;
        cursor: pointer;
        background-color: transparent;
        border: none;

        @at-root #{&}-title {
            flex: 0 1 auto;
            position: relative;
            top: 1px; // Offset for all uppercase lack of decenders
            text-transform: uppercase;
            font-weight: bold;
        }

        .icon {
            flex: 0 0 auto;
            margin-left: auto;
        }

        &[aria-expanded="false"] {
            border-bottom: none;
        }

        @at-root #{&}--non-collapsable {
            cursor: default;
        }
    }

    // One term within a facet
    @at-root #{&}-term {
        margin: 0 4px;
        padding: 2px 0;
        font-size: 0; // Edge/IE11 fix for too-tall <li>

        &:hover {
            background-color: #f0f0f0;
        }

        // Covers all the components within a facet term.
        @at-root #{&}__item {
            display: flex;
            width: 100%;
            justify-content: space-between;
            cursor: pointer;
            background-color: transparent;
            border: none;
        }

        // Checkbox for a facet term
        @at-root #{&}__check {
            @extend %facet-term-control;

            border-radius: 3px;

            $cart-facet-check-size: 16px;

            .icon {
                flex: 0 0 $cart-facet-check-size;
                font-size: $cart-facet-check-size;
            }
        }

        @at-root #{&}__check--checked {
            background-color: #008000;
            color: #fff;
        }

        @at-root #{&}__radio {
            @extend %facet-term-control;

            border-radius: $cart-facet-check-box-size / 2;
            text-align: center;

            $cart-facet-radio-size: 8px;

            .icon {
                flex: 0 0 $cart-facet-radio-size;
                font-size: $cart-facet-radio-size;
                line-height: $cart-facet-check-box-size;
            }
        }

        @at-root #{&}__radio--checked {
            background-color: #008000;
            color: #fff;
        }

        // Text of the facet term
        @at-root #{&}__text {
            padding: 0 5px;
            flex: 1 0 60%;
            text-align: left;
            font-size: 0.95rem;
        }

        // Circle whose tint reflects the count
        $cart-facet-magnitude-size: 18px;

        @at-root #{&}__magnitude {
            flex: 0 1 auto;
            padding: 0 5px 0;
            width: auto;
            height: $cart-facet-magnitude-size;
            line-height: $cart-facet-magnitude-size;
            border-radius: $cart-facet-magnitude-size / 2;

            > span {
                font-size: 0.8rem;
                line-height: $cart-facet-magnitude-size;
            }
        }

        // Icon indicating file visualizability
        @at-root #{&}__visualizable {
            flex: 0 0 $cart-facet-visualizable-size;
            width: $cart-facet-visualizable-size;
            height: $cart-facet-visualizable-size;
            padding: $cart-facet-visualizable-padding;

            svg {
                height: $cart-facet-visualizable-size - (2 * $cart-facet-visualizable-padding); // IE11
                fill: $icon-visualizable-color;
            }
        }
    }

    // Special cart facet for analysis.
    @at-root #{&}--analysis {
        margin-top: 0;
    }
}

// File-count note above facet
.cart__facet-count {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 2px 5px 3px;
    margin: 0 -10px 10px;
    background-color: #d8d8d8;
    text-align: center;
    font-size: 1rem;
    font-weight: bold;

    span {
        position: relative;
        z-index: 1;
    }

    @at-root #{&}-changer {
        position: absolute;
        opacity: 0;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        background-color: #ff0;
        z-index: 0;
        animation-duration: 0.2s;
        animation-name: change-flash;
    }

    .svg-icon {
        margin-right: 5px;
        width: 20px;
        height: 20px;
        fill: #000;
    }
}

// Allows div showing file count to flash yellow on term click
@keyframes change-flash {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

// Controls to display on cart page panel.
.cart-controls {
    position: absolute;
    top: 4px;
    right: 4px;
    bottom: 4px;
    z-index: 1;

    button {
        margin-left: 5px;
    }
}

// Cart manager table header
.cart-manager-header {
    display: flex;

    @at-root #{&}__title {
        flex: 1 1 auto;
    }
}

.btn.cart-manager-header__control {
    margin: 0;
}

$current-bg: #d0f0ff;
$autosave-bg: #ffffc0;
$deleted-bg: #ffe0e0;

%cart-manager-table-chip {
    display: inline-block;
    margin-right: 5px;
    width: 20px;
    height: 10px;
    border: 1px solid #c0c0c0;
}

.cart-manager-table {
    @at-root #{&}__action {
        display: flex;
        margin: -5px;
    }

    @at-root #{&}__name-header {
        width: 50%;
    }

    @at-root #{&}__current-button {
        display: block;
        margin: 0 auto !important;
    }

    // Mark the current cart's row in the table
    @at-root #{&}__current-row {
        background-color: $current-bg;
    }

    // Mark deleted carts' rows in the table
    @at-root #{&}__deleted-row {
        background-color: $deleted-bg;
    }

    // Mark auto-saved cart's row in the table
    @at-root #{&}__autosave-row {
        background-color: $autosave-bg;
    }

    @at-root #{&}__tooltip-group {
        position: relative;
    }

    @at-root #{&}__button-overlay {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
    }

    @at-root #{&}__text-wrap {
        overflow-wrap: break-word;
    }

    @at-root #{&}__footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    @at-root #{&}__footer-item {
        flex: 1 0;
    }

    @at-root #{&}__legend {
        display: flex;
        padding: 0 5px;

        @at-root #{&}-item {
            margin: 0 15px;
        }
    }

    @at-root #{&}__chip {
        @at-root #{&}--current {
            @extend %cart-manager-table-chip;

            background-color: $current-bg;
        }
    }

    .cart-set-current {
        width: 100%;
        white-space: break-spaces;
        height: auto;
        padding: 5px 10px;
        text-align: left;
        justify-content: left;
    }
}

// Cart rename modal styles
.cart-rename {
    @media screen and (min-width: $screen-sm-min) {
        display: flex;
    }

    .form-group {
        margin-bottom: 0;
    }

    @at-root #{&}__name-area {
        @media screen and (min-width: $screen-sm-min) {
            flex: 0 1 40%;
        }
    }

    @at-root #{&}__identifier-area {
        @media screen and (min-width: $screen-sm-min) {
            flex: 0 1 40%;
        }
    }

    @at-root #{&}__explanation {
        margin-top: 1.2rem;
        font-size: 0.9rem;
    }

    @at-root #{&}__control-area {
        text-align: center;

        @media screen and (min-width: $screen-sm-min) {
            flex: 0 0 20%;
            margin-top: 1.15rem;
        }

        button {
            @extend .icon;
            @extend .icon-arrow-circle-down;

            padding: 2px 8px;
            color: #606060;
            background-color: transparent;
            border: 1px solid #808080;
            border-radius: 5px;
            font-size: 1.5rem;

            @media screen and (min-width: $screen-sm-min) {
                &::before {
                    content: $fa-var-arrow-circle-right;
                }
            }
        }

        @at-root #{&}--enabled {
            button {
                color: #fff;
                background-color: #808080;
                border-color: #404040;
            }
        }
    }

    @at-root #{&}__input {
        width: 100% !important;
    }

    // Controls in rename modal footer
    @at-root #{&}__footer-controls {
        .spinner {
            display: inline-block;
            width: 40px;
            height: 24px;
            vertical-align: middle;
        }

        .modal-footer-controls {
            display: inline-block;
        }
    }
}

// Display of the number of carts the user owns.
.cart-counts {
    padding: 2px 10px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: normal;
    color: #606060;
    background-color: #fff;
    border-top: 1px solid #a0a0a0;
    border-bottom: 1px solid #a0a0a0;
}

// Checkbox for filtering out facet terms not included in visualizable files.
.cart-checkbox {
    margin: 10px 0;
    padding: 0;

    > button {
        display: flex;
        width: 100%;
        border: none;
        background: none;

        > label {
            display: flex;
            cursor: pointer;
        }
    }

    @at-root #{&}__check {
        @extend %facet-term-control;

        flex: 0 0 18px;
        border-radius: 3px;

        $cart-checkbox-size: 16px;

        .icon {
            flex: 0 0 $cart-checkbox-size;
            font-size: $cart-checkbox-size;
        }

        @at-root #{&}--checked {
            background-color: #008000;
            color: #fff;
        }
    }

    @at-root #{&}__label-text {
        flex: 0 1 auto;
        padding: 0 5px;
        font-size: 1rem;
        line-height: $cart-facet-visualizable-size;
    }

    @at-root #{&}__icon {
        flex: 0 0 18px;
        padding: 2px;
        width: $cart-facet-visualizable-size;
        height: $cart-facet-visualizable-size;

        svg {
            display: block;
            fill: $icon-visualizable-color;
        }
    }
}

.cart-tab {
    display: flex;
    align-items: center;
    line-height: 1.1;

    @at-root #{&}__count {
        display: none;
        padding: 0 5px;
        margin-left: 6px;
        font-size: 0.8rem;
        color: #fff;
        background-color: green;
        border-radius: 20px;
        line-height: 1.4;

        @media screen and (min-width: $screen-sm-min) {
            display: block;
        }
    }

    // Icon in cart tab
    .svg-icon {
        margin-right: 5px;
        width: 16px;
        height: 16px;
        fill: #000;
    }
}

// Defines cart-list identifier colors based on `file_format`
$file-type-colors: (
    (bam, #9de89b, #000),
    (bed, #ffe062, #000),
    (bedpe, #e8917c, #000),
    (bigBed, #4cc7ff, #000),
    (bigWig, #d5bafb, #000),
    (CEL, #a0eeff, #000),
    (chain, #ffa677, #000),
    (csv, #bc50ff, #fff),
    (database, #ffd86d, #000),
    (fasta, #99e8cd, #000),
    (fastq, #e8adb9, #000),
    (gff, #f9cbff, #000),
    (gtf, #cfc3b8, #000),
    (hdf5, #c1ceff, #000),
    (hic, #8886b2, #fff),
    (idat, #ffdfcd, #000),
    (PWM, #c8c6ff, #000),
    (rcc, #acccbe, #000),
    (sam, #8eb2b2, #000),
    (tagAlign, #b0ff8c, #000),
    (tar, #e8ce95, #000),
    (tsv, #ff9a99, #000),
    (vcf, #a08ce8, #fff),
    (wig, #a3fff2, #000),
    (idx, #ffd6ba, #000),
    (txt, #e897dc, #000),
);

// Contains list of cart-related objects, sort of like search results.
.cart-list {
    @at-root #{&}-item {
        position: relative;

        &.cart-list-item--no-dl {
            .cart-list-link__file-type {
                background-color: #606060;
                color: white;
            }

            .cart-file-view-checkbox {
                color: white;
            }
        }
    }

    // Contains one item in the cart list.
    @at-root #{&}-link {
        display: flex;
        flex: 1 0 auto;
        position: relative;
        border-bottom: 1px solid #ccc;
        color: #000;

        &:hover {
            text-decoration: none;
        }

        @at-root #{&}__hover {
            position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;

            &:hover {
                background-color: rgba(0, 0, 0, 0.07);
            }
        }

        // To allow last item's bottom border to sit on top of tab area bottom border.
        &:last-child {
            margin-bottom: -1px;
        }

        @at-root #{&}__file-type {
            display: flex;
            position: relative;
            flex: 0 0 25%;
            align-items: center;
            padding: 0 10px 5px;
            background-color: #ccf;
            box-shadow: 0 0 12px inset rgba(0, 0, 0, 0.07);

            @media screen and (min-width: $screen-md-min) {
                flex-basis: 20%;
            }

            @media screen and (min-width: $screen-lg-min) {
                flex-basis: 15%;
            }

            @media screen and (min-width: $screen-xl-min) {
                flex-basis: 10%;
            }

            .cart-list-link--no-dl & {
                background-color: #606060;
                color: white;
            }
        }

        @each $file-type, $back-color, $fore-color in $file-type-colors {
            @at-root #{&}__file-type--#{$file-type} {
                background-color: $back-color;
                color: $fore-color;
            }
        }

        @at-root #{&}__props {
            display: flex;
            flex: 0 0 75%;
            flex-wrap: wrap;

            @media screen and (min-width: $screen-md-min) {
                flex-basis: 80%;
            }

            @media screen and (min-width: $screen-lg-min) {
                flex-basis: 85%;
            }

            @media screen and (min-width: $screen-xl-min) {
                flex-basis: 90%;
            }
        }

        @at-root #{&}__format {
            flex-basis: 100%;
            text-align: center;
            font-size: 0.9rem;

            @media screen and (min-width: $screen-md-min) {
                font-size: 1.3rem;
            }
        }

        @at-root #{&}__no-dl {
            position: absolute;
            top: 3px;
            right: 0;
            left: 0;
            font-size: 0.75rem;
            color: white;
            text-align: center;
        }

        @at-root #{&}__details {
            display: flex;
            flex-wrap: wrap;
            flex: 0 0 100%;

            @media screen and (min-width: $screen-md-min) {
                flex-basis: 100%;
            }

            @media screen and (min-width: $screen-lg-min) {
                flex-basis: 80%;
            }
        }

        @at-root #{&}__identifier {
            display: flex;
            flex: 0 0 100%;
            background-color: #f0f0f0;

            @media screen and (min-width: $screen-lg-min) {
                flex-basis: 20%;
                flex-wrap: wrap;
            }

            @media screen and (min-width: $screen-xl-min) {
                flex-wrap: nowrap;
            }
        }

        @at-root #{&}__status {
            display: flex;
            flex: 0 0 50%;
            padding: 5px 10px;
            align-items: center;

            @media screen and (min-width: $screen-lg-min) {
                flex-basis: 100%;
                align-items: flex-end;
            }

            @media screen and (min-width: $screen-xl-min) {
                flex-basis: 50%;
                align-items: center;
            }
        }

        @at-root #{&}__title {
            display: flex;
            flex: 0 0 50%;
            padding: 5px 10px;
            align-items: center;
            justify-content: flex-end;
            font-size: 0.9rem;

            @media screen and (min-width: $screen-lg-min) {
                font-size: 1rem;
                flex-basis: 100%;
                align-items: flex-start;
                justify-content: flex-start;
            }

            @media screen and (min-width: $screen-xl-min) {
                flex-basis: 50%;
                align-items: center;
            }
        }
    }

    // File details section of each item
    @at-root #{&}-details {
        @at-root #{&}__output-type {
            flex-basis: 100%;
            padding: 2px 10px 5px;
            font-weight: 600;
            font-size: 1.2rem;
        }

        @at-root #{&}__type {
            flex: 0 0 50%;
            padding: 0 10px 5px;

            @media screen and (min-width: $screen-md-min) {
                flex-basis: 25%;
            }
        }

        @at-root #{&}__target {
            flex: 0 0 50%;
            padding: 0 10px 5px;

            @media screen and (min-width: $screen-md-min) {
                flex-basis: 25%;
            }
        }

        @at-root #{&}__assay {
            flex: 0 0 50%;
            padding: 0 10px 5px;

            @media screen and (min-width: $screen-md-min) {
                flex-basis: 25%;
            }
        }

        @at-root #{&}__biosample {
            flex: 0 0 50%;
            padding: 0 10px 5px;

            @media screen and (min-width: $screen-md-min) {
                flex-basis: 25%;
            }
        }

        @at-root #{&}__label {
            color: #808080;
            font-size: 0.8rem;
        }
    }

    @at-root #{&}__no-dl {
        padding: 2px 0;
        border-bottom: 1px solid #ccc;
        text-align: center;
        font-size: 0.9rem;
    }
}

$file-view-checkbox-size: 14px;

// Used on the checkbox for each file to include or remove from the file view.
.cart-file-view-checkbox {
    position: absolute;
    bottom: 0;
    left: 0;
    font-size: 0.9rem;
    z-index: 1;

    input {
        width: $file-view-checkbox-size;
        height: $file-view-checkbox-size;

        + label {
            padding-left: 15px;

            &::before {
                top: 4px;
                width: $file-view-checkbox-size;
                height: $file-view-checkbox-size;
            }

            svg {
                top: 6px;
                width: $file-view-checkbox-size - 4;
                height: $file-view-checkbox-size - 4;
            }
        }
    }
}

.file-view-toggle {
    margin: 0;

    .file-view-toggle__title {
        align-items: center;
        margin-right: 5px;

        .cart-tab__count {
            margin-right: 5px;
        }
    }
}

.file-view-controls {
    justify-content: stretch;

    @media screen and (min-width: $screen-md-min) {
        display: flex;
        justify-content: start;
    }

    .file-view-controls__control {
        margin-right: 2px;
        margin-bottom: 5px;
        margin-left: 2px;
        width: 100%;

        @media screen and (min-width: $screen-md-min) {
            width: auto;
            margin-bottom: 0;
        }
    }
}

.cart-pager-area {
    display: flex;
}

// Experiment tables with a cart control in the header.
.experiment-table {
    @at-root #{&}__header {
        display: flex;
        justify-content: space-between;

        .cart-add-all {
            margin: -5px -5px -5px 0;
        }
    }

    @at-root #{&}__header-controls {
        display: flex;

        .cart-add-all {
            margin: -5px 5px -5px 0;
        }

        > a.btn[href^="http"]::after {
            content: "";
        }
    }

    @at-root #{&}__subheader {
        padding: 5px;
        font-size: 1rem;
        font-weight: 600;
        background-color: #d8e0e8;

        @media screen and (min-width: $screen-xs-min) {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
    }

    @at-root #{&}__subheader-controls {
        display: flex;
        column-gap: 5px;
    }
}

// Control to batch download cart files.
.btn-cart-download {
    margin-right: 5px;
}

// Button to lock/unlock cart
.btn.cart-lock-trigger {
    width: 85px;
    color: #000;

    &:disabled {
        color: #000;
    }

    .svg-icon {
        fill: #000;
    }
}

// Lock icon in the menu.
.cart-nav-lock {
    display: inline-block;
    margin-left: 10px;
    width: 13px;
    height: 13px;

    > svg {
        fill: #000;
    }
}

// Cart status icon in the cart menu.
.cart-menu-status {
    line-height: 0;
    margin-right: 5px;
}

// Cart-accessories buttons.
.cart-accessories {
    display: flex;
    margin-bottom: 5px;

    .cart-accessories__button {
        margin-right: 5px;

        &:last-child {
            margin-right: 0;
        }

        button {
            width: 100%;
        }
    }
}

.cart-dataset-selector {
    width: 100%;
    margin-bottom: 5px;
    padding: 0 5px;

    @media screen and (min-width: $screen-md-min) {
        width: auto;
        height: 29px;
        margin-right: 5px;
        margin-bottom: 0;
    }
}

.cart-merge {
    margin-bottom: 5px;

    @media screen and (min-width: $screen-md-min) {
        margin-right: 5px;
        margin-bottom: 0;
    }

    button {
        width: 100%;

        @media screen and (min-width: $screen-md-min) {
            width: auto;
        }
    }
}

.cart-dataset-search {
    display: block;
    width: 100%;

    @media screen and (min-width: $screen-md-min) {
        width: auto;
    }
}

// Contents of the type-selection modal for /cart-search/ page, Report view control button.
.cart-type-selector {
    display: flex;
    justify-content: center;

    .btn {
        margin-left: 2.5px;
        margin-right: 2.55px;
    }
}

// "Dataset report" button on the cart view page.
.cart-dataset-report {
    button {
        @extend .btn-info;
        @extend .btn-sm;

        width: 100%;

        > svg {
            margin-left: 5px;
            width: 8px;
            fill: #fff;
        }
    }

    .dropdown-button__content {
        a {
            font-family: Quicksand, sans-serif;
            font-weight: 400;
            font-size: 1rem;

            &:hover {
                text-decoration: none;
            }
        }
    }
}

// Controls at the top of search results, below the tabs.
.cart-search-results-controls {
    padding: 5px;
    border-bottom: 1px solid #ccc;

    @media screen and (min-width: $screen-md-min) {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .cart-checkbox {
        margin-top: 0;
        margin-bottom: 0;
    }
}

// Control to clear all selections within a facet.
.cart-facet-clear {
    position: relative;
    margin: 0 0 0 5px;
    padding: 0;
    border: none;
    background-color: transparent;
    width: 10px;
    height: 10px;

    .cart-facet-clear__control {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;

        .svg-icon-circle {
            display: block;
            fill: #008000;
        }

        .svg-icon-multiplication {
            display: none;
            fill: #b24342;
        }
    }

    &:hover {
        .svg-icon-circle {
            display: none;
        }

        .svg-icon-multiplication {
            display: block;
        }
    }
}

// Modal to display dataset and file facets.
.cart-facet-modal {
    display: flex;
    gap: 10px;

    .cart__facet-count {
        margin: 0 0 0 -10px;
    }
}

// Each column (dataset and file) of facets within the modal.
.cart-facet-modal-column {
    flex: 0 0 calc(50% - 5px);
    padding: 0 0 10px 10px;
    border: 1px solid #e0e0e0;

    .cart-facet-list {
        max-height: 500px;
        overflow-y: auto;

        .facet {
            margin-right: 10px;
        }
    }
}

// Area showing "More filters" actuator and tags allowing user to clear selections.
.facet-selections-section {
    padding-top: 10px;
    border-top: 1px solid #eee;
}

// Button to bring up the facet modal.
.facet-selections-actuator {
    margin: 0 auto;
}

// Buttons that display the current facet selections and allows the user to clear them.
.facet-selections {
    display: flex;
    margin: 0 -2px;
    flex-wrap: wrap;
    justify-content: space-between;

    .facet-selections-button {
        display: flex;
        margin: 2px;
        padding: 0 5px;
        flex-grow: 1;
        align-items: center;
        justify-content: space-between;
        overflow: hidden;
        font-weight: normal;

        .facet-selections-button__label {
            display: flex;
            overflow: hidden;
            line-height: 1rem;
            font-size: 0.8rem;

            .facet-selections-button__icon {
                width: 14px;
                margin-right: 5px;
                padding: 0;

                svg {
                    width: 14px;
                    fill: #fff;
                }
            }

            .facet-selections-button__text {
                overflow: hidden;
                text-overflow: ellipsis;
            }
        }

        .facet-selections-button__close {
            width: 8px;
        }
    }
}

.cart-series-confirmation {
    position: absolute;
    top: 50px;
    right: 10%;
    left: 10%;
    padding: 10px;
    border: 1px solid #c0c0c0;
    background-color: #fff;
    box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
    z-index: 20;

    @media screen and (min-width: $screen-sm-min) {
        display: flex;
        gap: 20px;
    }

    .cart-series-confirmation__controls {
        @media screen and (min-width: $screen-sm-min) {
            order: 2;
        }

        @media screen and (min-width: $screen-md-min) {
            display: flex;
            gap: 5px;
        }
    }

    .cart-series-confirmation__help {
        @media screen and (min-width: $screen-sm-min) {
            order: 1;
        }
    }

    .cart-series-confirmation__button {
        width: 100%;
        margin-bottom: 5px;
        height: 40px;

        @media screen and (min-width: $screen-md-min) {
            width: auto;
            height: 29px;
            padding-top: 0;
            padding-bottom: 0;
            margin-bottom: 0;
        }

        &.cart-series-confirmation__button--confirm {
            order: 2;
        }

        &.cart-series-confirmation__button--cancel {
            order: 1;
        }
    }
}

.manage-series {
    position: relative;

    .manage-series__header {
        display: flex;
        gap: 10px;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        padding: 0 5px;
        border-top: 1px solid #ccc;
        border-right: 1px solid #ccc;
        border-bottom: none;
        border-left: 1px solid #ccc;
        background-color: #f0f0f0;

        h2 {
            margin: 0;
            font-size: 1rem;
            border: none;
        }
    }

    .manage-series__header-pagination {
        flex: 0 1 auto;

        .pager {
            display: block;
            margin-top: 5px;
            margin-bottom: 5px;
        }
    }

    .manage-series__removal-note {
        font-size: 0.9rem;
        font-weight: normal;
        color: #404040;
    }

    .manage-series__result-table {
        position: relative;
    }

    .manage-series__cover {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        backdrop-filter: blur(1px);
        z-index: 10;
    }
}

.result-table.result-table--manage-series {
    margin-bottom: 10px;
}

.search-results-description {
    word-break: normal;
}

.remove-multiple-control {
    .remove-multiple-control__note {
        font-size: 0.9rem;
        color: #606060;
    }
}

.cart-title-status {
    display: flex;
}

// Cart description as it appears on the cart-view page.
.cart-view-description {
    margin: 10px 0;

    @media screen and (min-width: $screen-md-min) {
        width: 70%;
    }

    @media screen and (min-width: $screen-lg-min) {
        width: 60%;
    }

    @media screen and (min-width: $screen-xl-min) {
        width: 50%;
    }

    .cart-view-description__display {
        &.cart-description__display--active {
            padding: 5px;
            border: 1px solid #e0e0e0;
        }
    }

    .cart-view-description__edit {
        float: right;
    }

    .cart-view-description__edit-button {
        display: block;
        padding: 2px;
        border: none;
        background: none;

        .svg-icon-edit {
            display: block;
            width: 22px;
            height: 22px;
            fill: #808080;

            @media screen and (min-width: $screen-sm-min) {
                width: 14px;
                height: 14px;
            }
        }
    }
}

// Markdow-formatted cart description.
.cart-description {
    word-break: normal;

    // Description text styles
    h1, h2, h3, h4, h5, h6 {
        font-family: $site-font;
        border-bottom: none;

        &:first-child {
            margin-top: 0;
        }

        + p {
            margin-top: 0;
        }
    }

    h1 {
        margin: 1.3rem 0 0.3rem;
        font-size: 1.3rem;
        font-weight: 700;
    }

    h2 {
        margin: 1.2rem 0 0.2rem;
        font-size: 1.2rem;
        font-weight: 700;
    }

    h3 {
        margin: 1.2rem 0 0.2rem;
        font-size: 1.1rem;
        font-weight: 700;
    }

    h4 {
        margin: 1.1rem 0 0.2rem;
        font-size: 1.1rem;
        font-weight: 600;
    }

    h5 {
        margin: 1.1rem 0 0.1rem;
        font-size: 1rem;
        font-weight: 600;
    }

    h6 {
        font-size: 1rem;
        margin: 1.1rem 0 0.1rem;
        font-weight: 500;
    }

    p {
        margin: 0.9rem 0;

        &:first-child {
            margin-top: 0;
        }

        &:last-child {
            margin-bottom: 0;
        }
    }

    ul, ol {
        margin: 0.3em;
        padding-left: 20px;
        list-style-position: outside;

        li {
            display: list-item;
            margin-top: 3px;
            margin-bottom: 3px;
        }
    }

    ul {
        li {
            list-style-type: disc;
        }
    }

    ol {
        li {
            list-style-type: decimal;
        }
    }

    ul ul, ol ul {
        list-style-type: circle;
        list-style-position: outside;
        margin-left: 15px;
    }

    ol ol, ul ol {
        list-style-type: lower-latin;
        list-style-position: outside;
        margin-left: 15px;
    }

    &.cart-description--search-results {
        position: relative;
        overflow: hidden;
    }

    .cart-description__overflow-indicator {
        position: absolute;
        height: 30px;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1;
        background: linear-gradient(rgba(255, 255, 255, 0), 50%, rgba(255, 255, 255, 1));
    }
}

.cart-description-editor {
    p {
        margin-top: 0;
    }

    .cart-description-editor__headline {
        margin: 0;
        font-size: 1rem;
        border-bottom: none;
    }

    textarea {
        width: 100%;
    }

    .cart-description-editor__tools {
        display: flex;
        justify-content: space-between;
    }
}

.listing-config-description-save {
    display: flex;
    justify-content: flex-end;
}

.listing-toggle {
    display: flex;
    margin: 5px 0 0;
    justify-content: flex-end;

    .listing-toggle__title {
        margin-right: 5px;
    }
}

.listing-note {
    margin-right: 10px;
    align-self: center;
    text-align: right;
    color: #808080;

    &.listing-note--error {
        color: #f00;
    }
}

.cart-static-status {
    display: flex;
    justify-content: center;
    padding: 2px 10px;
    font-size: 0.9rem;
    color: #606060;
    border-bottom: 1px solid #a0a0a0;
}

.cart-static-controls {
    display: flex;
    align-items: center;
    gap: 3px;
    padding-top: 3px;
    padding-right: 3px;
    padding-bottom: 3px;

    .batch-download-actuator {
        align-self: stretch;

        button {
            height: 100%;
            margin: 0;
        }
    }
}

.cart-assembly-selector {
    display: flex;
    justify-content: center;

    label {
        font-weight: bold;
        font-size: 1.2rem;
    }
}
