/**
 * Jkc_Sacs - Styles pour le tableau des produits sacs
 * Compatible Magento 2.4.x
 */

/* Variables */
:root {
    --sacs-orange: #EF9700;
    --sacs-orange-dark: #e4720d;
    --sacs-blue: #30A5FF;
    --sacs-black: #000;
    --sacs-white: #fff;
    --sacs-grey: #ddd;
    --sacs-green: #55c65e;
    --sacs-red: #ff5501;
}

/* Container principal */
.sacs-table-container {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 20px;
}

/* Titre de page avec ligne */
.page-with-filter h1#page-title-heading {
    font-size: 24px;
    position: relative;
    display: block;
    text-align: left;
    margin: 0 0 10px;
    z-index: 2;
}

.page-with-filter h1#page-title-heading span {
    background: var(--sacs-white);
    padding: 0 10px 0 0;
}

.page-with-filter h1#page-title-heading:after {
    content: '';
    display: block;
    background: var(--sacs-orange);
    height: 1px;
    width: 100%;
    position: absolute;
    top: 50%;
    z-index: -1;
}

/* Table */
.sacs-products-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

/* En-tête du tableau */
.sacs-products-table thead th {
    font-size: 16px;
    background: var(--sacs-black);
    color: var(--sacs-white);
    text-align: center;
    padding: 12px 8px;
    font-weight: 600;
}

.sacs-products-table thead th.qty-column {
    width: 15%;
}

.sacs-products-table thead th.cart-column {
    width: 5%;
}

/* Corps du tableau */
.sacs-products-table tbody tr td {
    border-bottom: 1px solid var(--sacs-grey);
    padding: 12px 8px;
    vertical-align: middle;
}

.sacs-products-table tbody tr:hover {
    background-color: #f9f9f9;
}

/* Colonne Stock */
.sacs-products-table .stock {
    display: inline-block;
}

.sacs-products-table .stock .stock-label {
    display: none;
}

.sacs-products-table .stock:before {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 24px;
    line-height: 28px;
    font-family: 'luma-icons';
    margin: 0;
    vertical-align: top;
    display: inline-block;
    font-weight: normal;
    overflow: hidden;
    speak: none;
    text-align: center;
}

.sacs-products-table .stock.available:before {
    content: '\e610';
    color: var(--sacs-green);
}

.sacs-products-table .stock.unavailable:before {
    content: '\e616';
    color: var(--sacs-red);
}

/* Colonnes Prix */
.sacs-products-table .col-price-100,
.sacs-products-table .col-price-carton {
    white-space: nowrap;
}

.sacs-products-table .price-box {
    margin: 0;
}

.sacs-products-table .price-container {
    display: flex !important;
    flex-flow: column-reverse;
}

.sacs-products-table .price-excluding-tax .price {
    font-size: 16px !important;
    font-weight: bold;
    color: var(--sacs-blue);
}

.sacs-products-table .price-including-tax {
    font-size: 12px;
    color: #666;
}

.sacs-products-table .price-including-tax:before {
    content: attr(data-label) ' : ';
    font-size: 12px;
}

/* Formulaire et contrôles de quantité */
.sacs-add-to-cart-form {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.qty-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.sacs-products-table .qty-input {
    width: 50px;
    text-align: center;
    padding: 5px;
    border: 1px solid var(--sacs-grey);
    border-radius: 3px;
    font-size: 14px;
}

.sacs-products-table .qty-cta {
    background: var(--sacs-black);
    color: var(--sacs-white);
    font-size: 15px;
    border-radius: 5px;
    width: 27px;
    height: 27px;
    padding: 0;
    margin: 0;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.sacs-products-table .qty-cta:hover {
    background: var(--sacs-orange);
}

/* Bouton Ajouter au panier */
.sacs-products-table .action.tocart.primary {
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    background: var(--sacs-orange);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.sacs-products-table .action.tocart.primary:hover {
    background: var(--sacs-blue);
}

.sacs-products-table .action.tocart.primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.sacs-products-table .action.tocart.primary .cart-text {
    display: none;
}

.sacs-products-table .action.tocart.primary .cart-icon:before {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 24px;
    line-height: 28px;
    color: var(--sacs-white);
    content: '\e611';
    font-family: 'luma-icons';
    margin: 0;
    vertical-align: top;
    display: inline-block;
    font-weight: normal;
    overflow: hidden;
    speak: none;
    text-align: center;
}

/* Classe utilitaire pour masquer sur PC */
.noPc {
    display: none;
}

/* ================================
   RESPONSIVE - Mobile (max 768px)
   ================================ */
@media all and (max-width: 768px) {
    .noMobile {
        display: none;
    }
    
    body .noPc {
        display: block;
    }
    
    .sacs-products-table * {
        padding: 10px 2px;
        vertical-align: middle;
        font-size: 10px !important;
    }
    
    .sacs-products-table thead th {
        font-size: 11px !important;
        padding: 8px 4px;
    }
    
    /* Formulaire en mode compact */
    .sacs-add-to-cart-form {
        flex-direction: column;
        gap: 5px;
        position: relative;
        height: 80px;
        width: 60px;
        margin: 0 auto;
    }
    
    .qty-controls {
        flex-direction: column;
    }
    
    .sacs-products-table .qty-input {
        width: 22px;
        padding: 3px;
    }
    
    .sacs-products-table .qty-cta {
        width: 20px;
        height: 17px;
    }
    
    .sacs-products-table .action.tocart.primary {
        padding: 0 6px;
    }
    
    .sacs-products-table .action.tocart.primary .cart-icon:before {
        font-size: 14px !important;
    }
    
    .sacs-products-table .stock:before {
        font-size: 18px !important;
    }
    
    .sacs-products-table .price-including-tax:before {
        font-size: 10px !important;
    }
    
    .sacs-products-table .price-container .price-including-tax + .price-excluding-tax {
        padding: 0 !important;
    }
}

/* ================================
   Prix global styles
   ================================ */
body .price-container,
body .minicart-items-wrapper .price-container .price-wrapper,
.minicart-items .subtotal {
    display: flex !important;
    flex-flow: column-reverse;
}

.price-box span.price-container .price-including-tax * {
    font-size: 12px;
    font-weight: normal;
}

.price-box span.price-container .price-excluding-tax *,
.price-including-tax + .price-excluding-tax:before,
.weee[data-label]:before {
    font-size: 24px !important;
}

.page-with-filter .price-box span.price-container .price-excluding-tax * {
    font-size: 16px !important;
}

.price-including-tax + .price-excluding-tax:before {
    font-weight: bold;
}