/**
 * Styles du shortcode Exposants Salon JMD
 * Fidélité à la charte graphique de production (Clash Grotesk, rouge #e6311c, noir #1d1d1b)
 */

.jmd-exposants-wrap {
    width: 100%;
    max-width: 1500px;
    margin: 2rem auto 4rem auto;
    font-family: "Clash Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1d1d1b;
    box-sizing: border-box;
}

.jmd-exposants-wrap * {
    box-sizing: border-box;
}

/* ==========================================================================
   Barre de filtres & recherche
   ========================================================================== */
.jmd-filters-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 2.5rem;
    padding: 0 10px;
}

.jmd-filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.jmd-filter-label {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #1d1d1b;
}

/* Champ de recherche */
.jmd-search-box {
    position: relative;
    width: 100%;
    max-width: 380px;
}

.jmd-search-input {
    width: 100%;
    height: 44px;
    padding: 10px 40px 10px 42px;
    font-family: inherit;
    font-size: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background-color: #fff;
    color: #1d1d1b;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.jmd-search-input:focus {
    outline: none;
    border-color: #e6311c;
    box-shadow: 0 0 0 3px rgba(230, 49, 28, 0.15);
}

.jmd-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    fill: #888;
    pointer-events: none;
}

.jmd-search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #888;
}

.jmd-search-clear:hover {
    color: #e6311c;
}

/* Sélecteurs (Activités & Tri) */
.jmd-select {
    height: 44px;
    padding: 0 34px 0 14px;
    font-family: inherit;
    font-size: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M6 8L0 0h12z'/%3E%3C/svg%3E") no-repeat right 12px center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    color: #1d1d1b;
    min-width: 240px;
    transition: border-color 0.2s ease;
}

.jmd-select:focus {
    outline: none;
    border-color: #e6311c;
}

/* Boutons de changement de vue */
.jmd-view-switch {
    display: flex;
    gap: 6px;
}

.jmd-view-btn {
    width: 44px;
    height: 44px;
    border: 2px solid #e6311c;
    background: #fff;
    color: #e6311c;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease, color 0.2s ease;
}

.jmd-view-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.jmd-view-btn:hover,
.jmd-view-btn.active {
    background: #e6311c;
    color: #fff;
}

/* Message aucun résultat */
.jmd-empty-message {
    display: none;
    text-align: center;
    padding: 60px 20px;
    font-size: 18px;
    color: #666;
    background: #fafafa;
    border-radius: 8px;
    margin: 20px 0;
}

/* Compteur de résultats */
.jmd-results-count {
    font-size: 13px;
    color: #777;
    margin-bottom: 20px;
    padding: 0 10px;
}

/* ==========================================================================
   Grille Mosaïque (Mode Grille)
   ========================================================================== */
.jmd-exposants-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    padding: 0 10px;
}

@media (max-width: 1300px) {
    .jmd-exposants-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .jmd-exposants-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 580px) {
    .jmd-exposants-grid {
        grid-template-columns: 1fr;
    }
}

/* Carte Exposant */
.jmd-card-exposant {
    background: #fff;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.jmd-card-exposant:hover {
    transform: translateY(-4px);
}

/* Bordures & ombres alternées (rouge / noir de prod) */
.jmd-card-red {
    border: 3px solid #e6311c;
    box-shadow: transparent 0px 0px 0px 2px inset, rgb(230 49 28) 4px -4px;
}

.jmd-card-dark {
    border: 3px solid #000000;
    box-shadow: transparent 0px 0px 0px 2px inset, #000000 -4px 4px;
}

/* Zone Image / Logo */
.jmd-card-media {
    height: 190px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    border-bottom: 1px solid #f0f0f0;
}

.jmd-card-media img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.25s ease;
}

.jmd-card-exposant:hover .jmd-card-media img {
    transform: scale(1.05);
}

/* Corps de la carte */
.jmd-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.jmd-card-title {
    font-size: 19px;
    font-weight: 700;
    margin: 0 0 12px 0;
    line-height: 1.3;
    color: #1d1d1b;
    min-height: 48px;
    display: flex;
    align-items: center;
}

/* Métadonnées de la carte */
.jmd-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #444;
}

.jmd-card-meta svg {
    width: 16px;
    height: 16px;
    fill: #e6311c;
    flex-shrink: 0;
}

.jmd-card-meta.stand strong {
    color: #e6311c;
    font-weight: 700;
}

.jmd-card-meta.website a {
    color: #1d1d1b;
    text-decoration: underline;
    text-underline-offset: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jmd-card-meta.website a:hover {
    color: #e6311c;
}

.jmd-card-meta.activity {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
    color: #666;
}

/* Bouton action carte */
.jmd-card-footer {
    margin-top: auto;
    padding-top: 15px;
    display: flex;
    justify-content: flex-end;
}

.jmd-btn-details {
    background: #e6311c;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 8px 14px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s ease;
}

.jmd-btn-details:hover {
    background: #b52211;
}

.jmd-btn-details svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* ==========================================================================
   Vue Tableau (Mode Liste)
   ========================================================================== */
.jmd-exposants-table-container {
    display: none;
    overflow-x: auto;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.jmd-exposants-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
}

.jmd-exposants-table thead {
    background: #1d1d1b;
    color: #fff;
}

.jmd-exposants-table th {
    padding: 14px 18px;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.jmd-exposants-table td {
    padding: 14px 18px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.jmd-exposants-table tbody tr:hover {
    background-color: #fafafa;
}

.jmd-td-logo {
    width: 80px;
    text-align: center;
}

.jmd-td-logo img {
    max-height: 40px;
    max-width: 70px;
    object-fit: contain;
    vertical-align: middle;
}

.jmd-td-company {
    font-weight: 700;
    color: #1d1d1b;
    cursor: pointer;
}

.jmd-td-company:hover {
    color: #e6311c;
}

.jmd-td-stand {
    font-weight: 700;
    color: #e6311c;
    white-space: nowrap;
}

.jmd-td-website a {
    color: #1d1d1b;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.jmd-td-website a:hover {
    color: #e6311c;
}

/* ==========================================================================
   Modale Fiche Détaillée
   ========================================================================== */
.jmd-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(3px);
}

.jmd-modal-backdrop.is-open {
    display: flex;
}

.jmd-modal-content {
    background: #fff;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 8px;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: jmdModalFadeIn 0.25s ease-out;
}

@keyframes jmdModalFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.jmd-modal-header {
    background: #f7f7f7;
    padding: 24px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #e6311c;
}

.jmd-modal-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: #1d1d1b;
}

.jmd-modal-close {
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 0 6px;
    border-radius: 4px;
    transition: color 0.2s ease, background 0.2s ease;
}

.jmd-modal-close:hover {
    color: #e6311c;
    background: #eee;
}

.jmd-modal-body {
    padding: 30px;
}

/* En-tête de la modale avec logo */
.jmd-modal-hero {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.jmd-modal-logo-wrapper {
    width: 180px;
    height: 110px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    flex-shrink: 0;
}

.jmd-modal-logo-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.jmd-modal-badges {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.jmd-modal-stand-badge {
    display: inline-block;
    background: #e6311c;
    color: #fff;
    padding: 5px 12px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 14px;
    width: fit-content;
}

/* Sections de contenu */
.jmd-modal-section {
    margin-bottom: 28px;
}

.jmd-modal-section-title {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #e6311c;
    margin: 0 0 14px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

.jmd-modal-description {
    font-size: 15px;
    line-height: 1.6;
    color: #333;
}

/* Grille d'informations de contact */
.jmd-modal-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    background: #fbfbfb;
    padding: 18px 20px;
    border-radius: 6px;
}

@media (max-width: 600px) {
    .jmd-modal-info-grid {
        grid-template-columns: 1fr;
    }
    .jmd-modal-hero {
        flex-direction: column;
        align-items: flex-start;
    }
}

.jmd-modal-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.jmd-modal-info-item svg {
    width: 18px;
    height: 18px;
    fill: #e6311c;
    flex-shrink: 0;
}

.jmd-modal-info-item a {
    color: #1d1d1b;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.jmd-modal-info-item a:hover {
    color: #e6311c;
}

/* Trombinoscope / Équipe stand */
.jmd-modal-team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 15px;
}

.jmd-team-card {
    background: #fafafa;
    border-left: 4px solid #e6311c;
    padding: 12px 16px;
    border-radius: 0 6px 6px 0;
}

.jmd-team-name {
    font-size: 15px;
    font-weight: 700;
    color: #1d1d1b;
    margin-bottom: 4px;
}

.jmd-team-post {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

.jmd-team-email a {
    font-size: 12px;
    color: #e6311c;
    text-decoration: none;
}

.jmd-team-email a:hover {
    text-decoration: underline;
}
