/* ========================================= */
/* Module MacroSearch                        */
/* ========================================= */

/* Hauteur uniforme pour tous les tags du widget */
.macro-ou-tag,
.macro-cat-btn,
.macro-subtype-chip,
.macro-quick-date-btn {
    height: 26px;
    box-sizing: border-box;
    padding-top: 0;
    padding-bottom: 0;
}

.macro-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 100%;
    margin: 1rem auto 0.75rem;
    color: #555;
    font-size: 0.9rem;
    font-weight: 500;
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

.macro-divider::before,
.macro-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #bbb;
}

.macro-divider-link {
    color: #2c3e50;
    font-size: 1.15rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: opacity 0.2s;
}

.macro-divider-link:hover {
    opacity: 0.75;
    text-decoration: underline;
}

.macro-hero {
    max-width: 100%;
    margin: 0 auto;
    text-align: left;
    animation: fadeInUp 0.8s ease-out 0.5s backwards;
}

/* Layout 2 colonnes du bloc macro */
.macro-two-col {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.macro-col-left {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.macro-map-side {
    flex: 0 0 580px;
    max-width: 580px;
    margin-left: auto;
}

.macro-cats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.macro-cats .macro-ou-label {
    flex-basis: 100%;
    min-width: unset;
    margin-bottom: 0.1rem;
}

.macro-cat-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.75rem;
    border: 1.5px solid #e0e0e0;
    border-radius: 50px;
    background: white;
    color: #555;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
}

/* Icônes colorées par catégorie */
.macro-cat-btn[data-cat="manifestation"] i { color: #3498db; }
.macro-cat-btn[data-cat="activite"] i      { color: #27ae60; }
.macro-cat-btn[data-cat="hebergement"] i   { color: #e67e22; }
.macro-cat-btn[data-cat="restaurant"] i    { color: #9b59b6; }

.macro-cat-btn:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

.macro-cat-btn.active {
    background: #d8d8d8;
    border-color: #aaa;
    color: #333;
}

/* Icônes conservent leur couleur à l'état actif */
.macro-cat-btn.active[data-cat="manifestation"] i { color: #3498db; }
.macro-cat-btn.active[data-cat="activite"] i      { color: #27ae60; }
.macro-cat-btn.active[data-cat="hebergement"] i   { color: #e67e22; }
.macro-cat-btn.active[data-cat="restaurant"] i    { color: #9b59b6; }

.macro-subtypes-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.1rem;
    min-height: 34px;
}

.macro-subtype-hint {
    flex-basis: 100%;
    font-size: 0.76rem;
    color: #7f8c8d;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.1rem;
}

.macro-subtype-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.8rem;
    border: 1.5px solid #e0e0e0;
    border-radius: 50px;
    background: white;
    color: #555;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.macro-subtype-chip:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

.macro-subtype-chip.selected {
    background: #d8d8d8;
    border-color: #aaa;
    color: #333;
    font-weight: 600;
}

/* Icônes des sous-types colorées selon la catégorie active */
#macro-subtypes[data-cat="manifestation"] .macro-subtype-chip i { color: #3498db; }
#macro-subtypes[data-cat="activite"]      .macro-subtype-chip i { color: #27ae60; }
#macro-subtypes[data-cat="hebergement"]   .macro-subtype-chip i { color: #e67e22; }
#macro-subtypes[data-cat="restaurant"]    .macro-subtype-chip i { color: #9b59b6; }

.macro-bottom-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.macro-ou-section {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.macro-ou-section .macro-ou-label {
    flex-basis: 100%;
    min-width: unset;
    margin-bottom: 0.1rem;
}

.macro-ou-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.macro-ou-label i {
    color: #2c3e50;
}

.macro-theme-slogan {
    font-size: 0.78rem;
    font-weight: 700;
    color: #2c3e50;
    font-style: italic;
    white-space: normal;
}

.macro-ou-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.macro-ou-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    padding: 0.28rem 0.65rem;
    border: 1.5px solid #e0e0e0;
    border-radius: 50px;
    background: white;
    color: #555;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
}

.macro-ou-tag i { color: #2c3e50; }

.macro-ou-tag:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

.macro-ou-tag.active {
    background: #d8d8d8;
    border-color: #aaa;
    color: #333;
}

.macro-ou-tag.active i { color: #2c3e50; }

/* Zone dynamique selon destination sélectionnée */
.macro-ou-detail {
    margin-top: 0.6rem;
    min-height: 0;
}

.macro-ville-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.macro-rayon-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #555;
    white-space: nowrap;
}

.macro-rayon-select {
    border: 1.5px solid #e0e0e0;
    border-radius: 20px;
    padding: 0.3rem 0.75rem;
    font-size: 0.85rem;
    color: #2c3e50;
    background: white;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.macro-rayon-select:focus {
    border-color: #2c3e50;
}

/* Chips régions dans la zone détail */
.macro-ou-detail .macro-subtype-chip {
    font-size: 0.78rem;
    padding: 0.25rem 0.65rem;
}

/* Mini carte région / département */
.macro-mini-map-container {
    border: 1px solid #d0c5e8;
    border-radius: 12px;
    overflow: hidden;
    max-width: 540px;
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.1);
}

.macro-map-hint {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.85rem;
    background: #f0f4ff;
    font-size: 0.82rem;
    color: #5a6fd6;
    border-bottom: 1px solid #dde6ff;
    margin: 0;
}

.macro-mini-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    background: #f5f2fb;
    font-size: 0.82rem;
    color: #666;
    border-bottom: 1px solid #e0d8f0;
}

.mini-bc-back {
    cursor: pointer;
    color: #2c3e50;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.mini-bc-back:hover { text-decoration: underline; }

.mini-bc-sep { color: #ccc; }

.mini-bc-region {
    font-weight: 600;
    color: #2c3e50;
}

.macro-mini-map {
    height: 340px;
    width: 100%;
    cursor: pointer;
    background: #f0f4ff;
}

.macro-mini-selection {
    padding: 0.45rem 0.85rem;
    background: #ede7f6;
    font-size: 0.82rem;
    color: #2c3e50;
    font-weight: 600;
    border-top: 1px solid #d0c5e8;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Section Outre-mer sous la mini carte */
.macro-mini-overseas {
    padding: 0.6rem 0.85rem;
    border-top: 1px solid #e0d8f0;
    background: #faf8fe;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.mini-overseas-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

.mini-overseas-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.mini-overseas-chip {
    font-size: 0.75rem !important;
    padding: 0.2rem 0.6rem !important;
}

/* Tooltip Leaflet mini carte */
.macro-mini-tooltip {
    background: #2c3e50 !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 3px 10px !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
}

/* Input ville */
.macro-ville-wrapper {
    position: relative;
    max-width: 400px;
}

.macro-ville-input {
    width: 100%;
    border: 1.5px solid #e0e0e0;
    border-radius: 50px;
    padding: 0.5rem 1rem;
    font-size: 0.88rem;
    color: #333;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.macro-ville-input:focus {
    border-color: #2c3e50;
}

.macro-ville-suggestions {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d0c5e8;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    max-height: 220px;
    overflow-y: auto;
    z-index: 100;
}

.macro-ville-suggestions.show {
    display: block;
}

.macro-ville-suggestion {
    padding: 0.6rem 1rem;
    cursor: pointer;
    transition: background 0.15s;
}

.macro-ville-suggestion:hover,
.macro-ville-suggestion.active {
    background: #f3eef8;
}

.macro-ville-suggestion .sug-nom {
    font-weight: 600;
    font-size: 0.88rem;
    color: #2c3e50;
}

.macro-ville-suggestion .sug-detail {
    font-size: 0.75rem;
    color: #999;
    margin-top: 1px;
}

.macro-ville-no-result {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    color: #aaa;
}

.macro-btn-execute {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.25rem;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.macro-btn-execute:hover:not(:disabled) {
    opacity: 0.85;
    transform: translateY(-1px);
}

.macro-btn-execute:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Section Quand ─────────────────────────── */
.macro-quand-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0;
    flex-wrap: wrap;
}

.macro-quand-section .macro-ou-label {
    flex-basis: 100%;
    min-width: unset;
    margin-bottom: 0.1rem;
}

.macro-quand-body {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.macro-quick-dates {
    display: flex;
    gap: 0.4rem;
}

.macro-quick-date-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.7rem;
    background: white;
    border: 1.5px solid #e0e0e0;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
}

.macro-quick-date-btn i { color: #2c3e50; }

.macro-quick-date-btn:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

.macro-quick-date-btn.active {
    background: #d8d8d8;
    border-color: #aaa;
    color: #333;
}

.macro-quick-date-btn.active i { color: #2c3e50; }

.macro-date-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.macro-date-field {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
}

.macro-date-input {
    padding: 0.28rem 0.5rem;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: inherit;
    color: #333;
    background: white;
    transition: border-color 0.2s;
}

.macro-date-input:focus {
    outline: none;
    border-color: #2c3e50;
    box-shadow: 0 0 0 2px rgba(118, 75, 162, 0.1);
}

.macro-date-sep {
    color: #bbb;
    font-size: 0.85rem;
}

.macro-hint {
    font-size: 0.85rem;
    color: #888;
    margin: 0.6rem 0 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.2s;
}

.macro-hint--error {
    color: #e74c3c !important;
    font-weight: 600;
}

@keyframes macro-hint-shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

.macro-hint--shake {
    animation: macro-hint-shake 0.45s ease;
}

/* ========================================= */
/* Widget macro-search sur pages recherche   */
/* ========================================= */

/* Wrapper qui aligne le widget sur la largeur du .recherche-container */
.macro-search-widget-outer {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 0.5rem 0;
}

.macro-search-widget {
    background: white;
    border-radius: 12px;
    margin: 0 0 1.25rem 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e0d8f0;
}

.macro-search-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #f5f6fa 0%, #eef0f3 100%);
    border-bottom: 1px solid #dde0e5;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    user-select: none;
}

.macro-search-widget-header i:not(.macro-header-theme-item i) {
    color: #2c3e50;
    margin-right: 0.3rem;
}

.macro-header-theme-item i {
    color: inherit;
}

.macro-header-themes {
    margin-left: 3rem;
    display: inline-flex;
    gap: 0.75rem;
    font-size: 1rem;
}

.macro-header-theme-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.macro-header-theme-item i {
    font-size: 1rem;
    margin-right: 0;
}

.macro-widget-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.macro-clear-all-btn {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0;
    transition: color 0.2s;
}

.macro-clear-all-btn:hover {
    color: #495057;
    text-decoration: underline;
}

.macro-widget-toggle {
    background: none;
    border: 1.5px solid #d0c5e8;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2c3e50;
    transition: all 0.2s;
    flex-shrink: 0;
}

.macro-widget-toggle:hover {
    background: #2c3e50;
    color: white;
    border-color: #2c3e50;
}

.macro-widget-body {
    padding: 1.25rem;
}

.macro-widget-body .macro-hero {
    animation: none;
}

/* ========================================= */
/* Responsive macro-search                   */
/* ========================================= */

@media (max-width: 900px) {
    .macro-two-col {
        flex-direction: column;
    }

    .macro-map-side {
        flex: none;
        max-width: 100%;
        width: 100%;
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .macro-search-widget-outer {
        padding: 1rem 1rem 0;
    }

    .macro-search-panel {
        padding: 1rem;
    }

    .macro-cats {
        justify-content: center;
    }

    .macro-cat-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
    }

    .macro-actions {
        justify-content: center;
    }

    .macro-subtype-chip {
        font-size: 0.73rem;
        padding: 0.22rem 0.65rem;
    }
}

@media (max-width: 480px) {
    .macro-cat-btn {
        font-size: 0.75rem;
        padding: 0.35rem 0.6rem;
    }

    .macro-subtype-chip {
        font-size: 0.7rem;
        padding: 0.18rem 0.5rem;
        gap: 0.2rem;
    }
}
