/**
 * MLEH - Styles principaux
 * Identité visuelle: Vert scientifique, Bleu laboratoire, Blanc
 */

:root {
    --primary-color: #2E7D32;
    /* Vert scientifique */
    --secondary-color: #1565C0;
    /* Bleu laboratoire */
    --accent-color: #00897B;
    /* Vert-bleu accent */
    --dark-color: #263238;
    --light-color: #ECEFF1;
    --white: #FFFFFF;
    --success: #43A047;
    --danger: #E53935;
    --warning: #FB8C00;
    --text-dark: #212121;
    --text-muted: #757575;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
}

/* Bootstrap overrides */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #1B5E20;
    border-color: #1B5E20;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

/* Navbar */
.navbar {
    padding: 1rem 0;
}

.navbar-brand img {
    height: 50px;
    transition: transform 0.3s;
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

.nav-link {
    font-weight: 500;
    color: var(--text-dark) !important;
    transition: color 0.3s;
    padding: 0.5rem 1rem !important;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
}

/* Search Box */
.search-box {
    position: relative;
    width: 300px;
}

.search-box input {
    padding-right: 40px;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-suggestions.show {
    display: block;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: background 0.2s;
}

.suggestion-item:hover {
    background-color: var(--light-color);
}

.suggestion-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 0.25rem;
}

.suggestion-item .info {
    flex: 1;
}

.suggestion-item .name {
    font-weight: 600;
    color: var(--text-dark);
}

.suggestion-item .ref {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.suggestion-item .price {
    font-weight: 600;
    color: var(--primary-color);
}

/* Hero Section */
.hero-section {
    padding: 4rem 0;
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 700;
}

/* Category Card */
.category-card {
    background: white;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s;
    border: 2px solid transparent;
    cursor: pointer;
    height: 100%;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.category-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.category-card h5 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.category-card .count {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Product Card */
.product-card {
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    transition: all 0.3s;
    border: 1px solid #e0e0e0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.product-card .image-container {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
    background: var(--light-color);
}

.product-card .image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .image-container img {
    transform: scale(1.1);
}

.product-card .badge-container {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
}

.product-card .card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card .product-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .product-ref {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.product-card .product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.product-card .btn-add-cart {
    width: 100%;
    margin-top: auto;
}

/* Feature Box */
.feature-box {
    transition: all 0.3s;
}

.feature-box:hover {
    transform: translateY(-5px);
}

.feature-box i {
    transition: transform 0.3s;
}

.feature-box:hover i {
    transform: scale(1.1);
}

/* Footer */
footer a {
    text-decoration: none;
    transition: color 0.3s;
}

footer a:hover {
    color: var(--primary-color) !important;
}

.social-links a {
    transition: transform 0.3s;
    display: inline-block;
}

.social-links a:hover {
    transform: translateY(-3px);
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
    color: var(--primary-color);
}

/* Alert Messages */
.alert {
    border-radius: 0.5rem;
    border: none;
}

.alert-success {
    background-color: #E8F5E9;
    color: var(--success);
}

.alert-danger {
    background-color: #FFEBEE;
    color: var(--danger);
}

.alert-warning {
    background-color: #FFF3E0;
    color: var(--warning);
}

/* Responsive */
@media (max-width: 991px) {
    .search-box {
        width: 100%;
        margin: 1rem 0;
    }

    .hero-section h1 {
        font-size: 2.5rem;
    }

    .navbar-nav {
        margin-top: 1rem;
    }
}

@media (max-width: 768px) {
    .hero-section {
        text-align: center;
    }

    .hero-section .col-lg-6:last-child {
        margin-top: 2rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* Utilities */
.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;
}
