/* 
 * Personnalisation de la recherche Motive
 * Fichier : motive-custom.css
 * 
 * Ce fichier permet de personnaliser l'apparence de la recherche Motive
 * sans modifier les fichiers originaux du module.
 */

/* ===== PERSONNALISATION GÉNÉRALE ===== */

/* Container principal de la recherche */
.x-mot-search-container {
    /* Personnaliser le container principal */
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    background: #ffffff !important;
}

/* ===== RÉSULTATS DE RECHERCHE ===== */

/* Container des résultats */
.x-mot-result {
    /* Hauteur et espacement */
    height: auto !important;
    min-height: 180px !important;
    max-height: 400px !important;
    
    /* Bordures et ombres */
    border: 1px solid #e0e0e0 !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    
    /* Espacement interne */
    padding: 12px !important;
    margin-bottom: 8px !important;
    
    /* Transition pour les effets hover */
    transition: all 0.3s ease !important;
}

/* Effet hover sur les résultats */
.x-mot-result:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
    border-color: #007bff !important;
}

/* ===== TITRES DES PRODUITS ===== */

.x-mot-result__title,
.x-result-link {
    /* Typographie */
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
    line-height: 1.4 !important;
    
    /* Affichage */
    display: block !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    
    /* Espacement */
    margin-bottom: 8px !important;
    
    /* Transition */
    transition: color 0.2s ease !important;
}

.x-mot-result__title:hover,
.x-result-link:hover {
    color: #007bff !important;
    text-decoration: none !important;
}

/* ===== DESCRIPTIONS ===== */

.x-mot-result__description {
    /* Typographie */
    font-size: 14px !important;
    color: #6c757d !important;
    line-height: 1.5 !important;
    
    /* Affichage */
    display: block !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    
    /* Limitation de hauteur avec scroll */
    max-height: 60px !important;
    overflow-y: auto !important;
    
    /* Espacement */
    margin-bottom: 8px !important;
}

/* ===== PRIX ===== */

.x-mot-result__price {
    /* Typographie */
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #28a745 !important;
    
    /* Affichage */
    display: inline-block !important;
    
    /* Espacement */
    margin: 8px 0 !important;
}

/* Prix barré (prix original) */
.x-mot-result__price--original {
    font-size: 14px !important;
    color: #6c757d !important;
    text-decoration: line-through !important;
    margin-right: 8px !important;
}

/* ===== IMAGES ===== */

.x-mot-result__image {
    /* Dimensions */
    width: 80px !important;
    height: 80px !important;
    
    /* Bordures */
    border-radius: 4px !important;
    border: 1px solid #e0e0e0 !important;
    
    /* Alignement */
    float: left !important;
    margin-right: 12px !important;
    
    /* Transition */
    transition: transform 0.2s ease !important;
}

.x-mot-result__image:hover {
    transform: scale(1.05) !important;
}

/* ===== BADGES ET LABELS ===== */

.x-mot-result__badge {
    /* Style des badges */
    display: inline-block !important;
    padding: 4px 8px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    border-radius: 12px !important;
    
    /* Couleurs par défaut */
    background: #f8f9fa !important;
    color: #495057 !important;
    border: 1px solid #dee2e6 !important;
}

/* Badge "Nouveau" */
.x-mot-result__badge--new {
    background: #28a745 !important;
    color: white !important;
    border-color: #28a745 !important;
}

/* Badge "Promotion" */
.x-mot-result__badge--sale {
    background: #dc3545 !important;
    color: white !important;
    border-color: #dc3545 !important;
}

/* ===== BOUTONS D'ACTION ===== */

.x-mot-result__actions {
    /* Container des actions */
    margin-top: 12px !important;
    padding-top: 8px !important;
    border-top: 1px solid #e0e0e0 !important;
}

.x-mot-result__button {
    /* Style des boutons */
    display: inline-block !important;
    padding: 6px 12px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    border-radius: 4px !important;
    
    /* Couleurs */
    background: #007bff !important;
    color: white !important;
    border: 1px solid #007bff !important;
    
    /* Transition */
    transition: all 0.2s ease !important;
    
    /* Espacement */
    margin-right: 8px !important;
    margin-bottom: 4px !important;
}

.x-mot-result__button:hover {
    background: #0056b3 !important;
    border-color: #0056b3 !important;
    transform: translateY(-1px) !important;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablettes */
@media (max-width: 768px) {
    .x-mot-result {
        min-height: 160px !important;
        padding: 10px !important;
    }
    
    .x-mot-result__image {
        width: 60px !important;
        height: 60px !important;
    }
    
    .x-mot-result__title {
        font-size: 15px !important;
    }
    
    .x-mot-result__description {
        font-size: 13px !important;
    }
}

/* Mobiles */
@media (max-width: 480px) {
    .x-mot-result {
        min-height: 140px !important;
        padding: 8px !important;
    }
    
    .x-mot-result__image {
        width: 50px !important;
        height: 50px !important;
        margin-right: 8px !important;
    }
    
    .x-mot-result__title {
        font-size: 14px !important;
    }
    
    .x-mot-result__description {
        font-size: 12px !important;
        max-height: 40px !important;
    }
    
    .x-mot-result__button {
        padding: 4px 8px !important;
        font-size: 12px !important;
    }
}

/* ===== ANIMATIONS ===== */

/* Animation d'apparition des résultats */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.x-mot-result {
    animation: fadeInUp 0.3s ease-out !important;
}

/* ===== PERSONNALISATION THÈME ===== */

/* Couleurs personnalisables */
:root {
    --motive-primary-color: #007bff;
    --motive-secondary-color: #6c757d;
    --motive-success-color: #28a745;
    --motive-danger-color: #dc3545;
    --motive-warning-color: #ffc107;
    --motive-info-color: #17a2b8;
    --motive-light-color: #f8f9fa;
    --motive-dark-color: #343a40;
}

/* Utilisation des variables CSS */
.x-mot-result__title {
    color: var(--motive-primary-color) !important;
}

.x-mot-result__price {
    color: var(--motive-success-color) !important;
}

.x-mot-result__badge--new {
    background: var(--motive-success-color) !important;
}

.x-mot-result__badge--sale {
    background: var(--motive-danger-color) !important;
}

/* ===== ACCESSIBILITÉ ===== */

/* Focus visible pour l'accessibilité */
.x-mot-result:focus,
.x-mot-result__button:focus {
    outline: 2px solid var(--motive-primary-color) !important;
    outline-offset: 2px !important;
}

/* Contraste amélioré */
.x-mot-result__description {
    color: #495057 !important; /* Contraste amélioré */
}

/* ===== IMPRESSION ===== */

@media print {
    .x-mot-result {
        box-shadow: none !important;
        border: 1px solid #000 !important;
        break-inside: avoid !important;
    }
    
    .x-mot-result__button {
        display: none !important;
    }
}
