table {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 10px;
    overflow: hidden;
    background-color: #fff;
    box-shadow: var(--box-shadow);
}
th,
td {
    padding: 12px 15px;
    white-space: nowrap; /* empêche le retour à la ligne */
}

th {
    background-color: var(--primary-color);
    text-align: left;
    color: #fff;
}
tr {
    transition: all ease-in-out 0.3s, opacity 0.3s ease;
    border-radius: 15px;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

tr:hover {
    background-color: #d8d8d8;
    z-index: 10;
    cursor: pointer;
    opacity: 1;
    border: 2px solid blue;
    color: darkblue;
    padding: 5px;
}
/* Sous-table */
.sub-table {
    width: 100%;
    margin-top: 5px;
    border-collapse: collapse;
}
.sub-table th,
.sub-table td {
    border: 1px solid #ccc;
    padding: 4px;
    font-size: 0.9em;
}

/* Accordéon */
.accordion {
    margin-top: 5px;
}
.accordion-toggle {
    display: none;
}
.accordion-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: bold;
    user-select: none;
}
.accordion-label .arrow {
    transition: transform 0.3s ease;
    margin-right: 5px;
}
.accordion-toggle:checked + .accordion-label .arrow {
    transform: rotate(90deg);
}
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.accordion-toggle:checked + .accordion-label + .accordion-content {
    max-height: 500px; /* assez pour contenir la table */
    margin-top: 5px;
}
table tbody:hover tr:not(:hover) {
    opacity: 0.4; /* toutes les autres lignes deviennent transparentes */
}
.row {
    display: flex;
    flex-direction: row;
    width: 100%;
}


/* Responsive mobile */
@media (max-width: 768px) {
    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: inline-block;
        width: 100%;
        text-align: center;
    }
    table {
        box-shadow: none;
        background-color: transparent;
    }

    thead tr {
        display: none; /* Masque l'entête sur mobile */
    }
    tr {
        margin-bottom: 1rem;
        border: 1px solid #ddd;
        padding: 0.5rem;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        overflow: hidden;
        background-color: #fff;
        border: 1px solid var(--primary-color);
    }
    td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border: none;
        border-bottom: 1px solid #eee;
    }
    /* Cellules avec data-label */
    td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 45%;
        padding-left: 0.5rem;
        text-align: left;
        color: darkblue;
    }
    /* Cellules sans data-label */
    td:not([data-label]) {
        padding-left: 0; /* pas de padding */
        text-align: center; /* centré horizontalement */
    }
    tbody {
        background-color: transparent;
    }
    tfoot {
        display: flex;
        width: 100%;
    }
    .cart-product {
        display: flex;
        background-color: var(--primary-color);
        margin: 0;
        padding: 10px;
        color: var(--text-color);
        width: 100%;
    }
    .row {
        flex-direction: column;
        align-items: center;
    }
}
