/* ==========================================================================
   Cart page (GRCIQ) - Views/ShoppingCart/YourCart.aspx
   Colours: navy #184b71 (brand), ink #12263a, body #374151, muted #6b7280,
            lines #e6ebf1, soft fill #f7f9fc, action orange #ee6331, green #1e7a46
   Materialize styles all text inputs, so input rules use !important.
   ========================================================================== */

/* Top spacing comes from the navy title band (same site classes/placement as the training details page) */
/* Even spacing around the whole page (!important: the site's .wrapper / .body-wrapper also set spacing).
   The site header is fixed and this page starts underneath it, so margin-top clears the header. */
.cart-page {
    box-sizing: border-box;
    margin-top: 70px !important;
    padding: 44px 64px 64px !important;
}

/* Site-wide rules float/size some icons (e.g. custom.css i.fa.fa-lock: float left, width 6%, margin-top 10px).
   Reset them on this page so every icon sits inline with its text. */
.cart-page i.fa {
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    position: static !important;
}

/* Page title: plain dark text (no background) with an item-count pill */
.cart-page .cart-band {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 24px !important;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    color: #12263a !important;
    font-size: 28px !important;
    font-weight: 700;
    line-height: 1.2 !important;
}

.cart-band__count {
    padding: 3px 12px;
    border-radius: 999px;
    background: #eef4f9;
    color: #184b71;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
}

/* Two columns: items + sticky summary */
.cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    align-items: start;
}

.cart-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

/* --------------------------------------------------------------------------
   Items
   -------------------------------------------------------------------------- */
.cart-lines {
    overflow: hidden;
    border: 1px solid #e6ebf1;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(16, 24, 40, 0.05);
}

.cart-line {
    display: flex;
    gap: 22px;
    padding: 22px 24px;
}

    .cart-line + .cart-line {
        border-top: 1px solid #eef1f5;
    }

.cart-line__media {
    position: relative;
    flex: 0 0 200px;
    height: 138px;
    overflow: hidden;
    border-radius: 10px;
    background: linear-gradient(135deg, #e8eff6 0%, #f4f7fb 100%);
}

    .cart-line__media img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Shown when the training image is missing */
    .cart-line__media--empty:after {
        content: "\f03d";
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        color: #b6c4d4;
        font-family: FontAwesome;
        font-size: 30px;
    }

.cart-line__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.cart-line__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.cart-line__title {
    display: block;
    color: #12263a !important;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
}

    .cart-line__title:hover {
        color: #184b71 !important;
        text-decoration: underline !important;
    }

.cart-line__package {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    background: #eef4f9;
    color: #184b71;
    font-size: 13px;
    font-weight: 600;
}

.cart-line__remove {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #c53030;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

    .cart-line__remove i.fa {
        color: #c53030;
        font-size: 16px;
    }

    .cart-line__remove:hover,
    .cart-line__remove:focus {
        background: #fdf2f2;
        color: #9b1c1c;
        outline: none;
    }

.cart-line__bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Quantity stepper */
.cart-qty {
    display: inline-flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid #dfe5ec;
    border-radius: 10px;
    background: #fff;
}

    .cart-page .cart-qty input.cart-qty__btn {
        width: 38px !important;
        height: 38px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: #f7f9fc !important;
        box-shadow: none !important;
        color: #184b71 !important;
        font-size: 18px !important;
        font-weight: 700;
        line-height: 38px !important;
        cursor: pointer;
    }

        .cart-page .cart-qty input.cart-qty__btn:hover {
            background: #e8eff6 !important;
        }

    .cart-page .cart-qty input.cart-qty__input {
        width: 46px !important;
        height: 38px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-right: 1px solid #dfe5ec !important;
        border-left: 1px solid #dfe5ec !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        color: #12263a !important;
        font-size: 15px !important;
        font-weight: 600;
        text-align: center;
    }

/* Price */
.cart-line__price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    padding: 6px 4px 2px 16px;
    line-height: 1.3;
}

.cart-line__price-was {
    color: #9aa3ae;
    font-size: 15px;
    text-decoration: line-through;
}

.cart-line__price-now {
    color: #12263a;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 700;
}

.cart-line__price-each {
    color: #6b7280;
    font-size: 14px;
    margin-top: 2px;
}

/* DVD/USB physical type */
.cart-line__physical {
    margin: 0;
}

    .cart-line__physical label {
        display: block;
        margin-bottom: 4px;
        color: #374151 !important;
        font-size: 13px !important;
        font-weight: 600;
    }

    .cart-line__physical .custom-select {
        max-width: 320px;
    }

        .cart-line__physical .custom-select.err select,
        .cart-line__physical .custom-select.err input {
            border-color: #e57373 !important;
        }

/* --------------------------------------------------------------------------
   Discount code
   -------------------------------------------------------------------------- */
.cart-discount {
    padding: 16px 18px;
    border: 1px solid #e6ebf1;
    border-radius: 14px;
    background: #fff;
}

.cart-page .cart-discount__label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #12263a !important;
    font-size: 15px !important;
    font-weight: 600;
}

    .cart-discount__label i.fa {
        color: #ee6331;
    }

.cart-discount__form {
    display: flex;
    gap: 10px;
    max-width: 480px;
}

.cart-page .cart-discount__form input#txtdiscountcode {
    box-sizing: border-box !important;
    flex: 1 1 auto;
    height: 44px !important;
    margin: 0 !important;
    padding: 0 14px !important;
    border: 1px solid #dfe5ec !important;
    border-radius: 10px !important;
    background: #f7f9fc !important;
    box-shadow: none !important;
    color: #12263a !important;
    font-size: 15px !important;
    text-transform: uppercase;
}

    .cart-page .cart-discount__form input#txtdiscountcode::placeholder {
        color: #a0a8b3;
        text-transform: none;
    }

    .cart-page .cart-discount__form input#txtdiscountcode:focus {
        border-color: #184b71 !important;
        background: #fff !important;
        box-shadow: 0 0 0 3px rgba(24, 75, 113, 0.15) !important;
    }

/* md-redesign.css makes .field-validation-error position:absolute; keep messages under their field */
.cart-page .field-validation-error {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
}

.cart-discount .field-validation-error,
.cart-line__physical .field-validation-error {
    display: block;
    margin-top: 6px;
    color: #c53030;
    font-size: 13px;
}

.cart-discount__applied {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: #1e7a46;
    font-size: 14px;
    font-weight: 600;
}

    .cart-discount__applied i.fa {
        font-size: 18px;
    }

.cart-discount__remove {
    margin-left: auto;
    color: #c53030 !important;
    font-size: 13px;
    font-weight: 700;
}

    .cart-discount__remove:hover {
        text-decoration: underline !important;
    }

/* Continue shopping: navy outline button */
.cart-continue {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    align-self: flex-start;
    height: 42px;
    padding: 0 20px;
    border: 1px solid #184b71;
    border-radius: 10px;
    background: #fff;
    color: #184b71 !important;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

    .cart-continue:hover,
    .cart-continue:focus {
        background: #eef4f9;
        box-shadow: 0 2px 8px rgba(24, 75, 113, 0.15);
        outline: none;
    }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.cart-page .cart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 44px;
    padding: 0 20px;
    border: 0;
    text-transform: none !important;
    letter-spacing: 0;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.cart-page .cart-btn--primary {
    width: 100%;
    height: 42px;
    padding: 0 16px;
    background: #ee6331;
    box-shadow: 0 4px 12px rgba(238, 99, 49, 0.25);
    color: #fff !important;
    font-size: 15px;
}

    .cart-page .cart-btn--primary:hover,
    .cart-page .cart-btn--primary:focus {
        background: #d9541f;
        box-shadow: 0 8px 22px rgba(238, 99, 49, 0.38);
        outline: none;
        transform: translateY(-1px);
    }

/* Apply discount: savings green (matches the green discount amount in the Order summary) */
.cart-page .cart-btn--secondary {
    background: #16a34a;
    box-shadow: 0 3px 10px rgba(22, 163, 74, 0.25);
    color: #fff !important;
}

    .cart-page .cart-btn--secondary:hover,
    .cart-page .cart-btn--secondary:focus {
        background: #15803d;
        box-shadow: 0 4px 12px rgba(21, 128, 61, 0.3);
        outline: none;
    }

/* --------------------------------------------------------------------------
   Order summary
   -------------------------------------------------------------------------- */
.cart-summary {
    position: sticky;
    top: 100px; /* below the fixed site header */
    padding: 22px;
    border: 1px solid #e6ebf1;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(16, 24, 40, 0.06);
}

.cart-page .cart-summary__title {
    margin: 0 0 16px !important;
    color: #12263a !important;
    font-size: 19px !important;
    font-weight: 700;
}

.cart-summary__row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    color: #4b5563;
    font-size: 17px;
}

    .cart-summary__row span:last-child {
        color: #12263a;
        font-weight: 600;
    }

.cart-summary__row--discount span:last-child {
    color: #1e7a46;
}

.cart-summary__total {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 14px 0 14px;
    padding-top: 14px;
    border-top: 1px dashed #d5dde6;
    color: #12263a;
    font-size: 17px;
    align-items: baseline;
    font-weight: 700;
}

    .cart-summary__total span:last-child {
        font-size: 19px;
    }

/* Instore credit */
.cart-summary__credit {
    margin-bottom: 18px;
    padding: 12px;
    border-radius: 10px;
    background: #f7f9fc;
}

.cart-page .cart-summary__credit-label {
    display: block;
    margin: 4px 0 6px;
    color: #374151 !important;
    font-size: 14px !important;
    font-weight: 600;
}

.cart-summary__credit-input {
    position: relative;
    display: flex;
    align-items: center;
}

    .cart-summary__credit-input span {
        position: absolute;
        left: 12px;
        color: #6b7280;
        font-weight: 600;
    }

    .cart-page .cart-summary__credit-input input#txtInstoreAmount {
        box-sizing: border-box !important;
        width: 100% !important;
        height: 42px !important;
        margin: 0 !important;
        padding: 0 12px 0 26px !important;
        border: 1px solid #dfe5ec !important;
        border-radius: 10px !important;
        background: #fff !important;
        box-shadow: none !important;
        color: #12263a !important;
        font-size: 15px !important;
    }

/* Trust notes */
.cart-summary__trust {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 18px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

    .cart-summary__trust li {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        color: #4b5563;
        font-size: 15px;
        font-weight: 500;
        list-style: none;
    }

        .cart-summary__trust li i.fa {
            color: #1e7a46;
            font-size: 17px;
        }

/* --------------------------------------------------------------------------
   Empty cart
   -------------------------------------------------------------------------- */
.cart-empty {
    max-width: 520px;
    margin: 30px auto;
    padding: 44px 28px;
    border: 1px solid #e6ebf1;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(16, 24, 40, 0.05);
    text-align: center;
}

.cart-empty__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    margin-bottom: 18px;
    border-radius: 50%;
    background: #eef4f9;
    color: #184b71;
    font-size: 32px;
}

.cart-page .cart-empty__title {
    margin: 0 0 8px !important;
    color: #12263a !important;
    font-size: 24px !important;
    font-weight: 700;
}

.cart-page .cart-empty__text {
    margin: 0 0 22px !important;
    color: #6b7280 !important;
    font-size: 15px;
    text-align: center !important;
}

.cart-page .cart-empty__btn {
    width: auto;
    padding: 0 28px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media only screen and (max-width: 991px) {
    .cart-page {
        padding: 32px 32px 48px !important;
    }

    .cart-layout {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
    }
}

@media only screen and (max-width: 576px) {
    .cart-page {
        padding: 24px 20px 36px !important;
    }

    .cart-page .cart-band {
        font-size: 24px !important;
    }

    .cart-line {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }

    .cart-line__media {
        flex: none;
        width: 100%;
        height: 200px;
    }

        .cart-line__media img {
            object-fit: contain; /* full-width box is wider than the image: show it whole */
        }

    .cart-discount__form {
        max-width: none;
    }
}
