/* ==========================================================================
   Shopping Cart Page Styles (FleetCart Modernized)
   ========================================================================== */

.shopping-cart-wrap {
    padding: 24px 0 60px;
    min-height: 60vh;
}

.shopping-cart-wrap .container {
    max-width: 1320px;
    width: 100%;
}

@media screen and (max-width: 992px) {
    .shopping-cart-wrap {
        padding: 16px 0 45px;
    }
}

/* On mobile / tablet, maximize usable screen width */
@media screen and (max-width: 768px) {
    .shopping-cart-wrap {
        padding: 10px 0 35px;
    }
    .shopping-cart-wrap .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

@media screen and (max-width: 380px) {
    .shopping-cart-wrap .container {
        padding-left: 6px !important;
        padding-right: 6px !important;
    }
}

/* --------------------------------------------------------------------------
   Steps (My Cart -> Checkout -> Order Complete)
   -------------------------------------------------------------------------- */
.steps-wrap {
    margin-bottom: 24px;
}

.step-tabs {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.step-tabs .step-tab {
    position: relative;
    flex: 1;
    max-width: 280px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    color: #475569;
    overflow: hidden;
    user-select: none;
    transition: all 0.2s ease;
}

.step-tabs .step-tab.active {
    background: var(--color-primary, #0758A2);
    border-color: var(--color-primary, #0758A2);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(7, 88, 162, 0.15);
}

.step-tabs .step-tab-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.step-tabs .step-tab-text {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-tabs .step-tab-text .bg-text {
    position: absolute;
    right: -36px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 34px;
    font-weight: 800;
    color: currentColor;
    opacity: 0.15;
    pointer-events: none;
    line-height: 1;
}

/* Mobile: full-width, clean 3-tab segmented progress bar */
@media screen and (max-width: 768px) {
    .steps-wrap {
        margin-bottom: 12px;
        width: 100%;
    }

    .step-tabs {
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        padding: 0;
        margin: 0;
        list-style: none;
        box-sizing: border-box;
    }

    .step-tabs .step-tab {
        flex: 1 1 0;
        height: 32px;
        max-width: none;
        border: 1px solid #e2e8f0;
        background: #ffffff;
        border-radius: 8px;
        padding: 0 4px;
        font-size: 11.5px;
        font-weight: 600;
        color: #64748b;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
        margin: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
    }

    .step-tabs .step-tab.active {
        background: var(--color-primary, #0758A2);
        border-color: var(--color-primary, #0758A2);
        color: #ffffff;
        font-weight: 600;
        box-shadow: 0 2px 4px rgba(7, 88, 162, 0.2);
    }

    .step-tabs .step-tab-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        color: inherit;
        text-decoration: none;
    }

    .step-tabs .step-tab-text {
        display: inline-flex;
        align-items: center;
        font-size: inherit;
    }

    .step-tabs .step-tab-text .bg-text {
        display: none !important;
    }
}

@media screen and (max-width: 360px) {
    .step-tabs .step-tab {
        font-size: 10px;
        height: 30px;
        padding: 0 2px;
    }
}

/* --------------------------------------------------------------------------
   Two-column Layout (Table + Order Summary)
   -------------------------------------------------------------------------- */
.shopping-cart {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    width: 100%;
}

.shopping-cart-inner {
    flex: 1 1 0%;
    min-width: 0;
    width: 100%;
}

.order-summary-wrap {
    width: 360px;
    min-width: 360px;
    flex-shrink: 0;
}

@media screen and (max-width: 992px) {
    .shopping-cart {
        flex-direction: column;
        gap: 16px;
    }
    .order-summary-wrap {
        width: 100%;
        min-width: 0;
    }
}

/* --------------------------------------------------------------------------
   Shopping Cart Table (Desktop > 768px)
   -------------------------------------------------------------------------- */
.table-responsive {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 18px;
    width: 100%;
}

.shopping-cart-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.shopping-cart-table thead th {
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
    text-align: left;
}

.shopping-cart-table thead th:first-child {
    width: 80px;
    text-align: center;
}

.shopping-cart-table thead th:nth-child(3) {
    width: 120px;
    text-align: right;
}

.shopping-cart-table thead th:nth-child(4) {
    width: 140px;
    text-align: center;
}

.shopping-cart-table thead th:nth-child(5) {
    width: 130px;
    text-align: right;
}

.shopping-cart-table thead th:last-child {
    width: 50px;
    text-align: center;
    padding-left: 0;
    padding-right: 14px;
}

.shopping-cart-table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
}

.shopping-cart-table tbody tr:last-child td {
    border-bottom: none;
}

.shopping-cart-table tbody tr {
    transition: background-color 0.15s ease;
}

.shopping-cart-table tbody tr:hover {
    background-color: #fafbfc;
}

.shopping-cart-table tbody td:first-child {
    width: 80px;
    text-align: center;
}

.shopping-cart-table tbody td:nth-child(3) {
    text-align: right;
}

.shopping-cart-table tbody td:nth-child(4) {
    text-align: center;
}

.shopping-cart-table tbody td:nth-child(5) {
    text-align: right;
}

.shopping-cart-table tbody td:last-child {
    text-align: center;
    padding-left: 0;
    padding-right: 14px;
}

/* Hide mobile-only cell labels on desktop */
.shopping-cart-table .cell-label {
    display: none;
}

/* Product thumbnail */
.shopping-cart-table .product-image {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    padding: 3px;
    transition: border-color 0.15s ease;
}

.shopping-cart-table .product-image:hover {
    border-color: var(--color-primary, #0758A2);
}

.shopping-cart-table .product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.shopping-cart-table .product-image .img-placeholder {
    width: 100%;
    height: 100%;
    background: #f1f5f9;
    border-radius: 4px;
}

/* Product title */
.shopping-cart-table .product-name {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
    text-decoration: none;
    transition: color 0.15s ease;
}

.shopping-cart-table .product-name:hover {
    color: var(--color-primary, #0758A2);
}

/* Price typography */
.shopping-cart-table .product-price {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
}

.shopping-cart-table .line-total {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Quantity Stepper (Desktop table)
   -------------------------------------------------------------------------- */
.shopping-cart-table .number-picker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.shopping-cart-table .input-group-quantity {
    display: inline-flex;
    align-items: center;
    height: 32px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.shopping-cart-table .input-group-quantity:hover,
.shopping-cart-table .input-group-quantity:focus-within {
    border-color: var(--color-primary, #0758A2);
    box-shadow: 0 0 0 2px var(--color-primary-soft, rgba(7, 88, 162, 0.12));
}

.shopping-cart-table .btn-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 100%;
    padding: 0;
    border: none;
    background: #f8fafc;
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.shopping-cart-table .btn-number:hover:not(:disabled) {
    background-color: var(--color-primary, #0758A2);
    color: #ffffff;
}

.shopping-cart-table .btn-number:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: #f8fafc;
    color: #94a3b8;
}

.shopping-cart-table .input-quantity {
    width: 38px;
    height: 100%;
    border: none;
    border-left: 1px solid #f1f5f9;
    border-right: 1px solid #f1f5f9;
    background: #ffffff;
    text-align: center;
    font-size: 13.5px;
    font-weight: 600;
    color: #0f172a;
    padding: 0 2px;
    margin: 0;
    outline: none;
    -moz-appearance: textfield;
}

.shopping-cart-table .input-quantity::-webkit-outer-spin-button,
.shopping-cart-table .input-quantity::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* --------------------------------------------------------------------------
   Remove Button (.btn-remove)
   -------------------------------------------------------------------------- */
.shopping-cart-table .btn-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.15s ease;
}

.shopping-cart-table .btn-remove:hover {
    color: #ef4444;
    background-color: #fef2f2;
    border-color: #fee2e2;
}

.shopping-cart-table thead .btn-remove {
    font-size: 18px;
    color: #94a3b8;
}

.shopping-cart-table thead .btn-remove:hover {
    color: #ef4444;
    background-color: #fef2f2;
    border-color: #fee2e2;
}

/* --------------------------------------------------------------------------
   Mobile View (Cards on <= 768px: wide cards, compact height)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 768px) {
    .table-responsive {
        border: none;
        background: transparent;
        box-shadow: none;
        overflow: visible;
        margin-bottom: 10px;
        width: 100%;
    }

    .shopping-cart-table {
        display: block;
        width: 100%;
    }

    .shopping-cart-table thead {
        display: none;
    }

    .shopping-cart-table tbody {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    /* Individual Card Layout — fills wider screen, compact height */
    .shopping-cart-table tbody tr {
        display: grid;
        grid-template-columns: 66px 1fr auto;
        grid-template-rows: auto auto auto;
        grid-template-areas:
            "image name   remove"
            "image price  price"
            "image qty    total";
        column-gap: 12px;
        row-gap: 3px;
        align-items: center;
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        padding: 10px 12px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
        position: relative;
        width: 100%;
        box-sizing: border-box;
    }

    .shopping-cart-table tbody tr:hover {
        background: #ffffff;
    }

    .shopping-cart-table tbody td {
        padding: 0;
        border: none;
        text-align: left;
    }

    /* 1. Image on the left spanning all 3 rows */
    .shopping-cart-table tbody td:nth-child(1) {
        grid-area: image;
        align-self: start;
        width: 66px !important;
        height: 66px !important;
    }

    .shopping-cart-table tbody td:nth-child(1) .product-image {
        width: 66px;
        height: 66px;
        border: 1px solid #f1f5f9;
        border-radius: 8px;
        background: #ffffff;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 3px;
    }

    .shopping-cart-table tbody td:nth-child(1) .product-image img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    /* 2. Product Name on Row 1 */
    .shopping-cart-table tbody td:nth-child(2) {
        grid-area: name;
        align-self: start;
        padding: 0;
    }

    .shopping-cart-table tbody td:nth-child(2) .product-name {
        font-size: 14px;
        font-weight: 600;
        color: #0f172a;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin: 0;
    }

    /* 6. Remove Button on Row 1 (top-right corner) */
    .shopping-cart-table tbody td:nth-child(6) {
        grid-area: remove;
        align-self: start;
        justify-self: end;
        padding: 0;
        line-height: 1;
    }

    .shopping-cart-table tbody td:nth-child(6) .btn-remove {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background: transparent;
        border: none;
        color: #94a3b8;
        font-size: 18px;
        line-height: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        transition: all 0.15s ease;
    }

    .shopping-cart-table tbody td:nth-child(6) .btn-remove:hover {
        color: #ef4444;
        background: #fee2e2;
    }

    /* 3. Unit Price on Row 2 */
    .shopping-cart-table tbody td:nth-child(3) {
        grid-area: price;
        align-self: center;
        display: flex;
        align-items: center;
        padding: 0;
    }

    .shopping-cart-table tbody td:nth-child(3) .cell-label {
        display: none !important;
    }

    .shopping-cart-table tbody td:nth-child(3) .product-price {
        font-size: 13px;
        font-weight: 500;
        color: #64748b;
        line-height: 1.2;
    }

    /* 4. Quantity Stepper on Row 3 (bottom-left) */
    .shopping-cart-table tbody td:nth-child(4) {
        grid-area: qty;
        align-self: end;
        justify-self: start;
        display: flex;
        align-items: center;
        padding: 2px 0 0;
    }

    .shopping-cart-table tbody td:nth-child(4) .cell-label {
        display: none !important;
    }

    .shopping-cart-table tbody td:nth-child(4) .number-picker {
        display: inline-flex;
    }

    .shopping-cart-table tbody td:nth-child(4) .input-group-quantity {
        display: inline-flex;
        align-items: center;
        height: 28px;
        border: 1px solid #cbd5e1;
        border-radius: 6px;
        overflow: hidden;
        background: #ffffff;
    }

    .shopping-cart-table tbody td:nth-child(4) .btn-number {
        width: 28px;
        height: 100%;
        border: none;
        background: #f8fafc;
        color: #334155;
        font-size: 15px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        transition: background-color 0.15s ease, color 0.15s ease;
    }

    .shopping-cart-table tbody td:nth-child(4) .btn-number:hover:not(:disabled) {
        background-color: var(--color-primary, #0758A2);
        color: #ffffff;
    }

    .shopping-cart-table tbody td:nth-child(4) .btn-number:disabled {
        opacity: 0.35;
        cursor: not-allowed;
        background: #f8fafc;
    }

    .shopping-cart-table tbody td:nth-child(4) .input-quantity {
        width: 36px;
        height: 100%;
        border: none;
        border-left: 1px solid #e2e8f0;
        border-right: 1px solid #e2e8f0;
        background: #ffffff;
        text-align: center;
        font-size: 13px;
        font-weight: 700;
        color: #0f172a;
        padding: 0;
        margin: 0;
        outline: none;
        -moz-appearance: textfield;
    }

    /* 5. Line Total on Row 3 (bottom-right) */
    .shopping-cart-table tbody td:nth-child(5) {
        grid-area: total;
        align-self: end;
        justify-self: end;
        text-align: right;
        padding: 2px 0 0;
    }

    .shopping-cart-table tbody td:nth-child(5) .cell-label {
        display: none !important;
    }

    .shopping-cart-table tbody td:nth-child(5) .line-total {
        font-size: 15.5px;
        font-weight: 700;
        color: var(--color-primary, #0758A2);
        white-space: nowrap;
        line-height: 1.2;
    }
}

/* --------------------------------------------------------------------------
   Order Summary
   -------------------------------------------------------------------------- */
.order-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 22px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.order-summary .section-title {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.order-summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.order-summary-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #475569;
    margin-bottom: 9px;
}

.order-summary-list li label {
    margin: 0;
    color: #475569;
    font-weight: 500;
}

.order-summary-list li > span {
    font-weight: 600;
    color: #0f172a;
}

.order-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
}

.order-summary-total label {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
}

.order-summary-total .total-price {
    font-size: 19px;
    font-weight: 800;
    color: var(--color-primary, #0758A2);
}

.order-summary-bottom {
    margin-top: 18px;
}

.btn-proceed-to-checkout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    padding: 13px 20px;
    background: var(--color-primary, #0758A2);
    color: #ffffff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 6px rgba(7, 88, 162, 0.2);
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

/* Hover only when the button is actually actionable — this element starts
   out disabled and is enabled once the summary has items. */
.btn-proceed-to-checkout:not(:disabled):hover {
    background: var(--color-primary-hover, #054178);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(7, 88, 162, 0.3);
}

.btn-proceed-to-checkout:not(:disabled):active {
    transform: translateY(0);
}

/* Disabled state ("Place Order" before the cart is ready). Without this the
   button still looked fully active and still lifted on hover. */
.btn-proceed-to-checkout:disabled,
.btn-proceed-to-checkout[disabled] {
    background: #e2e8f0;
    color: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
    opacity: 1;
}

/* The "Placing Order..." state is also disabled, but it is in flight —
   keep it on-brand blue so it doesn't read as an error. */
.btn-proceed-to-checkout.is-loading:disabled {
    background: var(--color-primary, #0758A2);
    color: #ffffff;
    cursor: progress;
}

.btn-proceed-to-checkout:focus-visible {
    outline: 2px solid var(--color-primary, #0758A2);
    outline-offset: 2px;
}

/* Keep the icon optically centered with the label */
.btn-proceed-to-checkout i {
    font-size: 0.95em;
    line-height: 1;
}

@media screen and (max-width: 768px) {
    .order-summary {
        padding: 16px 14px;
        border-radius: 10px;
        margin-top: 6px;
    }
    .order-summary .section-title {
        font-size: 15px;
        margin: 0 0 10px;
        padding-bottom: 8px;
    }
    .btn-proceed-to-checkout {
        min-height: 44px;
        padding: 11px 16px;
        font-size: 14px;
        border-radius: 8px;
    }
}

/* --------------------------------------------------------------------------
   Empty State (FleetCart Truck Illustration)
   -------------------------------------------------------------------------- */
.empty-cart-message {
    display: flex;
    width: 100%;
    padding: 50px 20px;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    margin: 16px 0 36px;
}

.empty-cart-message svg {
    height: 110px;
    width: 110px;
    margin-bottom: 20px;
}

.empty-cart-message svg g,
.empty-cart-message svg path {
    fill: var(--color-primary, #0758A2);
}

.empty-cart-message h2 {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px;
}

.empty-cart-message span {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 20px;
}

.btn-continue-shopping {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 22px;
    background: #ffffff;
    border: 1.5px solid var(--color-primary, #0758A2);
    border-radius: 8px;
    color: var(--color-primary, #0758A2);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-continue-shopping:hover {
    background: var(--color-primary, #0758A2);
    color: #ffffff;
}
