/* ===================================
   LISTINGS CRUD - STYLES
   =================================== */

/* FORMULAIRE DE CRÉATION/ÉDITION */
.listing-form-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 0;
}

.form-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 25px;
}

.form-section-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #facc15;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.form-row.full-width {
    grid-template-columns: 1fr;
}

.form-row.three-cols {
    grid-template-columns: repeat(3, 1fr);
}

/* UPLOAD D'IMAGES AVANCÉ */
.image-upload-container {
    position: relative;
}

.image-upload-dropzone {
    border: 3px dashed #e9ecef;
    border-radius: 8px;
    padding: 60px 20px;
    text-align: center;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-upload-dropzone:hover {
    border-color: #ff6b35;
    background: #fff;
}

.image-upload-dropzone.drag-over {
    border-color: #ff6b35;
    background: rgba(255, 107, 53, 0.05);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 48px;
    color: #6c757d;
    margin-bottom: 15px;
}

.upload-text {
    font-size: 16px;
    color: #6c757d;
    margin-bottom: 10px;
}

.upload-hint {
    font-size: 12px;
    color: #adb5bd;
}

.upload-file-input {
    display: none;
}

/* GRILLE D'APERÇU DES IMAGES */
.images-preview-container {
    margin-top: 30px;
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.image-item {
    position: relative;
    aspect-ratio: 4/3;
    border-radius: 8px;
    overflow: hidden;
    border: 3px solid #e9ecef;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.image-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.image-item.is-primary {
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.image-item:hover .image-overlay {
    opacity: 1;
}

.image-action-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-set-primary {
    background: #27ae60;
    color: white;
}

.btn-set-primary:hover {
    background: #229954;
    transform: scale(1.05);
}

.btn-delete-image {
    background: #e74c3c;
    color: white;
}

.btn-delete-image:hover {
    background: #c0392b;
    transform: scale(1.05);
}

.primary-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ff6b35;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.image-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff6b35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* CARACTÉRISTIQUES DU VÉHICULE */
.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.spec-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border-left: 3px solid #ff6b35;
}

.spec-label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.spec-value {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

/* ÉQUIPEMENTS & OPTIONS */
.equipment-section {
    margin-top: 20px;
}

.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.equipment-category {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.equipment-category h4 {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.equipment-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.equipment-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #ff6b35;
}

.equipment-item label {
    font-size: 14px;
    color: #495057;
    cursor: pointer;
    user-select: none;
}

/* ACTIONS DU FORMULAIRE */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    padding-top: 30px;
    border-top: 1px solid #e9ecef;
}

.form-actions .btn {
    min-width: 120px;
}

/* PREVIEW DE L'ANNONCE */
.listing-preview {
    position: sticky;
    top: 20px;
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.preview-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 20px 0;
}

.preview-image {
    width: 100%;
    height: 200px;
    border-radius: 8px;
    object-fit: cover;
    margin-bottom: 15px;
}

.preview-no-image {
    width: 100%;
    height: 200px;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin-bottom: 15px;
    color: #6c757d;
}

.preview-info {
    margin-bottom: 15px;
}

.preview-price {
    font-size: 24px;
    font-weight: 700;
    color: #ff6b35;
    margin-bottom: 10px;
}

.preview-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.preview-spec {
    background: #f8f9fa;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    color: #495057;
}

/* LISTE DES ANNONCES (INDEX) */
.listings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.listings-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.listings-actions {
    display: flex;
    gap: 10px;
}

.listings-filters {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.listings-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.stat-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.stat-badge.active {
    background: #ff6b35;
    color: white;
}

.stat-badge:not(.active) {
    background: #f8f9fa;
    color: #6c757d;
}

.stat-badge:not(.active):hover {
    background: #e9ecef;
}

/* TABLEAU DES ANNONCES */
.listings-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.listings-table table {
    width: 100%;
    border-collapse: collapse;
}

.listings-table thead {
    background: #f8f9fa;
}

.listings-table th {
    padding: 15px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.listings-table td {
    padding: 15px;
    border-top: 1px solid #e9ecef;
}

.listings-table tbody tr:hover {
    background: #f8f9fa;
}

.listing-thumbnail {
    width: 60px;
    height: 45px;
    border-radius: 6px;
    object-fit: cover;
}

.listing-no-thumbnail {
    width: 60px;
    height: 45px;
    background: #e9ecef;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 20px;
}

.listing-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.listing-details h4 {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 5px 0;
}

.listing-meta {
    font-size: 12px;
    color: #6c757d;
}

.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-draft {
    background: #ffc107;
    color: #000;
}

.status-published {
    background: #28a745;
    color: white;
}

.status-sold {
    background: #6c757d;
    color: white;
}

.status-archived {
    background: #dc3545;
    color: white;
}

.actions-cell {
    display: flex;
    gap: 5px;
}

.action-btn {
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.action-view {
    background: #3498db;
    color: white;
}

.action-edit {
    background: #f39c12;
    color: white;
}

.action-delete {
    background: #e74c3c;
    color: white;
}

.action-publish {
    background: #27ae60;
    color: white;
}

/* PAGE DE DÉTAIL */
.listing-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.listing-gallery {
    margin-bottom: 30px;
}

.main-image {
    width: 100%;
    height: 500px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.thumbnail {
    aspect-ratio: 4/3;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: #ff6b35;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.listing-main-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.listing-description {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.listing-sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.price-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.price-amount {
    font-size: 32px;
    font-weight: 700;
    color: #ff6b35;
    margin-bottom: 20px;
}

.contact-seller-btn {
    width: 100%;
    padding: 15px;
    background: #ff6b35;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.contact-seller-btn:hover {
    background: #e85a2a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.seller-info {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .form-row,
    .form-row.three-cols {
        grid-template-columns: 1fr;
    }
    
    .listings-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .filters-row {
        grid-template-columns: 1fr;
    }
    
    .listings-table {
        overflow-x: auto;
    }
    
    .listing-main-content {
        grid-template-columns: 1fr;
    }
    
    .main-image {
        height: 300px;
    }
    
    .images-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .listings-stats {
        flex-wrap: wrap;
    }
    
    .images-grid {
        grid-template-columns: 1fr;
    }
}






/* =========================
   PAGE LISTING
========================= */

.listing-page {
    max-width: 1300px;
    margin: auto;
    padding: 60px 20px;
}

/* HEADER */
.listing-header {
    text-align: center;
    margin-bottom: 40px;
}

.listing-header h1 {
    font-size: 36px;
    font-weight: 700;
}

.listing-header p {
    color: #666;
    margin-top: 10px;
}

/* FILTRES */
.listing-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.results-count {
    font-weight: 600;
}

.listing-filters select {
    background: #111;
    color: #fff;
    border: 1px solid #222;
    border-radius: 8px;
    padding: 10px 14px;
}

/* GRID */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
}

/* CARD */
.listing-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
    transition: transform .25s ease, box-shadow .25s ease;
    text-decoration: none;
    color: inherit;
}

.listing-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 45px rgba(0,0,0,0.15);
}

/* IMAGE */
.listing-image {
    position: relative;
    height: 180px;
    background: #f4f4f4;
}

.listing-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image {
    /*height: 100%;*/
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    color: #aaa;
}

/* PRICE */
.price-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: #facc15;
    color: #000;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 14px;
}

/* CONTENT */
.listing-content {
    padding: 18px;
    height: auto;
}

.listing-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* META */
.listing-meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: #555;
    margin-bottom: 10px;
}

.listing-meta i {
    color: #facc15;
}

/* LOCATION */
.listing-location {
    font-size: 13px;
    color: #777;
}

.listing-location i {
    color: #facc15;
}

/* PAGINATION */
.listing-pagination {
    margin-top: 50px;
    display: flex;
    justify-content: center;
}

/* =========================
   SEARCH FILTERS – PREMIUM
========================= */

.search-filters {
    background: #ffffff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.08);
}

/* Labels */
.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.filter-label i {
    color: #facc15;
    font-size: 14px;
}

/* Inputs & selects */
.search-filters .form-control,
.search-filters .form-select {
    border-radius: 12px;
    border: 1px solid #e5e5e5;
    padding: 12px 14px;
    font-size: 14px;
    background: #fafafa;
    transition: all .2s ease;
}

.search-filters .form-control:focus,
.search-filters .form-select:focus {
    border-color: #facc15;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(250,204,21,0.25);
}

/* Bouton recherche */
.search-filters .btn-primary {
    background: linear-gradient(135deg, #facc15, #fbbf24);
    border: none;
    color: #000;
    border-radius: 12px;
    height: 46px;
    font-size: 16px;
    transition: all .2s ease;
}

.search-filters .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(250,204,21,0.45);
}

/* Section filtres avancés */
.search-filters h6 {
    font-weight: 600;
    color: #666;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

/* Bouton reset */
.search-filters .btn-outline-danger {
    border-radius: 12px;
    height: 46px;
    font-weight: 600;
}

/* Alignement bas des boutons */
.search-filters .col-md-1,
.search-filters .col-md-3.d-flex.align-items-end {
    align-self: flex-end;
}


.filters-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #facc15, transparent);
    margin: 25px 0;
}


/* =========================
   FILTRES AVANCÉS – TOGGLE
========================= */

.advanced-toggle {
    margin: 20px 0;
    text-align: left;
}

.advanced-toggle button {
    background: none;
    border: none;
    font-weight: 600;
    color: #333;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 0;
}

.advanced-toggle i {
    color: #facc15;
}

.advanced-toggle .arrow {
    transition: transform .3s ease;
}

/* =========================
   ZONE FILTRES AVANCÉS
========================= */

#advancedFilters {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(-8px);
    transition: all .35s ease;
}

/* État ouvert */
#advancedFilters.is-open {
    max-height: 1200px; /* large volontaire */
    opacity: 1;
    transform: translateY(0);
}

/* Rotation flèche */
.advanced-open .advanced-toggle .arrow {
    transform: rotate(180deg);
}

    html .filter-label i{
    color: #fbbf24;
}


.listing-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.badge {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 999px;
    font-weight: 600;
    background: rgba(0,0,0,.7);
    color: #fff;
}

.badge-ok {
    background: #22c55e;
    color: #fff;
}

.badge-featured {
    background: #facc15;
    color: #000;
}

.listing-subtitle {
    font-size: 13px;
    color: #777;
    margin-bottom: 6px;
}

.listing-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    margin-bottom: 8px;
}

.listing-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 999px;
}

.listing-title small{
    color: rgba(0, 0, 0, 0.5);
}


    span.petit_pro,
    span.petit_part,
    .listing-location
    {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.5);
    font-weight: 300;
}

.listing-card{
    justify-content: space-between;
}

span.petit_pro {
    display: flex;
    align-items: center;
}

.seller-avatar-pt{
    display: inline-block;
    margin-right: 10px;
    margin-left: 10px;
    width: 32px;
    height: 32px;
    border: 1px solid #d6d6d6;
     border-radius: 100%;
   overflow: hidden;
   /*padding: 3px;*/
}

.seller-avatar-pt img{
    width: 32px;
    height: 32px;
    /*border-radius: 100%;*/
    object-fit: cover;
    /*overflow: hidden;*/
}

.listing-card{
    position: relative;
}


table.table.table-hover.mb-0 tr td {
    background: #181818;
    color: #ffffff;
}