*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
    overflow-x: hidden; /* Ngăn scroll ngang */
}

.checkout-container {
    max-width: 1200px;
    margin: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.checkout-header h1 {
    text-align: center;
    color: #007bff;
    margin-bottom: 20px;
}

.checkout-main {
    display: flex;
    gap: 20px;
    flex-wrap: wrap; /* Cho phép phần tử xếp thành cột khi không đủ không gian */
    width: 100%; /* Đảm bảo width không bị vượt quá */
    padding: 0 10px; /* Thêm padding để tránh che mất nội dung */
}

.customer-info,
.order-summary {
    background: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    width: 100%; /* Đảm bảo mỗi phần tử không tràn ra ngoài */
    min-width: 400px; /* Đảm bảo chiều rộng tối thiểu cho mỗi phần tử */
}

.customer-info {
    flex: 2;
    min-width: 300px; /* Ensure it doesn't get too narrow */
}

.order-summary {
    flex: 1;
    min-width: 400px; /* Ensure it doesn't get too narrow */
}

.customer-info h2,
.order-summary h2 {
    margin-bottom: 15px;
    font-size: 18px;
}

form input,
form select,
form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

textarea {
    resize: none;
    height: 80px;
}

.order-summary .product-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.product-item img {
    width: 50px;
    height: 50px;
    border-radius: 5px;
    margin-right: 10px;
}

.product-item div {
    flex: 1;
}

.product-item span {
    font-weight: bold;
}

.coupon {
    display: flex;
    gap: 10px;
}

.coupon input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.coupon button {
    padding: 10px 20px;
    border: none;
    background: #007bff;
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
}

.price-summary p {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.price-summary .total {
    font-weight: bold;
    font-size: 16px;
}

.place-order {
    width: 100%;
    padding: 10px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
}

* {
    cursor: url('/assets/chuot.png'), auto !important;
}

#loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px;
    border-radius: 10px;
    justify-content: center;
    text-align: center;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#loading .spinner {
    width: 100px;
    height: 100px;
    border: 10px solid rgba(0, 0, 0, 0.2); /* Vòng ngoài nhạt */
    border-top: 10px solid #3498db; /* Vòng trên nổi bật */
    border-radius: 50%;
    animation: spin 1s linear infinite; /* Hiệu ứng xoay */
    margin-bottom: 10px;
}

#loading p {
    font-size: 16px;
    color: #333;
}

/* Hiệu ứng xoay */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .checkout-header h1 {
        font-size: 24px;
        margin-bottom: 10px;
    }

    .checkout-main {
        flex-direction: column;
        gap: 10px;
        padding-right: 40px;
    }

    .customer-info,
    .order-summary {
        padding: 15px;
    }

    .customer-info h2,
    .order-summary h2 {
        font-size: 16px;
    }

    form input,
    form select,
    form textarea {
        padding: 8px;
        font-size: 14px;
    }

    .place-order {
        font-size: 14px;
        padding: 12px;
    }

    #loading .spinner {
        width: 70px;
        height: 70px;
    }

    #loading p {
        font-size: 14px;
    }
}

@media screen and (max-width: 480px) {
    .checkout-header h1 {
        font-size: 20px;
    }

    form input,
    form select,
    form textarea {
        font-size: 12px;
    }

    .place-order {
        font-size: 12px;
        padding: 10px;
    }

    .coupon input {
        padding: 8px;
    }

    .coupon button {
        padding: 8px 16px;
    }
}
