/* =========================================================
   CASH & CARRY - CART PAGE
========================================================= */

:root {
    --cart-green: #16a34a;
    --cart-dark-green: #15803d;
    --cart-light-green: #f0fdf4;
    --cart-border: #e5e7eb;
    --cart-text: #172033;
    --cart-muted: #6b7280;
    --cart-white: #ffffff;
    --cart-bg: #f7f8fa;
    --cart-red: #dc2626;
    --cart-orange: #f59e0b;
}


/* =========================================================
   HEADER
========================================================= */

.cart-header {
    background: var(--cart-white);
    border-bottom: 1px solid var(--cart-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.cart-header-container {
    max-width: 1400px;
    margin: auto;
    min-height: 82px;
    padding: 0 30px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
}


/* Logo */

.cart-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--cart-text);
    min-width: 220px;
}

.cart-logo-icon {
    width: 46px;
    height: 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 13px;

    background: linear-gradient(
        135deg,
        var(--cart-green),
        var(--cart-dark-green)
    );

    color: white;
    font-size: 20px;

    box-shadow: 0 8px 20px rgba(22, 163, 74, 0.2);
}

.cart-logo-text {
    display: flex;
    flex-direction: column;
}

.cart-logo-text strong {
    font-size: 20px;
    line-height: 1.2;
}

.cart-logo-text span {
    font-size: 11px;
    color: var(--cart-muted);
}


/* =========================================================
   PROGRESS
========================================================= */

.cart-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    max-width: 430px;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #9ca3af;
    white-space: nowrap;
}

.progress-step span {
    width: 34px;
    height: 34px;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #d1d5db;
    background: white;

    font-size: 13px;
}

.progress-step small {
    font-size: 12px;
    font-weight: 600;
}

.progress-step.active {
    color: var(--cart-green);
}

.progress-step.active span {
    background: var(--cart-green);
    border-color: var(--cart-green);
    color: white;
}

.progress-line {
    height: 1px;
    width: 55px;
    background: #d1d5db;
    margin: 0 10px;
}


/* Continue Shopping */

.continue-shopping-top {
    display: flex;
    align-items: center;
    gap: 8px;

    color: var(--cart-green);
    text-decoration: none;

    font-size: 14px;
    font-weight: 600;

    min-width: 180px;
    justify-content: flex-end;
}

.continue-shopping-top:hover {
    color: var(--cart-dark-green);
}


/* =========================================================
   PAGE
========================================================= */

.cart-page {
    min-height: calc(100vh - 82px);
    background: var(--cart-bg);
    padding: 45px 20px 70px;
}

.cart-container {
    max-width: 1400px;
    margin: auto;
}


/* =========================================================
   TITLE
========================================================= */

.cart-title-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 30px;
}

.cart-small-title {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    color: red;
    font-size: 13px;
    font-weight: 700;

    margin-bottom: 8px;
}

.cart-title-section h1 {
    margin: 0;
    font-size: 34px;
    color: var(--cart-text);
}

.cart-title-section p {
    margin: 7px 0 0;
    color: var(--cart-muted);
    font-size: 14px;
}

.cart-item-count {
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 10px 15px;

    border-radius: 10px;

    background: var(--cart-light-green);
    color: red;

    font-size: 13px;
    font-weight: 700;
}


/* =========================================================
   LAYOUT
========================================================= */

.cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 25px;
    align-items: start;
}


/* =========================================================
   LEFT SECTION
========================================================= */

.cart-items-section {
    min-width: 0;
}

.cart-items-header {
    background: white;
    border: 1px solid var(--cart-border);
    border-radius: 14px;

    padding: 16px 20px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 15px;
}

.select-all {
    display: flex;
    align-items: center;
    gap: 9px;

    cursor: pointer;

    font-size: 14px;
    font-weight: 600;
}

.select-all input {
    width: 17px;
    height: 17px;
    accent-color: var(--cart-green);
}

.remove-selected-btn {
    border: 0;
    background: transparent;

    color: var(--cart-red);

    cursor: pointer;

    font-size: 13px;
    font-weight: 600;

    display: flex;
    align-items: center;
    gap: 6px;
}

.remove-selected-btn:hover {
    text-decoration: underline;
}


/* =========================================================
   CART ITEMS
========================================================= */

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cart-item {
    background: white;

    border: 1px solid var(--cart-border);
    border-radius: 15px;

    padding: 18px;

    display: grid;
    grid-template-columns: 25px 105px minmax(0, 1fr) auto;

    gap: 16px;

    align-items: center;

    transition: 0.25s ease;
}

.cart-item:hover {
    border-color: #bbf7d0;

    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.05);
}


/* Checkbox */

.cart-item-checkbox {
    width: 17px;
    height: 17px;
    accent-color: var(--cart-green);
    cursor: pointer;
}


/* Product image */

.cart-item-image {
    width: 105px;
    height: 105px;

    border-radius: 12px;

    background: #f9fafb;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;
}

.cart-item-image img {
    width: 100%;
    height: 100%;

    object-fit: contain;

    padding: 8px;
}


/* Product information */

.cart-item-info {
    min-width: 0;
}

.cart-item-category {
    font-size: 11px;
    font-weight: 700;

    text-transform: uppercase;

    color: red;

    margin-bottom: 5px;
}

.cart-item-name {
    margin: 0;

    color: var(--cart-text);

    font-size: 16px;
    font-weight: 700;

    line-height: 1.35;
}

.cart-item-brand {
    color: var(--cart-muted);

    font-size: 12px;

    margin-top: 5px;
}

.cart-item-unit {
    color: var(--cart-muted);

    font-size: 12px;

    margin-top: 4px;
}


/* Price */

.cart-item-price {
    margin-top: 9px;

    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-current-price {
    font-size: 17px;
    font-weight: 800;
    color: var(--cart-text);
}

.cart-old-price {
    color: #9ca3af;
    text-decoration: line-through;
    font-size: 12px;
}

.cart-discount-badge {
    padding: 3px 7px;

    border-radius: 5px;

    background: #dcfce7;
    color: red;

    font-size: 10px;
    font-weight: 700;
}


/* =========================================================
   QUANTITY / ACTION
========================================================= */

.cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 13px;
}

.quantity-control {
    display: flex;
    align-items: center;

    border: 1px solid var(--cart-border);

    border-radius: 8px;

    overflow: hidden;
}

.quantity-btn {
    width: 32px;
    height: 32px;

    border: 0;
    background: #f9fafb;

    cursor: pointer;

    font-size: 13px;

    color: var(--cart-text);
}

.quantity-btn:hover {
    background: var(--cart-light-green);
    color: var(--cart-green);
}

.quantity-value {
    width: 38px;

    text-align: center;

    font-size: 13px;
    font-weight: 700;
}

.remove-item-btn {
    border: 0;
    background: transparent;

    color: #9ca3af;

    cursor: pointer;

    font-size: 12px;

    display: flex;
    align-items: center;
    gap: 5px;
}

.remove-item-btn:hover {
    color: var(--cart-red);
}


/* =========================================================
   EMPTY CART
========================================================= */

.empty-cart {
    background: white;

    border: 1px solid var(--cart-border);
    border-radius: 15px;

    padding: 70px 20px;

    text-align: center;
}

.empty-cart-icon {
    width: 80px;
    height: 80px;

    margin: auto;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--cart-light-green);
    color: var(--cart-green);

    font-size: 30px;
}

.empty-cart h2 {
    margin: 20px 0 8px;

    color: var(--cart-text);
}

.empty-cart p {
    color: var(--cart-muted);
    font-size: 14px;
}

.shop-now-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    margin-top: 12px;

    padding: 12px 20px;

    border-radius: 9px;

    background: var(--cart-green);
    color: white;

    text-decoration: none;

    font-size: 13px;
    font-weight: 700;
}

.shop-now-btn:hover {
    background: var(--cart-dark-green);
}


/* Continue */

.continue-shopping {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    margin-top: 20px;

    color: red;

    font-size: 14px;
    font-weight: 700;

    text-decoration: none;
}

.continue-shopping:hover {
    text-decoration: underline;
}


/* =========================================================
   SUMMARY
========================================================= */

.cart-summary {
    position: sticky;
    top: 105px;
}

.summary-card {
    background: white;

    border: 1px solid var(--cart-border);
    border-radius: 16px;

    padding: 23px;
}

.summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 22px;
}

.summary-header h2 {
    margin: 0;

    font-size: 20px;
    color: var(--cart-text);
}

.summary-header i {
    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background: var(--cart-light-green);
    color: red;
}


/* Rows */

.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 15px;

    font-size: 14px;
}

.summary-row span {
    color: var(--cart-muted);
}

.summary-row strong {
    color: var(--cart-text);
}

.discount-row strong {
    color: var(--cart-green);
}

.summary-divider {
    border-top: 1px dashed #d1d5db;
    margin: 20px 0;
}


/* Total */

.summary-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.summary-total div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-total span {
    color: var(--cart-text);
    font-size: 15px;
    font-weight: 800;
}

.summary-total small {
    color: var(--cart-muted);
    font-size: 10px;
}

.summary-total strong {
    font-size: 24px;
    color: black;
}


/* =========================================================
   COUPON
========================================================= */

.coupon-section {
    margin-top: 23px;
    padding-top: 20px;

    border-top: 1px solid var(--cart-border);
}

.coupon-section label {
    display: flex;
    align-items: center;
    gap: 7px;

    margin-bottom: 9px;

    font-size: 12px;
    font-weight: 700;

    color: var(--cart-text);
}

.coupon-section label i {
    color: red;
}

.coupon-input {
    display: flex;

    border: 1px solid var(--cart-border);

    border-radius: 8px;

    overflow: hidden;
}

.coupon-input input {
    min-width: 0;
    flex: 1;

    border: 0;
    outline: 0;

    padding: 11px;

    font-size: 12px;
}

.coupon-input button {
    border: 0;

    background: var(--cart-light-green);
    color: black;

    padding: 0 15px;

    cursor: pointer;

    font-size: 12px;
    font-weight: 700;
}

.coupon-input button:hover {
    background: #dcfce7;
}

#couponMessage {
    display: block;
    margin-top: 7px;
    font-size: 11px;
}


/* =========================================================
   CHECKOUT
========================================================= */

.checkout-btn {
    width: 100%;

    margin-top: 22px;

    padding: 14px 17px;

    border: 0;
    border-radius: 10px;

    background: linear-gradient(
        135deg,
        red
    );

    color: white;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: space-between;

    font-size: 14px;
    font-weight: 800;

    box-shadow: 0 8px 18px rgba(22, 163, 74, 0.2);

    transition: 0.2s ease;
}

.checkout-btn:hover {
    transform: translateY(-1px);

    box-shadow:
        0 12px 25px rgba(22, 163, 74, 0.28);
}


/* =========================================================
   SECURE
========================================================= */

.secure-checkout {
    margin-top: 18px;

    padding: 12px;

    border-radius: 9px;

    background: #f9fafb;

    display: flex;
    align-items: center;
    gap: 10px;
}

.secure-checkout > i {
    color: red;
    font-size: 18px;
}

.secure-checkout div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.secure-checkout strong {
    font-size: 11px;
    color: var(--cart-text);
}

.secure-checkout span {
    font-size: 10px;
    color: var(--cart-muted);
}


/* =========================================================
   BENEFITS
========================================================= */

.cart-benefits {
    margin-top: 15px;

    background: white;

    border: 1px solid var(--cart-border);
    border-radius: 15px;

    padding: 17px;
}

.cart-benefit {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 10px 0;
}

.cart-benefit + .cart-benefit {
    border-top: 1px solid #f0f0f0;
}

.cart-benefit > i {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 8px;

    background: var(--cart-light-green);
    color: red;
}

.cart-benefit div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cart-benefit strong {
    font-size: 11px;
    color: var(--cart-text);
}

.cart-benefit span {
    font-size: 10px;
    color: var(--cart-muted);
}


/* =========================================================
   FOOTER
========================================================= */

.cart-footer {
    background: #111827;
    color: #9ca3af;

    padding: 20px;
}

.cart-footer-container {
    max-width: 1400px;
    margin: auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    font-size: 11px;
}

.cart-footer-container p {
    margin: 0;
}

.cart-footer-container div {
    display: flex;
    gap: 10px;
}

.cart-footer a {
    color: #d1d5db;
    text-decoration: none;
}

.cart-footer a:hover {
    color: white;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1100px) {

    .cart-header-container {
        padding: 0 20px;
    }

    .cart-logo {
        min-width: auto;
    }

    .cart-progress {
        max-width: 350px;
    }

    .continue-shopping-top {
        min-width: auto;
    }

    .cart-layout {
        grid-template-columns: minmax(0, 1fr) 350px;
    }

}


@media (max-width: 900px) {

    .cart-progress {
        display: none;
    }

    .cart-layout {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
    }

}


@media (max-width: 600px) {

    .cart-header-container {
        min-height: 70px;
        padding: 0 15px;
    }

    .cart-logo-icon {
        width: 40px;
        height: 40px;
    }

    .cart-logo-text strong {
        font-size: 16px;
    }

    .cart-logo-text span {
        display: none;
    }

    .continue-shopping-top {
        font-size: 0;
    }

    .continue-shopping-top i {
        font-size: 17px;
    }

    .cart-page {
        padding: 25px 12px 45px;
    }

    .cart-title-section {
        align-items: flex-start;
        gap: 15px;
    }

    .cart-title-section h1 {
        font-size: 26px;
    }

    .cart-item-count {
        font-size: 11px;
        padding: 8px 10px;
    }

    .cart-items-header {
        padding: 13px;
    }

    .remove-selected-btn {
        font-size: 11px;
    }

    .cart-item {
        grid-template-columns: 20px 80px minmax(0, 1fr);
        padding: 13px;
        gap: 10px;
    }

    .cart-item-image {
        width: 80px;
        height: 80px;
    }

    .cart-item-actions {
        grid-column: 2 / -1;

        flex-direction: row;

        justify-content: space-between;

        align-items: center;
    }

    .cart-item-name {
        font-size: 13px;
    }

    .cart-current-price {
        font-size: 15px;
    }

    .cart-summary {
        margin-top: 5px;
    }

    .summary-card {
        padding: 18px;
    }

    .cart-footer-container {
        flex-direction: column;
        text-align: center;
    }

}


@media (max-width: 400px) {

    .cart-logo-text {
        display: none;
    }

    .cart-title-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .cart-item {
        grid-template-columns: 18px 70px minmax(0, 1fr);
    }

    .cart-item-image {
        width: 70px;
        height: 70px;
    }

    .cart-item-price {
        flex-wrap: wrap;
    }

}