/*
 * OLC Schedule Multiple Shipments - the cart line panel (Content/js/olc.schedule-shipments.js)
 * OnlineComponents.com theme copy. The other themes have their own copy in this plugin's Themes/<theme>/Content/css; only the
 * brand block below and the brand layout rules (fonts, link indent) differ between them.
 */

.olc-sch,
.olc-sch-blockers,
.olc-sch-toast {
    /* brand */
    --olc-sch-ink: #333333;
    --olc-sch-muted: #545C66;
    --olc-sch-link: #0548A8;
    --olc-sch-head: #002A49;
    --olc-sch-button: #076AF5;
    --olc-sch-button-off: #9D9EA1;
    --olc-sch-error: #FF4848;
    --olc-sch-ok: #06803F;
    --olc-sch-panel: #F2F3F5;
    --olc-sch-border: #E2E4E7;
    --olc-sch-input-border: #C0C8CE;
    --olc-sch-remove: #C0C8CE;
    --olc-sch-hatch: #E2E4E7;
    --olc-sch-color-1: #076AF5;
    --olc-sch-color-2: #002A49;
    --olc-sch-color-3: #545C66;
    --olc-sch-color-4: #9D9EA1;
    --olc-sch-toast: #002A49;
    --olc-sch-radius: 4px;
    --olc-sch-display-font: VinylOT, "Oswald", "Arial Narrow", sans-serif;
    --olc-sch-body-font: SourceSansPro, "Source Sans Pro", "Segoe UI", Arial, sans-serif;
}

/* ---- the line area ---- */
.olc-sch,
.olc-sch *,
.olc-sch-blockers,
.olc-sch-toast {
    box-sizing: border-box;
}

.olc-sch {
    font-family: var(--olc-sch-body-font);
    color: var(--olc-sch-ink);
    text-align: left;
    padding: 4px 0 12px;
}

.olc-sch--open {
    padding: 4px 0 16px;
}

/* the link on its own sits under the line's availability, quantity and price, like the old link */
@media (min-width: 992px) {
    .olc-sch--olc.olc-sch--link {
        padding-left: 33.333%;
    }
}

.olc-sch [hidden] {
    display: none !important;
}

.olc-sch svg {
    flex: none;
}

.olc-sch-link {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    color: var(--olc-sch-link);
    font-weight: 700;
    font-size: 14px;
    text-align: left;
}

.olc-sch-link:hover:not(:disabled) {
    text-decoration: underline;
}

.olc-sch-link:disabled {
    cursor: default;
}

.olc-sch-mini {
    background: none;
    border: 0;
    padding: 0;
    color: var(--olc-sch-link);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.olc-sch-mini:disabled {
    color: var(--olc-sch-muted);
    cursor: not-allowed;
}

.olc-sch :focus-visible,
.olc-sch-blockers :focus-visible {
    outline: 2px solid var(--olc-sch-link);
    outline-offset: 2px;
}

/* ---- applied schedule ---- */
.olc-sch-applied {
    font-size: 13px;
    padding: 8px 10px;
    margin-left: -10px;
    border-radius: var(--olc-sch-radius);
}

.olc-sch-applied-head {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    align-items: center;
}

.olc-sch-applied-title {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    font-weight: 700;
    color: var(--olc-sch-ok);
}

.olc-sch-applied.is-warn {
    background: var(--olc-sch-panel);
    box-shadow: inset 3px 0 0 var(--olc-sch-error);
}

.olc-sch-applied.is-warn .olc-sch-applied-title {
    color: var(--olc-sch-ink);
}

.olc-sch-applied.is-warn .olc-sch-applied-title svg {
    color: var(--olc-sch-error);
}

.olc-sch-applied-msg p {
    margin: 4px 0 0;
}

.olc-sch-applied.is-flash {
    animation: olc-sch-flash 1.8s ease-out;
}

@keyframes olc-sch-flash {
    0%, 40% { background: var(--olc-sch-panel); }
    100% { background: transparent; }
}

.olc-sch-list {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 22px;
}

.olc-sch-list li {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.olc-sch-swatch {
    width: 10px;
    height: 10px;
    flex: none;
    background: var(--olc-sch-color);
}

/* ---- panel ---- */
.olc-sch-panel {
    background: var(--olc-sch-panel);
    border: 1px solid var(--olc-sch-border);
    border-radius: var(--olc-sch-radius);
    padding: 18px 20px;
}

.olc-sch-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.olc-sch-head h4 {
    margin: 0;
    font-family: var(--olc-sch-display-font);
    font-weight: 400;
    text-transform: uppercase;
    font-size: 22px;
    line-height: 1.1;
    color: var(--olc-sch-head);
}

.olc-sch-head h4:focus {
    outline: none;
}

.olc-sch-head p {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--olc-sch-muted);
}

.olc-sch-close {
    width: 30px;
    height: 30px;
    border: 0;
    background: none;
    color: var(--olc-sch-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

.olc-sch-close:hover {
    color: var(--olc-sch-ink);
}

.olc-sch-notice {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-top: 12px;
    padding: 10px 12px;
    background: #FFFFFF;
    border-left: 4px solid var(--olc-sch-link);
    font-size: 13px;
}

.olc-sch-notice svg {
    color: var(--olc-sch-link);
    margin-top: 2px;
}

.olc-sch-notice.is-changed {
    border-left-color: var(--olc-sch-error);
}

.olc-sch-notice.is-changed svg {
    color: var(--olc-sch-error);
}

/* ---- ordered / scheduled / left ---- */
.olc-sch-rail {
    position: relative;
    margin-top: 12px;
    background: #FFFFFF;
    border: 1px solid var(--olc-sch-border);
    border-radius: var(--olc-sch-radius);
    padding: 14px 16px;
}

.olc-sch-tally {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

.olc-sch-tally dt {
    font-size: 12px;
    font-weight: 600;
    color: var(--olc-sch-muted);
}

.olc-sch-tally dd {
    margin: 2px 0 0;
    font-family: var(--olc-sch-display-font);
    font-size: 30px;
    line-height: 1;
    overflow-wrap: anywhere;
    color: var(--olc-sch-head);
}

.olc-sch-left.is-done dd {
    color: var(--olc-sch-ok);
}

.olc-sch-left.is-over dd {
    color: var(--olc-sch-error);
}

.olc-sch-bar {
    display: flex;
    position: relative;
    height: 14px;
    margin-top: 12px;
    background: #FFFFFF;
    border: 1px solid var(--olc-sch-border);
    border-radius: var(--olc-sch-radius);
    overflow: hidden;
}

.olc-sch-bar-part {
    height: 100%;
    border-right: 2px solid #FFFFFF;
    background: var(--olc-sch-color);
    transition: width .2s;
}

.olc-sch-bar-rest {
    flex: 1;
    background: repeating-linear-gradient(-45deg, var(--olc-sch-hatch) 0 4px, #FFFFFF 4px 9px);
}

.olc-sch-bar-over {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--olc-sch-error);
}

.olc-sch-rail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 10px;
    font-size: 13px;
    align-items: center;
}

/* the line's quantity is being changed in place (olc.cart-quantity.js): the tally is about to change */
.olc-sch-busy {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #FFFFFF;
    border-radius: var(--olc-sch-radius);
    font-size: 14px;
    font-weight: 600;
    color: var(--olc-sch-ink);
}

/* ---- shipments ---- */
.olc-sch-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.olc-sch-row {
    display: grid;
    grid-template-columns: 92px 110px 172px 32px;
    justify-content: start;
    gap: 4px 14px;
    align-items: start;
    background: #FFFFFF;
    border: 1px solid var(--olc-sch-border);
    border-radius: var(--olc-sch-radius);
    padding: 10px 12px;
}

.olc-sch-row.has-error {
    border-color: var(--olc-sch-error);
    box-shadow: inset 3px 0 0 var(--olc-sch-error);
}

.olc-sch-index {
    align-self: center;
    font-family: var(--olc-sch-display-font);
    font-size: 16px;
    line-height: 1.15;
    text-transform: uppercase;
    color: var(--olc-sch-head);
    padding-left: 8px;
    border-left: 4px solid var(--olc-sch-color);
}

.olc-sch-field {
    min-width: 0;
}

.olc-sch-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--olc-sch-muted);
    margin: 0 0 3px;
}

.olc-sch-field input {
    width: 100%;
    height: 32px;
    border: 1px solid var(--olc-sch-input-border);
    border-radius: var(--olc-sch-radius);
    background: #FFFFFF;
    color: var(--olc-sch-ink);
    padding: 0 8px;
    font-size: 14px;
    font-family: inherit;
}

.olc-sch-field input[aria-invalid="true"] {
    border-color: var(--olc-sch-error);
    box-shadow: inset 0 0 0 1px var(--olc-sch-error);
}

.olc-sch-field input:disabled {
    color: var(--olc-sch-muted);
    background: var(--olc-sch-panel);
}

.olc-sch-weekday {
    display: block;
    min-height: 15px;
    margin-top: 2px;
    font-size: 11px;
    color: var(--olc-sch-muted);
}

.olc-sch-remove {
    margin-top: 19px;
    width: 32px;
    height: 32px;
    border: 0;
    background: none;
    color: var(--olc-sch-remove);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.olc-sch-remove:hover:not(:disabled) {
    color: var(--olc-sch-error);
}

.olc-sch-remove:disabled {
    color: var(--olc-sch-border);
    cursor: not-allowed;
}

.olc-sch-row-errors {
    grid-column: 2 / -1;
}

.olc-sch-row-errors:empty,
.olc-sch-line-errors:empty {
    display: none;
}

.olc-sch-row-errors p,
.olc-sch-line-errors p {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    margin: 0;
    font-size: 13px;
    color: var(--olc-sch-ink);
}

.olc-sch-row-errors p + p,
.olc-sch-line-errors p + p {
    margin-top: 2px;
}

.olc-sch-row-errors svg,
.olc-sch-line-errors svg {
    color: var(--olc-sch-error);
    margin-top: 2px;
}

.olc-sch-line-errors {
    margin-top: 10px;
}

.olc-sch-add {
    margin-top: 10px;
    background: none;
    border: 0;
    padding: 0;
    color: var(--olc-sch-link);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.olc-sch-add:disabled {
    color: var(--olc-sch-muted);
    cursor: not-allowed;
}

/* ---- footer ---- */
.olc-sch-foot {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--olc-sch-border);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.olc-sch-status {
    margin: 0;
    display: inline-flex;
    gap: 6px;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
}

.olc-sch-status.is-ok {
    color: var(--olc-sch-ok);
}

.olc-sch-status.is-bad svg {
    color: var(--olc-sch-error);
}

.olc-sch-status.is-checking {
    color: var(--olc-sch-muted);
}

.olc-sch-foot-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    align-items: center;
}

.olc-sch-apply {
    background: var(--olc-sch-button);
    color: #FFFFFF;
    border: 0;
    border-radius: var(--olc-sch-radius);
    height: 40px;
    padding: 0 22px;
    font-family: var(--olc-sch-display-font);
    font-size: 19px;
    text-transform: uppercase;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.olc-sch-apply:disabled {
    background: var(--olc-sch-button-off);
    cursor: not-allowed;
}

.olc-sch-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--olc-sch-border);
    border-top-color: var(--olc-sch-link);
    border-radius: 50%;
    display: inline-block;
    flex: none;
    animation: olc-sch-spin .7s linear infinite;
}

.olc-sch-apply .olc-sch-spinner {
    border-color: #FFFFFF;
    border-top-color: transparent;
}

@keyframes olc-sch-spin {
    to { transform: rotate(360deg); }
}

/* ---- shipment colors (bar, swatches, shipment labels) ---- */
.olc-sch-color-1 { --olc-sch-color: var(--olc-sch-color-1); }
.olc-sch-color-2 { --olc-sch-color: var(--olc-sch-color-2); }
.olc-sch-color-3 { --olc-sch-color: var(--olc-sch-color-3); }
.olc-sch-color-4 { --olc-sch-color: var(--olc-sch-color-4); }

/* ---- the line's availability while it refreshes after Apply Schedule / Ship All Together ---- */
[data-olc-schedule-availability].olc-sch-availability--busy {
    position: relative;
    min-height: 24px;
}

[data-olc-schedule-availability].olc-sch-availability--busy::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(255, 255, 255, .75);
}

[data-olc-schedule-availability].olc-sch-availability--busy::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #E2E4E7;
    border-top-color: #0548A8;
    border-radius: 50%;
    animation: olc-sch-spin .7s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
    [data-olc-schedule-availability].olc-sch-availability--busy::after {
        animation-duration: 2.4s;
    }
}

/* ---- Secure Checkout while a shipment schedule blocks it (the site's button colors are !important) ---- */
#checkout[data-olc-sch-disabled],
#checkoutAriba[data-olc-sch-disabled] {
    background: #9D9EA1 !important;
    border-color: #9D9EA1 !important;
    color: #FFFFFF !important;
    opacity: 1;
    cursor: not-allowed;
}

/* ---- above Secure Checkout ---- */
.olc-sch-blockers {
    display: flex;
    gap: 8px;
    margin: 12px 0;
    font-family: var(--olc-sch-body-font);
    font-size: 13px;
    color: var(--olc-sch-ink);
    text-align: left;
}

.olc-sch-blockers-icon {
    color: var(--olc-sch-error);
    margin-top: 2px;
}

.olc-sch-blockers p {
    margin: 0;
    font-weight: 700;
}

.olc-sch-blockers ul {
    margin: 2px 0 0;
    padding-left: 16px;
}

.olc-sch-blockers li {
    margin: 0;
}

/* ---- confirmation ---- */
.olc-sch-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 10000;
    display: flex;
    gap: 8px;
    align-items: center;
    max-width: calc(100% - 32px);
    padding: 12px 18px;
    background: var(--olc-sch-toast);
    color: #FFFFFF;
    font-family: var(--olc-sch-body-font);
    font-size: 15px;
    border-radius: var(--olc-sch-radius);
    transform: translate(-50%, 12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
}

.olc-sch-toast.is-shown {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ---- below tablet width (phones, also held sideways): quantity and date share a row under the shipment label.
        The one-line row needs about 480px, more than the panel has between 576px and 660px wide ---- */
@media (max-width: 767.98px) {
    .olc-sch-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 32px;
    }

    .olc-sch-index {
        grid-column: 1 / -1;
    }

    .olc-sch-row-errors {
        grid-column: 1 / -1;
    }
}

/* ---- small screens ---- */
@media (max-width: 575.98px) {
    .olc-sch-panel {
        padding: 14px 12px;
    }

    /* phones: room for the whole date (mm/dd/yyyy and its picker) beside a 9-digit quantity */
    .olc-sch-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) 32px;
        column-gap: 8px;
    }

    .olc-sch-field input {
        padding: 0 6px;
    }

    .olc-sch-tally dd {
        font-size: 24px;
    }

    .olc-sch-foot-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ---- the narrowest phones (320px): quantity and date each get a line, remove sits beside the shipment label ---- */
@media (max-width: 359.98px) {
    .olc-sch-row {
        grid-template-columns: minmax(0, 1fr) 32px;
    }

    .olc-sch-index,
    .olc-sch-field {
        grid-column: 1;
    }

    .olc-sch-remove {
        grid-column: 2;
        grid-row: 1;
        margin-top: 0;
        align-self: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .olc-sch-spinner {
        animation-duration: 2.4s;
    }

    .olc-sch-applied.is-flash {
        animation: none;
    }

    .olc-sch-toast,
    .olc-sch-bar-part {
        transition: none;
    }
}
