.hidden {
    display: none;
}


/* Container modal trượt ngang từ phải vào */


/* Base style: trượt từ phải, hiển thị dạng panel */

.cart-modal {
    position: fixed;
    top: 0;
    right: 0;
    width: 90%;
    max-width: 500px;
    height: 100%;
    background: #fff;
    border-radius: 8px 0 0 8px;
    box-shadow: -4px 0 8px rgba(0, 0, 0, 0.2);
    padding: 20px;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}


/* Mở modal */

.cart-modal.open {
    transform: translateX(0);
}


/* Overlay */

.cart-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
}

.cart-modal-overlay.hidden {
    display: none;
}

.cart-modal__close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

.cart-modal__title {
    color: #D39461;
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 4px;
}

.cart-modal__divider {
    background: #ccc;
    height: 1px;
    margin-bottom: 15px;
}

.cart-modal__divider--thin {
    height: 1px;
    background: #eee;
    margin: 15px 0;
}

.cart-modal__list {
    /* max-height: 300px; */
    overflow-y: auto;
}

.cart-item {
    display: flex;
    margin-top: 25px;
}

.cart-item:first-child {
    margin-top: 10px;
}

.cart-item__image {
    margin-right: 12px;
    cursor: pointer;
    overflow: hidden;
    width: 80px;
}

.cart-item__image img {
    width: 100%;
    border-radius: 3px;
}

.cart-item__details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cart-item__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-item__name {
    font-weight: bold;
    cursor: pointer;
    color: var(--color-green-dark);
}

.cart-item__actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.qty-btn {
    background: none;
    border: 1px solid #ccc;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 18px;
    line-height: 0;
}

.qty-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.qty-display {
    margin: 0 8px;
}

.cart-item__remove {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #e00;
}

.cart-modal__footer {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-modal__total span:first-child {
    font-weight: bold;
    margin-right: 8px;
}

.btn--payment {
    border-radius: 3px;
    cursor: pointer;
    width: 150px;
}

.cart-modal__empty {
    text-align: center;
    padding: 40px 0;
}

.cart-item__pack {
    /* font-weight: bold; */
}

.cart-item__price {
    color: #f9f9f9;
    background-color: #D39461;
    padding: 5px 10px;
    border-radius: 2px;
}

.number-input {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e3e2e2;
    border-radius: 6px;
    padding: 4px;
}

.number-input input {
    width: 100%;
    max-width: 140px;
    text-align: center;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
}

.number-input button {
    background: none;
    border: none;
    font-size: 20px;
    color: #000;
    cursor: pointer;
    width: 25px;
}

.text-quantity {
    display: none;
}


/* Responsive: full màn hình trên mobile */

@media only screen and (max-width:768px) {
    .cart-modal {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
    }
    .number-input.cart {
        width: 40%;
    }
    .cart-item__name {
        font-size: 18px;
    }
    .cart-item__pack {
        font-size: 13px;
    }
    .cart-item__price {
        width: fit-content;
    }
    .number-input input {
        max-width: 100%;
    }

    .cart-item__name, .cart-item__price {
        font-size: 15px;
    }
    .cart-item__image {
        width: 100px !important;
    }
    .cart-item__qty-price {
        flex-direction: column !important;
        row-gap: 10px !important;
    }

    .number-input.cart {
        width: 100%;
    }

    .cart-modal__footer {
        flex-direction: column;
        row-gap: 10px;
    }
    .number-input button, .number-input input {
        font-size: 15px;
    }
}
