﻿/* wwwroot/css/cart-sidebar.css */

.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    opacity: 0;
    visibility: hidden;
    transition: .3s ease;
    z-index: 1040;
}

    .cart-overlay.active {
        opacity: 1;
        visibility: visible;
    }

.cart-wrapper {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    display: flex;
    z-index: 1050;
    transform: translateX(100%);
    transition: .35s ease;
}

    .cart-wrapper.active {
        transform: translateX(0);
    }

.recommend-panel {
    width: 270px;
    background: #fff;
    border-left: 1px solid #ececec;
    border-right: 1px solid #ececec;
    display: flex;
    flex-direction: column;
}

.cart-panel {
    width: 500px;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.panel-head {
    padding: 16px 18px;
    border-bottom: 1px solid #ededed;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

    .panel-head h3 {
        font-size: 20px;
        font-weight: 500;
        color: #111;
        margin: 0;
    }

.close-btn {
    border: none;
    background: transparent;
    color: #111;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.panel-scroll {
    overflow-y: auto;
    flex: 1;
    padding: 14px 16px 18px;
}

    .panel-scroll::-webkit-scrollbar {
        width: 5px;
    }

    .panel-scroll::-webkit-scrollbar-thumb {
        background: #d8d8d8;
        border-radius: 30px;
    }

.recommend-card {
    margin-bottom: 22px;
    padding-bottom: 22px;
    border-bottom: 1px solid #ececec;
}

.recommend-img-box {
    background: #f3f3f3;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 14px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .recommend-img-box img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

.recommend-title {
    font-size: 18px;
    line-height: 1.35;
    color: #111;
    margin-bottom: 8px;
}

.price-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.new-price {
    color: #d85b5b;
    font-size: 18px;
    font-weight: 600;
}

.old-price {
    color: #9a9a9a;
    font-size: 18px;
    text-decoration: line-through;
}

.free-box {
    background: #fafafa;
    border-radius: 10px;
    padding: 18px 18px 20px;
    margin-bottom: 18px;
}

    .free-box p {
        font-size: 15px;
        color: #222;
        margin-bottom: 10px;
    }

        .free-box p span {
            color: #d85b5b;
            font-weight: 700;
        }

.progress-custom {
    width: 100%;
    height: 4px;
    background: #e6e6e6;
    border-radius: 50px;
    position: relative;
    overflow: visible;
}

    .progress-custom .fill {
        height: 100%;
        background: #4caf50;
        border-radius: 50px;
        position: relative;
        transition: width .5s ease;
    }

        .progress-custom .fill::after {
            content: "\f1cb";
            font-family: "bootstrap-icons";
            position: absolute;
            right: -10px;
            top: -13px;
            width: 20px;
            height: 20px;
            border: 1px solid #8bc48e;
            border-radius: 50%;
            background: #fff;
            color: #7db782;
            font-size: 11px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

.mini-line {
    width: 78px;
    height: 5px;
    background: #dedede;
    border-radius: 10px;
    margin: 12px 0 16px;
}

.cart-item {
    display: flex;
    gap: 16px;
    padding: 12px 0 16px;
    border-top: 1px solid #ededed;
}

    .cart-item:first-of-type {
        border-top: none;
    }

.cart-item-img {
    width: 90px;
    height: 90px;
    border-radius: 8px;
    background: #f3f3f3;
    overflow: hidden;
    flex-shrink: 0;
}

    .cart-item-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-top-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.cart-product-title {
    font-size: 15px;
    color: #111;
    margin: 0;
    line-height: 1.3;
    font-weight: 400;
}

.remove-link {
    color: #d85b5b;
    font-size: 14px;
    text-decoration: underline;
    white-space: nowrap;
    cursor: pointer;
}

.item-meta {
    font-size: 15px;
    color: #9a9a9a;
    margin-bottom: 4px;
}

    .item-meta span {
        color: #333;
    }

/* ── item-bottom: stepper left, price right ── */
.item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.item-price {
    font-size: 18px;
    font-weight: 700;
    color: #111;
}

/* ── Quantity Stepper (NEW) ── */
.sidebar-stepper {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

    .sidebar-stepper button {
        width: 32px;
        height: 32px;
        border: none;
        background: #f5f5f5;
        font-size: 16px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background .2s;
    }

        .sidebar-stepper button:hover {
            background: #eee;
        }

    .sidebar-stepper span {
        min-width: 34px;
        text-align: center;
        font-size: 14px;
        font-weight: 600;
        color: #111;
    }

.action-boxes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 12px 0 22px;
}

.action-item {
    border: 1px solid #ececec;
    border-radius: 6px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 16px;
    color: #111;
    background: #fff;
    transition: background .2s;
}

    .action-item:hover {
        background: #f7f7f7;
    }

    .action-item i {
        font-size: 17px;
    }

.subtotal-box h4 {
    font-size: 22px;
    color: #111;
    margin-bottom: 14px;
}

.subtotal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

    .subtotal-row .amount {
        font-size: 20px;
        font-weight: 700;
        color: #111;
    }

.agree-box {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}

    .agree-box input {
        width: 20px;
        height: 20px;
        accent-color: #111;
        cursor: pointer;
        flex-shrink: 0;
    }

    .agree-box label {
        font-size: 15px;
        color: #111;
        margin: 0;
        cursor: pointer;
    }

    .agree-box a {
        color: #111;
        text-decoration: underline;
    }

.cart-btn-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

.btn-cart-outline, .btn-cart-dark {
    height: 58px;
    border-radius: 40px;
    font-size: 17px;
    font-weight: 600;
    transition: background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.btn-cart-outline {
    border: 1.5px solid #111;
    background: #fff;
    color: #111;
}

    .btn-cart-outline:hover {
        background: #111;
        color: #fff;
        border-color: #111;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    }

.btn-cart-dark {
    border: none;
    background: #111;
    color: #fff;
}

    .btn-cart-dark:hover {
        background: #333;
    }

.continue-text {
    text-align: center;
    font-size: 17px;
    color: #111;
    font-weight: 500;
}

/* ── Loading Spinner (NEW) ── */
.sidebar-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

@media (max-width: 991.98px) {
    .recommend-panel {
        width: 240px;
    }

    .cart-panel {
        width: 430px;
    }
}

@media (max-width: 767.98px) {
    .cart-wrapper {
        width: 100%;
        right: 0;
    }

    .recommend-panel {
        width: 38%;
    }

    .cart-panel {
        width: 62%;
    }

    .panel-head h3 {
        font-size: 18px;
    }

    .recommend-title, .cart-product-title {
        font-size: 15px;
    }

    .item-meta, .agree-box label, .continue-text, .action-item {
        font-size: 13px;
    }

    .btn-cart-outline, .btn-cart-dark {
        height: 52px;
        font-size: 15px;
    }

    .cart-item-img {
        width: 76px;
        height: 76px;
    }
}

@media (max-width: 575.98px) {
    .cart-wrapper {
        display: block;
        transform: translateY(100%);
        width: 100%;
    }

        .cart-wrapper.active {
            transform: translateY(0);
        }

    .recommend-panel, .cart-panel {
        width: 100%;
    }

    .recommend-panel {
        height: 38vh;
        border-right: none;
        border-bottom: 1px solid #ececec;
    }

    .cart-panel {
        height: 100vh;
    }

    .panel-scroll {
        padding: 12px;
    }

    .recommend-img-box {
        height: 180px;
    }

    .cart-btn-row {
        grid-template-columns: 1fr;
    }
}
