/* Section principale */
.products-section {
    padding: 2rem 0;
    min-height: 70vh;
    background-color: #f9f7f6;
}

/* Sidebar des catégories */
.category-sidebar {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(121, 85, 72, 0.1);
    overflow: hidden;
    margin-bottom: 1.5rem;
    height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    border: 1px solid #e0d7d4;
}

.category-header {
    padding: 1.25rem;
    border-bottom: 1px solid #e0d7d4;
    background: #795548;
    color: white;
}

.category-title {
    font-size: 1.25rem;
    margin: 0 0 1rem 0;
    font-weight: 600;
    color: white;
}

.category-search {
    position: relative;
}

.category-search input {
    width: 100%;
    padding: 0.625rem 2.5rem 0.625rem 1rem;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.95);
    font-size: 0.875rem;
    color: #5d4037;
    border: 1px solid #d7ccc8;
}

.category-search input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(121, 85, 72, 0.2);
}

.category-search i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #795548;
}

/* Conteneur scrollable */
.category-scroll-container {
    flex: 1;
    overflow-y: auto;
    max-height: 60vh;
    padding: 0.5rem;
}

/* Personnalisation de la scrollbar */
.category-scroll-container::-webkit-scrollbar {
    width: 6px;
}

.category-scroll-container::-webkit-scrollbar-track {
    background: #f5f0ee;
    border-radius: 10px;
}

.category-scroll-container::-webkit-scrollbar-thumb {
    background: #a1887f;
    border-radius: 10px;
}

.category-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #8d6e63;
}

/* Liste des catégories */
.category-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.category-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    text-decoration: none;
    color: #5d4037;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    background: #fff;
}

.category-item:hover {
    background: #f5efeb;
    border-color: #d7ccc8;
    transform: translateX(4px);
    color: #795548;
}

.category-item.active {
    background: rgba(121, 85, 72, 0.1);
    border-color: #795548;
    color: #795548;
    font-weight: 600;
}

.category-icon {
    width: 32px;
    text-align: center;
    margin-right: 0.75rem;
    font-size: 1.1rem;
    color: #795548;
}

.category-item.active .category-icon {
    color: #795548;
}

.category-name {
    flex: 1;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-count {
    font-size: 0.8rem;
    color: #8d6e63;
    background: #efebe9;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    margin-left: 0.5rem;
}

.category-item.active .category-count {
    background: #795548;
    color: white;
}

.category-footer {
    padding: 1rem;
    border-top: 1px solid #e0d7d4;
    text-align: center;
    color: #8d6e63;
    font-size: 0.85rem;
    background: #faf5f3;
}

/* Contenu principal */
.content-wrapper {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(121, 85, 72, 0.1);
    padding: 1.5rem;
    min-height: 500px;
    position: relative;
    border: 1px solid #e0d7d4;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #efebe9;
}

.results-header h1 {
    margin: 0;
    font-size: 1.75rem;
    color: #5d4037;
}

.results-count {
    background: #efebe9;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #795548;
    font-weight: 500;
}

/* Preloader amélioré */
.preloader-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.95);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(121, 85, 72, 0.15);
    border: 1px solid #e0d7d4;
}

.preloader-content {
    text-align: center;
}

.spinner {
    margin: 0 auto 1.5rem;
    width: 70px;
    text-align: center;
}

.spinner div {
    width: 18px;
    height: 18px;
    background-color: #795548;
    border-radius: 100%;
    display: inline-block;
    animation: bounce 1.4s infinite ease-in-out both;
}

.spinner .bounce1 {
    animation-delay: -0.32s;
}

.spinner .bounce2 {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% { 
        transform: scale(0);
    } 40% { 
        transform: scale(1.0);
    }
}

.loading-text {
    color: #795548;
    font-size: 1.1rem;
    margin: 0;
    font-weight: 500;
}

/* Conteneur des cartes */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    transition: opacity 0.3s ease;
}

.cards-container.loading {
    opacity: 0.3;
    pointer-events: none;
}

/* Styles spécifiques pour les cartes de l'annuaire */
.company-card {
    height: 100%;
    transition: all 0.3s ease;
    border: 1px solid #e0d7d4;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.company-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(121, 85, 72, 0.15);
    border-color: #a1887f;
}

.card-logo {
    max-height: 100px;
    max-width: 150px;
    object-fit: contain;
    padding: 10px;
}

.card-body {
    padding: 1.25rem;
}

.card-title {
    color: #5d4037;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-weight: 600;
    border-bottom: 1px solid #efebe9;
    padding-bottom: 0.5rem;
}

.contact-info {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: flex-start;
}

.contact-info i {
    width: 20px;
    margin-right: 0.75rem;
    color: #795548;
    font-size: 0.9rem;
    margin-top: 2px;
}

.contact-info span, .contact-info a {
    color: #5d4037;
    font-size: 0.95rem;
    line-height: 1.4;
}

.contact-info a {
    color: #795548;
    text-decoration: none;
    transition: color 0.2s;
}

.contact-info a:hover {
    color: #5d4037;
    text-decoration: underline;
}

/* Message aucun résultat */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: #8d6e63;
}

.no-results i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    color: #d7ccc8;
}

.no-results h3 {
    color: #795548;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.no-results p {
    color: #a1887f;
}

/* Pagination */
.pagination-container {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e0d7d4;
}

.pagination {
    margin-bottom: 0;
}

.page-item.active .page-link {
    background-color: #795548;
    border-color: #795548;
}

.page-link {
    color: #795548;
    border: 1px solid #d7ccc8;
}

.page-link:hover {
    color: #5d4037;
    background-color: #efebe9;
    border-color: #a1887f;
}

/* Responsive */
@media (max-width: 991px) {
    .category-sidebar {
        height: auto;
        max-height: 400px;
    }
    
    .category-scroll-container {
        max-height: 300px;
    }
    
    .cards-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .category-sidebar {
        margin-bottom: 1rem;
    }
    
    .content-wrapper {
        padding: 1rem;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .cards-container {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 1rem;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .cards-container {
        grid-template-columns: 1fr;
    }
    
    .company-card {
        margin-bottom: 0;
    }
    
    .preloader-container {
        padding: 2rem;
        width: 90%;
    }
}

/* Animation pour le changement de catégorie */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.company-card {
    animation: fadeIn 0.4s ease-out;
}

/* Couleur d'accent pour les éléments interactifs */
a, button {
    color: #795548;
}

a:hover, button:hover {
    color: #5d4037;
}

/* Conteneur principal de la recherche */
.category-search-wrapper {
    margin-bottom: 0.5rem;
}

/* Groupe d'entrée de recherche */
.search-input-group {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid #d7ccc8;
    border-radius: 8px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.search-input-group:focus-within {
    border-color: #795548;
    box-shadow: 0 0 0 3px rgba(121, 85, 72, 0.15);
    transform: translateY(-1px);
}

/* Icône de recherche */
.search-icon {
    padding: 0 0.875rem;
    color: #8d6e63;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.search-input-group:focus-within .search-icon {
    color: #795548;
}

/* Champ de saisie */
.search-input {
    flex: 1;
    padding: 0.75rem 0;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    color: #5d4037;
    outline: none;
    min-width: 0;
}

.search-input::placeholder {
    color: #a1887f;
    opacity: 0.8;
}

/* Bouton d'effacement */
.search-clear {
    padding: 0 0.875rem;
    background: transparent;
    border: none;
    color: #a1887f;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    transform: scale(0.8);
}

.search-clear.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.search-clear:hover {
    color: #795548;
}

.search-clear:active {
    transform: scale(0.9);
}

/* Indice de recherche */
.search-hint {
    padding: 0.25rem 0.5rem;
    color: #8d6e63;
    font-size: 0.8rem;
    opacity: 0.8;
    animation: fadeInUp 0.4s ease-out;
}

.search-hint i {
    margin-right: 0.25rem;
    font-size: 0.75rem;
}

/* Animation pour l'apparition */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 0.8;
        transform: translateY(0);
    }
}

/* Effet de focus pour l'accessibilité */
.search-input:focus {
    outline: none;
}

/* Style pour les résultats de recherche */
.search-results-count {
    display: none;
    padding: 0.5rem;
    background: #efebe9;
    border-radius: 4px;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #795548;
    animation: slideDown 0.3s ease-out;
}

.search-results-count.visible {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .search-input-group {
        border-width: 1px;
    }
    
    .search-input {
        padding: 0.625rem 0;
        font-size: 0.9rem;
    }
    
    .search-icon, .search-clear {
        padding: 0 0.625rem;
    }
    
    .search-hint {
        display: none;
    }
}

/* Animation pour le bouton d'effacement */
@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    60% {
        transform: scale(1.1);
        opacity: 1;
    }
    100% {
        transform: scale(1);
    }
}

.search-clear.visible {
    animation: popIn 0.3s ease-out;
}

/* Style pour le mode sombre (optionnel) */
@media (prefers-color-scheme: dark) {
    .search-input-group {
        background: #2d2019;
        border-color: #5d4037;
    }
    
    .search-input {
        color: #efebe9;
    }
    
    .search-input::placeholder {
        color: #a1887f;
    }
    
    .search-icon {
        color: #a1887f;
    }
    
    .search-clear {
        color: #a1887f;
    }
    
    .search-clear:hover {
        color: #d7ccc8;
    }
}

/* STYLES AMÉLIORÉS POUR LES ICÔNES DE CONTACT */

.contact-info {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: flex-start;
    transition: all 0.3s ease;
}

.contact-info:hover {
    transform: translateX(3px);
}

.contact-icon-wrapper {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin-right: 12px;
    flex-shrink: 0;
    transition: all 0.3s ease;
    background: rgba(121, 85, 72, 0.08);
}

.contact-info:hover .contact-icon-wrapper {
    transform: scale(1.1);
}

.contact-icon {
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.contact-info:hover .contact-icon {
    transform: scale(1.1);
}

.contact-text {
    flex: 1;
    padding-top: 4px;
}

.contact-text a {
    color: #5d4037;
    text-decoration: none;
    transition: color 0.2s;
}

.contact-text a:hover {
    color: #795548;
    text-decoration: underline;
}

.contact-text small {
    font-size: 0.85rem;
    color: #8d6e63;
}

/* COULEURS SPÉCIFIQUES POUR CHAQUE TYPE D'ICÔNE */

/* Adresse - Vert */
.contact-info .fa-map-marker-alt,
.contact-info .fa-location-dot {
    color: #4CAF50;
}
.contact-info:hover .contact-icon-wrapper[class*="fa-map-marker-alt"],
.contact-info:hover .contact-icon-wrapper[class*="fa-location-dot"] {
    background: rgba(76, 175, 80, 0.15);
}

/* Téléphone - Bleu */
.contact-info .fa-phone-alt,
.contact-info .fa-phone {
    color: #2196F3;
}
.contact-info:hover .contact-icon-wrapper[class*="fa-phone-alt"],
.contact-info:hover .contact-icon-wrapper[class*="fa-phone"] {
    background: rgba(33, 150, 243, 0.15);
}

/* Email - Rouge */
.contact-info .fa-envelope {
    color: #FF1493;
}
.contact-info:hover .contact-icon-wrapper[class*="fa-envelope"] {
    background: rgba(244, 67, 54, 0.15);
}

/* Site web - Violet */
.contact-info .fa-globe,
.contact-info .fa-link {
    color: #9C27B0;
}
.contact-info:hover .contact-icon-wrapper[class*="fa-globe"],
.contact-info:hover .contact-icon-wrapper[class*="fa-link"] {
    background: rgba(156, 39, 176, 0.15);
}

/* WhatsApp - Vert WhatsApp */
.contact-info .fa-whatsapp {
    color: #25D366;
}
.contact-info:hover .contact-icon-wrapper[class*="fa-whatsapp"] {
    background: rgba(37, 211, 102, 0.15);
}

/* Facebook - Bleu Facebook */
.contact-info .fa-facebook-f,
.contact-info .fa-facebook {
    color: #1877F2;
}
.contact-info:hover .contact-icon-wrapper[class*="fa-facebook"] {
    background: rgba(24, 119, 242, 0.15);
}

/* Twitter - Bleu Twitter */
.contact-info .fa-twitter {
    color: #1DA1F2;
}
.contact-info:hover .contact-icon-wrapper[class*="fa-twitter"] {
    background: rgba(29, 161, 242, 0.15);
}

/* Instagram - Rose Instagram */
.contact-info .fa-instagram {
    color: #E4405F;
}
.contact-info:hover .contact-icon-wrapper[class*="fa-instagram"] {
    background: rgba(228, 64, 95, 0.15);
}

/* LinkedIn - Bleu LinkedIn */
.contact-info .fa-linkedin-in,
.contact-info .fa-linkedin {
    color: #0077B5;
}
.contact-info:hover .contact-icon-wrapper[class*="fa-linkedin"] {
    background: rgba(0, 119, 181, 0.15);
}

/* YouTube - Rouge YouTube */
.contact-info .fa-youtube {
    color: #FF0000;
}
.contact-info:hover .contact-icon-wrapper[class*="fa-youtube"] {
    background: rgba(255, 0, 0, 0.15);
}

/* TikTok - Noir */
.contact-info .fa-tiktok {
    color: #000000;
}
.contact-info:hover .contact-icon-wrapper[class*="fa-tiktok"] {
    background: rgba(0, 0, 0, 0.1);
}

/* Telegram - Bleu Telegram */
.contact-info .fa-telegram {
    color: #0088CC;
}
.contact-info:hover .contact-icon-wrapper[class*="fa-telegram"] {
    background: rgba(0, 136, 204, 0.15);
}

/* Snapchat - Jaune Snapchat */
.contact-info .fa-snapchat-ghost {
    color: #FFFC00;
    text-shadow: 0 0 1px #000;
}
.contact-info:hover .contact-icon-wrapper[class*="fa-snapchat-ghost"] {
    background: rgba(255, 252, 0, 0.15);
}

/* Pinterest - Rouge Pinterest */
.contact-info .fa-pinterest {
    color: #BD081C;
}
.contact-info:hover .contact-icon-wrapper[class*="fa-pinterest"] {
    background: rgba(189, 8, 28, 0.15);
}

/* Horaires - Orange */
.contact-info .fa-clock {
    color: #FF9800;
}
.contact-info:hover .contact-icon-wrapper[class*="fa-clock"] {
    background: rgba(255, 152, 0, 0.15);
}

/* Statut ouvert/fermé */
.contact-info .fa-check-circle {
    color: #4CAF50;
}
.contact-info .fa-times-circle {
    color: #F44336;
}

/* ANIMATIONS POUR LES ICÔNES */
@keyframes iconPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.icon-pulse {
    animation: iconPulse 2s infinite;
}

/* Style pour les icônes de réseaux sociaux (version alternative) */
.social-icon-list {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #efebe9;
}

.social-icon-item {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-icon-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Icônes de catégories dans la sidebar */
.category-icon .fas,
.category-icon .fab {
    font-size: 1.2rem;
    color: #795548;
    transition: all 0.3s ease;
}

.category-item:hover .category-icon .fas,
.category-item:hover .category-icon .fab {
    color: #5d4037;
    transform: scale(1.1);
}

.category-item.active .category-icon .fas,
.category-item.active .category-icon .fab {
    color: white;
}

/* Responsive pour les icônes */
@media (max-width: 768px) {
    .contact-icon-wrapper {
        width: 32px;
        height: 32px;
        margin-right: 10px;
    }
    
    .contact-icon {
        font-size: 1rem;
    }
    
    .contact-text {
        font-size: 0.9rem;
    }
    
    .social-icon-item {
        width: 32px;
        height: 32px;
    }
}

/* Effet de brillance sur les icônes */
.contact-icon-wrapper {
    position: relative;
    overflow: hidden;
}

.contact-icon-wrapper::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg);
    transition: transform 0.6s;
    opacity: 0;
}

.contact-info:hover .contact-icon-wrapper::after {
    opacity: 1;
    transform: rotate(30deg) translateX(100%);
}
