/* ============================================================================
   CLASSIFIEDS ADDON - Styles centralisés
   @version 1.0.0
   
   Extrait de :
   - addons/classifieds/ui-blocks.php (5 blocs)
   - core/pages/classifieds-home.php (1 bloc)
   
   Chargé via $GLOBALS['page_css'] dans les pages classifieds
   ============================================================================ */

/* ============================================================================
   VALIDATION REQUIRED BLOCK
   Source: ui-blocks.php classifieds_validation_required()
   ============================================================================ */

.validation-required-block {
    max-width: 500px;
    margin: 2rem auto;
    padding: 2.5rem;
    text-align: center;
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-lg, 12px);
}

.validation-required-icon {
    color: #f59e0b;
    margin-bottom: 1rem;
}

.validation-required-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    margin-bottom: 0.75rem;
}

.validation-required-text {
    color: var(--text-secondary, #64748b);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.validation-required-steps {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.validation-step {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full, 9999px);
}

.validation-step.pending {
    background: #fef3c7;
    color: #92400e;
}

.validation-step.done {
    background: #d1fae5;
    color: #065f46;
}

[data-theme="dark"] .validation-required-block {
    background: var(--bg-secondary, #1e293b);
    border-color: var(--border-color, #334155);
}

[data-theme="dark"] .validation-step.pending {
    background: #78350f;
    color: #fef3c7;
}

[data-theme="dark"] .validation-step.done {
    background: #064e3b;
    color: #d1fae5;
}

/* ============================================================================
   ADVERTISER SECTION
   Source: ui-blocks.php classifieds_advertiser_header()
   ============================================================================ */

.advertiser-section {
    margin-bottom: 1.5rem;
}

.advertiser-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
}

.advertiser-section-title svg {
    opacity: 0.7;
}

.advertiser-header {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.advertiser-avatar-wrapper {
    flex-shrink: 0;
    position: relative;
}

.advertiser-avatar-wrapper .vendor-status-dot {
    position: absolute;
    bottom: 4px;
    right: 4px;
}

.advertiser-avatar-img {
    width: 80px !important;
    height: 80px !important;
    border-radius: var(--radius-full) !important;
    object-fit: cover;
    border: 3px solid var(--border-color);
}

.advertiser-info {
    flex: 1;
    min-width: 0;
}

.advertiser-name-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.advertiser-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.advertiser-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.advertiser-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.advertiser-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.advertiser-meta-item svg {
    opacity: 0.7;
}

@media (max-width: 480px) {
    .advertiser-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.25rem;
    }
    
    .advertiser-name-row {
        justify-content: center;
    }
    
    .advertiser-name {
        font-size: 1.25rem;
    }
    
    .advertiser-meta {
        justify-content: center;
        gap: 0.5rem 1rem;
    }
    
    .advertiser-avatar-img {
        width: 70px !important;
        height: 70px !important;
    }
}

/* ============================================================================
   CATEGORIES HOME GRID
   Source: ui-blocks.php classifieds_categories_home_grid()
   ============================================================================ */

.categories-home-wrapper {
    margin: 0;
}

.categories-home-grid {
    display: grid;
    grid-template-columns: repeat(var(--columns, 5), 1fr);
    gap: 1rem;
}

.category-home-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem 0.75rem;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: var(--radius-lg, 12px);
    text-decoration: none;
    color: var(--text-primary, #1a1a1a);
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.category-home-card:hover {
    background: var(--bg-tertiary, #fff);
    border-color: var(--primary-color, #007bff);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.category-home-card--hidden {
    display: none;
}

.categories-home-grid.expanded .category-home-card--hidden {
    display: flex;
    animation: categoryFadeIn 0.3s ease forwards;
}

@keyframes categoryFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-home-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color-light, rgba(0, 123, 255, 0.1));
    border-radius: 50%;
    margin-bottom: 0.75rem;
    color: var(--primary-color, #007bff);
}

.category-home-name {
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

.category-home-count {
    font-size: 0.8rem;
    color: var(--text-secondary, #6c757d);
}

.categories-home-toggle {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.categories-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: transparent;
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: var(--radius-full, 999px);
    color: var(--text-secondary, #666);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.categories-toggle-btn:hover {
    background: var(--bg-secondary, #f8f9fa);
    border-color: var(--primary-color, #007bff);
    color: var(--primary-color, #007bff);
}

.categories-toggle-btn svg {
    transition: transform 0.2s ease;
}

@media (max-width: 1024px) {
    .categories-home-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .categories-home-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
    
    .category-home-card {
        padding: 1rem 0.5rem;
    }
    
    .category-home-icon {
        width: 48px;
        height: 48px;
    }
    
    .category-home-name {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .categories-home-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .categories-toggle-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (prefers-color-scheme: dark) {
    .categories-toggle-btn {
        border-color: #374151;
        color: #9ca3af;
    }
    
    .categories-toggle-btn:hover {
        background: #1f2937;
        border-color: #60a5fa;
        color: #60a5fa;
    }
}

[data-theme="dark"] .categories-toggle-btn {
    border-color: #374151;
    color: #9ca3af;
}

[data-theme="dark"] .categories-toggle-btn:hover {
    background: #1f2937;
    border-color: #60a5fa;
    color: #60a5fa;
}

/* ============================================================================
   POPULAR SEARCHES
   Source: ui-blocks.php classifieds_popular_searches_section()
   ============================================================================ */

.popular-searches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.popular-search-tag {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: var(--bg-secondary, #f0f0f0);
    color: var(--text-secondary, #666);
    border-radius: var(--radius-full, 20px);
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.popular-search-tag:hover {
    background: var(--primary-color, #007bff);
    color: #fff;
}

/* ============================================================================
   LOCATION TAGS
   Source: ui-blocks.php classifieds_location_tags_section()
   ============================================================================ */

.location-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    justify-content: center;
}

.location-tag {
    color: var(--text-primary, #333);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.location-tag:hover {
    color: var(--primary-color, #007bff);
}

.location-count {
    color: var(--text-secondary, #888);
    font-size: 0.85rem;
}

/* ============================================================================
   CLASSIFIEDS HOME STYLES
   Source: core/pages/classifieds-home.php
   ============================================================================ */

/* Hero */
.classifieds-home-hero {
    background: linear-gradient(135deg, var(--primary-color, #007bff) 0%, var(--primary-color-dark, #0056b3) 100%);
    color: #fff;
    padding: 2.5rem 0 2rem;
    text-align: center;
}

/* Première section après hero : moins de padding-top */
.classifieds-home-hero + .classifieds-home-section {
    padding-top: 1.5rem;
}

.classifieds-home-hero .hero-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.classifieds-home-hero .hero-stats {
    font-size: 1.1rem;
    opacity: 0.95;
    margin-bottom: 1.5rem;
}

.classifieds-home-hero .hero-separator {
    margin: 0 0.5rem;
    opacity: 0.6;
}

/* Override search bar pour hero */
.classifieds-home-hero .search-category-container {
    max-width: 700px;
    margin: 0 auto;
}

/* Search: conteneur externe transparent, style sur l'inner */
.classifieds-home-hero .search-bar-permanent {
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.classifieds-home-hero .search-bar-inner {
    background: #fff;
    border: none;
    border-radius: var(--radius-full, 999px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0.75rem;
}

.classifieds-home-hero .search-bar-inner input {
    border: none;
    background: transparent;
    box-shadow: none;
}

.classifieds-home-hero .search-bar-inner input:focus {
    outline: none;
    box-shadow: none;
}

/* Sélecteur catégories - Même style que search-bar-inner (pilule) */
.classifieds-home-hero .category-selector-bar {
    background: #fff;
    border: none;
    color: var(--text-primary, #1a1a1a);
    margin-top: 0;
    border-radius: var(--radius-full, 999px);
    padding: 0.5rem 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.classifieds-home-hero .category-selector-bar:hover {
    background: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* Icônes du sélecteur : folder bleu, chevron gris */
.classifieds-home-hero .category-selector-current svg {
    color: var(--primary-color, #6366f1);
}

.classifieds-home-hero .category-selector-action svg {
    color: var(--text-secondary, #666);
}

/* Sections - Reset du margin global de core.css */
.classifieds-home-section,
.classifieds-home-hero,
.classifieds-home-cta {
    margin-top: 0 !important;
}

.classifieds-home-section {
    padding: 2rem 0;
}

.classifieds-home-section:nth-child(even) {
    background: var(--bg-secondary, #f8f9fa);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title-small {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--text-secondary, #666);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header .section-title {
    margin-bottom: 0;
}

.section-link {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--primary-color, #007bff);
    text-decoration: none;
    font-weight: 500;
    transition: gap 0.2s ease;
}

.section-link:hover {
    gap: 0.5rem;
}

/* CTA */
.classifieds-home-cta {
    padding: 2rem 0;
    background: var(--bg-tertiary, #e9ecef);
}

.cta-box {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    padding: 1.75rem 2rem;
    background: #fff;
    border-radius: var(--radius-xl, 16px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.cta-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cta-subtitle {
    color: var(--text-secondary, #666);
    margin-bottom: 1.5rem;
}

/* Trust section */
.classifieds-home-trust {
    padding: 2rem 0;
}

.classifieds-home-trust .features-grid {
    margin-bottom: 0;
}

/* Searches */
.classifieds-home-searches {
    padding: 2rem 0;
    text-align: center;
}

/* Responsive hero */
@media (max-width: 768px) {
    .classifieds-home-hero {
        padding: 1.5rem 0 1.25rem;
    }
    
    .classifieds-home-hero .hero-title {
        font-size: 1.75rem;
    }
    
    .classifieds-home-hero .hero-stats {
        font-size: 0.95rem;
    }
    
    .classifieds-home-section {
        padding: 1.5rem 0;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .cta-box {
        padding: 1.25rem;
    }
    
    .cta-title {
        font-size: 1.25rem;
    }
}

/* ============================================================================
   DARK MODE
   ============================================================================ */
@media (prefers-color-scheme: dark) {
    .classifieds-home-hero {
        background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    }
    
    .classifieds-home-hero .search-bar-permanent {
        background: transparent;
        box-shadow: none;
        border: none;
    }
    
    .classifieds-home-hero .search-bar-inner {
        background: #1f2937;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
        border: 1px solid #374151;
    }
    
    .classifieds-home-hero .search-bar-inner input {
        color: #f3f4f6;
    }
    
    .classifieds-home-hero .search-bar-inner input::placeholder {
        color: #9ca3af;
    }
    
    .classifieds-home-hero .search-bar-submit {
        background: #3b82f6;
        color: #fff;
    }
    
    .classifieds-home-hero .category-selector-bar {
        background: #1f2937;
        color: #f3f4f6;
        border: 1px solid #4b5563;
    }
    
    .classifieds-home-hero .category-selector-bar:hover {
        background: #374151;
        border-color: #6b7280;
    }
    
    .classifieds-home-hero .category-selector-current svg {
        color: #818cf8;
    }
    
    .classifieds-home-hero .category-selector-action svg {
        color: #9ca3af;
    }
    
    .classifieds-home-cta {
        background: #111827 !important;
    }
    
    .classifieds-home-cta .cta-box {
        background: #1f2937 !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
        border: 1px solid #374151 !important;
    }
    
    .classifieds-home-cta .cta-title {
        color: #f9fafb !important;
    }
    
    .classifieds-home-cta .cta-subtitle {
        color: #d1d5db !important;
    }
    
    .classifieds-home-cta .btn-primary,
    .classifieds-home-cta .btn {
        background: #3b82f6 !important;
        color: #fff !important;
        border: none !important;
    }
    
    .classifieds-home-cta .btn-primary:hover,
    .classifieds-home-cta .btn:hover {
        background: #2563eb !important;
    }
    
    .classifieds-home-section:nth-child(even) {
        background: #111827;
    }
}

/* Support data-theme="dark" (toggle manuel via UFK DarkMode) */
[data-theme="dark"] .classifieds-home-hero {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
}

[data-theme="dark"] .classifieds-home-hero .search-bar-inner {
    background: #1f2937 !important;
    border: 1px solid #374151 !important;
}

[data-theme="dark"] .classifieds-home-hero .search-bar-inner input {
    color: #f3f4f6 !important;
}

[data-theme="dark"] .classifieds-home-hero .category-selector-bar {
    background: #1f2937 !important;
    color: #f3f4f6 !important;
    border: 1px solid #4b5563 !important;
}

[data-theme="dark"] .classifieds-home-hero .category-selector-bar:hover {
    background: #374151 !important;
}

[data-theme="dark"] .classifieds-home-cta {
    background: #111827 !important;
}

[data-theme="dark"] .classifieds-home-cta .cta-box {
    background: #1f2937 !important;
    border: 1px solid #374151 !important;
}

[data-theme="dark"] .classifieds-home-cta .cta-title {
    color: #f9fafb !important;
}

[data-theme="dark"] .classifieds-home-cta .cta-subtitle {
    color: #d1d5db !important;
}

[data-theme="dark"] .classifieds-home-cta .btn-primary,
[data-theme="dark"] .classifieds-home-cta .btn {
    background: #3b82f6 !important;
    color: #fff !important;
}

/* ============================================================================
   CLASSIFIEDS LISTING PAGE STYLES
   Source: core/pages/classifieds-listing.php
   ============================================================================ */

/* ============================================================================
   BANDE DE RECHERCHE BLEUE (Continuité visuelle avec Home)
   ============================================================================ */

.classifieds-search-banner {
    background: linear-gradient(135deg, var(--primary-color, #007bff) 0%, var(--primary-color-dark, #0056b3) 100%);
    padding: 0.75rem 0;
    margin-top: 0 !important;
}

.classifieds-search-banner .search-category-container {
    margin-bottom: 0;
}

.classifieds-search-banner .search-bar-permanent {
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.classifieds-search-banner .search-bar-inner {
    background: #fff;
    border: none;
    border-radius: var(--radius-full, 999px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0.75rem;
}

.classifieds-search-banner .search-bar-inner input {
    border: none;
    background: transparent;
    box-shadow: none;
}

.classifieds-search-banner .search-bar-inner input:focus {
    outline: none;
    box-shadow: none;
}

.classifieds-search-banner .category-selector-bar {
    background: #fff;
    border: none;
    color: var(--text-primary, #1a1a1a);
    margin-top: 0;
    border-radius: var(--radius-full, 999px);
    padding: 0.5rem 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.classifieds-search-banner .category-selector-bar:hover {
    background: #f8f9fa;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
    transform: translateY(-1px);
}

.classifieds-search-banner .category-selector-current svg {
    color: var(--primary-color, #6366f1);
}

.classifieds-search-banner .category-selector-action svg {
    color: var(--text-secondary, #666);
}

@media (max-width: 768px) {
    .classifieds-search-banner {
        padding: 0.625rem 0;
    }
    
    .classifieds-search-banner .search-bar-inner {
        padding: 0.375rem 0.625rem;
    }
}

@media (prefers-color-scheme: dark) {
    .classifieds-search-banner {
        background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    }
    
    .classifieds-search-banner .search-bar-inner {
        background: #1f2937;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
        border: 1px solid #374151;
    }
    
    .classifieds-search-banner .search-bar-inner input {
        color: #f3f4f6;
    }
    
    .classifieds-search-banner .search-bar-inner input::placeholder {
        color: #9ca3af;
    }
    
    .classifieds-search-banner .category-selector-bar {
        background: #1f2937;
        color: #f3f4f6;
        border: 1px solid #4b5563;
    }
    
    .classifieds-search-banner .category-selector-bar:hover {
        background: #374151;
        border-color: #6b7280;
    }
    
    .classifieds-search-banner .category-selector-current svg {
        color: #818cf8;
    }
    
    .classifieds-search-banner .category-selector-action svg {
        color: #9ca3af;
    }
}

[data-theme="dark"] .classifieds-search-banner {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
}

[data-theme="dark"] .classifieds-search-banner .search-bar-inner {
    background: #1f2937 !important;
    border: 1px solid #374151 !important;
}

[data-theme="dark"] .classifieds-search-banner .search-bar-inner input {
    color: #f3f4f6 !important;
}

[data-theme="dark"] .classifieds-search-banner .category-selector-bar {
    background: #1f2937 !important;
    color: #f3f4f6 !important;
    border: 1px solid #4b5563 !important;
}

[data-theme="dark"] .classifieds-search-banner .category-selector-bar:hover {
    background: #374151 !important;
}

/* ============================================================================
   BREADCRUMB - Adapté à la structure listing
   ============================================================================ */

.classifieds-listing {
    margin-top: 0 !important;
}

.classifieds-listing .listing-layout {
    margin-top: 0;
}

.classifieds-listing .breadcrumb {
    margin-bottom: 0.5rem;
}

.classifieds-listing .breadcrumb-list {
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.25rem;
    border: none;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

.classifieds-listing .breadcrumb-item a span[itemprop="name"],
.classifieds-listing .breadcrumb-item .breadcrumb-text,
.classifieds-listing .breadcrumb-item > span[aria-current="page"] {
    max-width: 280px;
}

@media (max-width: 768px) {
    .classifieds-listing .breadcrumb-item a span[itemprop="name"],
    .classifieds-listing .breadcrumb-item .breadcrumb-text,
    .classifieds-listing .breadcrumb-item > span[aria-current="page"] {
        max-width: 180px;
    }
    
    .classifieds-listing .breadcrumb-item:last-child span[aria-current="page"] {
        max-width: 200px;
    }
    
    .classifieds-listing .breadcrumb-list {
        margin-top: 0.5rem;
        margin-bottom: 0.375rem;
    }
}

@media (max-width: 480px) {
    .classifieds-listing .breadcrumb-item a span[itemprop="name"],
    .classifieds-listing .breadcrumb-item .breadcrumb-text {
        max-width: 120px;
    }
    
    .classifieds-listing .breadcrumb-item:last-child span[aria-current="page"] {
        max-width: none;
        text-overflow: unset;
        overflow: visible;
    }
}

/* ============================================================================
   FILTRE SOUS-CATÉGORIES
   ============================================================================ */

.subcategories-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
    margin-bottom: 0.75rem;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.subcategories-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* ============================================================================
   TAGS SOUS-CATÉGORIES
   ============================================================================ */

.tag-checkbox,
.tag-all,
.tag-link,
.tag-back {
    display: inline-block;
    cursor: pointer;
    margin: 0;
    text-decoration: none;
}

.tag-checkbox input[type="checkbox"] {
    display: none;
}

.tag-checkbox .tag-label,
.tag-all .tag-label,
.tag-link .tag-label {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: all 0.15s ease;
    white-space: nowrap;
}

.tag-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    transition: all 0.15s ease;
}

.tag-back:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--bg-secondary);
}

.category-header-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 0 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.category-header-nav--with-cats {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0.25rem;
}

/* Bloc unifié H1 + sous-catégories (une seule bordure en bas) */
.category-nav-block {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
}

.category-nav-block .category-seo-title {
    margin-bottom: 0.5rem;
}

.category-nav-block .subcategories-filter {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Intro pour page /annonces (H1 + retour + compteur) */
.category-header-intro {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.category-header-intro .category-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-left: auto;
}

.category-seo-header {
    padding: 0 0 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.category-seo-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    padding-top: 0.6rem;
    line-height: 1.3;
}

@media (max-width: 480px) {
    .category-seo-title {
        font-size: 0.9rem;
        padding-top: 0;
    }
}

.category-header-nav .category-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: auto;
}

@media (max-width: 480px) {
    .category-header-nav .category-count {
        display: none;
    }
}

.tag-checkbox .tag-count,
.tag-link .tag-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    font-weight: 600;
}

.tag-checkbox:hover .tag-label,
.tag-all:hover .tag-label,
.tag-link:hover .tag-label {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.tag-checkbox.active .tag-label,
.tag-all.active .tag-label {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.tag-checkbox.active .tag-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.subcategories-dropdown {
    width: 100%;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.subcategories-dropdown select {
    width: 100%;
    height: 120px;
}

@media (max-width: 768px) {
    .subcategories-filter {
        gap: 0.4rem;
        padding: 0.5rem 0;
    }
    
    .subcategories-label {
        width: 100%;
        margin-bottom: 0.25rem;
    }
    
    .tag-checkbox .tag-label {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .subcategories-dropdown select {
        height: 150px;
    }
}

/* ============================================================================
   BARRE UNIFIÉE : RÉSULTATS + FILTRES + TRI
   ============================================================================ */

.results-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.results-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin: 0; /* Reset H2 default margin */
}

/* Contexte SEO masqué sur mobile */
@media (max-width: 768px) {
    .results-context {
        display: none;
    }
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.375rem 0.625rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s;
}

.toolbar-btn:hover {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
}

.toolbar-btn.has-filters {
    border-color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary-color);
}

.toolbar-btn svg {
    flex-shrink: 0;
}

.toolbar-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.3rem;
    background: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.toolbar-chevron {
    display: flex;
    transition: transform 0.2s;
    opacity: 0.6;
}

.toolbar-btn.expanded .toolbar-chevron {
    transform: rotate(180deg);
}

.toolbar-reset {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}

.toolbar-reset:hover {
    color: var(--danger-color, #dc3545);
    background: rgba(220, 53, 69, 0.1);
}

.toolbar-separator {
    width: 1px;
    height: 1.25rem;
    background: var(--border-color);
    margin: 0 0.25rem;
}

.toolbar-sort {
    display: flex;
    align-items: center;
}

.toolbar-select {
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.15s;
}

.toolbar-select:hover {
    border-color: var(--primary-color);
}

.toolbar-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filters-panel {
    display: none;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    margin-top: 0.5rem !important;
    margin-bottom: 0.75rem;
    animation: slideDown 0.15s ease-out;
}

.filters-panel.expanded {
    display: block;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-0.25rem); }
    to { opacity: 1; transform: translateY(0); }
}

.filters-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: end;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    min-width: 100px;
}

.filter-field label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.filter-field input,
.filter-field select {
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.15s;
}

.filter-field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    padding-right: 1.5rem;
}

.filter-field input:focus,
.filter-field select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-field input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.filters-grid-auto .filter-field {
    min-width: 90px;
}

.filter-submit {
    flex: 0 0 auto;
}

.filter-submit .btn {
    padding: 0.4rem 0.75rem;
}

@media (max-width: 480px) {
    .results-toolbar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .results-count {
        font-size: 0.8rem;
    }
    
    .toolbar-btn span:not(.toolbar-badge):not(.toolbar-chevron) {
        display: none;
    }
    
    .filters-grid {
        flex-direction: column;
    }
    
    .filter-field {
        width: 100%;
    }
}

/* ============================================================================
   CLASSIFIEDS DETAIL - Section titles (H2 styled like H3 for visual consistency)
   ============================================================================ */

.detail-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--text-primary, #1a1a1a);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-section-title svg {
    color: var(--primary-color, #007bff);
}

.card-header .detail-section-title {
    margin: 0;
}

/* ============================================================================
   CLASSIFIEDS DETAIL - Breadcrumb overrides
   ============================================================================ */

/* Override margin-top global de core.css (main > *:not(:first-child)) */
.classifieds-detail {
    margin-top: 0 !important;
}

.classifieds-detail .detail-layout {
    margin-top: 0;
}

/* Override margin-bottom du wrapper breadcrumb */
.classifieds-detail .breadcrumb {
    margin-bottom: 0.5rem;
}

.classifieds-detail .breadcrumb-list {
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.25rem;
    border: none;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

/* Troncature plus souple (plus de place sans bordure) */
.classifieds-detail .breadcrumb-item a span[itemprop="name"],
.classifieds-detail .breadcrumb-item .breadcrumb-text,
.classifieds-detail .breadcrumb-item > span[aria-current="page"] {
    max-width: 280px;
}

@media (max-width: 768px) {
    .classifieds-detail .breadcrumb-item a span[itemprop="name"],
    .classifieds-detail .breadcrumb-item .breadcrumb-text,
    .classifieds-detail .breadcrumb-item > span[aria-current="page"] {
        max-width: 180px;
    }
    
    .classifieds-detail .breadcrumb-item:last-child span[aria-current="page"] {
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .classifieds-detail .breadcrumb-item a span[itemprop="name"],
    .classifieds-detail .breadcrumb-item .breadcrumb-text,
    .classifieds-detail .breadcrumb-item > span[aria-current="page"] {
        max-width: 140px;
    }
    
    .classifieds-detail .breadcrumb-item:last-child span[aria-current="page"] {
        max-width: 160px;
    }
}

/* Breadcrumb plus compact sur mobile */
@media (max-width: 768px) {
    .classifieds-detail .breadcrumb-list {
        margin-top: 0.5rem;
        margin-bottom: 0.375rem;
    }
}

/* ============================================================================
   MODALE CONNEXION REQUISE
   ============================================================================ */

.login-required-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.login-required-content {
    background: var(--card-bg, #fff);
    border-radius: var(--radius-lg, 12px);
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.login-required-title {
    margin: 0 0 1rem 0;
    color: var(--primary-color, #007bff);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.login-required-content > p {
    color: var(--text-secondary, #666);
    margin: 0 0 1.5rem 0;
    line-height: 1.5;
}

.login-required-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.login-required-actions .btn {
    min-width: 120px;
}

.login-required-register {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #e0e0e0);
    font-size: 0.875rem;
    color: var(--text-secondary, #666);
}

.login-required-register a {
    color: var(--primary-color, #007bff);
    font-weight: 500;
}

/* Fermer modale au clic sur fond */
.login-required-modal:not(:has(.login-required-content:hover)) {
    cursor: pointer;
}

