:root {
    /* Couleurs */
    --color-red: hsl(14, 86%, 42%);
    --color-green: hsl(159, 69%, 38%);
    
    --color-rose-50: hsl(20, 50%, 98%);
    --color-rose-100: hsl(13, 31%, 94%);
    --color-rose-300: hsl(14, 25%, 72%);
    --color-rose-400: hsl(7, 20%, 60%);
    --color-rose-500: hsl(12, 20%, 44%);
    --color-rose-900: hsl(14, 65%, 9%);

    /* Typographie */
    --font-body: 'Red Hat Text', sans-serif;
    
    /* Taille de police */
    --font-size-body: 16px;

    /* Poids de la police */
    --font-weight-normal: 400;
    --font-weight-medium: 600;
    --font-weight-bold: 700;
}
*{
    font-family: var(--font-body);
}
body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-size: var(--font-size-body);
    background-color: var(--color-rose-50);
}
h2{
    margin: 0;
    font-size: 1em;
}
h3{
    margin: 5px 0;
    font-size: 0.8em;
    color: var(--color-red);
}
h4{
    font-size: 1.2em;
    color: var(--color-red);
}
.container {
    padding: 3rem 2rem 2rem 5rem;
    display: flex;
}

/* Styles pour les filtres et la recherche */
.search-container input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--color-rose-300);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.search-container input:focus {
    outline: none;
    border-color: var(--color-red);
}

.category-filters {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.category-btn {
    padding: 12px 24px;
    border: 2px solid var(--color-rose-300);
    background-color: white;
    color: var(--color-rose-500);
    border-radius: 25px;
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.category-btn:hover {
    border-color: var(--color-red);
    color: var(--color-red);
}

.category-btn.active {
    background-color: var(--color-red);
    border-color: var(--color-red);
    color: white;
}

.category-btn.active:hover {
    background-color: hsl(14, 86%, 35%);
}

/* Styles pour le panier amélioré */
.cart-item {
    transition: background-color 0.3s ease;
}

.cart-item:hover {
    background-color: #f9f9f9;
}

.cart-item-image img {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cart-buttons button {
    transition: all 0.3s ease;
    font-weight: var(--font-weight-medium);
}

.view-cart:hover {
    background-color: #e0e0e0 !important;
}

.confirm-order:hover {
    background-color: hsl(14, 86%, 35%) !important;
}

main{
    gap: 10px;
    display: grid;
    margin-right: 1rem;
    grid-template-columns: 1fr 1fr 1fr;
}
.main-section {
    flex: 2;
}
.sidebar {
    flex: 1;
}
.cart{
    padding: 20px;
    border-radius: 10px;
    background-color: hsl(0, 0%, 100%);
}
.empty-message{
    font-size: 0.9em;
    color: var(--color-rose-500);
}
.empty-content{
    text-align: center;
}
.products-card{
    margin-top: 2rem;
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.products-card p{
    margin-top: 1.5rem;
    font-size: 0.9em;
    color: var(--color-rose-500);
    font-weight: var(--font-weight-medium);
}
.image-product{
    width: 100%;
    height: 35vh;
    object-fit: cover;
    border-radius: 10px;
    position: relative;
    border: 1px solid transparent;
    transition: border 0.3s ease;
}
.image-product.active{
    border: 2px solid var(--color-red);
}
.addToCart{
    gap: 10px;
    display: flex;
    align-items: center;
    border-radius: 50px;
    padding: 0.5rem 1rem;
    color: var(--color-rose-900);
    font-weight: var(--font-weight-bold);
    background-color: hsl(0, 0%, 100%);
    border: 2px solid var(--color-rose-300);
}
.addToCart:hover{
    cursor: pointer;
    color: var(--color-red);
    border-color: var(--color-red);
}
.addToCart,
.counter {
    z-index: 1;
    margin-top: -25px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.addToCart.hidden {
    display: none;
}
.counter {
    display: none;
    justify-content: space-between;
    align-items: center;
}
.icon-remove {
    padding: 5px;
    cursor: pointer;
    border-radius: 50%;
    fill: #CAAFA7;
    border: 1px solid var(--color-rose-300);
}
.icon-remove:hover {
    fill: var(--color-rose-900);
    border: 1px solid var(--color-rose-900);
}
.counter{
    width: 42%;
    display: flex;
    align-items: center;
    border-radius: 50px;
    padding: 0.5rem 1rem;
    justify-content: space-between;
    background-color: var(--color-red);
}
.counter span{
    color: hsl(0, 0%, 100%);
}
.hidden {
    display: none;
}
.cart-item,.summary-item{
    display: flex;
    margin-top: 10px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--color-rose-100);
}
.cart-item h2{
    color: var(--color-rose-900);
    font-weight: var(--font-weight-medium);
}
.cart-summary{
    align-items: center;
    justify-content: space-between;
}
.carbo-neutral{
    gap: 10px;
    display: flex;
    padding: 10px;
    border-radius: 5px;
    align-items: center;
    justify-content: center;
    background-color: var(--color-rose-100);
}
.cart-total{
    font-size: 1.5em;
    font-weight: var(--font-weight-bold);
}
.pdcs-infos{
    display: flex;
    align-items: flex-start;
}
.total-div,.final-total{
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.product-quantity{
    margin-right: 15px;
    color: var(--color-red);
    font-weight: var(--font-weight-medium);
}
.single-price{
    margin-right: 10px;
    color: var(--color-rose-300);
    font-weight: var(--font-weight-medium);
}
.total-price{
    color: var(--color-rose-500);
    font-weight: var(--font-weight-medium);
}
.confirm-order,.start-new-order{
    width: 100%;
    border: none;
    padding: 1rem;
    font-size: 0.9em;
    cursor: pointer;
    border-radius: 50px;
    color: hsl(0, 0%, 100%);
    background-color: var(--color-red);
    font-weight: var(--font-weight-medium);
}
.confirm-order:hover{
    cursor: pointer;
    background-color: hsl(14, 85%, 31%);
}
.icon-decrement,.icon-increment{
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    border: 1px solid hsl(0, 0%, 100%);
}
.icon-decrement{
    padding: 8px 5px;
}
.overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}
.final-summary {
    width: 30%;
    position: absolute;
    background: white;
    padding: 30px;
    border-radius: 10px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.order-summary{
    max-height: 35vh;
    padding: 20px;
    overflow-y: scroll;
    border-radius: 10px;
    background-color: var(--color-rose-50);
}
.hope-p{
    color: var(--color-rose-300);
}
.final-infos{
    gap: 20px;
    display: flex;
    align-items: flex-start;
}
.final-div-infos{
    display: flex;
}
.final-total strong{
    font-size: 1.2em;
}
.image-thumbnail{
    height: 8vh;
    border-radius: 10px;
}
.start-new-order {
    margin-top: 20px;
}
.final-price{
    font-weight: var(--font-weight-medium);
}

/* Styles pour la gestion des utilisateurs */
.user-management {
    background: #f8f9fa !important;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.user-management h5 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
}

.btn {
    display: inline-block;
    padding: 6px 12px;
    margin: 2px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.42857143;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 3px;
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
    border-color: #545b62;
}

.btn-outline-dark {
    background-color: transparent;
    border-color: #343a40;
    color: #343a40;
}

.btn-outline-dark:hover {
    background-color: #343a40;
    border-color: #343a40;
    color: white;
}

/* Styles pour les filtres de catégorie */
.category-filters {
    margin-bottom: 20px;
    text-align: center;
}

.category-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 8px 16px;
    margin: 0 5px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.category-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.category-btn.active {
    background: var(--color-red);
    border-color: var(--color-red);
    color: white;
}

/* Styles pour la barre de recherche */
.search-container input {
    width: 50%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
    font-size: 14px;
}

.search-container input:focus {
    outline: none;
    border-color: var(--color-red);
    box-shadow: 0 0 0 2px rgba(229, 62, 35, 0.2);
}

/* Styles améliorés pour les éléments du panier */
.cart-item {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    border-bottom: 1px solid #eee;
    position: relative;
}

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

.remove-item {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.remove-item:hover {
    background: #c82333;
}

/* Styles pour l'info guest */
.guest-info {
    background: #fff3cd;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    border: 1px solid #ffeaa7;
    text-align: center;
}

.guest-info small {
    color: #856404;
    font-size: 12px;
}

/* Styles pour le bouton de confirmation */
.confirm-order {
    background-color: hsl(14, 85%, 31%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.view-cart {
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.view-cart:hover{
    background-color: hsl(14, 85%, 35%);
}

.confirm-order:hover {
    background-color: hsl(14, 85%, 31%);
}

.confirm-order:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Styles pour la modal des détails du panier */
.cart-details-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 900px;
    width: 90%;
    max-height: 85%;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:hover {
    color: #e74c3c;
    background: #f8f9fa;
}

.detail-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #eee;
    border-radius: 10px;
    background: #fafafa;
    transition: box-shadow 0.3s ease;
}

.detail-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.item-info {
    flex: 1;
}

.item-info h5 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.item-barcode {
    margin-top: 15px;
}

.detail-barcode {
    margin-top: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Styles pour le bouton View Cart Details */
.view-cart-details {
    background: #17a2b8 !important;
    border-color: #17a2b8 !important;
    color: white !important;
    transition: all 0.3s ease;
}

.view-cart-details:hover {
    background: #138496 !important;
    border-color: #117a8b !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Amélioration responsive */
@media (max-width: 768px) {
    .modal-content {
        padding: 20px;
        margin: 10px;
        max-height: 90%;
    }
    
    .detail-item {
        flex-direction: column;
        gap: 15px;
    }
    
    .item-image img, .item-image div {
        width: 80px;
        height: 100px;
        margin: 0 auto;
    }
}