/**
 * Styles pour TDC Tools - Produits Techniques
 *
 * @package TDC Tools Produits Techniques
 */

/* =========================================================================
   PASTILLE COULEUR TARAUDS MANIGLEY (Alu / Inox-Acier / Acier difficile)
   ========================================================================= */

/* Vignette boutique (Divi) : la pastille est INSIDE .et_shop_image */
.et_shop_image {
    position: relative;
    display: block; /* sinon position:relative sur span sans display n'a pas d'effet */
}

/* Fallback non-Divi (pastille en sibling du lien) */
.woocommerce ul.products li.product a,
.woocommerce-loop-product__link,
.products .product .woocommerce-LoopProduct-link {
    position: relative;
}

/* Page produit : la galerie WC est déjà en position:relative par défaut */
.woocommerce div.product div.images,
.woocommerce-product-gallery {
    position: relative;
}

.tdcpt-pastille {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 5px solid #fff;
    z-index: 5;
    display: inline-block;
    pointer-events: auto;
    transition: border 0.3s ease;
}
.product:hover .tdcpt-pastille {
    border: 10px solid;
}


/* Plus visible sur la fiche produit */
.woocommerce div.product div.images .tdcpt-pastille,
.woocommerce-product-gallery .tdcpt-pastille {
    width: 32px;
    height: 32px;
    bottom: 16px;
    right: 16px;
    border-width: 3px;
}

.tdcpt-pastille-alu             { border-color: #FFD000; } /* jaune */
.tdcpt-pastille-inox-acier      { border-color: #0022FF; } /* bleu  */
.tdcpt-pastille-acier-difficile { border-color: #FF0000; } /* rouge */


.product:hover  .tdcpt-pastille-alu             { border-color: #FFD000; } /* jaune */
.product:hover .tdcpt-pastille-inox-acier      { border-color: #0022FF; } /* bleu  */
.product:hover .tdcpt-pastille-acier-difficile { border-color: #FF0000; } /* rouge */

/* =========================================================================
   SPECS DANS LE DÉTAIL DE COMMANDE (frontend + admin)
   ========================================================================= */

.tdcpt-order-specs {
    margin-top: 5px;
    font-size: 12px;
    color: #555;
    line-height: 1.5;
}

.tdcpt-order-specs strong {
    font-weight: 700;
    color: #333;
}

/* =========================================================================
   Tableau des caractéristiques techniques
.tdcpt-specifications-table {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    margin: 20px 0;
}

.tdcpt-specs-title {
    margin: 0;
    padding: 10px 14px;
    font-size: 0.9em;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.3px;
    background: #303891;
    color: #ffffff;
    border-bottom: none;
}

.tdcpt-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Montserrat', sans-serif;
}

.tdcpt-table th,
.tdcpt-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #eeeeee;
    font-size: 0.92em;
    color: #333;
}

.tdcpt-table th {
    font-weight: 600;
    width: 40%;
    background: transparent;
}

.tdcpt-table td {
    color: #333;
}

.tdcpt-table tr:last-child th,
.tdcpt-table tr:last-child td {
    border-bottom: none;
}

.tdcpt-table tr:hover th,
.tdcpt-table tr:hover td {
    background-color: #f5f7ff;
}

.tdcpt-specs-note {
    padding: 10px 14px;
    margin: 0;
    color: #666;
    font-style: italic;
    font-size: 0.85em;
    font-family: 'Montserrat', sans-serif;
    border-top: 1px solid #eeeeee;
}

/* Animation pour l'apparition du tableau */
#tdcpt-specs-table {
    transition: opacity 0.3s ease-in-out;
}

/* Tableau de toutes les variations */
.tdcpt-all-variations-table {
    margin: 40px 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.tdcpt-variations-title {
    display: none;
}

.tdcpt-variations-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Montserrat', sans-serif;
}

.tdcpt-variations-table thead {
    background: #303891;
    color: white;
}

.tdcpt-variations-table thead th {
    padding: 10px 14px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9em;
    letter-spacing: 0.3px;
}

.tdcpt-variations-table tbody tr {
    border-bottom: 1px solid #eeeeee;
    transition: background-color 0.15s ease;
}

.tdcpt-variations-table tbody tr:last-child {
    border-bottom: none;
}

.tdcpt-variations-table tbody tr:hover {
    background-color: #f5f7ff;
}

.tdcpt-variations-table tbody td {
    padding: 10px 14px;
    text-align: center;
    color: #333;
    font-size: 0.92em;
}

.tdcpt-variations-table tbody td.tdcpt-diameter,
.tdcpt-variations-table tbody td.tdcpt-attr {
    font-weight: 600;
    color: #333;
}

.tdcpt-variations-table tbody td.tdcpt-code {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9em;
}

/* Responsive */
@media (max-width: 768px) {
    .tdcpt-all-variations-table {
        padding: 15px;
        margin: 20px 0;
    }
    
    .tdcpt-variations-title {
        font-size: 1.2em;
    }
    
    .tdcpt-variations-table {
        font-size: 0.85em;
    }
    
    .tdcpt-variations-table thead th,
    .tdcpt-variations-table tbody td {
        padding: 8px 6px;
    }
    
    .tdcpt-table th,
    .tdcpt-table td {
        padding: 10px;
        font-size: 0.95em;
    }
    
    .tdcpt-specs-title {
        font-size: 1.1em;
    }
}

/* Version mobile : tableau scrollable horizontalement */
@media (max-width: 600px) {
    .tdcpt-all-variations-table {
        overflow-x: auto;
    }
    
    .tdcpt-variations-table {
        min-width: 500px;
    }
}

/* Champs admin WordPress */
.tdcpt-variation-fields {
    padding: 10px;
    background: #f9f9f9;
    margin: 10px 0;
    border-left: 3px solid #2271b1;
    border-radius: 4px;
}

.tdcpt-variation-fields h4 {
    margin-top: 0;
    color: #2271b1;
}

/* Style pour les données dans le panier */
.woocommerce-cart-form__cart-item dl.variation {
    margin: 10px 0;
}

.woocommerce-cart-form__cart-item dl.variation dt {
    font-weight: 600;
    color: #333;
    margin-top: 5px;
}

.woocommerce-cart-form__cart-item dl.variation dd {
    margin: 0 0 5px 0;
    color: #666;
}


/* Message d'information quantité minimale */
.tdcpt-min-qty-notice {
    display: none;
    background: #e7f3ff;
    border-left: 4px solid #2271b1;
    padding: 12px 15px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 0.95em;
    color: #2271b1;
}

.tdcpt-min-qty-notice.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

.tdcpt-min-qty-notice strong {
    font-weight: 600;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================================================
   SHORTCODE [tdc_tags_produits] — Tags produit avec icônes
   ========================================================================= */

.tdcpt-product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin: 15px 0;
}

.tdcpt-product-tag-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-align: center;
}


.tdcpt-product-tag-item .tdcpt-tag-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.tdcpt-product-tag-item .tdcpt-tag-name {
    font-size: 0.8em;
    color: #555;
    font-weight: 500;
    line-height: 1.2;
    padding: 8px 12px;
}

/* Responsive tags */
@media (max-width: 600px) {
    .tdcpt-product-tags {
        gap: 8px;
    }

    .tdcpt-product-tag-item {
        padding: 6px 8px;
        min-width: 60px;
    }

    .tdcpt-product-tag-item .tdcpt-tag-icon {
        width: 30px;
        height: 30px;
    }

    .tdcpt-product-tag-item .tdcpt-tag-name {
        font-size: 0.75em;
    }
}