/* Cart page — modern layout */
.cart-page {
    background: #f4f6f9;
}

/* Neutralise legacy course-list styles on this page */
.cart-page .cart-item-card.cbox-5 {
    border-bottom: none;
    margin-bottom: 0;
}

.cart-page .cart-item-card.cbox-5:hover {
    transform: none;
}

.cart-page .cart-item-card .cbox-5-price,
.cart-page .cart-item-card .cbox-5-txt,
.cart-page .cart-item-card .instructor-detail,
.cart-page .cart-item-card .original-price {
    float: none !important;
    width: auto !important;
    max-width: 100%;
    padding: 0 !important;
    margin: 0;
    text-align: left !important;
}

.cart-page .cart-item-card .cbox-5-price .course-price,
.cart-page .cart-item-card .cbox-5-txt .course-price {
    display: inline;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    margin: 0;
}

.cart-page .cart-item-card .cbox-5-price .old-price {
    font-size: inherit;
}

.cart-page-intro {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e8ebf0;
}

.cart-page-intro__title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: #1f2937;
}

.cart-page-intro__subtitle {
    margin: 6px 0 0;
    font-size: 0.95rem;
    color: #6b7280;
}

.cart-page-body {
    padding: 28px 0 48px;
}

.cart-page-body > .container {
    max-width: 1320px;
    width: 100%;
}

.cart-page-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cart-page-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.cart-page-summary {
    width: 100%;
}

.cart-item-card {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 20px 24px;
    align-items: start;
    padding: 22px 24px;
    background: #fff;
    border: 1px solid #e8ebf0;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    overflow: hidden;
    min-width: 0;
    height: auto;
}

.cart-item-card:hover {
    border-color: #dbeafe;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.cart-item-card__media img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

.cart-item-card__body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.cart-item-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.cart-item-card__heading {
    min-width: 0;
    flex: 1;
}

.cart-item-card__title {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.cart-item-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 16px;
    font-size: 0.875rem;
    color: #6b7280;
}

.cart-item-card__meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cart-item-card__meta strong {
    color: #4b5563;
    font-weight: 600;
}

.cart-item-card__pricing {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.25fr) minmax(0, 1.15fr) minmax(132px, 0.9fr) minmax(0, 1.05fr);
    gap: 12px 20px;
    width: 100%;
    min-width: 0;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.cart-qty-stepper {
    display: inline-flex;
    align-items: center;
    gap: 0;
    max-width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    overflow: hidden;
    background: #fff;
}

.cart-qty-stepper.is-busy {
    opacity: 0.65;
    pointer-events: none;
}

.cart-qty-stepper__btn {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border: 0;
    background: #f8fafc;
    color: #111827;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.cart-qty-stepper__btn:hover {
    background: #eef2ff;
    color: #1d4ed8;
}

.cart-qty-stepper__value {
    min-width: 22px;
    padding: 0 4px;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
}

.cart-item-card__price-col {
    min-width: 0;
    max-width: 100%;
}

.cart-item-card__label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #9ca3af;
    white-space: nowrap;
    line-height: 1.3;
}

.cart-item-card__value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.4;
    white-space: nowrap;
}

.cart-item-card__value .old-price {
    display: block;
    margin-left: 0;
    margin-top: 2px;
    font-size: 0.8rem;
    font-weight: 400;
    color: #9ca3af;
    text-decoration: line-through;
}

.cart-item-card__payment-badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 5px 10px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #353556;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}

.cart-item-card__payment-badge.is-installment {
    background: #eff6ff;
    color: #1d4ed8;
}

.cart-item-card__actions {
    flex: 0 0 auto;
}

.cart-item-card__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff;
    color: #b91c1c;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.cart-item-card__remove:hover {
    background: #fef2f2;
    border-color: #f87171;
    color: #991b1b;
}

.cart-summary-card {
    position: static;
    width: 100%;
    padding: 24px;
    background: #fff;
    border: 1px solid #e8ebf0;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
}

.cart-summary-card__title {
    margin: 0 0 20px;
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}

.cart-summary-card__grid {
    --summary-side-width: 320px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--summary-side-width);
    column-gap: 32px;
    row-gap: 12px;
    align-items: center;
}

.cart-summary-coupon {
    display: contents;
}

.cart-summary-heading,
.cart-page .cart_total {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    color: #4b5563;
}

.cart-summary-heading {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    min-height: 24px;
}

.cart-page .cart_total {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 24px;
}

.cart-summary-field {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
}

.cart-summary-card__totals-body {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-self: start;
}

.cart-page .cart_discount_total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    color: #047857;
}

.cart-page .cart_grand_total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    padding: 14px 0 0;
    border-top: 2px solid #f1f5f9;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
}

.cart-page #coupon_code input[name="coupon_code"] {
    display: block;
    width: 100%;
    margin: 0;
    padding: 12px 14px;
    min-height: 46px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cart-page #coupon_code input[name="coupon_code"]:focus {
    outline: none;
    border-color: #353556;
    box-shadow: 0 0 0 3px rgba(53, 53, 86, 0.12);
}

.cart-page .apply_coupon_code {
    grid-column: 1;
    grid-row: 3;
    justify-self: end;
    width: var(--summary-side-width);
    min-height: 46px;
    margin: 0;
    box-sizing: border-box;
}

.cart-page .apply_coupon_code:hover {
    background: #c40a0c;
    border-color: #c40a0c;
}

.cart-page .coupon_response {
    margin-top: 10px;
    font-size: 0.8125rem;
    color: #dc2626;
}

.cart-page .applied_coupon_code {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    font-size: 0.875rem;
    color: #166534;
}

.cart-page .applied_coupon_code .remove_applied_coupon {
    margin-left: 8px;
    padding: 0;
    border: 0;
    background: none;
    color: #b91c1c;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

.cart-page__actions {
    grid-column: 2;
    grid-row: 3;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 0;
    width: 100%;
}

.cart-page__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 46px;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none !important;
    text-align: center;
    box-sizing: border-box;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cart-page__btn--primary {
    background: #ea0c0e;
    color: #fff !important;
    border: 1px solid #ea0c0e;
}

.cart-page__btn--primary:hover {
    background: #c40a0c;
    border-color: #c40a0c;
}

.cart-page__btn--secondary {
    background: #fff;
    color: #374151 !important;
    border: 1px solid #d1d5db;
}

.cart-page__btn--secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.cart-page-empty {
    max-width: 420px;
    margin: 0 auto;
    padding: 48px 24px;
    text-align: center;
    background: #fff;
    border: 1px solid #e8ebf0;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

.cart-page-empty__icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-page-empty__icon img {
    width: 48px;
    height: 48px;
    opacity: 0.7;
}

.cart-page-empty h3 {
    margin: 0 0 8px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
}

.cart-page-empty p {
    margin: 0 0 24px;
    color: #6b7280;
    font-size: 0.95rem;
}

.cart-page-payment {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid #e5e7eb;
}

.cart-page-payment .h5-xl {
    margin-bottom: 20px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
}

.cart-page-payment #accordion .card {
    border: 1px solid #e8ebf0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: none;
}

.cart-page-payment #accordion .card-header {
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    padding: 14px 18px;
}

@media (max-width: 991px) {
    .cart-summary-card__grid {
        --summary-side-width: 100%;
        grid-template-columns: 1fr;
        column-gap: 0;
        row-gap: 12px;
    }

    .cart-summary-heading,
    .cart-summary-field,
    .cart-page .apply_coupon_code,
    .cart-page .cart_total,
    .cart-summary-card__totals-body,
    .cart-page__actions {
        grid-column: 1;
        grid-row: auto;
        justify-self: stretch;
        width: 100%;
    }

    .cart-item-card {
        grid-template-columns: 88px minmax(0, 1fr);
    }

    .cart-item-card__media img {
        width: 88px;
        height: 88px;
    }

    .cart-item-card__pricing {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px 18px;
    }

    .cart-item-card__label,
    .cart-item-card__value,
    .cart-item-card__payment-badge {
        white-space: normal;
    }

    .cart-page .apply_coupon_code {
        width: 100%;
    }

    .cart-page-intro__title {
        font-size: 1.5rem;
    }

    .cart-page__btn {
        width: 100%;
    }
}

@media (max-width: 575px) {
    .cart-page-body {
        padding: 20px 0 32px;
    }

    .cart-page-intro {
        margin-bottom: 16px;
        padding-bottom: 14px;
    }

    .cart-page-intro__title {
        font-size: 1.35rem;
    }

    .cart-item-card {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 14px;
    }

    .cart-item-card__media img {
        width: 100%;
        height: 160px;
    }

    .cart-item-card__pricing {
        grid-template-columns: 1fr 1fr;
        gap: 10px 12px;
    }

    .cart-item-card__title {
        font-size: 1rem;
    }

    .cart-summary-card {
        padding: 18px;
    }

    .cart-page-payment {
        margin-top: 24px;
        padding-top: 24px;
    }

    .cart-page-payment .h5-xl {
        font-size: 1.1rem;
    }
}
