/* Annuaire Agricole — front public (rapatrié de apaba-annuaire-agricole, inchangé) */

/* Main Container */
.annuaire-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Controls */
.annuaire-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
    line-height: normal;
}

.annuaire-controls>* {
    margin: 0 !important;
}

.annuaire-controls input[type="text"],
.annuaire-controls input[type="number"],
.annuaire-controls select {
    padding: 0 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    flex: 1;
    min-width: 150px;
    height: 46px !important;
    min-height: 46px !important;
    line-height: 46px !important;
    box-sizing: border-box !important;
    background: #fff;
    vertical-align: middle;
    -webkit-appearance: none;
    appearance: none;
}

.annuaire-controls input[type="number"]::-webkit-outer-spin-button,
.annuaire-controls input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.annuaire-controls input[type="number"] {
    -moz-appearance: textfield;
}

#btn-propose-supplier {
    margin-left: auto;
    height: 46px;
    padding: 0 20px;
    line-height: 46px;
    border-radius: 4px;
    background: #82b440;
    color: #fff;
    border: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

#btn-propose-supplier:hover {
    background: #73a137;
}

/* Results Grid */
.annuaire-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.annuaire-item {
    background: #fff;
    border: 1px solid #eee;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.annuaire-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: #0073aa;
}

.annuaire-item-title {
    margin: 0 0 10px;
    font-size: 1.2em;
    color: #333;
}

.annuaire-item-meta {
    font-size: 0.9em;
    color: #666;
    line-height: 1.4;
}

.cat {
    color: #0073aa;
    font-weight: 500;
}

/* Modals */
.annuaire-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2147483647 !important;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.annuaire-modal[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
}

.annuaire-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.annuaire-modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 10;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.annuaire-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 18px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    color: #666;
}

.annuaire-modal-close:hover {
    color: #000;
}

/* Form Styles */
.form-group {
    margin-bottom: 15px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-group.half {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: normal;
    height: auto;
    min-height: 36px;
}

.annuaire-checkbox-list {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 4px;
    background: #fdfdfd;
}

.annuaire-checkbox-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
    font-weight: normal;
    cursor: pointer;
    font-size: 14px;
}

.annuaire-checkbox-list input[type="checkbox"] {
    width: auto;
    min-height: auto;
    margin: 0;
}

#address-suggestions {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid #ddd;
    border-top: none;
    max-height: 150px;
    overflow-y: auto;
    display: none;
    position: absolute;
    background: #fff;
    width: calc(100% - 60px);
    z-index: 20;
}

#address-suggestions li {
    padding: 8px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

#address-suggestions li:hover {
    background: #f9f9f9;
}

/* Success Modal specific */
#success-message-body {
    padding: 20px;
    font-size: 1.2em;
    color: #2e7d32;
}

/* Pagination — reprise 1:1 du front Petites annonces (.aa-an-pagination).
   IMPORTANT : ne PAS cibler .page-numbers (paginate_links met aussi cette
   classe sur le <ul> conteneur → encadrerait tout le bloc). On stylise
   uniquement les <a>/<span>, comme petites-annonces.css. */
.annuaire-pagination {
    margin-top: 32px;
}

.annuaire-pagination ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: 0;
    background: none;
}

.annuaire-pagination a,
.annuaire-pagination span {
    display: inline-block;
    min-width: 40px;
    padding: 9px 12px;
    text-align: center;
    border: 1px solid #e8e6df;
    border-radius: 8px;
    text-decoration: none;
    color: #353b41;
    background: #fff;
    font-size: 14px;
    transition: background .15s, border-color .15s;
}

.annuaire-pagination .current {
    background: #82b440;
    border-color: #82b440;
    color: #fff;
}

.annuaire-pagination a:hover {
    background: #f5faf9;
    border-color: #cfd6cf;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .annuaire-container {
        padding: 10px;
    }

    .annuaire-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .annuaire-controls input[type="text"],
    .annuaire-controls input[type="number"],
    .annuaire-controls select,
    #btn-propose-supplier {
        width: 100%;
        margin-bottom: 2px;
        min-width: 0;
    }

    .annuaire-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .annuaire-item {
        padding: 15px;
    }
}

/* Modification Button */
.btn-modify-supplier {
    background: transparent;
    color: #999;
    border: 1px solid #ddd;
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-modify-supplier:hover {
    background: #f9f9f9;
    color: #666;
    border-color: #ccc;
}
