#rightSide {
    position: absolute; /* Conserve la structure existante mais sans déroulement */
    top: 0;
    right: 0;
    width: 90%;
    max-width: 90%;
    height: auto;
    padding: 0.5rem;
    overflow: visible;
    background: transparent;
    z-index: 1000;
    transform: none;
    transition: none;
    box-shadow: none;
}
#rightSide.visible { /* Conservé pour compat mais sans effet de slide */
    transform: none;
}
#rightSide.mini-mode {
    width: 125px;
    padding: 8px;
    overflow: hidden;
    height: auto;
    min-height: 200px;
}
#rightSide.mini-mode #fullContent {
    display: none;
}
#rightSide #fullContent {
    display: none; /* Masqué par défaut si dans la colonne rightSide */
}
#rightSide.mini-mode #miniContent {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    height: 100%;
    gap: 8px;
    position: relative;
}

/* Styles pour les flèches de déploiement/réduction */
.mini-expand-arrow,
.mini-collapse-arrow {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #086eff;
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1011;
    box-shadow: 0 2px 8px rgba(8, 110, 255, 0.3);
}

/* Bouton de fermeture pour le mode mini */
.mini-close-button {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #dc3545;
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1011;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.mini-close-button:hover {
    background: #c82333;
    transform: scale(1.1);
}

.mini-expand-arrow:hover,
.mini-collapse-arrow:hover {
    background: #0052cc;
    transform: scale(1.1);
}

.mini-collapse-arrow {
    background: #64748b;
    box-shadow: 0 2px 8px rgba(100, 116, 139, 0.3);
}

.mini-collapse-arrow:hover {
    background: #475569;
}

/* Container pour les éléments du mode mini */
.mini-items-preview {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 50px;
    width: 100%;
    align-items: center;
    padding: 0 8px;
}

/* Élément individuel en mode mini */
.mini-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 105px;
    margin-bottom: 3px;
}

.mini-item-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.mini-item-name {
    font-size: 10px;
    font-weight: 600;
    color: #1e293b;
    text-align: center;
    line-height: 1.2;
    margin: 4px 0 2px 0;
    max-width: 95px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-item-qty {
    font-size: 11px;
    font-weight: 700;
    color: #086eff;
    background: rgba(8, 110, 255, 0.1);
    border-radius: 10px;
    padding: 2px 6px;
    min-width: 20px;
    text-align: center;
}
#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 { display: none; }
#closeCartButton:hover { color: inherit; }

.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: 3700; /* Niveau 1.5: entre panier (3600-3650) et devis (4000+) */
    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 MOBILE - PANIER
   ============================================ */

/* Tablettes */
@media (max-width: 1024px) {
    #rightSide {
        width: 85%;
        max-width: 450px;
    }

    #rightSide h4 {
        font-size: 1.1rem;
        padding-top: 8px;
    }

    .sel-item {
        padding: 9px;
        font-size: 0.88rem;
    }

    .sel-item-img {
        width: 55px;
        height: 55px;
    }
}

/* Smartphones - Panier en overlay plein écran */
@media (max-width: 768px) {
    /* MASQUER complètement le mode mini et tous ses éléments */
    #rightSide.mini-mode {
        display: none !important;
        visibility: hidden !important;
    }

    #miniContent,
    .mini-expand-arrow,
    .mini-close-button,
    .mini-items-preview,
    .mini-item {
        display: none !important;
        visibility: hidden !important;
    }

    /* MASQUER le bouton de réduction/collapse */
    .mini-collapse-arrow {
        display: none !important;
        visibility: hidden !important;
    }

    /* Panier plein écran */
    #rightSide {
        position: fixed !important;
        top: 0;
        right: 0;
        bottom: 0;
        width: 100% !important;
        max-width: 100% !important;
        height: 100vh !important;
        height: 100dvh !important;
        z-index: 2000;
        background: white;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        overflow-x: hidden;
        padding: 1rem;
        box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    }

    #rightSide.visible {
        transform: translateX(0) !important;
    }

    /* Header du panier plein écran */
    #rightSide:not(.mini-mode) h4 {
        font-size: 1.2rem;
        margin: 0 0 1rem 0;
        padding: 0 0 0.75rem 0;
        border-bottom: 2px solid #e3e7ee;
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
    }

    /* Bouton de réduction en mode plein écran */
    .mini-collapse-arrow {
        display: block !important;
        position: fixed;
        top: 15px;
        right: 15px;
        z-index: 2001;
        background: #64748b;
        color: white;
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    /* Colonnes du panier - passage en colonne unique */
    #items {
        flex-direction: column;
        gap: 12px;
        margin-top: 10px;
    }

    .cart-column {
        width: 100%;
    }

    .cart-separator {
        display: none;
    }

    .cart-category-title {
        font-size: 1rem;
        margin-top: 12px;
        margin-bottom: 8px;
        padding-bottom: 6px;
    }

    /* Cartes d'articles responsive */
    .sel-item {
        padding: 12px;
        font-size: 0.9rem;
        gap: 12px;
        border-radius: 10px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    .sel-item-main-content {
        gap: 12px;
    }

    .sel-item-img {
        width: 70px;
        height: 70px;
        border-radius: 6px;
    }

    .sel-item-details {
        gap: 4px;
    }

    .sel-item-ref {
        font-size: 0.95rem;
    }

    .sel-item-price {
        font-size: 0.85rem;
    }

    .sel-item-controls {
        gap: 10px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .sel-item-controls input[type="number"] {
        width: 55px;
        padding: 6px;
        font-size: 1rem;
        border-radius: 6px;
    }

    .sel-item-controls button {
        font-size: 1.4rem;
        padding: 6px 8px;
        min-width: 36px;
        min-height: 36px;
    }

    /* Indicateurs de stock */
    .stock-indicator {
        width: 12px;
        height: 12px;
        margin-left: 6px;
    }

    /* Bouton terminer */
    #finishBtn {
        padding: 14px 20px;
        font-size: 1rem;
        margin: 1.5rem 0 1rem 0;
        border-radius: 12px;
    }

    /* Boutons d'ajout manuel */
    #manualAddButtons {
        margin: 1rem 0;
        gap: 10px;
    }

    .manual-add-btn {
        padding: 12px 16px;
        font-size: 0.9rem;
        border-radius: 8px;
        min-height: 48px;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: flex-start;
    }

    /* Suggestion NVR */
    #nvrSuggestionContainer {
        padding: 12px;
        margin-top: 12px;
        border-radius: 8px;
        font-size: 0.9rem;
    }

    /* Modal produits associés */
    .associated-products-modal {
        width: 95%;
        max-width: none;
        max-height: 90vh;
        padding: 15px;
        border-radius: 12px;
    }

    .associated-products-modal-header h3 {
        font-size: 1.2em;
    }

    .associated-products-modal-close-btn {
        font-size: 1.8rem;
    }

    .associated-products-modal-content {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .associated-product-card {
        padding: 12px;
    }

    .associated-product-card img {
        width: 70px;
        height: 70px;
    }

    /* Produits associés dans le panier */
    .added-associated-products-container {
        padding-left: 15px;
        margin-top: 8px;
    }

    .added-associated-products-container .associated-item-display {
        padding: 8px;
        gap: 8px;
        flex-wrap: wrap;
    }

    .added-associated-products-container .assoc-item-img {
        width: 40px;
        height: 40px;
    }

    .added-associated-products-container .assoc-item-details {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .added-associated-products-container .associated-item-display .desc {
        max-width: 100%;
    }

    .added-associated-products-container .assoc-item-controls {
        flex: 1 1 auto;
        justify-content: flex-end;
    }

    /* Modales NVR - disques durs */
    .nvr-modal-step1,
    .nvr-modal-step2 {
        width: 95%;
        max-width: none;
        margin: 10px;
        padding: 15px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .nvr-modal-info {
        padding: 10px 12px;
        margin-bottom: 15px;
        font-size: 0.9em;
    }

    .hdd-selection {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .hdd-product-card {
        padding: 12px;
    }

    .hdd-product-card img,
    .hdd-img-placeholder {
        width: 70px;
        height: 70px;
    }

    .nvr-modal-footer {
        flex-direction: column;
        gap: 10px;
        padding-top: 15px;
        margin-top: 15px;
    }

    .nvr-validate-step1-btn,
    .nvr-finish-btn {
        width: 100%;
        min-width: auto;
        padding: 12px 20px;
        font-size: 1rem;
    }

    /* Calculateur temps d'enregistrement */
    .recording-time-section {
        padding: 12px;
        margin-top: 12px;
        border-radius: 8px;
    }

    .recording-time-section .cart-category-title {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }

    .calc-recording-btn {
        padding: 12px 16px;
        font-size: 0.9rem;
        border-radius: 8px;
    }

    .recording-results {
        margin-top: 12px;
        padding: 10px;
    }

    .recording-result-initial p {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }

    .recording-adjustment {
        gap: 10px;
        margin-top: 12px;
        padding-top: 10px;
    }

    .recording-adjustment label {
        font-size: 0.75rem;
    }

    .recording-adjustment input {
        padding: 8px 10px;
        font-size: 0.9rem;
    }

    .validate-days-btn {
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    .recording-suggestion {
        padding: 10px;
        margin-top: 8px;
    }

    .recording-suggestion p {
        font-size: 0.8rem;
        margin-bottom: 5px;
    }

    .recording-actions {
        flex-direction: column;
        gap: 8px;
        margin-top: 10px;
    }

    .apply-switch-btn,
    .cancel-switch-btn {
        flex: none;
        width: 100%;
        padding: 10px 14px;
        font-size: 0.85rem;
    }
}

/* Très petits smartphones */
@media (max-width: 375px) {
    #rightSide {
        padding: 0.75rem;
    }

    #rightSide.mini-mode {
        width: 65px !important;
        height: 65px !important;
        bottom: 15px;
        right: 15px;
    }

    .mini-expand-arrow {
        font-size: 24px;
    }

    #rightSide.mini-mode::after {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }

    .sel-item {
        padding: 10px;
    }

    .sel-item-img {
        width: 60px;
        height: 60px;
    }

    .sel-item-controls input[type="number"] {
        width: 50px;
    }

    #finishBtn {
        padding: 12px 18px;
        font-size: 0.95rem;
    }

    .manual-add-btn {
        padding: 10px 14px;
        font-size: 0.85rem;
        min-height: 44px;
    }
}

/* Tablettes en mode paysage */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    #rightSide {
        width: 400px;
        max-width: 40%;
    }
}

/* Optimisations tactiles pour le panier */
@media (hover: none) and (pointer: coarse) {
    /* Zones tactiles suffisantes */
    .sel-item-controls button,
    .manual-add-btn,
    .associated-products-btn,
    #finishBtn,
    .add-hdd-btn {
        min-height: 44px;
        min-width: 44px;
    }

    /* Pas d'effet hover */
    .sel-item:hover,
    .manual-add-btn:hover,
    .hdd-product-card:hover {
        transform: none;
        box-shadow: inherit;
    }

    /* Effet active */
    .sel-item:active {
        background: #f0f4f8;
    }

    .manual-add-btn:active {
        transform: scale(0.98);
    }

    #finishBtn:active {
        transform: scale(0.98);
    }
}

/* Styles pour les boutons d'ajout manuel */
.manual-add-btn {
    background: #f8fafd;
    border: 1px solid #e3e7ee;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.85rem;
    color: #253359;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    text-align: left;
}

.manual-add-btn:hover {
    background: #e8f2ff;
    border-color: #0066ff;
    transform: translateY(-1px);
}

.manual-add-btn:active {
    transform: translateY(0);
}

/* Masquer les boutons d'ajout manuel en mode mini */
#rightSide.mini-mode #manualAddButtons {
    display: none;
} 