/* ========================================
   product.css - Styles spécifiques à la page produit
   Version: 3.0 - Correction mobile absolue
   ======================================== */

/* Force le reset pour la zone produit */
.product-detail,
.product-two-columns,
.product-gallery,
.main-image,
.main-image img {
    box-sizing: border-box;
}

/* --- Structure principale --- */
.product-detail {
    margin-bottom: 60px;
    overflow-x: visible !important;
}
.product-two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    margin-bottom: 60px;
    overflow: visible !important;
}
.product-gallery {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    position: sticky;
    top: 100px;
}
.thumbnail-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    order: 2;
}
.thumbnail-list::-webkit-scrollbar {
    width: 4px;
}
.thumbnail-list::-webkit-scrollbar-track {
    background: #334155;
    border-radius: 4px;
}
.thumbnail-list::-webkit-scrollbar-thumb {
    background: #38bdf8;
    border-radius: 4px;
}
.thumbnail {
    width: 80px;
    height: 80px;
    background: #1e293b;
    border-radius: 12px;
    padding: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
}
.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.thumbnail:hover {
    transform: scale(1.05);
    border-color: #38bdf8;
}
.thumbnail.active {
    border-color: #38bdf8;
}
.main-image {
    flex: 1;
    background: #1e293b;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    border: 1px solid #334155;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.main-image:hover {
    border-color: #38bdf8;
}
.main-image img {
    max-width: 100%;
    max-height: 400px;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    display: block !important;
    margin: 0 auto !important;
}

/* --- Informations produit (inchangé sauf bouton) --- */
.product-brand {
    display: inline-block;
    background: rgba(56,189,248,0.1);
    color: #38bdf8;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 15px;
}
.product-title-main {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.3;
    word-break: break-word;
}
.product-rating {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.stars {
    color: #fbbf24;
    font-size: 14px;
    letter-spacing: 2px;
}
.rating-count {
    font-size: 13px;
    color: #94a3b8;
}
.price-section {
    background: #1e293b;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #334155;
}
.current-price {
    font-size: 32px;
    font-weight: 700;
    color: #38bdf8;
}
.original-price {
    font-size: 18px;
    color: #64748b;
    text-decoration: line-through;
    margin-left: 12px;
}
.price-vat {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 5px;
}
.stock-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 30px;
    margin-bottom: 20px;
    background: rgba(16,185,129,0.15);
    color: #10b981;
}
.key-features {
    list-style: none;
    margin-bottom: 25px;
}
.key-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #334155;
    font-size: 13px;
}
.key-features li i {
    color: #38bdf8;
    width: 20px;
}
.color-section {
    margin-bottom: 20px;
}
.color-label {
    font-size: 14px;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 12px;
}
.color-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.color-option {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid #334155;
}
.color-option:hover {
    transform: scale(1.05);
}
.color-option.active {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px #0f172a, 0 0 0 4px #38bdf8;
}
.quantity-section {
    margin-bottom: 24px;
}
.quantity-label {
    font-size: 14px;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 12px;
}
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #0f172a;
    width: fit-content;
    border-radius: 12px;
    border: 1px solid #334155;
    margin-bottom: 24px;
}
.quantity-btn {
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    color: #38bdf8;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
}
.quantity-btn:hover {
    color: #0ea5e9;
}
.quantity-input {
    width: 60px;
    text-align: center;
    background: none;
    border: none;
    color: #f1f5f9;
    font-size: 16px;
    font-weight: 600;
    outline: none;
}
.product-actions {
    margin-bottom: 24px;
    overflow: visible !important;
}
.btn-add-cart {
    background: #38bdf8;
    color: #0f172a;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
    min-height: 52px;
    touch-action: manipulation;
    white-space: normal;
    word-break: break-word;
}
.btn-add-cart:active {
    transform: scale(0.98);
    background: #0ea5e9;
}
.btn-add-cart:hover {
    background: #0ea5e9;
    transform: translateY(-2px);
}
.delivery-info {
    background: #1e293b;
    border-radius: 12px;
    padding: 15px;
    border: 1px solid #334155;
    margin-top: 20px;
}
.delivery-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    font-size: 12px;
}
.delivery-item i {
    width: 25px;
    color: #38bdf8;
}

/* --- Onglets --- */
.product-tabs {
    margin-top: 40px;
}
.tabs-nav {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid #334155;
    margin-bottom: 30px;
    flex-wrap: wrap;
}
.tab-link {
    padding: 12px 25px;
    background: none;
    border: none;
    font-size: 15px;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 8px 8px 0 0;
    touch-action: manipulation;
}
.tab-link:hover {
    color: #38bdf8;
    background: rgba(56,189,248,0.1);
}
.tab-link.active {
    color: #38bdf8;
    border-bottom: 2px solid #38bdf8;
    margin-bottom: -2px;
    background: rgba(56,189,248,0.05);
}
.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
    background: #1e293b;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #334155;
}
.tab-pane.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.description-content {
    color: #cbd5e1;
    line-height: 1.8;
    text-align: justify;
    word-wrap: break-word;
    white-space: pre-line;
}

/* --- Fiche technique --- */
.specs-container {
    background: #0f172a;
    border-radius: 16px;
    padding: 20px;
}
.specs-title {
    font-size: 18px;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #334155;
    display: flex;
    align-items: center;
    gap: 10px;
}
.specs-title i {
    color: #38bdf8;
}
.specs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.spec-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: #1e293b;
    border-radius: 12px;
    border: 1px solid #334155;
    transition: all 0.2s ease;
}
.spec-card:hover {
    border-color: #38bdf8;
    transform: translateX(4px);
}
.spec-card-icon {
    width: 40px;
    height: 40px;
    background: rgba(56,189,248,0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.spec-card-icon i {
    font-size: 20px;
    color: #38bdf8;
}
.spec-card-content {
    flex: 1;
}
.spec-card-label {
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.spec-card-value {
    font-size: 14px;
    font-weight: 600;
    color: #f1f5f9;
}

/* --- Produits similaires & accessoires --- */
.section-commune {
    margin-top: 60px;
}
.section-title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}
.section-title:after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: #38bdf8;
    margin: 15px auto 0;
    border-radius: 3px;
}
.items-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}
.item-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.3s;
    display: block;
}
.item-card:hover {
    transform: translateY(-5px);
    border-color: #38bdf8;
}
.item-image {
    background: #0f172a;
    padding: 20px;
    text-align: center;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.item-image img {
    max-height: 120px;
    object-fit: contain;
}
.item-info {
    padding: 15px;
    text-align: center;
}
.item-name {
    font-size: 14px;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 5px;
}
.item-price {
    font-size: 16px;
    font-weight: 700;
    color: #38bdf8;
}
.accessory-badge {
    display: inline-block;
    background: rgba(56,189,248,0.1);
    color: #38bdf8;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 12px;
    margin-bottom: 8px;
}

/* Avis clients */
.reviews-section {
    margin-top: 20px;
}
.reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}
.reviews-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.average-rating {
    font-size: 36px;
    font-weight: 800;
    color: #fbbf24;
}
.review-card {
    background: #0f172a;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #334155;
}
.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}
.review-author {
    font-weight: 600;
    color: #38bdf8;
}
.review-stars {
    color: #fbbf24;
    font-size: 14px;
    letter-spacing: 2px;
}
.review-date {
    color: #64748b;
    font-size: 12px;
}
.review-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 10px;
    color: #f1f5f9;
}
.review-comment {
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 12px;
}
.review-form-container {
    background: #0f172a;
    padding: 25px;
    border-radius: 16px;
    margin-top: 30px;
    border: 1px solid #334155;
}
.review-form-container input,
.review-form-container select,
.review-form-container textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #f1f5f9;
    font-size: 16px;
}
.review-form-container button {
    background: #38bdf8;
    color: #0f172a;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    min-height: 48px;
}

/* --- Breadcrumb --- */
.breadcrumb {
    background: #1e293b;
    border-bottom: 1px solid #334155;
    padding: 20px 0;
    margin-bottom: 30px;
}
.breadcrumb a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 13px;
}
.breadcrumb a:hover {
    color: #38bdf8;
}
.breadcrumb span {
    color: #475569;
    margin: 0 8px;
}
.breadcrumb .current {
    color: #38bdf8;
}

/* --- Modale zoom --- */
.modal-zoom {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    justify-content: center;
    align-items: center;
    cursor: pointer;
}
.modal-zoom img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}
.close-zoom {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
}
.back-link {
    display: inline-block;
    margin-top: 40px;
    color: #38bdf8;
    text-decoration: none;
}

/* ========================================
   RESPONSIVE : Tablettes & Mobiles
   ======================================== */

/* Tablettes (max 992px) */
@media (max-width: 992px) {
    .product-two-columns {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .product-gallery {
        position: static;
        flex-direction: row;
    }
    .thumbnail-list {
        flex-direction: column;
        width: 70px;
        max-height: 300px;
    }
    .thumbnail {
        width: 60px;
        height: 60px;
    }
    .items-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .specs-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* Mobiles larges (max 768px) */
@media (max-width: 768px) {
    .items-grid {
        grid-template-columns: 1fr;
    }
    .product-title-main {
        font-size: 24px;
    }
    .current-price {
        font-size: 28px;
    }
    .thumbnail-list {
        width: 55px;
    }
    .thumbnail {
        width: 50px;
        height: 50px;
    }
    .tab-link {
        padding: 10px 16px;
        font-size: 14px;
    }
    .price-section {
        padding: 16px;
    }
    .delivery-info {
        padding: 12px;
    }
}

/* === OPTIMISATIONS SPÉCIFIQUES POUR TOUS LES MOBILES (≤576px) === */
@media (max-width: 576px) {
    .product-gallery {
        flex-direction: column;
        gap: 16px;
        align-items: center;
        width: 100%;
    }
    .thumbnail-list {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        width: 100%;
        order: 2;
        max-height: none;
        padding-bottom: 8px;
        gap: 10px;
        justify-content: flex-start;
    }
    .thumbnail {
        width: 70px;
        height: 70px;
        flex-shrink: 0;
    }
    .main-image {
        order: 1;
        padding: 20px;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .main-image img {
        max-height: 250px;
        width: auto !important;
        margin: 0 auto !important;
    }

    /* Bouton Ajouter */
    .btn-add-cart {
        font-size: 15px;
        padding: 14px;
        min-height: 54px;
    }

    /* Quantité */
    .quantity-btn {
        width: 48px;
        height: 48px;
        font-size: 22px;
    }
    .quantity-input {
        font-size: 18px;
        width: 50px;
    }

    /* Espacements */
    .product-two-columns {
        gap: 24px;
    }
    .price-section {
        padding: 14px;
    }
    .current-price {
        font-size: 26px;
    }
    .original-price {
        font-size: 16px;
    }

    /* Onglets */
    .tab-link {
        padding: 10px 14px;
        font-size: 13px;
    }
    .tab-pane {
        padding: 18px;
    }

    /* Fiche technique */
    .spec-card {
        padding: 12px;
    }
    .spec-card-value {
        font-size: 13px;
    }
    .spec-card-label {
        font-size: 10px;
    }

    /* Cartes produits similaires */
    .item-image {
        height: 140px;
    }
    .item-image img {
        max-height: 100px;
    }
    .item-name {
        font-size: 13px;
    }
    .item-price {
        font-size: 14px;
    }

    /* Avis */
    .review-card {
        padding: 15px;
    }
    .review-form-container {
        padding: 18px;
    }
    .average-rating {
        font-size: 30px;
    }

    /* Breadcrumb */
    .breadcrumb {
        padding: 15px 0;
    }
    .breadcrumb a, .breadcrumb span, .breadcrumb .current {
        font-size: 12px;
    }
}

/* Très petits mobiles (≤480px) */
@media (max-width: 480px) {
    .product-title-main {
        font-size: 20px;
    }
    .stars, .rating-count {
        font-size: 12px;
    }
    .thumbnail {
        width: 60px;
        height: 60px;
    }
    .color-option {
        width: 40px;
        height: 40px;
    }
    .btn-add-cart {
        font-size: 14px;
        gap: 8px;
        padding: 12px;
    }
    .delivery-item {
        font-size: 11px;
    }
    .tab-link {
        padding: 8px 12px;
        font-size: 12px;
    }
    .specs-grid {
        gap: 8px;
    }
}
body { background: #0f172a !important; color: #f1f5f9 !important; }
#custom-notification {
    position: fixed; top: 20px; right: 20px; z-index: 10000;
    background: #1e293b; border-left: 4px solid #38bdf8;
    color: #f1f5f9; padding: 12px 20px; border-radius: 8px;
    font-size: 14px; box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateX(400px); opacity: 0;
}
#custom-notification.show { transform: translateX(0); opacity: 1; }
.lock-scroll { overflow: hidden; }

/* Styles pour les identifiants produit (GMC) */
.product-identifiers {
    background: #0f172a;
    border-radius: 12px;
    padding: 12px 16px;
    margin: 20px 0;
    font-size: 12px;
    border: 1px solid #334155;
}
.identifier-item {
    display: flex;
    gap: 8px;
    padding: 4px 0;
}
.identifier-label {
    font-weight: 600;
    color: #94a3b8;
    min-width: 140px;
}
.identifier-value {
    color: #f1f5f9;
}