/**
 * Styles pour le bloc "Informations sur le produit"
 * Structure : Image (gauche 40%) + Accordéon (droite 60%)
 * Responsive : colonne unique en mobile
 */

/* ============================================
   GRID PRINCIPAL - 40% / 60%
   ============================================ */

.product-info-grid {
    display: grid;
    grid-template-columns: 40% 60%;
    gap: 2rem;
    padding: 1.5rem;
    background: #f8f9fc;
    border-radius: 8px;
}

/* ============================================
   COLONNE GAUCHE - IMAGE PRODUIT (40%)
   ============================================ */

.product-info-image {
    display: flex;
    align-items: flex-start; /* alignement en haut au lieu de center */
    justify-content: center;
}

/* Règle plus spécifique pour surcharger .tabs .tab-pane img du thème parent */
.tabs .tab-pane .product-info-image img,
.product-info-image img {
    width: 100%;
    height: auto !important; /* !important pour surcharger le height: 100% du thème */
    border: none;
    box-shadow: none;
    transition: none;
    object-fit: contain;
    display: block;
}

/* ============================================
   COLONNE DROITE - ACCORDÉON (60%)
   ============================================ */

.product-info-accordion {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ============================================
   ITEMS DE L'ACCORDÉON
   ============================================ */

.accordion-item {
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

/* Ajoute un trait de séparation au-dessus du premier accordéon */
.accordion-item:first-child {
    border-top: 1px solid #e0e0e0;
}

/* Le dernier accordéon garde aussi son trait en bas */
/* .accordion-item:last-child {
    border-bottom: none;
} */

/* ============================================
   EN-TÊTE DE L'ACCORDÉON
   ============================================ */

.accordion-header {
    margin: 0;
    padding: 0;
}

.accordion-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    text-align: left;
    transition: all 0.3s ease;
    position: relative;
}

/* Suppression du hover */
/* .accordion-toggle:hover {
    background-color: #f5f5f5;
    color: #000;
} */

/* Suppression du focus */
/* .accordion-toggle:focus {
    outline: 2px solid #007bff;
    outline-offset: -2px;
} */

/* État actif avec bordure supérieure */
.accordion-item.active .accordion-toggle {
    color: #0C0C0D;
    background-color: #f8f9fc;
    font-weight: 700;
}

/* ============================================
   ICÔNE +/- DE L'ACCORDÉON
   ============================================ */

.accordion-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: transparent;
    font-size: 1.5rem;
    font-weight: 300; /* moins épais */
    color: #0C0C0D;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-left: 1rem;
    line-height: 1; /* pour centrer verticalement */
}

.accordion-icon::before {
    content: "+";
    display: block;
}

.accordion-item.active .accordion-icon {
    color: #0C0C0D;
}

.accordion-item.active .accordion-icon::before {
    content: "−"; /* utilise le signe moins unicode (U+2212) qui est plus long */
}

/* ============================================
   CONTENU DE L'ACCORDÉON
   ============================================ */

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease, opacity 0.3s ease;
    opacity: 0;
}

.accordion-item.active .accordion-content {
    max-height: 2000px;
    opacity: 1;
}

.accordion-body {
    padding: 1.5rem 1rem;
    color: #555;
    line-height: 1.7;
    font-size: 0.95rem;
}

.accordion-body p {
    margin-bottom: 1rem;
}

.accordion-body p:last-child {
    margin-bottom: 0;
}

/* ============================================
   CARACTÉRISTIQUES (DATA SHEET)
   ============================================ */

.data-sheet {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem 1.5rem;
    margin: 0;
}

.data-sheet dt.name {
    font-weight: 600;
    color: #333;
    margin: 0;
}

.data-sheet dd.value {
    color: #666;
    margin: 0;
}

/* ============================================
   DOCUMENTATIONS (ATTACHMENTS)
   ============================================ */

.product-attachments {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.attachment-item {
    padding: 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.attachment-item:hover {
    border-color: #007bff;
    background-color: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.attachment-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
}

.attachment-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.attachment-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.attachment-name {
    color: #007bff;
    font-size: 1rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.attachment-link:hover .attachment-name {
    color: #0056b3;
    text-decoration: underline;
}

.attachment-description {
    color: #666;
    font-size: 0.875rem;
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

@media (max-width: 768px) {
    /* Passage en une seule colonne */
    .product-info-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1rem;
        margin: 1rem 0;
    }

    /* Image en haut */
    .product-info-image {
        order: 1;
    }

    .product-info-image img {
        max-width: 100%;
    }

    /* Accordéon en dessous */
    .product-info-accordion {
        order: 2;
    }

    /* Réduction de la taille des textes */
    .accordion-toggle {
        font-size: 1rem;
        padding: 1rem 0.75rem;
    }

    .accordion-body {
        padding: 1rem 0.75rem;
        font-size: 0.9rem;
    }

    /* Data sheet en colonne simple */
    .data-sheet {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .data-sheet dt.name {
        font-weight: 700;
        margin-top: 0.5rem;
    }

    .data-sheet dt.name:first-child {
        margin-top: 0;
    }
}

/* ============================================
   RESPONSIVE - TABLETTE
   ============================================ */

@media (min-width: 769px) and (max-width: 1024px) {
    .product-info-grid {
        gap: 1.5rem;
        padding: 1.25rem;
    }

    .accordion-toggle {
        font-size: 1rem;
    }

    .accordion-body {
        font-size: 0.925rem;
    }
}

/* ============================================
   ANIMATIONS SUPPLÉMENTAIRES
   ============================================ */

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

.accordion-item.active .accordion-body {
    animation: fadeIn 0.3s ease;
}

/* ============================================
   ACCESSIBILITÉ
   ============================================ */

.accordion-toggle:focus-visible {
    outline: 3px solid #007bff;
    outline-offset: 2px;
}

/* Mode sombre (optionnel) */
@media (prefers-color-scheme: dark) {
    .product-info-grid {
        background: #1a1a1a;
    }

    .accordion-toggle {
        color: #e0e0e0;
    }

    .accordion-toggle:hover {
        background-color: #2a2a2a;
        color: #fff;
    }

    .accordion-item.active .accordion-toggle {
        color: #4da3ff;
        background-color: #1a3a5a;
    }

    .accordion-body {
        color: #b0b0b0;
    }

    .data-sheet dt.name {
        color: #e0e0e0;
    }

    .data-sheet dd.value {
        color: #b0b0b0;
    }

    .attachment-item {
        border-color: #333;
        background-color: #1a1a1a;
    }

    .attachment-item:hover {
        border-color: #4da3ff;
        background-color: #2a2a2a;
    }
}
