/* Styles for the cart detail page */
.cart-container {
    max-width: 950px;
    margin: 20px auto;
    padding: 20px;
    background-color: var(--color-surface);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-light);
}

.cart-container h1 {
    text-align: center;
    color: var(--color-primary);
    margin-bottom: 25px;
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Pousse les actions à droite */
    padding: 15px 0;
    border-bottom: 1px solid var(--color-border);
}

.cart-item-product-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    flex-grow: 1; /* Permet au lien de prendre l'espace disponible */
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 30px; /* Espace entre quantité, total et suppression */
}

@media (max-width: 767px) {
    .cart-item {
        flex-direction: column; /* Empile les éléments verticalement */
        align-items: flex-start;
    }

    .cart-item-product-link {
        width: 100%; /* Prend toute la largeur sur mobile */
        margin-bottom: 10px; /* Espace entre la première et la deuxième ligne */
    }

    .cart-item-actions {
        width: 100%; /* Prend toute la largeur sur mobile */
        justify-content: flex-end; /* Aligne les éléments à droite */
        gap: 15px; /* Ajuste l'espace entre les éléments */
        margin-left: auto; /* Pousse le bloc à droite */
    }

    .cart-item-image {
        margin-right: 15px;
    }

    .cart-item-details {
        flex-grow: 1;
    }

    .cart-item-quantity,
    .cart-item-total,
    .cart-item-remove {
        margin-bottom: 0; /* Réinitialiser la marge pour mobile */
    }

    .cart-item-quantity {
        margin-right: 0; /* Réinitialiser la marge */
    }

    .cart-item-total {
        width: auto;
        margin-right: 0; /* Réinitialiser la marge */
    }
}

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

.cart-item-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    margin-right: 15px;
}

.cart-item-product-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit; /* Inherit color from parent */
}

.cart-item-details {
    flex-grow: 1;
}

.cart-item-details p {
    margin: 0;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
}

.cart-item-quantity .quantity-change {
    background-color: #f0f0f0;
    border: 1px solid var(--color-border);
    cursor: pointer;
    padding: 5px 10px;
    font-size: 1em;
}

.cart-item-quantity .quantity-display {
    width: 40px;
    text-align: center;
    border: 1px solid var(--color-border);
    border-left: none;
    border-right: none;
    padding: 5px;
    font-size: 1em;
}

.cart-item-quantity .quantity-change:first-child {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.cart-item-quantity .quantity-change:last-child {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

.cart-item-total {
    font-weight: bold;
    width: auto;
    text-align: right;
}

.cart-item-remove button {
    background: none;
    border: none;
    color: red;
    font-size: 2.4em; /* Doublé la taille de la croix */
    cursor: pointer;
    padding: 5px;
}

.cart-item-remove {
    position: relative; /* Pour positionner la popup */
}

.confirm-delete-popup {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    padding: 10px;
    z-index: 10;
    width: 180px;
    text-align: center;
}

.confirm-delete-popup p {
    margin: 0 0 10px 0;
    font-size: 0.9em;
}

.confirm-delete-popup button {
    padding: 5px 10px;
    border-radius: 3px;
    border: 1px solid #ccc;
    cursor: pointer;
    margin: 0 5px;
    font-size: 0.9em;
}

.confirm-delete-popup .confirm-yes {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
}

.confirm-delete-popup .confirm-no {
    background-color: #f8f9fa;
}

.cart-summary {
    margin-top: 20px;
    text-align: right;
}

.cart-summary h3 {
    margin-bottom: 15px;
}

.checkout-button {
    padding: 12px 25px;
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease;   
}

.checkout-button:hover {
    background-color: var(--color-primary-darker);
}

.clear-cart-section {
    margin-bottom: 10px;
    text-align: right;
    position: relative;
}

.div-cart-btn{
    margin-bottom: 10px;
    text-align: right;
    position: relative;
}

.clear-cart-button {
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.danger-button {
    background-color: #dc3545; /* Red color for danger */
    color: white;
    border: 1px solid #dc3545;
}

.danger-button:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.confirm-clear-popup {
    position: absolute;
    top: 0; /* Align with the button */
    right: 0;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    padding: 10px;
    z-index: 10;
    width: 250px; /* Adjust width as needed */
    text-align: center;
    transform: translateY(-100%); /* Position above the button */
    margin-top: -10px; /* Adjust to fine-tune position */
}

.confirm-clear-popup p {
    margin: 0 0 10px 0;
    font-size: 0.9em;
}

.confirm-clear-popup button {
    padding: 5px 10px;
    border-radius: 3px;
    border: 1px solid #ccc;
    cursor: pointer;
    margin: 0 5px;
    font-size: 0.9em;
}

.confirm-clear-popup .confirm-clear-yes {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
}

.confirm-clear-popup .confirm-clear-no {
    background-color: #f8f9fa;
}

/* Styles for shipping method radio buttons */
.shipping-method-selection .form-check {
    display: flex;
    justify-content: space-between; /* Pushes input to the right */
    align-items: center;
    margin-bottom: 8px;
    padding: 5px 0;
}

.shipping-method-selection .form-check-label {
    order: 1; /* Keep label first */
    flex-grow: 1; /* Allow label to take available space */

    margin-right: 10px; /* Space between label and input */
    cursor: pointer;
}

.shipping-method-selection .form-check-input {
    order: 2; /* Move input second */
    margin-left: 0; /* Remove default left margin */
    cursor: pointer;
}