/* Styles demand-summary supprimÃ©s - fonctionnalitÃ© retirÃ©e */

.product-card-container { display: flex; flex-direction: column; gap: 12px; margin-top: 0.5rem; }

/* --- Premier ensemble de rÃ¨gles .product-card --- */
.product-card {
    border-radius: 8px;
    padding: 0.8rem; /* LÃ©ger ajustement du padding */
    /* flex: 1 1 280px; */ /* Supprimé pour affichage vertical */
    /* max-width: calc(50% - 0.5rem); */
    display: flex;
    flex-direction: column;
    width: 100%; /* Prendre toute la largeur disponible en mode vertical */
    /* min-width: 280px; */ /* Supprimé pour affichage vertical */
}

/* SUPPRIMÉ: Cette règle était pour l'affichage horizontal en grille, inutile en affichage vertical */
/* .product-card-container:has(.product-card:nth-child(3)) .product-card {
    max-width: calc(98.333% - 0.66rem);
} */



.product-card img { 
    width: 100%; 
    max-height: 120px; /* TAILLE IMAGE REDUITE */
    object-fit: contain; 
    margin-bottom: 0.75rem; /* Marge ajustÃ©e */
    border-bottom: 1px solid #eee; 
    padding-bottom: 0.75rem; /* Padding ajustÃ© */
}
.product-card h5.product-title { /* Style pour le nouveau titre produit */
    margin: 0 0 0.3rem 0; 
    font-size: 1.05rem; /* Taille ajustÃ©e */
    color: #253359;
    font-weight: 600;
    line-height: 1.3;
}
.product-card p.product-ref { /* Style pour la rÃ©fÃ©rence */
    font-size: 0.8rem;
    color: #6c757d;
    margin: 0 0 0.5rem 0;
}
.product-card ul.product-key-points { /* Style pour les points clÃ©s */
    font-size: 0.85rem;
    margin: 0.5rem 0;
    padding-left: 1.2rem;
    color: #333;
}
.product-card ul.product-key-points li {
    margin-bottom: 0.2rem;
}
.product-card p.product-delivery { /* Style pour le dÃ©lai */
    font-size: 0.85rem;
    color: #555;
    margin: 0.3rem 0;
}
.product-card p { margin: 0.25rem 0; font-size: 0.9rem; }
.product-card .price { font-weight: bold; color: #007bff; margin-top: 0.5rem; font-size: 1rem; }
.input-row { display: flex; gap: .5rem; margin-top: auto; /* Pousse en bas */ padding-top: 0.75rem; align-items: center; }


/* --- DeuxiÃ¨me ensemble de rÃ¨gles .product-card (fusionnÃ© et nettoyÃ© si possible) --- */
/* Ces rÃ¨gles Ã©taient initialement sÃ©parÃ©es, je les intÃ¨gre ici en supposant qu'elles s'appliquent au mÃªme .product-card */
/* S'il y a des diffÃ©rences subtiles, elles devront Ãªtre ajustÃ©es manuellement */

.product-card {
    /* flex-basis: calc(93.3333% - (2rem / 3)); */ /* Supprimé pour affichage vertical */
    box-sizing: border-box;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    max-width: 90%;
    min-width: 40%;
}

.product-card img {
    max-width: 100%; 
    height: auto; 
    max-height: 120px; 
    object-fit: contain; 
    margin-bottom: 0.75rem; 
    border-radius: 4px; 
    align-self: center; 
}

.product-card .product-title { /* RenommÃ© depuis h5.product-title pour la gÃ©nÃ©ricitÃ© */
    font-size: 0.95rem; 
    font-weight: bold;
    margin-bottom: 0.25rem;
    color: #333;
    min-height: 2.8em; 
    line-height: 1.4em;
}

.product-card .product-ref { /* RenommÃ© depuis p.product-ref */
    font-size: 0.75rem; 
    color: #777;
    margin-bottom: 0.5rem;
}

.product-card .product-key-points { /* RenommÃ© depuis ul.product-key-points */
    font-size: 0.8rem; 
    color: #555;
    list-style-position: inside; 
    padding-left: 0; 
    margin-bottom: 0.5rem;
    flex-grow: 1; 
}

.product-card .product-key-points li {
    margin-bottom: 0.15rem; 
}

.product-card .product-delivery { /* RenommÃ© depuis p.product-delivery */
    font-size: 0.75rem; 
    color: #777;
    margin-bottom: 0.75rem;
}

.product-card .price {
    font-size: 1rem; 
    font-weight: bold;
    color: #007bff; 
    margin-bottom: 1rem;
}

.product-card .input-row {
    display: flex;
    align-items: center; 
    gap: 0.5rem; 
    margin-top: auto; 
}

.product-card .input-row input[type="number"] {
   padding: 0.4rem;
   width: 50px; 
   border: 1px solid #ccc;
   border-radius: 4px;
   text-align: center;
}

.product-card .input-row .confirm-button {
  flex-grow:1; 
  padding: .5rem .7rem; 
  font-size:0.85rem; 
  background-color: #007bff; /* Note: .confirm-button global a un gradient */
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.product-card .input-row .confirm-button:hover {
  background-color: #0056b3;
}

/* Styles pour product-detail-card (injectÃ©s par JS) */
.product-details-container { margin: 15px 0; }
.product-detail-card { border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; margin-bottom: 20px; background: #ffffff; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.product-detail-header { display: flex; padding: 15px; }
.product-detail-img { width: 120px; flex-shrink: 0; margin-right: 20px; }
.product-detail-img img { width: 100%; height: auto; border-radius: 4px; }
.product-detail-summary { flex-grow: 1; }
.product-detail-summary h3 { margin: 0 0 10px; color: #2956c5; font-size: 1.3rem; }
.product-detail-short { margin: 0 0 10px; font-size: 1rem; }
.product-detail-price { font-weight: bold; font-size: 1.2rem; color: #2956c5; margin: 5px 0; }
.product-detail-delivery { font-size: 0.9rem; color: #666; margin-bottom: 15px; }
.product-detail-description { padding: 15px; border-top: 1px solid #eee; font-size: 0.95rem; line-height: 1.5; }
.product-detail-card .btn-add-to-cart { background: #2956c5; color: white; border: none; padding: 8px 15px; border-radius: 4px; cursor: pointer; font-weight: 600; }
.product-detail-card .btn-add-to-cart.added { background: #57a957; }
@media (max-width: 600px) {
  .product-detail-header { flex-direction: column; }
  .product-detail-img { width: 100%; margin-right: 0; margin-bottom: 15px; }
}

/* Styles pour le tableau de comparaison */
.comparison-table-container {
    margin: 20px auto;
    max-width: 100%;
    overflow-x: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: white;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border-radius: 8px;
    overflow: hidden;
}

.comparison-table thead th {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 15px 10px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.comparison-table thead th:first-child {
    text-align: left;
    width: 200px;
    min-width: 180px;
}

.comparison-table tbody td {
    padding: 12px 10px;
    border-bottom: 1px solid #ecf0f1;
    vertical-align: middle;
    font-size: 13px;
}

.comparison-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.comparison-table tbody tr:hover {
    background-color: #e3f2fd;
    transition: background-color 0.2s ease;
}

.comparison-table tbody td:first-child {
    background-color: #ecf0f1 !important;
    border-right: 2px solid #bdc3c7;
    font-weight: 600;
    color: #2c3e50;
}

.comparison-table tbody td:not(:first-child) {
    text-align: center;
}

/* Style pour les images dans le tableau */
.comparison-table img {
    max-width: 120px;
    max-height: 90px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* Boutons d'action pour chaque produit */
.comparison-table-container .action-container {
    margin-top: 20px;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 0 10px;
}

.comparison-table-container .product-actions {
    background: #f8f9fa;
    border: 2px solid #3498db;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    min-width: 200px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.comparison-table-container .product-actions:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.comparison-table-container .product-actions h5 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-weight: 600;
}

.comparison-table-container .product-actions input[type="number"] {
    width: 60px;
    padding: 5px;
    margin-right: 10px;
    border-radius: 4px;
    border: 1px solid #bdc3c7;
    text-align: center;
}

/* ============================================
   RESPONSIVE MOBILE - CARTES PRODUITS
   ============================================ */

/* Tablettes */
@media (max-width: 1024px) {
    .product-card-container {
        gap: 10px;
    }

    .product-card {
        padding: 0.85rem;
        max-width: 100%;
    }

    .product-card img {
        max-height: 110px;
    }

    .product-card h5.product-title {
        font-size: 1rem;
    }

    .product-card .product-title {
        font-size: 0.9rem;
    }

    .product-card .price {
        font-size: 0.95rem;
    }

    /* Product detail card */
    .product-detail-card {
        margin-bottom: 15px;
    }

    .product-detail-header {
        padding: 12px;
    }

    .product-detail-img {
        width: 100px;
        margin-right: 15px;
    }

    .product-detail-summary h3 {
        font-size: 1.2rem;
    }

    .product-detail-description {
        padding: 12px;
        font-size: 0.9rem;
    }
}

/* Smartphones */
@media (max-width: 768px) {
    .product-card-container {
        gap: 12px;
        margin-top: 0.5rem;
    }

    .product-card {
        padding: 1rem;
        border-radius: 10px;
        max-width: 100%;
        min-width: 100%;
        width: 100%;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }

    .product-card img {
        max-height: 130px;
        margin-bottom: 0.85rem;
        padding-bottom: 0.85rem;
    }

    .product-card h5.product-title,
    .product-card .product-title {
        font-size: 1rem;
        margin-bottom: 0.4rem;
        min-height: auto;
    }

    .product-card p.product-ref,
    .product-card .product-ref {
        font-size: 0.8rem;
        margin-bottom: 0.6rem;
    }

    .product-card ul.product-key-points,
    .product-card .product-key-points {
        font-size: 0.85rem;
        margin: 0.6rem 0;
        padding-left: 1.3rem;
    }

    .product-card ul.product-key-points li,
    .product-card .product-key-points li {
        margin-bottom: 0.25rem;
        line-height: 1.4;
    }

    .product-card p.product-delivery,
    .product-card .product-delivery {
        font-size: 0.85rem;
        margin: 0.4rem 0;
    }

    .product-card .price {
        font-size: 1.1rem;
        margin: 0.75rem 0;
    }

    .product-card .input-row,
    .input-row {
        gap: 0.6rem;
        padding-top: 0.85rem;
        flex-wrap: nowrap;
    }

    .product-card .input-row input[type="number"] {
        padding: 0.6rem;
        width: 60px;
        font-size: 1rem;
        border-radius: 6px;
    }

    .product-card .input-row .confirm-button {
        padding: 0.65rem 0.9rem;
        font-size: 0.9rem;
        flex-grow: 1;
        border-radius: 8px;
        min-height: 44px;
    }

    /* Product detail card responsive */
    .product-details-container {
        margin: 12px 0;
    }

    .product-detail-card {
        margin-bottom: 15px;
        border-radius: 10px;
    }

    .product-detail-header {
        flex-direction: column;
        padding: 15px;
    }

    .product-detail-img {
        width: 100%;
        max-width: 200px;
        margin: 0 auto 15px;
    }

    .product-detail-summary {
        text-align: center;
    }

    .product-detail-summary h3 {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }

    .product-detail-short {
        font-size: 0.95rem;
        margin-bottom: 12px;
    }

    .product-detail-price {
        font-size: 1.15rem;
        margin: 8px 0;
    }

    .product-detail-delivery {
        font-size: 0.85rem;
        margin-bottom: 12px;
    }

    .product-detail-description {
        padding: 15px;
        font-size: 0.9rem;
        line-height: 1.6;
        text-align: left;
    }

    .product-detail-card .btn-add-to-cart {
        padding: 12px 20px;
        font-size: 1rem;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
        display: block;
        border-radius: 8px;
        min-height: 48px;
    }

    /* Tableau de comparaison responsive */
    .comparison-table-container {
        margin: 10px 5px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 10px;
    }

    .comparison-table {
        min-width: 600px;
        font-size: 12px;
    }

    .comparison-table thead th {
        padding: 10px 8px;
        font-size: 13px;
        position: sticky;
        top: 0;
    }

    .comparison-table thead th:first-child {
        width: 140px;
        min-width: 120px;
    }

    .comparison-table tbody td {
        padding: 10px 8px;
        font-size: 12px;
    }

    .comparison-table tbody td:first-child {
        width: 140px;
        min-width: 120px;
        font-size: 11px;
    }

    .comparison-table img {
        max-width: 70px;
        max-height: 55px;
    }

    .comparison-table-container .action-container {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 10px;
    }

    .comparison-table-container .product-actions {
        width: 100%;
        max-width: none;
        padding: 12px;
        min-width: auto;
    }

    .comparison-table-container .product-actions h5 {
        font-size: 1rem;
        margin-bottom: 12px;
    }

    .comparison-table-container .product-actions input[type="number"] {
        width: 70px;
        padding: 8px;
        font-size: 1rem;
        margin-right: 10px;
    }

    .comparison-table-container .product-actions button {
        padding: 10px 16px;
        font-size: 0.9rem;
        min-height: 44px;
    }
}

/* Très petits smartphones */
@media (max-width: 375px) {
    .product-card {
        padding: 0.85rem;
    }

    .product-card img {
        max-height: 110px;
    }

    .product-card h5.product-title,
    .product-card .product-title {
        font-size: 0.95rem;
    }

    .product-card .input-row input[type="number"] {
        width: 55px;
        padding: 0.5rem;
    }

    .product-card .input-row .confirm-button {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }

    .product-detail-summary h3 {
        font-size: 1.1rem;
    }

    .product-detail-price {
        font-size: 1.05rem;
    }

    .comparison-table {
        min-width: 550px;
        font-size: 11px;
    }

    .comparison-table thead th:first-child,
    .comparison-table tbody td:first-child {
        width: 120px;
        min-width: 100px;
    }

    .comparison-table img {
        max-width: 60px;
        max-height: 50px;
    }

    .comparison-table-container .product-actions input[type="number"] {
        width: 60px;
        padding: 6px;
    }
}

/* Tablettes en mode paysage */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .product-card {
        max-width: 100%;
    }

    .comparison-table-container {
        margin: 15px auto;
    }
}

/* RESPONSIVE - Cartes produits horizontales (column-1, column-2, column-3) */
@media (max-width: 768px) {
    /* Forcer l'affichage en colonne verticale sur mobile */
    .product-card-horizontal {
        flex-direction: column !important;
        gap: 12px !important;
        padding: 16px !important;
    }

    /* Column 1 - Image en haut, centrée */
    .product-card-horizontal .column-1 {
        flex: 0 0 auto !important;
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
    }

    .product-card-horizontal .column-1 .product-image-left img {
        width: 160px !important;
        height: 160px !important;
    }

    /* Column 2 - Infos produit */
    .product-card-horizontal .column-2 {
        flex: 1 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        width: 100% !important;
    }

    .product-card-horizontal .column-2 .product-title {
        font-size: 15px !important;
        line-height: 1.3 !important;
    }

    .product-card-horizontal .column-2 .product-ref {
        font-size: 12px !important;
    }

    .product-card-horizontal .column-2 .price {
        font-size: 18px !important;
    }

    /* Column 3 - Contrôles quantité en bas, pleine largeur */
    .product-card-horizontal .column-3 {
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 12px !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    .product-card-horizontal .column-3 .quantity-display {
        font-size: 32px !important;
        min-height: auto !important;
        flex: 0 0 auto !important;
        margin-right: 12px !important;
    }

    .product-card-horizontal .column-3 .quantity-controls {
        flex: 0 0 auto !important;
        margin-right: 12px !important;
    }

    .product-card-horizontal .column-3 .confirm-button {
        flex: 1 !important;
        margin-top: 0 !important;
        padding: 12px 16px !important;
        font-size: 14px !important;
        min-height: 48px !important;
    }

    /* Boutons +/- */
    .product-card-horizontal .qty-minus,
    .product-card-horizontal .qty-plus {
        width: 40px !important;
        height: 40px !important;
        font-size: 22px !important;
    }

    /* Lien documentation */
    .product-card-horizontal a[download] {
        font-size: 11px !important;
        padding: 6px 10px !important;
        display: inline-flex !important;
    }
}

/* Très petits smartphones */
@media (max-width: 375px) {
    .product-card-horizontal .column-1 .product-image-left img {
        width: 140px !important;
        height: 140px !important;
    }

    .product-card-horizontal .column-2 .product-title {
        font-size: 14px !important;
    }

    .product-card-horizontal .column-2 .price {
        font-size: 16px !important;
    }

    .product-card-horizontal .column-3 .quantity-display {
        font-size: 28px !important;
        margin-right: 10px !important;
    }

    .product-card-horizontal .qty-minus,
    .product-card-horizontal .qty-plus {
        width: 36px !important;
        height: 36px !important;
        font-size: 20px !important;
    }
}

/* Optimisations tactiles pour les cartes produits */
@media (hover: none) and (pointer: coarse) {
    /* Zones tactiles suffisantes */
    .product-card .input-row input[type="number"],
    .product-card .input-row .confirm-button,
    .product-detail-card .btn-add-to-cart,
    .comparison-table-container .product-actions button,
    .product-card-horizontal .qty-minus,
    .product-card-horizontal .qty-plus,
    .product-card-horizontal .confirm-button {
        min-height: 44px;
        min-width: 44px;
    }

    /* Pas d'effet hover */
    .product-card .input-row .confirm-button:hover,
    .comparison-table-container .product-actions:hover,
    .product-card-horizontal .confirm-button:hover {
        transform: none;
        box-shadow: inherit;
    }

    /* Effet active */
    .product-card .input-row .confirm-button:active,
    .product-card-horizontal .confirm-button:active {
        transform: scale(0.98);
    }

    .product-card-horizontal .qty-minus:active,
    .product-card-horizontal .qty-plus:active {
        transform: scale(0.95);
        background: rgba(255, 255, 255, 0.25) !important;
    }

    .product-detail-card .btn-add-to-cart:active {
        transform: scale(0.98);
    }

    .comparison-table tbody tr:hover {
        background-color: inherit;
    }

    .comparison-table-container .product-actions:active {
        transform: scale(0.98);
    }
} 