/**
 * MLEH - Design Professionnel B2B
 * Inspiré par: Thermo Fisher Scientific, Sigma Aldrich, VWR Avantor
 * Identité: Scientifique, Professionnel, Confiance, Expertise
 */

/* ============================================
   VARIABLES PROFESSIONNELLES
   ============================================ */
:root {
    /* Couleurs Principales - Palette Scientifique */
    --primary-blue: #0D47A1;        /* Bleu scientifique profond */
    --secondary-blue: #1976D2;      /* Bleu laboratoire */
    --accent-teal: #00838F;         /* Cyan scientifique */
    --dark-navy: #263238;           /* Navy professionnel */
    
    /* Couleurs Neutres */
    --white: #FFFFFF;
    --light-gray: #ECEFF1;
    --medium-gray: #CFD8DC;
    --dark-gray: #546E7A;
    
    /* Couleurs Statut */
    --success-green: #2E7D32;       /* Vert validation */
    --warning-orange: #F57C00;      /* Orange alerte */
    --danger-red: #C62828;          /* Rouge erreur */
    --info-blue: #0288D1;           /* Bleu information */
    
    /* Texte */
    --text-primary: #212121;        /* Texte principal */
    --text-secondary: #616161;      /* Texte secondaire */
    --text-muted: #9E9E9E;          /* Texte atténué */
    --text-white: #FFFFFF;
    
    /* Typographie */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-headings: 'Poppins', 'Inter', sans-serif;
    --font-mono: 'Roboto Mono', 'Courier New', monospace;
    
    /* Espacements */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    
    /* Bordures */
    --border-radius-sm: 0.25rem;
    --border-radius-md: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
    
    /* Ombres */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
}

/* ============================================
   RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-headings);
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--secondary-blue);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   BOOTSTRAP OVERRIDES - PROFESSIONNEL
   ============================================ */

/* Boutons Primaires */
.btn-primary {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
    color: var(--white);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-md);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: #0A3A7F;
    border-color: #0A3A7F;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Boutons Secondaires */
.btn-secondary {
    background-color: var(--secondary-blue);
    border-color: var(--secondary-blue);
    color: var(--white);
    font-weight: 600;
}

.btn-secondary:hover {
    background-color: #1565C0;
    border-color: #1565C0);
}

/* Boutons Outline */
.btn-outline-primary {
    color: var(--primary-blue);
    border-color: var(--primary-blue);
    border-width: 2px;
    font-weight: 600;
}

.btn-outline-primary:hover {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
    color: var(--white);
}

/* Bouton Devis - Spécial */
.btn-devis {
    background: linear-gradient(135deg, var(--accent-teal) 0%, var(--primary-blue) 100%);
    border: none;
    color: var(--white);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.btn-devis:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-devis i {
    margin-right: 0.5rem;
}

/* Cards Professionnelles */
.card {
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.card-header {
    background-color: var(--light-gray);
    border-bottom: 2px solid var(--primary-blue);
    font-weight: 600;
    padding: 1rem 1.5rem;
}

/* Badges Professionnels */
.badge {
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
}

.badge-stock-ok {
    background-color: var(--success-green);
    color: var(--white);
}

.badge-stock-low {
    background-color: var(--warning-orange);
    color: var(--white);
}

.badge-stock-out {
    background-color: var(--danger-red);
    color: var(--white);
}

.badge-stock-order {
    background-color: var(--info-blue);
    color: var(--white);
}

/* ============================================
   HEADER PROFESSIONNEL
   ============================================ */

/* Top Bar Info */
.top-bar {
    background-color: var(--dark-navy);
    color: var(--white);
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.top-bar a {
    color: var(--white);
    margin: 0 1rem;
}

.top-bar a:hover {
    color: var(--accent-teal);
}

.top-bar i {
    margin-right: 0.5rem;
}

/* Navbar Principale */
.navbar-professional {
    background-color: var(--white);
    box-shadow: var(--shadow-md);
    padding: 1rem 0;
}

.navbar-brand img {
    height: 60px;
    transition: transform var(--transition-base);
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

.nav-link {
    color: var(--text-primary) !important;
    font-weight: 500;
    padding: 0.75rem 1.25rem !important;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background-color: var(--primary-blue);
    transition: all var(--transition-base);
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-blue) !important;
}

/* Barre de Recherche Professionnelle */
.search-professional {
    position: relative;
    width: 400px;
}

.search-professional input {
    border: 2px solid var(--medium-gray);
    border-radius: var(--border-radius-lg);
    padding: 0.75rem 3rem 0.75rem 1rem;
    width: 100%;
    transition: all var(--transition-fast);
}

.search-professional input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.1);
    outline: none;
}

.search-professional .search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--medium-gray);
    border-top: none;
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: var(--shadow-lg);
}

.search-suggestions.show {
    display: block;
}

.suggestion-item {
    padding: 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: background-color var(--transition-fast);
}

.suggestion-item:hover {
    background-color: var(--light-gray);
}

.suggestion-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
}

.suggestion-item .info {
    flex: 1;
}

.suggestion-item .name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.suggestion-item .ref {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.suggestion-item .price {
    font-weight: 700;
    color: var(--primary-blue);
    font-size: 1.125rem;
}

/* ============================================
   HERO SECTION PROFESSIONNELLE
   ============================================ */
.hero-professional {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 50%, var(--accent-teal) 100%);
    color: var(--white);
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.hero-professional::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
}

.hero-professional .container {
    position: relative;
    z-index: 1;
}

.hero-professional h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--white);
}

.hero-professional .subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    opacity: 0.95;
}

.hero-professional .lead {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 600px;
}

.hero-professional .btn {
    margin: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.hero-professional .btn-light {
    background-color: var(--white);
    color: var(--primary-blue);
    border: none;
    font-weight: 600;
}

.hero-professional .btn-light:hover {
    background-color: var(--light-gray);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.hero-professional .btn-outline-light {
    border: 2px solid var(--white);
    color: var(--white);
    font-weight: 600;
}

.hero-professional .btn-outline-light:hover {
    background-color: var(--white);
    color: var(--primary-blue);
}

/* Badges Hero */
.hero-badges {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.hero-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-lg);
    backdrop-filter: blur(10px);
}

.hero-badge i {
    font-size: 1.5rem;
    color: var(--white);
}

.hero-badge span {
    font-weight: 600;
    color: var(--white);
}

/* ============================================
   CATÉGORIES PROFESSIONNELLES
   ============================================ */
.category-card-pro {
    background: var(--white);
    border: 2px solid var(--light-gray);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    text-align: center;
    transition: all var(--transition-base);
    cursor: pointer;
    height: 100%;
}

.category-card-pro:hover {
    border-color: var(--primary-blue);
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.category-card-pro .icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-base);
}

.category-card-pro:hover .icon {
    transform: scale(1.1) rotate(5deg);
}

.category-card-pro .icon i {
    font-size: 2.5rem;
    color: var(--white);
}

.category-card-pro h5 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.category-card-pro .count {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ============================================
   PRODUITS PROFESSIONNELS
   ============================================ */
.product-card-pro {
    background: var(--white);
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card-pro:hover {
    border-color: var(--primary-blue);
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.product-card-pro .image-container {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
    background-color: var(--light-gray);
}

.product-card-pro .image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.product-card-pro:hover .image-container img {
    transform: scale(1.1);
}

.product-card-pro .badge-container {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.product-card-pro .card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card-pro .brand {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.product-card-pro .product-name {
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.product-card-pro .product-ref {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-bottom: 1rem;
}

.product-card-pro .product-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

.product-card-pro .product-price small {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
}

.product-card-pro .stock-status {
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.product-card-pro .actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

.product-card-pro .btn {
    flex: 1;
    padding: 0.75rem;
    font-size: 0.875rem;
}

/* ============================================
   SECTION "POURQUOI MLEH?"
   ============================================ */
.why-mleh {
    background-color: var(--light-gray);
    padding: 4rem 0;
}

.why-mleh h2 {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.feature-box-pro {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    text-align: center;
    transition: all var(--transition-base);
    height: 100%;
    border: 2px solid transparent;
}

.feature-box-pro:hover {
    border-color: var(--primary-blue);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-box-pro .icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-teal) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-box-pro .icon i {
    font-size: 2rem;
    color: var(--white);
}

.feature-box-pro h5 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.feature-box-pro p {
    color: var(--text-secondary);
    margin: 0;
}

/* ============================================
   MARQUES PARTENAIRES
   ============================================ */
.brands-section {
    padding: 4rem 0;
    background-color: var(--white);
}

.brands-section h2 {
    text-align: center;
    margin-bottom: 3rem;
}

.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    align-items: center;
}

.brand-logo {
    padding: 1.5rem;
    background: var(--white);
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    height: 100px;
}

.brand-logo:hover {
    border-color: var(--primary-blue);
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.brand-logo img {
    max-width: 100%;
    max-height: 60px;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all var(--transition-base);
}

.brand-logo:hover img {
    filter: grayscale(0%);
    opacity: 1;
}

/* ============================================
   FOOTER PROFESSIONNEL
   ============================================ */
footer.footer-professional {
    background-color: var(--dark-navy);
    color: var(--white);
    padding: 3rem 0 1rem;
}

footer.footer-professional h5 {
    color: var(--white);
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
}

footer.footer-professional a {
    color: rgba(255, 255, 255, 0.7);
    transition: color var(--transition-fast);
    display: block;
    margin-bottom: 0.75rem;
}

footer.footer-professional a:hover {
    color: var(--white);
    padding-left: 0.5rem;
}

footer.footer-professional .social-links a {
    display: inline-block;
    margin-right: 1rem;
    margin-bottom: 0;
}

footer.footer-professional .social-links a:hover {
    color: var(--accent-teal);
    transform: translateY(-3px);
    padding-left: 0;
}

footer.footer-professional .footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 2rem;
    padding-top: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 991px) {
    .search-professional {
        width: 100%;
        margin: 1rem 0;
    }
    
    .hero-professional h1 {
        font-size: 2rem;
    }
    
    .hero-professional .subtitle {
        font-size: 1.25rem;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
}

@media (max-width: 768px) {
    .hero-professional {
        text-align: center;
        padding: 3rem 0;
    }
    
    .hero-badges {
        justify-content: center;
    }
    
    .brands-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 1rem;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* ============================================
   UTILITIES
   ============================================ */
.text-primary-blue {
    color: var(--primary-blue) !important;
}

.bg-primary-blue {
    background-color: var(--primary-blue) !important;
}

.bg-gradient-blue {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
}

.cursor-pointer {
    cursor: pointer;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Loading States */
.skeleton {
    background: linear-gradient(90deg, var(--light-gray) 25%, var(--medium-gray) 50%, var(--light-gray) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}


/* ============================================
   PAGE PRODUIT DÉTAILLÉE
   ============================================ */

/* Images produit */
.product-images .main-image {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius-lg);
    background-color: var(--light-gray);
}

.product-images .main-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    max-height: 500px;
}

.product-images .row img {
    cursor: pointer;
    transition: all var(--transition-base);
    height: 100px;
    object-fit: cover;
}

.product-images .row img:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

/* Informations produit */
.product-info h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.product-info h2 {
    font-size: 2.5rem;
    font-weight: 700;
}

.product-info .badge {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

.product-info .card {
    border: 2px solid var(--light-gray);
    border-radius: var(--border-radius-lg);
}

.product-info .card-header {
    background-color: var(--light-gray);
    border-bottom: 2px solid var(--primary-blue);
    font-weight: 600;
}

/* Quantité */
.product-info .input-group {
    max-width: 150px;
}

.product-info .input-group input {
    text-align: center;
    font-weight: 600;
}

.product-info .input-group button {
    border-color: var(--medium-gray);
}

.product-info .input-group button:hover {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
    color: var(--white);
}
