/* =========================================================
   KSMALL CART PAGE
   ========================================================= */

:root {
    --cart-primary: #16a6a8;
    --cart-primary-dark: #078c8e;
    --cart-primary-light: #e9fafa;

    --cart-text: #24323d;
    --cart-muted: #7b8790;
    --cart-border: #e8edef;
    --cart-bg: #f6f8f9;
    --cart-white: #ffffff;

    --cart-danger: #e05252;
    --cart-shadow: 0 8px 30px rgba(25, 55, 65, 0.07);
}


/* =========================================================
   PAGE
   ========================================================= */

.cart-section {
    width: min(1180px, calc(100% - 40px));
    margin: 35px auto 70px;
    color: var(--cart-text);
}


/* =========================================================
   HEADER
   ========================================================= */

.cart-section .title {
    margin: 0 0 24px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.cart-section .title::after {
    content: "";
    display: block;
    width: 42px;
    height: 4px;
    margin-top: 10px;
    border-radius: 10px;
    background: var(--cart-primary);
}


/* =========================================================
   VENDOR GROUP
   ========================================================= */

.vendor-group {
    background: var(--cart-white);
    border: 1px solid var(--cart-border);
    border-radius: 16px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: var(--cart-shadow);
}


/* Vendor header */

.vendor-name {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    gap: 9px;

    padding: 15px 20px;

    background: #fbfcfc;
    border-bottom: 1px solid var(--cart-border);

    color: var(--cart-text);
    font-size: 14px;
    font-weight: 700;
}

.vendor-name i {
    color: var(--cart-primary);
    font-size: 17px;
}

.cart-vendor-checkbox {
    width: 17px;
    height: 17px;
    accent-color: var(--cart-primary);
    cursor: pointer;
    flex-shrink: 0;
}


/* =========================================================
   CART ITEM
   ========================================================= */

.cart-item {
    display: grid;

    grid-template-columns:
        22px
        100px
        minmax(0, 1fr)
        auto
        130px
        42px;

    align-items: center;
    gap: 20px;

    padding: 20px;

    border-bottom: 1px solid var(--cart-border);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--cart-primary);
    cursor: pointer;
    justify-self: center;
}


/* =========================================================
   PRODUCT IMAGE
   ========================================================= */

.cart-item .thumb {
    width: 100px;
    height: 100px;

    border-radius: 12px;
    overflow: hidden;

    background: #f3f5f6;

    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* =========================================================
   PRODUCT INFO
   ========================================================= */

.cart-item .info {
    min-width: 0;
}

.cart-item .name {
    margin: 0 0 8px;

    color: var(--cart-text);

    font-size: 15px;
    font-weight: 700;
    line-height: 1.45;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.cart-item .variant {
    display: inline-flex;
    align-items: center;

    width: fit-content;
    max-width: 100%;

    margin: 0 0 9px;
    padding: 5px 9px;

    border-radius: 6px;

    background: var(--cart-primary-light);
    color: var(--cart-primary-dark);

    font-size: 12px;
    font-weight: 600;
}

.cart-item .unit-price {
    margin: 0;

    color: var(--cart-muted);
    font-size: 13px;
}


/* =========================================================
   QUANTITY
   ========================================================= */

.qty-stepper {
    display: inline-flex;
    align-items: center;

    height: 38px;

    border: 1px solid #dfe5e7;
    border-radius: 9px;

    overflow: hidden;

    background: #fff;
}

.qty-stepper button {
    width: 36px;
    height: 100%;

    border: none;
    background: #f7f9f9;

    color: var(--cart-text);

    font-size: 18px;
    font-weight: 500;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.qty-stepper button:hover {
    background: var(--cart-primary-light);
    color: var(--cart-primary-dark);
}

.qty-stepper button:active {
    background: #dff5f5;
}

.qty-stepper span {
    min-width: 38px;

    text-align: center;

    color: var(--cart-text);

    font-size: 14px;
    font-weight: 700;
}


/* =========================================================
   LINE TOTAL
   ========================================================= */

.line-total {
    text-align: right;

    color: var(--cart-text);

    font-size: 15px;
    font-weight: 700;

    white-space: nowrap;
}


/* =========================================================
   DELETE
   ========================================================= */

.cart-page-delete {
    width: 38px;
    height: 38px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #f0dddd;
    border-radius: 9px;

    background: #fff;

    color: var(--cart-danger);

    cursor: pointer;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease;
}

.cart-page-delete:hover {
    background: #fff3f3;
    border-color: #efcaca;
    transform: translateY(-1px);
}

.cart-page-delete i {
    font-size: 16px;
}


/* =========================================================
   COURIER
   ========================================================= */

.courier-select {
    padding: 20px;

}

.courier-select > span {
    display: block;

    margin-bottom: 14px;

    color: var(--cart-text);

    font-size: 14px;
    font-weight: 700;
}

.courier-select > span i {
    margin-right: 7px;
    color: var(--cart-primary);
}


/* Courier options */

.courier-select label {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    margin: 0 10px 8px 0;
    padding: 10px 14px;

    border: 1px solid var(--cart-border);
    border-radius: 9px;

    background: #fff;

    color: var(--cart-text);

    font-size: 13px;
    cursor: pointer;

    transition: all 0.15s ease;
}

.courier-select label:hover {
    border-color: #b9dede;
    background: var(--cart-primary-light);
}

.courier-select input {
    accent-color: var(--cart-primary);
}


/* =========================================================
   ORDER SUMMARY
   ========================================================= */

.order-summary {
    width: 100%;

    margin: 25px 0 0 auto;
    padding: 24px;

    background: var(--cart-white);

    border: 1px solid var(--cart-border);
    border-radius: 16px;

    box-shadow: var(--cart-shadow);
}

.order-summary h3 {
    margin: 0 0 20px;

    color: var(--cart-text);

    font-size: 18px;
    font-weight: 700;
}

.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding: 10px 0;

    color: var(--cart-muted);

    font-size: 14px;
}

.summary-row > span:last-child {
    color: var(--cart-text);
    font-weight: 600;
    white-space: nowrap;
}

.summary-row.total {
    margin-top: 8px;
    padding-top: 17px;

    border-top: 1px solid var(--cart-border);

    color: var(--cart-text);

    font-size: 16px;
    font-weight: 700;
}

.summary-row.total .amount {
    color: var(--cart-primary-dark);

    font-size: 21px;
    font-weight: 800;
}


/* =========================================================
   CHECKOUT BUTTON
   ========================================================= */

.cart-checkout-link {
    display: block;
    text-decoration: none;
}

.order-summary .btn-primary {
    width: 100%;
    min-height: 48px;

    margin-top: 18px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    border: none;
    border-radius: 10px;

    background: var(--cart-primary);
    color: #fff;

    font-family: inherit;
    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.15s ease,
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.order-summary .btn-primary:hover {
    background: var(--cart-primary-dark);

    transform: translateY(-1px);

    box-shadow: 0 6px 16px rgba(22, 166, 168, 0.22);
}

.order-summary .btn-primary i {
    font-size: 16px;
}


/* =========================================================
   EMPTY CART
   ========================================================= */

.cart-empty-state {
    padding: 70px 20px;

    text-align: center;

    background: var(--cart-white);

    border: 1px solid var(--cart-border);
    border-radius: 16px;

    box-shadow: var(--cart-shadow);
}

.cart-empty-state .empty-icon {
    width: 74px;
    height: 74px;

    margin: 0 auto 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: var(--cart-primary-light);
    color: var(--cart-primary);

    font-size: 32px;
}

.cart-empty-state h3 {
    margin: 0 0 7px;

    color: var(--cart-text);

    font-size: 19px;
    font-weight: 700;
}

.cart-empty-state p {
    margin: 0 auto 22px;

    max-width: 400px;

    color: var(--cart-muted);

    font-size: 14px;
}

.cart-empty-state a {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 44px;

    padding: 0 20px;

    border-radius: 9px;

    background: var(--cart-primary);
    color: #fff;

    text-decoration: none;

    font-size: 14px;
    font-weight: 700;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

    .cart-section {
        width: min(100% - 28px, 760px);
        margin-top: 25px;
    }

    .cart-item {
        grid-template-columns:
            22px
            85px
            minmax(0, 1fr)
            auto;

        gap: 15px;
    }

    .cart-item .thumb {
        width: 85px;
        height: 85px;
    }

    .cart-item-checkbox {
        grid-column: 1;
        grid-row: 1 / span 2;
        align-self: start;
        margin-top: 4px;
    }

    .qty-stepper {
        grid-column: 3;
        justify-self: start;
    }

    .line-total {
        grid-column: 4;
        grid-row: 2;
    }

    .cart-page-delete {
        grid-column: 4;
        grid-row: 1;
        justify-self: end;
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

    .cart-section {
        width: calc(100% - 20px);
        margin: 20px auto 45px;
    }

    .cart-section .title {
        margin-bottom: 18px;

        font-size: 23px;
    }

    .vendor-group {
        border-radius: 13px;
        margin-bottom: 14px;
    }

    .vendor-name {
        padding: 13px 14px;

        font-size: 12px;
    }

    .cart-item {
        display: grid;

        grid-template-columns: 18px 76px minmax(0, 1fr) auto;

        gap: 10px;

        padding: 14px;
    }

    .cart-item .thumb {
        width: 76px;
        height: 76px;

        border-radius: 9px;
    }

    .cart-item-checkbox {
        grid-column: 1;
        grid-row: 1 / span 2;
        align-self: start;
        margin-top: 3px;
        width: 16px;
        height: 16px;
    }

    .cart-item .name {
        margin-bottom: 5px;

        font-size: 13px;
        line-height: 1.4;
    }

    .cart-item .variant {
        margin-bottom: 5px;
        padding: 4px 7px;

        font-size: 10px;
    }

    .cart-item .unit-price {
        font-size: 11px;
    }

    .cart-page-delete {
        width: 32px;
        height: 32px;

        grid-column: 4;
        grid-row: 1;

        border-radius: 7px;
    }

    .cart-page-delete i {
        font-size: 14px;
    }

    .qty-stepper {
        grid-column: 3;
        grid-row: 2;

        height: 34px;
    }

    .qty-stepper button {
        width: 32px;

        font-size: 16px;
    }

    .qty-stepper span {
        min-width: 34px;

        font-size: 12px;
    }

    .line-total {
        grid-column: 4;
        grid-row: 2;

        font-size: 13px;
    }

    .courier-select {
        margin-top: 14px;
        padding: 16px;

        border-radius: 13px;
    }

    .courier-select > span {
        margin-bottom: 11px;

        font-size: 12px;
    }

    .courier-select label {
        width: 100%;

        margin: 0 0 8px;
        padding: 10px 11px;

        font-size: 12px;
    }

    .order-summary {
        width: 100%;

        margin-top: 14px;
        padding: 18px;

        border-radius: 13px;
    }

    .order-summary h3 {
        margin-bottom: 14px;

        font-size: 16px;
    }

    .summary-row {
        padding: 8px 0;

        font-size: 12px;
    }

    .summary-row.total {
        padding-top: 14px;

        font-size: 14px;
    }

    .summary-row.total .amount {
        font-size: 18px;
    }

    .order-summary .btn-primary {
        min-height: 46px;
        margin-top: 15px;

        font-size: 13px;
    }
}


/* =========================================================
   VERY SMALL PHONE
   ========================================================= */

@media (max-width: 380px) {

    .cart-section {
        width: calc(100% - 14px);
    }

    .cart-item {
        grid-template-columns: 16px 65px minmax(0, 1fr) auto;
        gap: 8px;

        padding: 11px;
    }

    .cart-item .thumb {
        width: 65px;
        height: 65px;
    }

    .cart-item-checkbox {
        width: 15px;
        height: 15px;
    }

    .cart-item .name {
        font-size: 12px;
    }

    .line-total {
        font-size: 12px;
    }

    .qty-stepper button {
        width: 29px;
    }

    .qty-stepper span {
        min-width: 29px;
    }
}