/**
 * =======================================================================
 * SHIPPING COLLAPSE - CSS (VERSION FINALE)
 * =======================================================================
 * 
 * Design épuré et professionnel avec tableau
 * Compatible avec le thème Astra
 * 
 * =======================================================================
 */

/* ===================================================================
   VARIABLES CSS
   =================================================================== */
:root {
    --shipping-primary: #242424;
    --shipping-text: #333333;
    --shipping-text-light: #666666;
    --shipping-border: #e0e0e0;
    --shipping-bg-light: #f9f9f9;
    --shipping-bg-white: #ffffff;
}

/* ===================================================================
   MÉTHODE DE LIVRAISON - Item principal
   =================================================================== */
   
ul.products-list{
	padding-left: 0!important;
}

.supplier-detail-card{border-bottom: 1px solid #efefef; margin-bottom: 15px;}

.supplier-header, .supplier_name_1{
    position: relative;
    background-image: url('/wp-content/themes/astra-child/img/picto-livraison-panier.png');
    background-repeat: no-repeat;
    background-position: calc(100% - 10px);
    background-size: 27px auto;
}   
   
.shipping-method-item {
    margin: 15px 0 !important;
	text-indent: 0!important;
    padding: 10px 5px !important;
    text-align: left;
    background: var(--shipping-bg-white);
    border: 1px solid var(--shipping-border);
    border-radius: 8px;
    transition: all 0.2s ease;
}


.shipping-method-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    color: var(--shipping-text);
    margin: 0;
}

.shipping-method-item input[type="radio"] {
    margin-right: 12px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.shipping-method-item img{
	display:block;
}

/* ===================================================================
   BOUTON TOGGLE - TOUTE LARGEUR
   =================================================================== */
.shipping-details-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    padding: 12px 20px;
    background: var(--shipping-bg-light);
    border: 1px solid var(--shipping-border);
    border-radius: 6px;
    color: var(--shipping-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    
    /* Force capture clics */
    pointer-events: auto !important;
    position: relative;
    z-index: 10;
}

.shipping-details-toggle * {
    pointer-events: none;
}

.shipping-details-toggle:hover {
    background: var(--shipping-primary);
    color: white;
    border-color: var(--shipping-primary);
}

.shipping-details-toggle.expanded {
    background: var(--shipping-primary);
    color: white;
    border-color: var(--shipping-primary);
}

.toggle-icon {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.expanded .toggle-icon {
    transform: rotate(180deg);
}

/* ===================================================================
   CONTENU COLLAPSE
   =================================================================== */
.shipping-details-content {
    margin-top: 16px;
    padding: 0;
    background: transparent;
}


/* ===================================================================
   TABLEAU DES FOURNISSEURS
   =================================================================== */
.shipping-suppliers-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--shipping-bg-white);
    border: 1px solid var(--shipping-border);
    border-radius: 6px;
    overflow: hidden;
}

/* En-tête du tableau */
.shipping-suppliers-table thead {
    background: var(--shipping-bg-light);
}

.shipping-suppliers-table thead th {
    padding: 14px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    color: var(--shipping-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--shipping-border);
}

/* Corps du tableau */
.shipping-suppliers-table tbody tr {
    border-bottom: 1px solid var(--shipping-border);
    transition: background 0.2s ease;
}

.shipping-suppliers-table tbody tr:last-child {
    border-bottom: none;
}

.shipping-suppliers-table tbody tr:hover {
    background: #fffbfc;
}

.shipping-suppliers-table tbody td {
    padding: 16px;
    vertical-align: top;
    font-size: 14px;
    line-height: 1.6;
}

/* Colonne Fournisseur */
.supplier-name-col {
    color: var(--shipping-text);
    font-weight: 600;
    width: 20%;
}

/* Colonne Montant */
.supplier-cost-col {
    color: var(--shipping-primary);
    font-weight: 700;
    font-size: 16px;
    width: 15%;
    white-space: nowrap;
}

/* Colonne Dates */
.supplier-dates-col {
    color: var(--shipping-text-light);
    width: 25%;
}

.supplier-dates-col strong {
    color: var(--shipping-primary);
    font-weight: 600;
}

.supplier-dates-col em {
    color: var(--shipping-text-light);
    font-style: italic;
}

/* Colonne Produits */
.supplier-products-col {
    width: 40%;
}

.supplier-products-col ul {
    margin: 0;
    padding-left: 20px;
    list-style: none;
}

.supplier-products-col ul li {
    position: relative;
    margin-bottom: 6px;
    padding-left: 4px;
    font-size: 13px;
    color: var(--shipping-text-light);
    line-height: 1.5;
}

.supplier-products-col ul li:before {
    content: "•";
    position: absolute;
    left: -12px;
    color: var(--shipping-primary);
    font-weight: bold;
}

.supplier-products-col ul li:last-child {
    margin-bottom: 0;
}

/* ===================================================================
   NOTICE MESSAGERIE
   =================================================================== */
.messagerie-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 12px 16px;
    background: #eff6ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    font-size: 13px;
    color: #0c4a6e;
}

.messagerie-notice svg {
    flex-shrink: 0;
    color: #0284c7;
}

/* ===================================================================
   AFFICHAGE SIMPLIFIÉ (1 FOURNISSEUR)
   =================================================================== */
.single-supplier-info {
    margin-top: 8px;
    padding: 10px 14px;
    background: #f0f9ff;
    border-radius: 6px;
    border: 1px solid #bae6fd;
    font-size: 13px;
    color: #0c4a6e;
}

.single-supplier-info strong {
    color: var(--shipping-primary);
    font-weight: 700;
}

/* ===================================================================
   RESPONSIVE - TABLET (992px)
   =================================================================== */
@media (max-width: 992px) {
    .shipping-suppliers-table {
        font-size: 13px;
    }
    
    .shipping-suppliers-table thead th {
        padding: 12px 14px;
        font-size: 12px;
    }
    
    .shipping-suppliers-table tbody td {
        padding: 14px;
    }
    
    .supplier-name-col {
        width: 22%;
    }
    
    .supplier-cost-col {
        width: 18%;
    }
    
    .supplier-dates-col {
        width: 28%;
    }
    
    .supplier-products-col {
        width: 32%;
    }
}

/* ===================================================================
   RESPONSIVE - MOBILE (768px)
   =================================================================== */
@media (max-width: 768px) {
    .shipping-method-item {
        padding: 12px 16px;
    }
    
    .shipping-details-toggle {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    /* Passer en mode "carte" sur mobile */
    .shipping-suppliers-table,
    .shipping-suppliers-table thead,
    .shipping-suppliers-table tbody,
    .shipping-suppliers-table tr,
    .shipping-suppliers-table td,
    .shipping-suppliers-table th {
        display: block;
    }
    
    .shipping-suppliers-table thead {
        display: none; /* Masquer l'en-tête sur mobile */
    }
    
    .shipping-suppliers-table tbody tr {
        margin-bottom: 16px;
        border: 1px solid var(--shipping-border);
        border-radius: 6px;
        padding: 0;
    }
    
    .shipping-suppliers-table tbody tr:last-child {
        margin-bottom: 0;
    }
    
    .shipping-suppliers-table tbody td {
        padding: 12px 16px;
        border-bottom: 1px solid var(--shipping-border);
        width: 100% !important;
    }
    
    .shipping-suppliers-table tbody td:last-child {
        border-bottom: none;
    }
    
    /* Ajouter des labels sur mobile */
    .shipping-suppliers-table tbody td:before {
        content: attr(data-label);
        display: block;
        font-weight: 700;
        font-size: 11px;
        color: var(--shipping-text-light);
        text-transform: uppercase;
        margin-bottom: 4px;
        letter-spacing: 0.5px;
    }
    
    .supplier-name-col:before {
        content: "Fournisseur";
    }
    
    .supplier-cost-col:before {
        content: "Montant";
    }
    
    .supplier-dates-col:before {
        content: "Livraison prévue";
    }
    
    .supplier-products-col:before {
        content: "Produits";
    }
    
    .supplier-products-col ul li {
        font-size: 12px;
    }
}

/* ===================================================================
   ACCESSIBILITÉ
   =================================================================== */
.shipping-details-toggle:focus-visible {
    outline: 3px solid var(--shipping-primary);
    outline-offset: 3px;
}

button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--shipping-primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===================================================================
   PRINT
   =================================================================== */
@media print {
    .shipping-details-toggle {
        display: none;
    }
    
    .shipping-details-content {
        display: block !important;
        max-height: none !important;
        opacity: 1 !important;
    }
    
    .shipping-suppliers-table {
        border: 1px solid #333;
    }
    
    .shipping-suppliers-table thead {
        background: #f0f0f0;
    }
}