#rightSide {
    position: absolute; /* Positioned relative to #content */
    top: 0;
    right: 0;
    width: 90%;
    max-width: 90%; /* Ensure it doesn't get too wide on smaller #container */
    height: 100%;
    padding: 1rem;
    overflow-y: auto;
    background: #f8fafd; /* Or #fff for a different look */
    z-index: 1000; /* Ensure it's above the chat */
    transform: translateX(100%); /* Hidden off-screen to the right */
    transition: transform 0.35s ease-in-out;
    box-shadow: -3px 0 15px rgba(0,0,0,0.12); /* Shadow for a floating effect */
}
#rightSide.visible {
    transform: translateX(0); /* Slides into view */
}
#rightSide h4 { margin-top:0; text-align:center; color: #253359; position: relative; padding-top: 10px; }

#items {
    display: flex;
    flex-direction: row;
    gap: 20px; /* Espace entre les colonnes */
    margin-top: 15px;
}

.cart-column {
    flex: 1; /* Chaque colonne prend la moitié de l'espace disponible */
    display: flex;
    flex-direction: column;
    gap: 10px; /* Espace entre les cartes dans une colonne */
}

.cart-separator {
    width: 1px;
    background-color: #ddd;
    align-self: stretch; /* S'étend sur toute la hauteur des colonnes */
}

#toggleCartButton {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    background: rgb(255 255 255 / 18%);
    color: rgb(255 255 255);
    border: 1px solid rgb(204, 204, 204);
    border-radius: 4px;
    padding: 8px 16px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    z-index: 1010;
}
#toggleCartButton:hover {
    opacity: 0.8;
}

#closeCartButton {
    position: absolute;
    top: 12px; 
    right: 12px; 
    background: none;
    border: none;
    font-size: 1.8rem; 
    color: #8899a6; 
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    z-index: 1010; 
}
#closeCartButton:hover {
    color: #526471; 
}

.sel-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    font-size: 0.9rem;
    gap: 10px;
    background-color: #fff; /* Fond blanc pour la carte */
    border-radius: 8px; /* Coins arrondis */
    box-shadow: 0 2px 5px rgba(0,0,0,0.08); /* Ombrage léger */
    border: 1px solid #e9eef4; /* Bordure subtile */
}

.sel-item-main-content {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.sel-item-img { width: 50px; height: 50px; object-fit: contain; border: 1px solid #eee; border-radius: 4px; }
.sel-item-details { flex-grow: 1; display: flex; flex-direction: column; }
.sel-item-ref { font-weight: bold; }
.sel-item-price { color: #555; font-size: 0.85em; }
.sel-item-controls { display: flex; align-items: center; gap: 8px; }
.sel-item-controls input[type="number"] { width: 45px; padding: 4px; text-align: center; border: 1px solid #ccc; border-radius: 4px; font-size: 0.9rem; }
.sel-item-controls .update-qty-btn, .sel-item-controls .remove-item-btn { background: none; border: none; cursor: pointer; font-size: 1.1rem; padding: 2px 4px; }
.sel-item-controls .update-qty-btn { color: #007bff; } 
.sel-item-controls .remove-item-btn { color: #d00; } 

#nvrSuggestionContainer { margin-top: 15px; padding: 10px; background-color: #e9f5ff; border: 1px solid #b8dfff; border-radius: 5px; text-align: center; }
#nvrSuggestionContainer p { margin: 5px 0; font-size: 0.95em; }
#nvrSuggestionContainer button { margin: 5px; } 

.cart-category-title {
    font-size: 1.1em;
    color: #253359;
    margin-top: 15px; /* Espace au-dessus du titre de catégorie */
    margin-bottom: 8px; /* Espace en dessous du titre, avant les cartes */
    padding-bottom: 5px;
    border-bottom: 1px solid #dde4ec;
}

.cart-column .cart-category-title:first-child {
    margin-top: 0; /* Pas de marge en haut pour le premier titre d'une colonne */
} 

/* Styles pour l'animation fade-in des nouveaux articles */
.sel-item.newly-added-hidden {
    opacity: 0;
}

.sel-item.newly-added-fadein {
    animation: fadeInCartItem 0.5s ease-out forwards;
}

@keyframes fadeInCartItem {
    from { opacity: 0; transform: translateY(10px); } /* Optionnel: petit effet de translation */
    to { opacity: 1; transform: translateY(0); }
}

/* Style pour le bouton Terminer ma configuration */
#finishBtn {
    padding: 8px 15px; /* Ajustez selon vos préférences */
    font-size: 0.9rem; /* Ajustez selon vos préférences */
    /* Vous pouvez ajouter d'autres propriétés comme max-width, etc. */
}

/* Styles pour le statut de stock */
.stock-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-left: 8px;
    transition: background-color 0.3s ease;
    /* L'infobulle sera gérée par l'attribut title natif du HTML */
}

/* Stock disponible - Vert */
.stock-indicator.in-stock {
    background-color: #4CAF50;
}

/* Stock indisponible - Rouge */
.stock-indicator.out-of-stock {
    background-color: #f44336;
}

/* Quantité importante (>64) - Orange */
.stock-indicator.contact-required {
    background-color: #ff9800;
}

/* En cours de vérification - Gris */
.stock-indicator.checking {
    background-color: #9e9e9e;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Styles pour l'overlay et le flou lorsque le panier est ouvert */
#pageOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0); /* Initialement transparent */
    opacity: 0;
    z-index: 999; /* Juste en dessous du rightSide (qui est à 1000) */
    pointer-events: none; /* Ne pas interférer avec les clics initialement */
    transition: background-color 0.35s ease-in-out, opacity 0.35s ease-in-out;
}

#pageOverlay.active-backdrop {
    background-color: rgba(0, 0, 0, 0.200); /* Noir semi-transparent */
    opacity: 1;
    /* pointer-events: auto; Si on veut bloquer les clics sur le contenu derrière */
}

/* Supposons que le contenu principal à gauche a l'ID #leftSide */
/* S'il a un autre ID ou une classe, cela devra être ajusté. */
#leftSide.blurred-by-cart {
    filter: blur(3px);
    transition: filter 0.35s ease-in-out; /* Synchronisé avec l'ouverture du panier */
} 

/* Styles pour le modal des produits associés */
.associated-products-modal {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 700px;
    max-height: 80vh;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    z-index: 1050; /* Au-dessus de l'overlay du panier */
    padding: 25px;
    display: none; /* Caché par défaut */
    flex-direction: column;
    overflow: hidden; /* Pour gérer le scroll interne */
}

.associated-products-modal.visible {
    display: flex;
}

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

.associated-products-modal-header h3 {
    margin: 0;
    font-size: 1.4em;
    color: #253359;
}

.associated-products-modal-close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: #8899a6;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.associated-products-modal-close-btn:hover {
    color: #526471;
}

.associated-products-modal-content {
    overflow-y: auto; /* Scroll pour le contenu si trop long */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* Grille responsive */
    gap: 20px;
}

.associated-product-card {
    background-color: #f8fafd;
    border: 1px solid #e9eef4;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.associated-product-card img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
}

.associated-product-card .ref {
    font-weight: bold;
    font-size: 1em;
    color: #253359;
    margin-bottom: 5px;
}

.associated-product-card .desc {
    font-size: 0.85em;
    color: #555;
    margin-bottom: 10px;
    flex-grow: 1; /* Pour que les cartes aient la même hauteur */
}

.associated-product-card .price {
    font-size: 0.9em;
    color: #007bff;
    font-weight: bold;
    margin-bottom: 10px;
}

.associated-product-card .add-assoc-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s ease;
}

.associated-product-card .add-assoc-btn:hover {
    background-color: #0056b3;
}

/* Style pour le bouton "Produits Associés" dans la carte du panier */
.associated-products-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 5px 10px;
    font-size: 0.8em;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 5px;
    display: block; /* Pour qu'il prenne la largeur disponible si besoin ou pour le centrer */
    width: fit-content;
}

.associated-products-btn:hover {
    background-color: #5a6268;
}

/* Style pour les produits associés ajoutés sous le produit parent dans le panier */
.added-associated-products-container {
    width: 100%;
    margin-top: 8px;
    padding-left: 25px;
    box-sizing: border-box;
}

.added-associated-products-container .associated-item-display {
    font-size: 0.85em;
    padding: 8px 5px; /* Ajuster le padding */
    color: #333;
    border-left: 2px solid #007bff;
    padding-left: 10px; 
    margin-top: 8px; /* Plus d'espace entre les items associés */
    background-color: #f8fafd; /* Fond légèrement différent pour distinction */
    border-radius: 4px;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    gap: 8px; /* Espace entre les éléments de l'accessoire */
}

/* Styles pour l'image de l'accessoire dans le panier */
.added-associated-products-container .assoc-item-img {
    width: 35px;
    height: 35px;
    object-fit: contain;
    border: 1px solid #eee;
    border-radius: 3px;
    flex-shrink: 0; /* Empêcher le rétrécissement */
}

/* Styles pour les détails de l'accessoire (référence et description) */
.added-associated-products-container .assoc-item-details {
    display: flex;
    flex-direction: column; /* Empiler réf et description */
    flex-grow: 1; /* Prendre l'espace disponible */
    text-align: left;
    overflow: hidden; /* Pour gérer le texte long avec ellipsis si besoin */
}

.added-associated-products-container .associated-item-display .ref {
    font-weight: bold;
    /* flex-grow: 1; /* Déplacé vers .assoc-item-details */
    white-space: nowrap; /* Empêcher le retour à la ligne de la référence */
}

.added-associated-products-container .associated-item-display .desc {
    font-size: 0.9em; /* Taille légèrement plus petite pour la description */
    color: #555;
    margin-top: 2px; /* Petit espace entre réf et description */
    white-space: nowrap; 
    overflow: hidden;
    text-overflow: ellipsis; /* Afficher ... si la description est trop longue */
    max-width: 250px; /* Ajuster au besoin */
}

/* Styles pour les contrôles de l'accessoire (prix, input quantité, bouton supprimer) */
.added-associated-products-container .assoc-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0; /* Empêcher le rétrécissement */
}

.added-associated-products-container .associated-item-display .price {
    margin-left: 0; /* Ajusté par le gap */
    margin-right: 0; /* Ajusté par le gap */
    color: #555;
    font-size: 0.95em;
}

.added-associated-products-container .assoc-qty-input {
    width: 40px; /* Largeur pour l'input de quantité */
    padding: 3px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 0.9em;
}

.added-associated-products-container .associated-item-display .qty {
    font-style: italic;
    margin-right: 0; /* Ajusté par le gap */
}

.added-associated-products-container .associated-item-display .remove-assoc-btn {
    margin-left: 0; /* Ajusté par le gap */
    /* ... autres styles du bouton supprimer ... */
}

/* Styles spécifiques pour les modales NVR à étapes */
.nvr-modal-step1,
.nvr-modal-step2 {
    max-width: 900px;
}

.nvr-modal-info {
    background-color: #e8f4f8;
    border: 1px solid #bee5eb;
    border-radius: 6px;
    padding: 12px 15px;
    margin-bottom: 20px;
    font-size: 0.95em;
}

.nvr-modal-info p {
    margin: 0 0 5px 0;
    color: #0c5460;
}

.nvr-modal-info p:last-child {
    margin-bottom: 0;
}

/* Styles pour la grille de sélection des disques durs */
.hdd-selection {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

/* Styles pour les cartes de disques durs */
.hdd-product-card {
    background-color: #f8fafd;
    border: 2px solid #e9eef4;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.hdd-product-card:hover:not(.disabled) {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.hdd-product-card.selected {
    border-color: #28a745;
    background-color: #f0fff4;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

.hdd-product-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f5f5f5;
}

.hdd-product-card.disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Contrôles de sélection (croix) en haut à droite */
.hdd-selection-controls {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
}

.hdd-remove-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    line-height: 1;
    transition: background-color 0.2s ease;
}

.hdd-remove-btn:hover {
    background-color: #c82333;
}

/* Image et contenus des cartes HDD */
.hdd-product-card img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
}

.hdd-img-placeholder {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #eee;
    border-radius: 4px;
    background-color: #f8f9fa;
    color: #6c757d;
    font-size: 0.7em;
    text-align: center;
    margin-bottom: 10px;
}

.hdd-product-card .ref {
    font-weight: bold;
    font-size: 1em;
    color: #253359;
    margin-bottom: 5px;
}

.hdd-product-card .capacity {
    font-size: 0.9em;
    color: #007bff;
    font-weight: 600;
    margin-bottom: 5px;
}

.hdd-product-card .desc {
    font-size: 0.85em;
    color: #555;
    margin-bottom: 10px;
    flex-grow: 1;
    line-height: 1.3;
}

.hdd-product-card .price {
    font-size: 0.9em;
    color: #28a745;
    font-weight: bold;
    margin-bottom: 10px;
}

/* Boutons d'ajout HDD */
.add-hdd-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
    min-width: 100px;
}

.add-hdd-btn:hover:not(:disabled) {
    background-color: #0056b3;
}

.add-hdd-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.hdd-product-card.selected .add-hdd-btn {
    background-color: #28a745;
}

.hdd-product-card.disabled .add-hdd-btn {
    background-color: #adb5bd;
}

/* Footer de modal NVR */
.nvr-modal-footer {
    border-top: 1px solid #eee;
    padding-top: 20px;
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.nvr-validate-step1-btn,
.nvr-finish-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: background-color 0.2s ease;
    min-width: 200px;
}

.nvr-validate-step1-btn:hover:not(:disabled),
.nvr-finish-btn:hover {
    background-color: #218838;
}

.nvr-validate-step1-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* Compteur de sélection */
#selected-count {
    font-weight: bold;
    color: #007bff;
}

/* Animation pour les changements d'état */
.hdd-product-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive pour les modales NVR */
@media (max-width: 768px) {
    .nvr-modal-step1,
    .nvr-modal-step2 {
        max-width: 95vw;
        margin: 20px auto;
    }
    
    .hdd-selection {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 10px;
    }
    
    .hdd-product-card {
        padding: 12px;
    }
    
    .nvr-modal-footer {
        flex-direction: column;
        align-items: center;
    }
    
    .nvr-validate-step1-btn,
    .nvr-finish-btn {
        width: 100%;
        max-width: 300px;
    }
}

/* === STYLES CALCULATEUR TEMPS D'ENREGISTREMENT === */

.recording-time-section {
    background: #f0f8ff;
    border: 1px solid #d0e7ff;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.recording-time-section .cart-category-title {
    margin-bottom: 10px;
    color: #2563eb;
    font-size: 0.9rem;
    font-weight: 600;
}

.calc-recording-btn {
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 15px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.calc-recording-btn:hover:not(:disabled) {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.calc-recording-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

.recording-results {
    margin-top: 15px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.recording-result-initial p {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: #1e293b;
}

.recording-adjustment {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.recording-adjustment label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

.recording-adjustment input {
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.85rem;
}

.validate-days-btn {
    background: #059669;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.validate-days-btn:hover {
    background: #047857;
}

.recording-suggestion {
    background: #fef7cd;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    padding: 12px;
    margin-top: 10px;
}

.recording-suggestion p {
    margin: 0 0 6px 0;
    font-size: 0.85rem;
}

.recording-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.apply-switch-btn {
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    flex: 1;
}

.apply-switch-btn:hover {
    background: #b91c1c;
}

.cancel-switch-btn {
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    flex: 1;
}

.cancel-switch-btn:hover {
    background: #4b5563;
}

/* Responsive pour le calculateur */
@media (max-width: 768px) {
    .recording-adjustment {
        gap: 10px;
    }
    
    .recording-actions {
        flex-direction: column;
    }
    
    .apply-switch-btn,
    .cancel-switch-btn {
        flex: none;
    }
} 