/* CART, ORDER AND PAYMENT RESULT (cart/index, cart/order, payment/result, payment/thankyou)
   Layers over main.css and style-page.css (for .specsLabel and .textField).
   Items are white cards; the next step happens in a green 10% summary panel under
   a 20px black bar, as in the license panel. */

/* ---------- cart item: a white card, its license panel underneath ---------- */


.cartItem {
    grid-column: span 10;
    min-width: 0;
}

.cartCard {
    background-color: #FFF;
    padding: 20px;
}

.cartItemHead {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 20px;
    padding-bottom: 8px;
    font-size: 1.125em;
}

.cartItemTotal {
    font-weight: 700;
    text-wrap: nowrap;
}

/* license rows: icon, license, quantity, discounts, price; a hairline above each */
.cartLicense {
    display: grid;
    grid-template-columns: 1.75em minmax(0, 2fr) minmax(0, 3fr) minmax(0, 2fr) minmax(0, 1.2fr);
    grid-template-areas: "icon name qty disc price";
    column-gap: 20px;
    align-items: baseline;
    padding: 8px 0;
    border-top: 1px solid rgba(21, 71, 52, 0.35);
}

.cartLicense > i {
    grid-area: icon;
    text-align: center;
}

.cartLicenseName {
    grid-area: name;
}

.cartLicenseQty {
    grid-area: qty;
}

.cartDiscounts {
    grid-area: disc;
    font-size: 0.875em;
    color: #154734;
}

.cartLicensePrice {
    grid-area: price;
    text-align: right;
    text-wrap: nowrap;
}

.cartItemFoot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(21, 71, 52, 0.35);
}

.cartItemFoot form {
    display: contents;
}

/* small uppercase actions with the icon after the label, as the license panel's Close */
.cartAction {
    font-family: "Inerta", sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #000;
    background: none;
    text-wrap: nowrap;
    flex: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    transition: 200ms;
}

.cartAction:hover {
    color: #154734;
}

.cartAction i {
    margin-left: 10px;
}

/* the edit panel sits flush under its card */
.cartItem .options {
    margin-top: 0;
}

/* ---------- empty cart ---------- */

.cartEmpty {
    grid-column: span 10;
    padding: 40px 0 20px;
}

.cartEmpty p {
    font-size: 2.25em;
}

/* ---------- summary panel: subtotal or order confirmation, and the next step ---------- */

.cartSummary {
    grid-column: 7 / span 4;
    background-color: rgba(21, 71, 52, 0.1);
    border-top: solid 20px #111;
    border-radius: 0 0 10px 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cartTotal {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 20px;
    font-weight: 700;
}

.cartTotal > :last-child {
    font-size: 1.5em;
    text-wrap: nowrap;
}

.cartNotes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.875em;
}

.cartField {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cartField .specsLabel {
    margin-bottom: 0;
}

.cartField p {
    font-size: 0.875em;
}

.cartCheck {
    display: flex;
    gap: 12px;
    align-items: baseline;
    cursor: pointer;
}

.cartCheck input {
    flex: none;
    width: 16px;
    height: 16px;
    margin: 0;
    position: relative;
    top: 2px;
    accent-color: #154734;
    cursor: pointer;
}

.cartCheck a, .cartCheck a:link, .cartCheck a:visited {
    text-decoration: underline;
}

/* the one primary action of the page: a black block, as the buy button, laid flat */
.actionButton {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 15px 18px;
    border: 0;
    background-color: #111;
    color: #FFF;
    font-family: "Inerta", sans-serif;
    font-size: 0.875em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    cursor: pointer;
    transition: background-color 200ms;
}

.actionButton i {
    font-size: 1rem;
}

.actionButton:hover {
    background-color: #093322;
}

.actionButton:focus-visible {
    outline: 2px solid #154734;
    outline-offset: 2px;
}

.actionButton:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.actionButton:disabled:hover {
    background-color: #111;
}

/* the action button as a link (Sign in to order): main.css resets link colour, so it is set again here */
a.actionButton, a.actionButton:link, a.actionButton:visited, a.actionButton:hover, a.actionButton:active {
    color: #FFF;
}


.cartLinks {
    display: flex;
    justify-content: flex-end;
}

/* ---------- payment result (payment/result, payment/thankyou) ----------
   What happened, in large type on the left; the next step in the summary panel on the right. */

.paymentMessage {
    grid-column: span 6;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.paymentMessage > p:first-child {
    font-size: 2.25em;
    text-wrap: balance;
}

.paymentFacts {
    max-width: 480px;
}

/* ---------- order table ---------- */

.orderCard {
    grid-column: span 10;
    background-color: #FFF;
    padding: 20px;
    min-width: 0;
}

.orderTable {
    width: 100%;
    border-collapse: collapse;
}

.orderTable th {
    font-size: 0.875em;
    font-weight: normal;
    color: #154734;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    padding: 0 20px 12px 0;
}

.orderTable td {
    padding: 8px 20px 8px 0;
    border-top: 1px solid rgba(21, 71, 52, 0.35);
    vertical-align: baseline;
}

.orderTable th:last-child, .orderTable td:last-child {
    padding-right: 0;
}

.orderTable .num {
    text-align: right;
    text-wrap: nowrap;
}

.orderTable td i {
    margin-right: 10px;
}

.orderTable .cartDiscounts {
    font-size: 0.875em;
}

.orderTable tfoot td {
    border-top: 1px solid #000;
    padding-top: 20px;
    font-weight: 700;
}

.orderTable tfoot .num {
    font-size: 1.5em;
}

/* ---------- widths ---------- */

@media only screen and (max-width: 1410px) {
    .cartItem, .cartEmpty, .orderCard {
        grid-column: span 8;
    }
    .paymentMessage {
        grid-column: span 4;
    }
    .cartSummary {
        grid-column: 5 / span 4;
    }
}

@media only screen and (max-width: 1150px) {
    .cartItem, .cartEmpty, .orderCard, .paymentMessage {
        grid-column: span 6;
    }
    .cartSummary {
        grid-column: 3 / span 4;
    }
    .cartLicense {
        grid-template-columns: 1.75em minmax(0, 2fr) minmax(0, 3fr) minmax(0, 1.4fr);
        grid-template-areas:
            "icon name qty price"
            ".    disc disc .";
    }
}

/* 5 columns: the order table turns into stacked label/value rows */
@media only screen and (max-width: 880px) {
    .cartItem, .cartEmpty, .orderCard, .paymentMessage {
        grid-column: span 5;
    }
    .cartSummary {
        grid-column: span 5;
    }
    .orderTable thead {
        display: none;
    }
    .orderTable tr {
        display: block;
        padding: 12px 0;
        border-top: 1px solid #000;
    }
    .orderTable tbody tr:first-child {
        border-top: 0;
        padding-top: 0;
    }
    .orderTable td {
        display: flex;
        justify-content: space-between;
        gap: 20px;
        padding: 6px 0;
        border-top: 0;
        text-align: right;
    }
    .orderTable td::before {
        content: attr(data-label);
        font-size: 0.875rem;
        color: #154734;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        text-align: left;
    }
    .orderTable tbody td:first-child {
        display: block;
        text-align: left;
    }
    .orderTable tbody td:first-child::before {
        content: none;
    }
    .orderTable tfoot tr {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 20px;
    }
    .orderTable tfoot td {
        padding: 0;
        border-top: 0;
    }
    .orderTable tfoot td::before {
        content: none;
    }
}

@media only screen and (max-width: 760px) {
    .cartItem, .cartEmpty, .orderCard, .cartSummary, .paymentMessage {
        grid-column: span 4;
    }
    /* clear of the hanging logo, as the page title is */
    a.back {
        margin-left: 40px;
    }
    .cartItemHead {
        flex-direction: column;
        gap: 4px;
    }
    .cartLicense {
        grid-template-columns: 1.75em minmax(0, 1fr) auto;
        grid-template-areas:
            "icon name price"
            ".    qty  ."
            ".    disc .";
        row-gap: 2px;
    }
    .cartLicenseQty {
        font-size: 0.875em;
    }
}
