:root {
    --primary: #007BFF;
    --primary-dark: #0056b3;
    --secondary: #28A745;
    --text-dark: #333;
    --text-light: #666;
    --bg-light: #f8f9fa;
    --white: #fff;
    --border-color: #ddd;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    padding-top: 130px;
    /* Space for fixed header - increased to prevent content overlap */
    position: relative;
    display: block;
    /* Ensure padding works correctly */
}

/* Blue gradient border removed - was hiding content */
/* body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    box-shadow:
        inset 0 0 0 2px #1e3a8a,
        inset 0 0 0 4px #1e40af,
        inset 0 0 0 6px #3b82f6,
        inset 0 0 0 8px #60a5fa,
        inset 0 0 0 10px #7dd3fc,
        inset 0 0 0 12px #93c5fd,
        inset 0 0 15px rgba(59, 130, 246, 0.2);
    pointer-events: none;
    z-index: 50;
} */

/* FIX: Ensure body is never hidden by generic language classes */
body.lang-fr,
body.lang-en,
body.lang-ar {
    display: block !important;
}

/* RTL Support */
[dir="rtl"] {
    font-family: 'Noto Sans Arabic', 'Roboto', sans-serif;
    text-align: right;
}

[lang="ar"] {
    font-family: 'Noto Sans Arabic', 'Roboto', sans-serif;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: white;
    box-shadow: var(--shadow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.header-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 0.5rem;
}

/* Logo in top left */
.logo {
    grid-column: 1;
    grid-row: 1;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
}

/* Right side container for language buttons and search - top right */
.header-right {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-self: end;
}

/* Language switch */
.lang-switch {
    display: flex;
    align-items: center;
    gap: 5px;
}

.search-icon-header {
    flex-shrink: 0;
}

/* Navigation on second row, spanning all columns */
nav {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    margin-top: 0.5rem;
}

/* Hamburger menu in center top (for mobile) */
.hamburger-menu {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    display: none;
}

.lang-switch button {
    background: none;
    border: 1px solid var(--border-color);
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 4px;
    margin-left: 5px;
    transition: var(--transition);
}

.lang-switch button:hover,
.lang-switch button.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}



.nav-links {
    display: flex;
    list-style: none;
    gap: 15px;
    padding-bottom: 5px;
    align-items: center;
    /* Align items vertically */
}

/* Base link style */
.nav-links a,
.dropbtn {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    white-space: nowrap;
    padding: 5px 10px;
    border-radius: 4px;
    transition: none;
    /* Removed transition to stop flash */
    display: inline-block;
}

.nav-links a:hover,
.dropdown:hover .dropbtn {
    background-color: var(--primary);
    color: var(--white);
}

/* Dropdown Container */
.dropdown {
    position: relative;
    display: inline-block;
}

/* Dropdown Content (Hidden by Default) */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 250px;
    /* Wider for category names */
    /* NO max-height - let it expand naturally */
    overflow: visible;
    /* Allow submenus to appear outside */
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    border-radius: 4px;
    top: 100%;
    /* Below the button */
    left: 0;
}

/* Show on hover */
.dropdown:hover .dropdown-content {
    display: block;
}

/* Links inside the dropdown */
.dropdown-content a {
    color: black;
    padding: 8px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
    color: var(--primary);
}

/* --- Nested Submenu Styles --- */

/* Dropdown item with submenu container */
.dropdown-item-with-submenu {
    position: relative;
}

/* Category link with submenu arrow */
.category-link {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.submenu-arrow {
    margin-left: 10px;
    font-size: 0.9em;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.category-link:hover .submenu-arrow {
    opacity: 1;
}

/* Submenu positioning */
.dropdown-submenu {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    background-color: #ffffff;
    min-width: 400px;
    max-width: 550px;
    max-height: 60vh;
    overflow-y: auto;
    box-shadow: 0px 8px 20px 0px rgba(0, 0, 0, 0.25);
    z-index: 10000;
    border-radius: 4px;
    border-left: 3px solid var(--primary);
    margin-left: 0;
    /* Small gap to allow mouse movement */
}

/* RTL: Submenus appear on the LEFT in Arabic */
body.lang-ar .dropdown-submenu {
    left: auto;
    right: 100%;
    border-left: none;
    border-right: 3px solid var(--primary);
    margin-left: 0;
    margin-right: 0;
}

/* Show submenu on hover - keep parent category and submenu connected */
.dropdown-item-with-submenu:hover>.dropdown-submenu,
.dropdown-submenu:hover {
    display: block !important;
    animation: slideInRight 0.2s ease-out;
}

/* Keep submenu visible when mouse is over it */
.dropdown-item-with-submenu .dropdown-submenu:hover {
    display: block !important;
}

/* Desktop-only: Dropdown hover behavior */
@media (min-width: 769px) {

    /* Ensure dropdown stays open when hovering over submenu */
    .dropdown:hover .dropdown-content {
        display: block !important;
    }

    /* Additional rule to ensure submenu appears */
    .dropdown .dropdown-content .dropdown-item-with-submenu:hover .dropdown-submenu {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Submenu links */
.dropdown-submenu a {
    color: #333;
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.90em;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.dropdown-submenu a:last-child {
    border-bottom: none;
}

.dropdown-submenu a:hover {
    background-color: #e8f4fd;
    color: var(--primary);
    padding-left: 20px;
    font-weight: 500;
}

/* Smooth scrollbar for long lists */
.dropdown-submenu::-webkit-scrollbar {
    width: 6px;
}

.dropdown-submenu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.dropdown-submenu::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.dropdown-submenu::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Animation for submenu appearance */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Hamburger Menu Button (Mobile Only) */
.hamburger-menu {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 10px;
    z-index: 101;
}

.hamburger-menu span {
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 3px;
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Mobile: Responsive Navigation */
@media (max-width: 768px) {

    /* Show hamburger button on mobile */
    .hamburger-menu {
        display: flex;
    }

    /* Hide navigation by default on mobile */
    nav {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: calc(100vh - 80px);
        background: white;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        transition: left 0.3s ease;
        overflow-y: auto;
        z-index: 100;
        margin-top: 0;
    }

    /* Show navigation when active */
    nav.active {
        left: 0;
    }

    /* Stack navigation links vertically */
    .nav-links {
        flex-direction: column;
        gap: 0;
        padding: 10px 0;
        align-items: stretch;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a,
    .dropbtn {
        padding: 15px 20px;
        display: block;
        width: 100%;
        text-align: left;
        border-bottom: 1px solid #eee;
    }

    /* Dropdown adjustments for mobile */
    .dropdown {
        position: relative;
        display: block;
    }

    .dropdown-content {
        position: static;
        box-shadow: none;
        background: #f5f5f5;
        width: 100%;
        min-width: auto;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.3s ease, opacity 0.3s ease;
        border-radius: 0;
        pointer-events: auto;
    }

    /* Show dropdown on click (managed by JS) - ULTRA MAXIMUM SPECIFICITY */
    nav.active .nav-links .dropdown.active>.dropdown-content,
    nav .nav-links li.dropdown.active>.dropdown-content,
    .nav-links li.dropdown.active>.dropdown-content,
    nav .nav-links .dropdown.active .dropdown-content,
    .nav-links .dropdown.active .dropdown-content,
    li.dropdown.active>.dropdown-content,
    .dropdown.active>.dropdown-content,
    .dropdown.active .dropdown-content {
        display: block !important;
        max-height: 2000px !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        overflow: visible !important;
    }

    /* Disable ALL hover effects on mobile - MAXIMUM SPECIFICITY */
    nav .nav-links .dropdown:hover .dropdown-content,
    .nav-links .dropdown:hover .dropdown-content,
    .dropdown:hover .dropdown-content,
    nav .nav-links .dropdown-item-with-submenu:hover>.dropdown-submenu,
    .nav-links .dropdown-item-with-submenu:hover>.dropdown-submenu,
    .dropdown-item-with-submenu:hover>.dropdown-submenu,
    .dropdown-submenu:hover,
    .dropdown-item-with-submenu .dropdown-submenu:hover,
    .dropdown .dropdown-content .dropdown-item-with-submenu:hover .dropdown-submenu {
        display: none !important;
        visibility: hidden !important;
    }

    /* Submenu adjustments for mobile - ULTRA SPECIFIC to override desktop */
    nav .nav-links .dropdown .dropdown-content .dropdown-item-with-submenu .dropdown-submenu,
    .nav-links .dropdown .dropdown-content .dropdown-item-with-submenu .dropdown-submenu,
    .dropdown .dropdown-content .dropdown-item-with-submenu .dropdown-submenu,
    .dropdown-content .dropdown-submenu,
    .dropdown-submenu {
        position: static !important;
        left: 0 !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        transform: none !important;
        box-shadow: none !important;
        border-left: none !important;
        padding-left: 20px;
        padding-right: 10px;
        background-color: #f0f0f0;
        max-height: none !important;
        min-height: auto !important;
        border-radius: 0;
        margin: 0 !important;
        min-width: auto !important;
        max-width: none !important;
        width: 100% !important;
        display: none !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    /* Override all hover states on mobile */
    nav .nav-links .dropdown .dropdown-content .dropdown-item-with-submenu:hover>.dropdown-submenu,
    .dropdown-item-with-submenu:hover>.dropdown-submenu {
        display: none !important;
        visibility: hidden !important;
    }

    /* Show submenu on click (managed by JS) - ULTRA SPECIFIC */
    nav.active .nav-links .dropdown.active .dropdown-content .dropdown-item-with-submenu.active>.dropdown-submenu,
    nav .nav-links .dropdown.active .dropdown-content .dropdown-item-with-submenu.active>.dropdown-submenu,
    .nav-links .dropdown.active .dropdown-content .dropdown-item-with-submenu.active>.dropdown-submenu,
    nav .nav-links .dropdown .dropdown-content .dropdown-item-with-submenu.active>.dropdown-submenu,
    .nav-links .dropdown .dropdown-content .dropdown-item-with-submenu.active>.dropdown-submenu,
    .dropdown .dropdown-content .dropdown-item-with-submenu.active>.dropdown-submenu,
    .dropdown-item-with-submenu.active>.dropdown-submenu {
        display: block !important;
        visibility: visible !important;
        position: static !important;
        left: 0 !important;
        width: 100% !important;
        pointer-events: auto !important;
    }

    .submenu-arrow {
        transform: rotate(90deg);
        /* Zone de tap agrandie pour mobile */
        font-size: 1.4em;
        padding: 8px 12px;
        margin-left: auto;
        opacity: 1;
        color: var(--primary);
        border-left: 1px solid #ddd;
        min-width: 44px;
        text-align: center;
    }

    /* Indice visuel : catégorie active = tap sur le texte pour naviguer */
    .dropdown-item-with-submenu.active>.category-link {
        background-color: #e8f0fe !important;
        color: var(--primary) !important;
        border-left: 3px solid var(--primary);
    }


    /* Adjust product grid for mobile */
    .product-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Adjust header for mobile */
    .header-inner {
        flex-wrap: nowrap;
        justify-content: space-between;
    }

    .logo img {
        height: 40px !important;
    }

    .lang-switch {
        order: -1;
        margin-right: auto;
        margin-left: 10px;
    }

    .lang-switch button {
        padding: 3px 6px;
        font-size: 0.8rem;
        margin-left: 3px;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .dropdown-submenu {
        max-width: 400px;
        max-height: 50vh;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}



/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    padding: 3rem 0;
    text-align: center;
    margin-bottom: 2rem;
    /* Removed margin-top as body padding-top handles header spacing */
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.product-card {
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: #fff;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.product-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    font-size: 0.85rem;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.product-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.product-desc {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary);
    color: var(--white);
    text-decoration: none;
    border-radius: 4px;
    text-align: center;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: var(--primary-dark);
}

.btn-block {
    display: block;
    width: 100%;
}

/* Detail Page */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .product-detail {
        grid-template-columns: 1fr;
    }
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.specs-table th,
.specs-table td {
    padding: 12px;
    border: 1px solid var(--border-color);
    text-align: left;
}

[dir="rtl"] .specs-table th,
[dir="rtl"] .specs-table td {
    text-align: right;
}

.specs-table th {
    background: var(--bg-light);
    font-weight: 600;
}

/* Industrial Piles Table */
.piles-table-container {
    overflow-x: auto;
    margin-bottom: 3rem;
}

.piles-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.piles-table th,
.piles-table td {
    padding: 10px;
    border: 1px solid #ccc;
    text-align: center;
    font-size: 0.9rem;
}

.piles-table th {
    background: var(--primary);
    color: var(--white);
    position: sticky;
    top: 0;
    /* Note: requires container max-height if we want vertical scroll, but here we want full page */
}

/* Contact Section */
.contact-info {
    text-align: center;
    padding: 3rem 0;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

/* Footer */
footer {
    background: var(--text-dark);
    color: var(--white);
    padding: 2rem 0;
    text-align: center;
    margin-top: auto;
}

/* Language Visibility */
/* By default show all, JS will toggle 'display: none' on irrelevant spans */
/* Actually, best approach for a clean UI:
   Identify translatable elements with data attributes or classes.
   .lang-fr, .lang-en, .lang-ar
*/

/* Language Visibility - Fail Open Strategy */

/* Base State: Hide All - REMOVED per user request to restore tabs */
/* .lang-fr,
.lang-en,
.lang-ar {
    display: none;
} */

/* Fix: Explicitly hide EN/AR when FR is active (Default) */
html:not([lang="en"]):not([lang="ar"]) .lang-en,
html:not([lang="en"]):not([lang="ar"]) .lang-ar,
body.lang-fr .lang-en,
body.lang-fr .lang-ar {
    display: none !important;
}

/* 2. Default State (When no body class or lang="fr") -> Show FR */
/* We target HTML to handle initial load before JS adds body class if needed, 
   but strictly relies on body class for switching. */
html:not([lang="en"]):not([lang="ar"]) .lang-fr,
body.lang-fr .lang-fr {
    display: inline !important;
}

/* Handle Block elements specifically to avoid layout collapse */
html:not([lang="en"]):not([lang="ar"]) div.lang-fr,
html:not([lang="en"]):not([lang="ar"]) p.lang-fr,
html:not([lang="en"]):not([lang="ar"]) h1.lang-fr,
html:not([lang="en"]):not([lang="ar"]) h2.lang-fr,
html:not([lang="en"]):not([lang="ar"]) section.lang-fr,
body.lang-fr div.lang-fr,
body.lang-fr p.lang-fr,
body.lang-fr h1.lang-fr,
body.lang-fr h2.lang-fr,
body.lang-fr section.lang-fr {
    display: block !important;
}

/* 3. English Active */
body.lang-en .lang-en {
    display: inline !important;
}

body.lang-en div.lang-en,
body.lang-en p.lang-en,
body.lang-en h1.lang-en,
body.lang-en h2.lang-en,
body.lang-en section.lang-en {
    display: block !important;
}

/* Ensure others are hidden (Redundant due to base state but safe) */
body.lang-en .lang-fr,
body.lang-en .lang-ar {
    display: none !important;
}

/* 4. Arabic Active */
body.lang-ar .lang-ar {
    display: inline !important;
}

body.lang-ar div.lang-ar,
body.lang-ar p.lang-ar,
body.lang-ar h1.lang-ar,
body.lang-ar h2.lang-ar,
body.lang-ar section.lang-ar {
    display: block !important;
}

body.lang-ar .lang-fr,
body.lang-ar .lang-en {
    display: none !important;
}

/* Block Helpers (Legacy) */
.lang-block-fr {
    display: block;
}

.lang-block-en,
.lang-block-ar {
    display: none;
}

body.lang-en .lang-block-fr {
    display: none !important;
}

body.lang-en .lang-block-en {
    display: block !important;
}

body.lang-ar .lang-block-fr {
    display: none !important;
}

body.lang-ar .lang-block-ar {
    display: block !important;
}


/* Modal Lightbox */
.modal {
    display: none;
    position: fixed;
    z-index: 3000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0, 0, 0);
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    object-fit: contain;
    animation-name: zoom;
    animation-duration: 0.6s;
}

@keyframes zoom {
    from {
        transform: scale(0)
    }

    to {
        transform: scale(1)
    }
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

@media only screen and (max-width: 700px) {
    .modal-content {
        width: 100%;
    }
}


/* --- NEW HERO SECTION --- */
.hero-full {
    position: relative;
    width: 100%;
    min-height: 80vh;
    /* Updated to 80vh */
    /* New Hero Image with Overlay - Composition Gamme MDE */
    background: linear-gradient(rgba(0, 0, 0, 0.45), rgba(15, 76, 117, 0.45)), url('../images/hero-gamme-mde.png');
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
    /* Parallax effect */
    display: flex;
    align-items: flex-end;
    justify-content: center;
    color: #fff;
    text-align: center;
    padding: 2rem;
    padding-bottom: 4rem;
}

.hero-content {
    max-width: 1200px;
    z-index: 2;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.8);
    /* Stronger shadow for readability */
    animation: fadeInDown 1s ease-out;
}

.hero-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin: 3rem 0;
    animation: fadeInUp 1s ease-out 0.5s backwards;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1.5rem;
    border-radius: 15px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.2);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #ffd700;
    /* Gold accent */
    margin-bottom: 0.5rem;
}

.cta-btn {
    background-color: rgba(15, 76, 117, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    padding: 15px 40px;
    font-size: 1.2rem;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(15, 76, 117, 0.4);
    display: inline-block;
    animation: pulse 2s infinite;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.cta-btn:hover {
    background-color: rgba(50, 130, 184, 0.7);
    transform: scale(1.05);
}

/* --- NEW ABOUT SECTION --- */
.about-section {
    padding: 4rem 0;
    background: #f8f9fa;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.about-card {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    /* Soft shadow */
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-bottom: 4px solid #0f4c75;
    /* MDE Blue */
}

.about-card:hover {
    transform: scale(1.03);
    box-shadow: 0 15px 40px rgba(15, 76, 117, 0.15);
}

.card-icon-emoji {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: block;
}

.about-card h3 {
    color: #0f4c75;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(15, 76, 117, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(15, 76, 117, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(15, 76, 117, 0);
    }
}

/* Responsive */
@media (max-width: 900px) {

    .hero-stats-grid,
    .about-grid {
        grid-template-columns: 1fr;
        /* Stack on mobile */
    }

    /* Ajuster le positionnement du hero sur mobile - 50% plus petit */
    .hero-full {
        align-items: center;
        padding: 1.5rem 1rem;
        padding-bottom: 1.5rem;
        min-height: 50vh;
    }

    .hero-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .cta-btn {
        padding: 10px 25px;
        font-size: 0.9rem;
    }
}

/* Product Detail Page Styling - FIXED to prevent image cropping */
/* Fix header overlap on product pages */
.product-detail-wrapper {
    padding-top: 3rem;
}

.main-image-box {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #eee;
    border-radius: 12px;
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 40px 30px;
    /* Generous padding top/bottom */
}

.main-product-image {
    max-width: 90%;
    /* Leave space on sides */
    height: auto;
    /* Let image determine its own height */
    object-fit: contain;
    display: block;
}

.badge-category {
    display: inline-block;
    background: #e0f2fe;
    color: #0284c7;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.product-detail-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.product-sku {
    font-family: monospace;
    color: #666;
    margin-bottom: 1.5rem;
}

.product-short-desc {
    font-size: 1.1rem;
    color: #444;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Main Product Image - Custom Cursor */
.main-product-image {
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'></circle><line x1='21' y1='21' x2='16.65' y2='16.65'></line><line x1='11' y1='8' x2='11' y2='14'></line><line x1='8' y1='11' x2='14' y2='11'></line></svg>") 24 24, zoom-in;
}

/* Piles Table Scroll and Sticky Styles */
.piles-table-container {
    overflow-x: auto;
    width: 100%;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    border: 1px solid #eee;
}

.piles-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
    /* Ensure it triggers scroll on small screens */
}

.piles-table th {
    background-color: #007bff;
    /* Blue header as requested */
    color: white;
    padding: 1rem;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 100;
    /* Above regular cells */
    white-space: nowrap;
    /* Prevent wrapping in header if preferred */
    vertical-align: top;
}

.piles-table td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    vertical-align: top;
    min-width: 150px;
}

.piles-table tr:hover td {
    background-color: #f9f9f9;
}

/* Make first column sticky too if desired */
.piles-table td:first-child {
    position: sticky;
    left: 0;
    background: white;
    z-index: 10;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
    font-weight: bold;
    min-width: 200px;
}

.piles-table th:first-child {
    position: sticky;
    left: 0;
    z-index: 101;
    /* Above first column cells */
}

/* --- PREMIUM PRODUCT CARD STYLES --- */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    /* Subtle shadow */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(15, 76, 117, 0.2);
    /* Blue tint shadow on hover */
}

.card-image-wrapper {
    height: 250px;
    /* Fixed height for consistency */
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.product-image {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    min-height: 3.2rem;
    /* Ensure 2 lines alignment */
}

.product-sku {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 1rem;
}

.product-highlights {
    background: #fcfcfc;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 0;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    overflow: hidden;
}

.highlight-badge {
    background: #ffd700;
    /* Gold */
    color: #333;
    /* Dark text */
    font-weight: bold;
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: 0.4rem 1rem;
    letter-spacing: 0.5px;
    display: block;
    width: 100%;
}

.highlight-list {
    list-style: none;
    padding: 0.8rem 1rem;
    margin: 0;
    font-size: 0.9rem;
    color: #555;
}

.highlight-list li {
    margin-bottom: 0.4rem;
    position: relative;
    padding-left: 0;
}

.card-btn {
    background-color: #0f4c75;
    color: white !important;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 1rem;
    border-radius: 6px;
    letter-spacing: 0.5px;
    transition: background 0.3s;
    margin-top: auto;
    text-align: center;
    text-decoration: none;
    display: block;
}

.card-btn:hover {
    background-color: #3282b8;
}

/* --- PRODUCT TABS UI --- */
.product-tabs-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-top: 2rem;
}

.tabs-nav-wrapper {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Smooth scroll on iOS */
    white-space: nowrap;
}

/* Hide scrollbar but allow scroll */
.tabs-nav-wrapper::-webkit-scrollbar {
    height: 4px;
}

.tabs-nav-wrapper::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.tabs-nav {
    display: flex;
    gap: 10px;
    padding: 0 1rem;
    min-width: min-content;
}

.tab-btn {
    background: none;
    border: none;
    padding: 1.2rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    color: #0f4c75;
    background: rgba(15, 76, 117, 0.05);
}

.tab-btn.active {
    color: #0f4c75;
    border-bottom-color: #0f4c75;
}

.tab-content-wrapper {
    padding: 2.5rem;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-content.active {
    display: block;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tab Content Styles */
.text-content p {
    line-height: 1.8;
    color: #444;
    font-size: 1.05rem;
    max-width: 800px;
}

.specs-table-modern {
    width: 100%;
    border-collapse: collapse;
}

.specs-table-modern th,
.specs-table-modern td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.specs-table-modern th {
    width: 40%;
    color: #0f4c75;
    font-weight: 600;
    background: #fafafa;
}

.cert-badge {
    display: inline-block;
    padding: 8px 16px;
    background: #ecfdf5;
    color: #059669;
    border-radius: 50px;
    margin: 5px;
    font-weight: 500;
    border: 1px solid #d1fae5;
}

/* Responsive - Tablet & Desktop */
@media (max-width: 900px) {
    .product-header-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    .tab-content-wrapper {
        padding: 1.5rem;
    }
}

/* Mobile-specific product page improvements */
@media (max-width: 768px) {

    /* Product header - ensure single column */
    .product-header-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        margin-bottom: 2rem !important;
    }

    /* Image container - fluid height */
    .main-image-box,
    .detail-image-container .main-image-box {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        padding: 2rem !important;
        overflow: visible !important;
    }

    /* Product image - better mobile sizing */
    .main-product-image {
        max-width: 100% !important;
        max-height: 350px !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
    }

    /* Product title */
    .detail-info-side h1,
    h1[style*="font-size: 2rem"] {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.75rem !important;
    }

    /* Category badge */
    .badge-category {
        font-size: 0.75rem !important;
        padding: 3px 10px !important;
    }

    /* SKU */
    div[style*="font-family: monospace"] {
        font-size: 0.9rem !important;
        margin-bottom: 1rem !important;
    }

    /* Description text - NO TRUNCATION */
    .detail-info-side>div[style*="font-size: 1.1rem"],
    div[style*="font-size: 1.1rem"][style*="color: #444"] {
        font-size: 1rem !important;
        line-height: 1.6 !important;
        margin-bottom: 1.5rem !important;
        overflow: visible !important;
        text-overflow: clip !important;
        white-space: normal !important;
        display: block !important;
        line-clamp: unset !important;
        -webkit-line-clamp: unset !important;
        -webkit-box-orient: unset !important;
    }

    /* CTA box */
    .cta-box {
        padding: 1.25rem !important;
    }

    /* Quantity input */
    input[type="number"] {
        width: 70px !important;
        font-size: 1rem !important;
    }

    /* Add to cart button */
    .cart-btn-add {
        font-size: 1rem !important;
        padding: 12px 20px !important;
    }

    /* Tabs navigation */
    .tabs-nav {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    .tab-btn {
        font-size: 0.9rem !important;
        padding: 10px 15px !important;
    }

    /* Tab content */
    .tab-content-wrapper {
        padding: 1.25rem !important;
        font-size: 0.95rem !important;
    }

    /* Tables in tabs */
    .tab-content table {
        font-size: 0.9rem !important;
    }

    .tab-content td,
    .tab-content th {
        padding: 0.75rem 0.5rem !important;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .main-image-box {
        min-height: 200px !important;
        max-height: 300px !important;
    }

    .main-product-image {
        max-height: 250px !important;
    }

    .detail-info-side h1,
    h1[style*="font-size: 2rem"] {
        font-size: 1.3rem !important;
    }

    .detail-info-side>div[style*="font-size: 1.1rem"] {
        font-size: 0.95rem !important;
    }

    .product-header-grid {
        gap: 1rem !important;
    }

    /* Fix for image and text spacing */
    .product-detail-wrapper {
        padding: 2rem 1rem 0 1rem !important;
    }

    .detail-info-side {
        padding: 0 0.5rem !important;
    }

    /* Ensure image container has proper height and padding */
    .detail-image-container {
        padding: 0 !important;
        margin-bottom: 1.5rem !important;
    }

    .main-image-box {
        height: auto !important;
        min-height: 320px !important;
        max-height: none !important;
        padding: 1.5rem 1rem !important;
        margin: 0 !important;
        overflow: visible !important;
    }

    .main-product-image {
        width: 100% !important;
        max-height: none !important;
        height: auto !important;
        object-fit: contain !important;
    }

    /* Add horizontal padding to text elements */
    .product-short-desc,
    div[style*="font-size: 1.1rem"] {
        padding: 0 0.5rem !important;
    }
}

/* --- CART UI STYLES --- */
#cart-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #0f4c75;
    color: white;
    padding: 15px 20px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.3s;
}

#cart-icon:hover {
    transform: scale(1.05);
    background: #3282b8;
}

#cart-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #dc3545;
    color: white;
    border-radius: 20px;
    min-width: 24px;
    height: auto;
    padding: 2px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    border: 2px solid white;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.cart-modal-content {
    max-width: 800px;
    width: 90%;
    position: relative;
    /* Ensure close button is positioned relative to this */
}

/* Close Button Style */
.close {
    position: absolute;
    top: 10px;
    right: 20px;
    color: #333;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    line-height: 1;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.cart-table th,
.cart-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

.cart-table th {
    background-color: #f8f9fa;
    text-align: left;
}

.cart-table td:nth-child(3) {
    text-align: left;
    /* Product Name */
}

.cart-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.cart-btn-add {
    background-color: #28a745 !important;
    /* Green */
    margin-bottom: 5px;
}

.cart-btn-add:hover {
    background-color: #218838 !important;
}

/* Correction pour descendre les produits sous le menu fixe */
.product-detail-wrapper {
    padding-top: 160px !important;
}

/* --- Version V2 : Bouton Transparent Net & Lisible --- */
.btn-ghost {
    /* 1. GRAND NETTOYAGE : On enlève tout fond gris ou flou parasite */
    background: none !important;
    background-color: transparent !important;
    backdrop-filter: none !important;
    /* C'est lui qui créait le flou ! */
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;

    /* 2. LE STYLE : Bordure Bleue + Texte Blanc */
    border: 3px solid #007bff !important;
    /* Bordure un peu plus épaisse (3px) */
    color: white !important;
    /* BLANC IMPÉRATIF pour la lecture */

    /* 3. LA TOUCHE PRO : Une petite ombre noire sous le texte pour qu'il "pop" */
    text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.8) !important;
    font-weight: 800 !important;
    /* Texte très gras */
    font-size: 1.1rem;
    /* Texte un peu plus grand */

    transition: all 0.3s ease;
}

/* Au survol de la souris */
.btn-ghost:hover {
    background-color: #007bff !important;
    /* Le fond devient bleu */
    color: white !important;
    /* Le texte reste blanc */
    text-shadow: none !important;
    /* Plus besoin d'ombre sur fond bleu */
    border-color: #007bff !important;
}

/* --- FIX FINAL : ESPACE SOUS LE MENU --- */

/* 1. Réglage de base pour mobile et tablette */
.product-detail-wrapper {
    margin-top: 100px !important;
    /* Ajuste ce chiffre pour régler l'écart sur MOBILE */
    padding-top: 20px !important;
}

/* 2. Réglage spécifique pour ORDINATEUR (C'est lui qui bloquait !) */
@media (min-width: 992px) {
    .product-detail-wrapper {
        height: auto !important;
        object-fit: contain !important;
    }

    /* Add horizontal padding to text elements */
    .product-short-desc,
    div[style*="font-size: 1.1rem"] {
        padding: 0 0.5rem !important;
    }
}

/* --- CART UI STYLES --- */
#cart-icon {
    position: fixed;
    bottom: 30px;
    left: 30px;
    right: auto;
    background: #0f4c75;
    color: white;
    padding: 15px 20px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.3s;
}

#cart-icon:hover {
    transform: scale(1.05);
    background: #3282b8;
}

#cart-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #dc3545;
    color: white;
    border-radius: 20px;
    min-width: 24px;
    height: auto;
    padding: 2px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    border: 2px solid white;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.cart-modal-content {
    max-width: 800px;
    width: 90%;
    position: relative;
    /* Ensure close button is positioned relative to this */
}

/* Close Button Style */
.close {
    position: absolute;
    top: 10px;
    right: 20px;
    color: #333;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    line-height: 1;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.cart-table th,
.cart-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

.cart-table th {
    background-color: #f8f9fa;
    text-align: left;
}

.cart-table td:nth-child(3) {
    text-align: left;
    /* Product Name */
}

.cart-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.cart-btn-add {
    background-color: #28a745 !important;
    /* Green */
    margin-bottom: 5px;
}

.cart-btn-add:hover {
    background-color: #218838 !important;
}

/* Correction pour descendre les produits sous le menu fixe */
.product-detail-wrapper {
    padding-top: 160px !important;
}

/* --- Version V2 : Bouton Transparent Net & Lisible --- */
.btn-ghost {
    /* 1. GRAND NETTOYAGE : On enlève tout fond gris ou flou parasite */
    background: none !important;
    background-color: transparent !important;
    backdrop-filter: none !important;
    /* C'est lui qui créait le flou ! */
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;

    /* 2. LE STYLE : Bordure Bleue + Texte Blanc */
    border: 3px solid #007bff !important;
    /* Bordure un peu plus épaisse (3px) */
    color: white !important;
    /* BLANC IMPÉRATIF pour la lecture */

    /* 3. LA TOUCHE PRO : Une petite ombre noire sous le texte pour qu'il "pop" */
    text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.8) !important;
    font-weight: 800 !important;
    /* Texte très gras */
    font-size: 1.1rem;
    /* Texte un peu plus grand */

    transition: all 0.3s ease;
}

/* Au survol de la souris */
.btn-ghost:hover {
    background-color: #007bff !important;
    /* Le fond devient bleu */
    color: white !important;
    /* Le texte reste blanc */
    text-shadow: none !important;
    /* Plus besoin d'ombre sur fond bleu */
    border-color: #007bff !important;
}

/* --- FIX FINAL : ESPACE SOUS LE MENU --- */

/* 1. Réglage de base pour mobile et tablette */
.product-detail-wrapper {
    margin-top: 100px !important;
    padding-top: 20px !important;
}

/* 2. Réglage spécifique pour ORDINATEUR */
@media (min-width: 992px) {

    /* Par défaut (EN et AR) : 60px pour remonter le contenu */
    .product-detail-wrapper {
        margin-top: 60px !important;
    }

    /* Spécifique FR : Menu plus haut -> Besoin de 140px */
    body.lang-fr .product-detail-wrapper {
        margin-top: 140px !important;
    }
}

/* Optionnel : Si tu veux aussi masquer le petit FR (puisqu'il est seul) */
/* .lang-switch { display: none !important; } */
/* --- Force Language Switcher Visibility --- */
/* Override any hiding rules for the language buttons */
header .lang-switch button,
.lang-btn {
    display: inline-block !important;
    opacity: 1 !important;
    visibility: visible !important;
}