.product-detail-page {
    background-color: #f9fafb;
    padding-bottom: 5rem;
}

.product-main-grid {
    display: flex;
    align-items: flex-start;
    justify-content: between;
    gap: 5rem;
    width: 100%;
}

/* Galerie Photos */
.gallery-wrapper {
    display: flex;
    gap: 1rem;
    /* Largeur fixe : sans ca, width:auto faisait dependre la largeur du bloc de
       l'aspect-ratio de la photo (et de la presence ou non des miniatures),
       d'ou une largeur differente d'un produit a l'autre. */
    flex: 0 0 60%;
    width: 60%;
    max-width: 60%;
    min-width: 0;
}

/* Empeche l'image de forcer l'elargissement du conteneur flex */
.main-image-container {
    min-width: 0;
}

.thumbs-sidebar {
    width: 80px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.thumb-item {
    aspect-ratio: 1;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    position: relative;
}

.thumb-item img {
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
    object-fit: cover;
}

.thumb-item.active {
    border-color: #4c5ca4;
    box-shadow: 0 0 0 2px rgba(76, 92, 164, 0.2);
}

.thumb-item.thumb-more {
    position: relative;
}
.thumb-item.last {
    background-color: #dae3f2;
    width: 110px;
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    align-items: center;
    cursor: pointer;
    align-content: center;
    font-weight: 500;
}

.thumb-item.thumb-more .thumb-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    color: white;
    font-weight: 600;
    transition: background 0.3s;
}

.thumb-item.thumb-more .thumb-overlay span {
    font-size: 1.25rem;
    margin-top: 0.25rem;
}

.thumb-item.thumb-more .thumb-overlay small {
    font-size: 0.7rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

.thumb-item.thumb-more:hover .thumb-overlay {
    background: rgba(76, 92, 164, 0.85);
}

.main-image-container {
    flex: 1;
    position: relative;
    height: 600px;
    overflow: hidden;
}

.main-image-container .item {
    height: 600px;
}

.main-image-container img {
    overflow: hidden;
    border-radius: 1.5rem;
    width: 100%;
    height: 100%;
    -o-object-fit: contain;
    object-fit: contain;
}

/* Badges de statut */
.status-badge {
    /*
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 10;
     box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    */
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 800;
    font-size: 0.8rem;
    color: white;
    display: flex;
    align-items: center;
    cursor: help;
}

.badge-vendu {
    background: #ef4444;
}
.badge-option {
    background: #302d63;
}
.badge-option {
    background: #ef4444;
}

/* Tooltip CSS */
.badge-option[data-tooltip] {
    position: relative;
    cursor: help;
}

.badge-option[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(30, 41, 59, 0.95);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.3s,
        transform 0.3s;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.badge-option[data-tooltip]::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-2px);
    border: 5px solid transparent;
    border-top-color: rgba(30, 41, 59, 0.95);
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.3s,
        transform 0.3s;
    z-index: 1000;
}

.badge-option[data-tooltip]:hover::before,
.badge-option[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Carte d'infos */
.product-info-card {
    flex: 1;
    background: white;
    border-radius: 1.25rem;
    padding: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    height: -moz-fit-content;
    height: fit-content;
}

/* --- META ROW & QUICK DOWNLOAD --- */
.product-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.meta-left {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.quick-download-btn {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    background-color: #eff6ff;
    color: #4c5ca4;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    text-decoration: none;
}

.quick-download-btn:hover {
    background-color: #4c5ca4;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Ajustement pour mobile */
@media (max-width: 480px) {
    .product-meta-row {
        flex-direction: row;
        align-items: flex-start;
    }
}

.ref-tag {
    background: #4c5ca4;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 0.9rem;
}

.stock-tag {
    background: #eff6ff;
    color: #4c5ca4;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.product-brand-name {
    font-family: "Alata", sans-serif;
    text-transform: uppercase;
    color: #9ca3af;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    display: inline-block;
    background: #f9fafb;
    color: #343434;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    display: inline-block;
    margin-bottom: 30px;
}
.product-brand-logo {
    width: 100px;
    margin-bottom: 30px;
}
.product-brand-logo img {
    width: 100%;
}
.product-desc-modern {
    color: #4b5563;
    line-height: 1.6;
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

/* Actions Panier */
.action-box {
    background: #f9fafb;
    border-radius: 1rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.qty-modern {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    padding: 0.4rem;
    border-radius: 0.75rem;
    width: -moz-fit-content;
    width: fit-content;
    margin-bottom: 1rem;
}

.qty-btn {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.5rem;
    border: none;
    background: #f3f4f6;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.qty-btn:hover {
    background: #e5e7eb;
}

.btn-add-modern {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: linear-gradient(180deg, #302d63 0%, #201e47 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(48, 45, 99, 0.2);
    transition: all 0.3s;

    margin-bottom: 1rem;

    box-sizing: border-box;
}

.btn-add-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px rgba(48, 45, 99, 0.3);
}

.btn-contact {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: transparent;
    color: #302d63;
    border: 2px solid #302d63;

    transition: all 0.3s;

    text-decoration: none;

    box-sizing: border-box;
}

.btn-contact:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px rgba(48, 45, 99, 0.3);
}

/* Documents Section */
.docs-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.doc-link-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    background: linear-gradient(to right, #eff6ff, #f9fafb);
    border: 1px solid #dbeafe;
    border-radius: 1rem;
    text-decoration: none;
    transition: all 0.2s;
}

.doc-link-modern:hover {
    transform: translateX(6px);
    border-color: #4c5ca4;
}

.doc-icon-box {
    width: 2.5rem;
    height: 2.5rem;
    background: white;
    border-radius: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4c5ca4;
}

/* Help Box */
.help-card-modern {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 1rem;
    padding: 1.25rem;
    margin-top: 1.5rem;
}

.help-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #1e40af;
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 0.75rem;
}

.help-link span {
    box-shadow: none;
    background-color: transparent;
}

.container {
    max-width: 1576px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Container principal */
.docs-section-container {
    background: #ffffff;
    border-radius: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 2.5rem;
    margin-top: 3rem;
    border: 1px solid #e5e7eb;
}

.docs-title {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 2rem;
    gap: 1rem;
}

/* Lien Document Individuel */
.doc-link-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    background: linear-gradient(90deg, #eff6ff 0%, #f9fafb 100%);
    border: 1px solid #dbeafe;
    border-radius: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.doc-link-modern:hover {
    transform: translateX(8px);
    border-color: #4c5ca4;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.doc-info-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Icônes */
.doc-icon-box {
    width: 2.75rem;
    height: 2.75rem;
    background: #ffffff;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4c5ca4;
    font-size: 1.2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

/* Textes */
.doc-label {
    font-weight: 700;
    color: #1f2937;
    font-size: 1rem;
    display: block;
    margin-bottom: 0.15rem;
}

.doc-type {
    font-size: 0.8rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Flèche de droite */
.doc-arrow-icon {
    color: #9ca3af;
    transition: color 0.3s ease;
}

.doc-link-modern:hover .doc-arrow-icon {
    color: #4c5ca4;
}

.related-products-section {
    margin-top: 5rem;
    padding-top: 3rem;
    border-top: 1px solid #e5e7eb;
}

.related-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
    margin-bottom: 3.5rem;
}

/* Ajustement du carousel pour l'alignement des cards */
.crsl-other-prdts .owl-stage-outer {
    padding: 1rem 0 2rem 0; /* Pour laisser respirer les ombres au survol */
}

.crsl-other-prdts .owl-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.crsl-other-prdts .owl-nav button.owl-prev,
.crsl-other-prdts .owl-nav button.owl-next {
    width: 45px;
    height: 45px;
    background: white !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 50% !important;
    color: #4c5ca4 !important;
    font-size: 1.5rem !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.crsl-other-prdts .owl-nav button:hover {
    background: #4c5ca4 !important;
    color: white !important;
    transform: translateY(-2px);
}

/* Boutons de Navigation */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3rem;
    height: 3rem;
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    color: #1f2937;
}

.nav-btn:hover {
    background: #ffffff;
}
.prev-btn {
    left: 1rem;
}
.next-btn {
    right: 1rem;
}

/* Bouton Fullscreen */
.fullscreen-trigger {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 20;
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    border: none;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    color: #1f2937;
}

.fullscreen-trigger:hover {
    background: #ffffff;
}

/* Compteur de photos */
.photo-counter {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 1px;
    z-index: 5;
    pointer-events: none;
}

.photo-counter-overlay {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 1px;
    z-index: 10000;
}

/* Overlay Fullscreen */
.fullscreen-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    background: rgb(76 92 164 / 80%);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.fullscreen-overlay.active {
    display: flex;
}

.fullscreen-overlay .zoom-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 95vw;
    height: 95vh;
    cursor: zoom-in;
}

.fullscreen-overlay .zoom-container.zoomed {
    cursor: move;
    overflow: hidden;
}

.fullscreen-overlay img {
    max-width: 100%;
    max-height: 95vh;
    width: 95%;
    height: 95%;
    -o-object-fit: contain;
    object-fit: contain;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center center;
    display: block;
}

.fullscreen-overlay .zoom-container.zoomed img {
    transform: scale(2.5);
    max-width: none;
    max-height: none;
    cursor: move;
}

.close-overlay {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 3rem;
    height: 3rem;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    cursor: pointer;
    z-index: 99;
}

.nav-btn-overlay {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 10000;
    padding: 20px;
    transition: scale 0.2s;
}

.nav-btn-overlay:hover {
    scale: 1.1;
}

.prev-btn-overlay {
    left: 2rem;
}
.next-btn-overlay {
    right: 2rem;
}

/* ========================================
   RESPONSIVE — Tablette (max-width: 1024px)
   ======================================== */
@media (max-width: 1024px) {
    .product-main-grid {
        flex-direction: column;
        gap: 1.5rem;
    }
    .gallery-wrapper {
        max-width: 100%;
        width: 100%;
    }
    .product-info-card {
        width: 100%;
        box-sizing: border-box;
    }
    .container {
        padding: 0 10px;
    }
}

/* ========================================
   RESPONSIVE — Mobile (max-width: 768px)
   ======================================== */
@media (max-width: 768px) {
    .product-detail-page {
        padding-bottom: 2rem;
    }
    .product-main-grid {
        gap: 1rem;
    }
    .gallery-wrapper {
        flex-direction: column-reverse;
    }
    .thumbs-sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        gap: 0.5rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .thumbs-sidebar::-webkit-scrollbar {
        display: none;
    }
    .thumb-item {
        width: 60px;
        min-width: 60px;
    }
    .thumb-item.last {
        width: 80px;
        min-width: 80px;
        padding: 5px;
        margin-top: -10px;
    }
    .main-image-container {
        height: 300px;
    }
    .main-image-container .item {
        height: 300px;
    }
    .product-info-card {
        padding: 1rem;
    }
    .product-meta-row {
        flex-wrap: wrap;
    }
    .ref-tag,
    .stock-tag {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
    }
    .product-brand-name {
        margin-bottom: 15px;
    }
    .product-desc-modern {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
    .docs-section-container {
        padding: 1.25rem;
        margin-top: 1.5rem;
    }
    .docs-title {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    .related-products-section {
        margin-top: 2rem;
        padding-top: 2rem;
    }
    .related-title {
        font-size: 1.25rem;
        margin-bottom: 1.5rem;
    }
    .crsl-other-prdts .item {
        width: 80%;
    }
    .nav-btn-overlay svg {
        width: 30px;
        height: 30px;
    }
    .nav-btn {
        width: 2.25rem;
        height: 2.25rem;
    }
    .close-overlay {
        top: 0.75rem;
        right: 0.75rem;
        width: 2.5rem;
        height: 2.5rem;
    }
}

/* --- RELATED PRODUCTS CAROUSEL --- */
.related-products-section {
    margin-top: 5rem;
    padding-top: 3rem;
    border-top: 1px solid #e5e7eb;
}

.related-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
    margin-bottom: 3rem;
}

/* Empêche la coupure des ombres portées au survol dans le carousel */
.crsl-other-prdts {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;

    /* 3 éléments par lignes */
    grid-template-columns: repeat(1, 1fr);
}

.crsl-other-prdts .item {
    padding: 0 10px;
    box-sizing: border-box;
    width: 25%;
}

.crsl-other-prdts .owl-stage-outer {
    padding: 20px 10px;
    margin: -20px -10px;
    width: 100%;
    max-width: 100%;
}

.crsl-other-prdts .item {
    height: 100%;
}

/* Style des flèches du carousel */
.crsl-other-prdts .owl-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.crsl-other-prdts .owl-nav button.owl-prev,
.crsl-other-prdts .owl-nav button.owl-next {
    width: 45px;
    height: 45px;
    background: white !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 50% !important;
    color: #4c5ca4 !important;
    font-size: 1.5rem !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.crsl-other-prdts .owl-nav button:hover {
    background: #4c5ca4 !important;
    color: white !important;
    transform: translateY(-2px);
}

/* Tooltip CSS pour badge-option */
.badge-option[data-tooltip] {
    position: relative;
    cursor: help;
}

.badge-option[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 41, 59, 0.95);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.3s,
        transform 0.3s;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.badge-option[data-tooltip]::after {
    content: "";
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(30, 41, 59, 0.95);
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.3s,
        transform 0.3s;
    z-index: 999;
}

.badge-option[data-tooltip]:hover::before,
.badge-option[data-tooltip]:hover::after {
    opacity: 1;
}

/* ========================================
   RESPONSIVE — Équipements suggérés
   ======================================== */
@media (max-width: 1024px) {
    .crsl-other-prdts .item {
        width: 50%;
    }
}
@media (max-width: 768px) {
    .crsl-other-prdts {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    .crsl-other-prdts .item {
        width: 100%;
        padding: 0;
    }
    .crsl-other-prdts .product-img-container {
        aspect-ratio: 1/1;
    }
}
