/* =========================
   PAGE DETAIL PRODUIT
========================= */

.product-detail-page {
    background: #ffffff;
    padding-bottom: 50px;
}

/* =========================
   TOP SECTION
========================= */
.product-top-section {
    padding: 20px 0;
}

.product-top-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    grid-template-areas:
        "button image"
        "button image";
    gap: 40px;
    align-items: flex-start;
    row-gap: 30px;
}

.product-back-box {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: auto;
    padding-top: 20px;
    grid-area: button;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #2f9e44;
    color: #ffffff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    padding: 12px 22px;
    border-radius: 999px;
    transition: background 0.25s ease, transform 0.25s ease;
}

.back-btn:hover {
    background: #25853a;
    transform: translateY(-2px);
}

.back-icon {
    font-size: 18px;
    line-height: 1;
}

.product-hero-image {
    min-height: 420px;
    width: 100%;
    overflow: visible;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 24px;
    grid-area: image;
}

.product-hero-image img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 380px;
    object-fit: contain;
    display: block;
}

/* =========================
   MENU HORIZONTAL
========================= */
.product-tabs {
    background: #ffffff;
    border-top: 1px solid #e3e8e3;
    border-bottom: 1px solid #e3e8e3;
    padding: 18px 0;
    margin-top: 16px;
}

.product-tabs-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.product-tabs-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 20px;
    border-radius: 999px;
    background: #f0f1f0;
    color: #3e4742;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
}

.tab-btn:hover,
.tab-btn.active {
    background: #2f9e44;
    color: #ffffff;
}

.product-search input {
    width: 260px;
    max-width: 100%;
    padding: 12px 14px;
    border: 1px solid #d8ded9;
    border-radius: 10px;
    background: #fafafa;
    color: #777;
    font-size: 14px;
}

/* =========================
   DETAIL SECTION
========================= */
.product-detail-section {
    padding: 34px 0 40px;
}

.product-section-head {
    margin-bottom: 26px;
}

.product-section-head h2 {
    font-size: 36px;
    font-weight: 800;
    color: #1d2329;
}

.product-detail-card {
    background: #f3f4f3;
    border: 1px solid #e6ebe6;
    border-radius: 12px;
    padding: 22px 22px 24px;
    margin-bottom: 32px;
}

.product-detail-header {
    grid-area: header;
    margin-bottom: 8px;
}

.product-detail-header h1 {
    font-size: 54px;
    line-height: 1.1;
    font-weight: 800;
    color: #2f9e44;
    margin-bottom: 4px;
}

.product-subtitle {
    color: #58a666;
    font-size: 20px;
    line-height: 1.5;
    margin-top: 6px;
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    grid-template-areas:
        "header header"
        "image description"
        "gallery description"
        "pdf description";
    gap: 34px;
    align-items: start;
}

/* =========================
   SECTION AREAS
========================= */
.product-detail-header {
    grid-area: header;
    margin-bottom: 8px;
}

.product-main-image-box {
    grid-area: image;
}

.product-gallery-wrapper {
    grid-area: gallery;
}

.product-pdf-box {
    grid-area: pdf;
}

.product-right-column {
    grid-area: description;
}

/* Remove old product-left-column styles */
.product-left-column {
    display: contents;
}

/* Conteneur wrapper pour la galerie avec effet fade */
.product-gallery-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

/* Effet fade à droite pour indiquer le scroll */
.product-gallery-wrapper::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 40px;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.85));
    pointer-events: none;
    z-index: 10;
    border-radius: 0 10px 10px 0;
}

/* =========================
   AUTO-SCROLL ANIMATIONS
========================= */
@keyframes galleryScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(200px);
    }
}

.product-gallery.gallery-auto-scrolling {
    animation: galleryScroll 60s linear infinite;
}

.product-main-image-box {
    background: #ffffff;
    border: 2px solid #2f9e44;
    border-radius: 12px;
    padding: 14px;
    min-height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-main-image-box img {
    width: 100%;
    max-width: 260px;
    max-height: 300px;
    object-fit: contain;
    display: block;
}

.product-gallery {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 0;
    scrollbar-width: thin;
    scrollbar-color: #d0d0d0 #f5f5f5;
}

/* Custom scrollbar for Webkit browsers */
.product-gallery::-webkit-scrollbar {
    height: 4px;
}

.product-gallery::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 4px;
}

.product-gallery::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 4px;
}

.product-gallery::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

.gallery-thumb {
    flex: 0 0 auto;
    width: 90px;
    height: 90px;
    border: 2px solid transparent;
    background: #ffffff;
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-thumb.active,
.gallery-thumb:hover {
    border-color: #2f9e44;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(47, 158, 68, 0.2);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.product-pdf-box {
    background: #ededed;
    border-radius: 10px;
    padding: 18px 16px;
    text-align: center;
}

.product-pdf-box p {
    font-size: 15px;
    color: #525e57;
    line-height: 1.6;
    margin-bottom: 16px;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #2f9e44;
    color: #ffffff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    padding: 12px 22px;
    border-radius: 6px;
    transition: background 0.25s ease;
}

.download-btn:hover {
    background: #25853a;
}

.download-icon {
    font-size: 18px;
    line-height: 1;
}

/* =========================
   COLONNE DROITE
========================= */
.product-right-column h3 {
    font-size: 22px;
    font-weight: 800;
    color: #3f9c52;
    margin-bottom: 10px;
}

.product-description {
    font-size: 17px;
    line-height: 1.55;
    color: #4e5953;
}

/* =========================
   AUTO-SCROLL ANIMATIONS
========================= */
@keyframes galleryScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(200px);
    }
}

.product-gallery.gallery-auto-scrolling {
    animation: galleryScroll 60s linear infinite;
}

/* =========================
   CTA
========================= */
.product-cta-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 26px;
    background: linear-gradient(90deg, #2f9e44 0%, #40b85a 100%);
    border-radius: 10px;
    padding: 30px 34px;
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.08);
}

.product-cta-content h3 {
    color: #ffffff;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 10px;
}

.product-cta-content p {
    color: #e9f7ec;
    font-size: 18px;
    line-height: 1.6;
}

.cta-contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 170px;
    background: #ffffff;
    color: #2f2f2f;
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    padding: 14px 22px;
    border-radius: 6px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cta-contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 1100px) {
    .product-top-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "image"
            "button";
    }

    .product-hero-image {
        min-height: 350px;
        grid-column: auto;
        grid-row: auto;
        grid-area: image;
        max-width: 480px;
        margin: 0 auto;
    }

    .product-back-box {
        min-height: auto;
        justify-content: center;
        grid-area: button;
        order: 2;
    }

    .product-detail-header h1 {
        font-size: 42px;
    }

    .product-subtitle {
        font-size: 18px;
    }

    .product-detail-grid {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "image"
            "description"
            "pdf"
            "gallery";
        gap: 18px;
        align-items: start;
    }

    .product-detail-header {
        grid-area: header;
        margin-bottom: 0;
        order: unset;
    }

    .product-main-image-box {
        grid-area: image;
        max-width: 100%;
        margin: 0;
        min-height: 280px;
        padding: 12px;
    }

    .product-main-image-box img {
        max-width: 240px;
        max-height: 240px;
    }

    .product-right-column {
        grid-area: description;
        order: unset;
    }

    .product-pdf-box {
        grid-area: pdf;
        margin-top: 0;
        padding: 16px 14px;
    }

    .product-gallery-wrapper {
        grid-area: gallery;
        border-radius: 10px;
    }
}

@media (max-width: 768px) {
    .product-tabs-wrapper {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 12px;
        flex-wrap: nowrap !important;
    }

    /* hide desktop menu */
    .product-tabs-menu.desktop-menu {
        display: none !important;
    }

    /* show dropdown button */
    .tabs-menu-container {
        order: 1;
        display: block !important;
        flex: 0 0 auto;
    }

    /* search takes remaining space */
    .product-search {
        order: 2;
        flex: 1;
        min-width: 0;
    }

    .product-search input {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 520px) {
    .tab-btn {
        width: 100%;
    }

    .product-tabs-menu {
        flex-direction: column;
        align-items: stretch;
    }

    .back-btn {
        font-size: 15px;
        padding: 12px 18px;
        gap: 10px;
    }

    .product-hero-image {
        min-height: 300px;
        grid-column: auto;
        grid-row: auto;
        padding: 18px;
    }

    .product-detail-card {
        padding: 14px 12px;
        margin-bottom: 24px;
    }

    .product-detail-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "image"
            "gallery"
            "description"
            "pdf";
        gap: 12px;
    }

    .product-detail-header h1 {
        font-size: 24px;
        line-height: 1.2;
        margin-bottom: 6px;
    }

    .product-subtitle {
        font-size: 14px;
        margin-top: 6px;
    }

    .product-main-image-box {
        grid-area: image;
        min-height: 260px;
        padding: 10px;
    }

    .product-main-image-box img {
        max-width: 180px;
        max-height: 220px;
    }

    .product-right-column {
        grid-area: description;
    }

    .product-right-column h3 {
        font-size: 18px;
        margin-bottom: 10px;
        margin-top: 0;
    }

    .product-description {
        font-size: 14px;
        line-height: 1.5;
    }

    .product-pdf-box {
        grid-area: pdf;
        padding: 14px 12px;
        margin-top: 0;
    }

    .product-pdf-box p {
        font-size: 13px;
        margin-bottom: 12px;
    }

    .download-btn {
        font-size: 13px;
        padding: 10px 16px;
    }

    .product-gallery-wrapper {
        grid-area: gallery;
        border-radius: 10px;
        margin-top: 0;
    }

    .product-gallery-wrapper::after {
        width: 30px;
    }

    .product-gallery {
        gap: 8px;
        padding: 4px 0;
    }

    .gallery-thumb {
        width: 75px;
        height: 75px;
        padding: 6px;
    }

    .gallery-thumb img {
        height: auto;
    }

    .product-cta-box {
        flex-direction: column;
        padding: 20px 16px;
        gap: 16px;
    }

    .product-cta-content h3 {
        font-size: 20px;
        margin-bottom: 8px;
    }

    .product-cta-content p {
        font-size: 14px;
    }

    .cta-contact-btn {
        width: 100%;
        font-size: 13px;
        padding: 12px 16px;
    }
}