/* ==========================================================================
   PRODUCT DETAIL PAGE - Galerie d'images corrigée
   Fichier: 05-pages/products/product-detail.css
   ========================================================================== */

/* Vue d'ensemble du produit */
.product-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
    align-items: start;
}

/* Container des images */
.product-images {
    position: relative;
}

/* Image principale - TAILLE CONTRÔLÉE */
.main-image {
    width: 100%;
    max-width: 500px;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s ease;
    display: block;
    margin: 0 auto;
}

.main-image:hover {
    transform: scale(1.02);
}

/* Grille des miniatures - TAILLE FIXE */
.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 15px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.thumbnail {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

/* Zone d'agrandissement */
.image-zoom-area {
    margin-top: 20px;
    min-height: 250px;
    max-height: 400px;
    background: #f8f9fa;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.enlarged-image {
    max-width: 100%;
    max-height: 350px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: zoomIn 0.3s ease;
}

.image-zoom-placeholder {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.close-zoom {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 18px;
    display: none;
    z-index: 10;
}

.close-zoom:hover {
    background: rgba(0,0,0,0.9);
}

@keyframes zoomIn {
    from { 
        opacity: 0; 
        transform: scale(0.8); 
    }
    to { 
        opacity: 1; 
        transform: scale(1); 
    }
}

/* Détails du produit */
.product-details {
    padding: 0 20px;
}

.product-details h2 {
    font-size: 2rem;
    color: #1a73e8;
    margin-bottom: 15px;
}

.price-badge {
    background: linear-gradient(135deg, #1a73e8, #4285f4);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    display: inline-block;
    margin: 15px 0;
}

.key-specs, .compatibility {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 4px solid #1a73e8;
}

.key-specs h3, .compatibility h3 {
    color: #1a73e8;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.key-specs ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.key-specs li {
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.key-specs li:last-child {
    border-bottom: none;
}

.driver-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.driver-item {
    background: white;
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid #1a73e8;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* RESPONSIVE */
@media (max-width: 992px) {
    .product-overview {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .main-image {
        max-width: 100%;
        max-height: 350px;
    }
    
    .thumbnail-grid {
        max-width: 100%;
    }
    
    .image-zoom-area {
        min-height: 200px;
        max-height: 300px;
    }
    
    .product-details {
        padding: 0;
    }
}

@media (max-width: 768px) {
    .main-image {
        max-height: 300px;
    }
    
    .thumbnail-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .image-zoom-area {
        min-height: 150px;
        max-height: 250px;
    }
    
    .cta-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .thumbnail-grid {
        grid-template-columns: 1fr;
    }
    
    .main-image {
        max-height: 250px;
    }
    
    .product-details h2 {
        font-size: 1.5rem;
    }
}
/* Overlay de commentaire dans la zone zoom */
.image-comment-overlay {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 10px;
    border-radius: 5px;
    font-size: 0.9rem;
}

.image-comment-overlay p {
    margin: 0;
    text-align: center;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* Lightbox pour agrandissement modal */
.image-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    cursor: pointer;
}

.image-lightbox.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.image-lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.close-lightbox {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 10px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    transition: background 0.3s ease;
}

.close-lightbox:hover {
    background: rgba(0,0,0,0.8);
}
/* IMAGES PRODUIT */
.product-image {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    padding: 20px;
    background-color: white;
    height: auto;
    min-height: 300px;
}

.product1-img {
    height: 300px;
    background-color: var(--medium);
    width: 100%;
    object-fit: cover;
    position: relative;
    z-index: 1;
    border-radius: 5px;
}

.placeholder-image::before {
    content: "📷";
    font-size: 3rem;
    margin-bottom: 15px;
}

/* INFO PRODUIT */
.product-info {
    flex: 1;
    min-width: 300px;
}

.product-title {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.product-ref {
    color: var(--dark);
    font-size: 1.2rem;
    margin-bottom: 20px;
    display: inline-block;
    background-color: var(--light);
    padding: 5px 15px;
    border-radius: 20px;
}

.product-description {
    font-size: 1.1rem;
    margin-bottom: 30px;
    color: #555;
    line-height: 1.6;
}

/* CARACTÉRISTIQUES */
.product-features {
    margin-bottom: 20px;
}

.product-features h3 {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--medium);
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li:last-child {
    border-bottom: none;
}


.connectivity-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 80px 0;
}

.connectivity-hero {
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    color: white;
    padding: 60px 40px;
    border-radius: 20px;
    margin-bottom: 60px;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 40px;
    opacity: 0.9;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    flex-wrap: wrap;
}

/* Schéma des connecteurs */
.connectors-diagram {
    background: white;
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 40px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.diagram-title {
    text-align: center;
    margin-bottom: 30px;
    color: #1a73e8;
    font-size: 1.8rem;
}

.board-visualization {
    display: flex;
    justify-content: center;
}

.board-outline {
    position: relative;
    width: 400px;
    height: 250px;
    background: linear-gradient(145deg, #2c3e50, #34495e);
    border-radius: 15px;
    border: 3px solid #1a73e8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.board-label {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.connector-pin {
    position: absolute;
    width: 60px;
    height: 40px;
    background: #1a73e8;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid white;
}

.connector-pin:hover {
    transform: scale(1.1);
    z-index: 10;
    box-shadow: 0 5px 15px rgba(26, 115, 232, 0.5);
}

.j34 { top: 20px; left: 20px; background: #e74c3c; }
.j35 { top: 20px; right: 20px; background: #2ecc71; }
.j36 { bottom: 20px; left: 20px; background: #f39c12; }
.j37 { bottom: 20px; right: 20px; background: #9b59b6; }

.pin-label {
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
}

.pin-tooltip {
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.connector-pin:hover .pin-tooltip {
    opacity: 1;
}

.connector-legend {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.legend-item:hover {
    background: #e8f4f8;
    transform: translateX(5px);
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.i2c-color { background: #e74c3c; }
.spi-color { background: #2ecc71; }
.uart-color { background: #f39c12; }
.onewire-color { background: #9b59b6; }

/* Onglets */
.protocols-tabs {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

.tabs-header {
    display: flex;
    background: linear-gradient(90deg, #f8f9fa, #e9ecef);
    border-bottom: 1px solid #e0e0e0;
}


.tab-btn:hover, .tab-btn.active {
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: white;
}

.tab-icon {
    font-size: 1.5rem;
}

.tab-text {
    font-weight: bold;
}

.tab-badge {
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
}

.protocol-showcase {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.protocol-header {
    margin-bottom: 30px;
}

.protocol-header h3 {
    margin-bottom: 15px;
    color: #1a73e8;
    font-size: 1.8rem;
}

.protocol-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.badge.primary { background: #1a73e8; color: white; }
.badge.success { background: #28a745; color: white; }
.badge.warning { background: #ffc107; color: #333; }
.badge.info { background: #17a2b8; color: white; }

.feature-text strong {
    display: block;
    margin-bottom: 5px;
    color: #1a73e8;
}

.sensors-showcase h4 {
    color: #1a73e8;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.sensors-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sensor-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.sensor-card.featured {
    border-left-color: #1a73e8;
    background: linear-gradient(135deg, #e8f4f8, #f0f7ff);
}

.sensor-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.sensor-icon {
    font-size: 1.5rem;
    background: #1a73e8;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sensor-info {
    flex: 1;
}

.sensor-info strong {
    display: block;
    color: #1a73e8;
    margin-bottom: 2px;
}

.sensor-specs {
    font-size: 0.8rem;
    color: #666;
    background: white;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
    margin-top: 3px;
}

.sensor-price {
    font-weight: bold;
    color: #28a745;
    background: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.9rem;
}

/* Exemples d'usage */
.usage-examples {
    background: white;
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 40px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.usage-examples h3 {
    text-align: center;
    margin-bottom: 30px;
    color: #1a73e8;
    font-size: 1.8rem;
}

.example-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    transition: transform 0.3s ease;
    border-left: 5px solid #1a73e8;
}

.example-card:hover {
    transform: translateY(-5px);
}

.example-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.example-icon {
    font-size: 2rem;
    background: #1a73e8;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.example-header h4 {
    margin: 0;
    color: #1a73e8;
}

.example-sensors {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.sensor-tag {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
    color: white;
}

.sensor-tag.i2c { background: #e74c3c; }
.sensor-tag.spi { background: #2ecc71; }
.sensor-tag.uart { background: #f39c12; }
.sensor-tag.onewire { background: #9b59b6; }

/* CTA */
.connectivity-cta {
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: white;
    padding: 50px;
    border-radius: 15px;
    text-align: center;
}

.cta-content h3 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.cta-content p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .diagram-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .board-outline {
        width: 300px;
        height: 200px;
    }
    
    .protocol-showcase {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .tabs-header {
        flex-direction: column;
    }
    
    .hero-stats {
        gap: 30px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
}
