/* =============================================
   PROPERTIES RESPONSIVE - Tous les breakpoints
   Mobile-First Approach
   ============================================= */

/* =============================================
   BREAKPOINT 1: Mobile Très Petit
   < 480px (Smartphones en portrait)
   ========================================== */
@media (max-width: 479px) {
    /* ==========================================
       PROPERTIES INDEX (Mes annonces)
       ========================================== */
    
    .properties-index-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem !important;
        margin: 1rem 0 !important;
    }
    
    .properties-index-header h1 {
        font-size: 1.5rem !important;
        margin: 0 !important;
    }
    
    .properties-index-header .btn {
        width: 100% !important;
        padding: 0.625rem 1rem !important;
        font-size: 0.875rem !important;
        text-align: center !important;
    }
    
    /* Onglets */
    .properties-index-header + div[style*="border-bottom"] {
        margin-bottom: 1rem !important;
    }
    
    .properties-index-header + div[style*="border-bottom"] > div {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    .properties-index-header + div[style*="border-bottom"] a {
        padding: 0.625rem 1rem !important;
        font-size: 0.875rem !important;
        width: 100% !important;
        text-align: center !important;
    }
    
    /* Grille de propriétés */
    .property-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .property-card {
        padding: 1rem !important;
    }
    
    /* Boutons d'action - Mobile très petit : En bas de la carte */
    .property-card .property-actions {
        position: static !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 0.5rem !important;
        margin-top: 1rem !important;
        padding-top: 1rem !important;
        border-top: 1px solid #e0e0e0 !important;
        width: 100% !important;
        top: auto !important;
        right: auto !important;
    }
    
    .property-card .property-actions .btn,
    .property-card .property-actions button,
    .property-card .property-actions a {
        width: 100% !important;
        padding: 0.625rem 1rem !important;
        font-size: 0.875rem !important;
        text-align: center !important;
        margin: 0 !important;
    }
    
    .property-card .property-actions form {
        width: 100% !important;
        margin: 0 !important;
    }
    
    .property-card .property-actions form button {
        width: 100% !important;
    }
    
    /* ==========================================
       PROPERTIES SHOW (Détail propriété)
       ========================================== */
    
    .properties-show-container {
        padding: 0 0.75rem !important;
        margin: 1rem auto !important;
    }
    
    .properties-show-header {
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.5rem !important;
        margin-bottom: 1.5rem !important;
        flex-wrap: nowrap !important;
    }

    .properties-show-header .btn,
    .properties-show-header a {
        flex: 1 1 0 !important;
        padding: 0.55rem 0.5rem !important;
        font-size: 0.8rem !important;
        text-align: center !important;
        white-space: nowrap !important;
    }

    .properties-show-header .btn-report,
    .properties-show-header a.btn-report {
        justify-content: center !important;
        display: inline-flex !important;
        align-items: center !important;
    }
    
    .properties-show-image-slider {
        height: 250px !important;
    }

    .properties-show-layout {
        gap: 0.875rem !important;
        padding: 0.875rem !important;
    }

    /* Sidebar blocs : padding réduit sur très petit écran */
    .ps-sidebar-block {
        padding: 0.875rem 1rem !important;
        margin-bottom: 0.625rem !important;
    }
    .ps-sidebar-actions {
        padding: 0.875rem 1rem !important;
        gap: 0.4rem !important;
    }
    .ps-action-btn {
        padding: 0.55rem 0.875rem !important;
        font-size: 0.875rem !important;
    }
    .ps-action-btn--contact {
        padding: 0.65rem 0.875rem !important;
        font-size: 0.9rem !important;
    }
    .ps-features-pills {
        gap: 0.35rem !important;
    }
    .ps-feature-pill {
        padding: 0.25rem 0.55rem !important;
        font-size: 0.8rem !important;
    }

    .properties-show-title-row {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .properties-show-title {
        font-size: 1.25rem !important;
    }

    /* Prix et Vente sur une seule ligne, côte à côte (pas d'affichage vertical) */
    .properties-show-price-row {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: baseline !important;
        gap: 0.35rem 0.5rem !important;
    }
    
    .properties-show-price,
    .properties-show-transaction-type,
    .properties-show-price-suffix {
        white-space: nowrap !important;
    }
    
    .properties-show-price {
        font-size: 1.5rem !important;
    }
    
    .properties-show-features {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
        padding: 1rem !important;
    }
    
    /* Terrain + m² : garder côte à côte en responsive */
    .properties-show-terrain-m2-row {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
    }
    
    .properties-show-terrain-m2-row span {
        white-space: nowrap !important;
    }
    
    /* Caractéristiques : autoriser le retour à la ligne pour rester dans le cadre */
    .properties-show-feature-value,
    .properties-show-feature-item > div:last-child {
        white-space: normal !important;
        word-wrap: break-word !important;
        min-width: 0 !important;
        overflow-wrap: break-word !important;
    }
    
    .properties-show-feature-item {
        min-width: 0 !important;
        overflow: hidden !important;
    }
    
    .properties-show-feature-icon {
        font-size: 1.5rem !important;
    }
    
    .properties-show-feature-label {
        font-size: 0.875rem !important;
    }
    
    .properties-show-gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
    
    .properties-show-info {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .properties-show-actions {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    .properties-show-actions .btn,
    .properties-show-actions a {
        width: 100% !important;
        padding: 0.75rem 1rem !important;
        font-size: 0.875rem !important;
    }
    
    /* ==========================================
       PROPERTIES CREATE/EDIT (Formulaires)
       ========================================== */
    
    .container[style*="max-width: 1000px"] {
        max-width: 100% !important;
        margin: 1rem auto !important;
        padding: 0 0.75rem !important;
    }
    
    .card[style*="border-radius: 0 0 12px 12px"] {
        border-radius: 8px !important;
    }
    
    .card-body[style*="padding: 2.5rem"] {
        padding: 1rem !important;
    }
    
    /* Header du formulaire */
    div[style*="background: linear-gradient"][style*="padding: 2rem"] {
        padding: 1.5rem 1rem !important;
        border-radius: 8px 8px 0 0 !important;
    }
    
    div[style*="background: linear-gradient"] h1 {
        font-size: 1.25rem !important;
    }
    
    div[style*="background: linear-gradient"] p {
        font-size: 0.875rem !important;
    }
    
    div[style*="background: linear-gradient"] > div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    /* Formulaires */
    .form-group {
        margin-bottom: 1rem !important;
    }
    
    .form-control,
    select.form-control,
    textarea.form-control {
        font-size: 0.875rem !important;
        padding: 0.625rem !important;
    }
    
    /* Catégorie : pleine largeur sur très petit mobile */
    .property-category-wrap {
        max-width: 100% !important;
    }

    /* Grilles de formulaire */
    div[style*="display: grid"] {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    /* Page détail bien : grille des caractéristiques en 2 colonnes (priorité sur la règle générique) */
    .properties-show-features,
    div.properties-show-features {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
        padding: 1rem !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }
    
    /* Chaque caractéristique : icône et texte sur une même ligne (côte à côte), reste dans le cadre */
    .properties-show-feature-item {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 0.5rem !important;
        text-align: left !important;
        padding: 0.35rem 0 !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }
    
    .properties-show-feature-item .properties-show-feature-value,
    .properties-show-feature-item > div:last-child {
        margin-bottom: 0 !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        min-width: 0 !important;
        overflow-wrap: break-word !important;
    }
    
    .properties-show-feature-item > div:first-child {
        flex-shrink: 0 !important;
        margin-bottom: 0 !important;
    }
    
    /* Terrain + m² : garder la cellule en flex row (icône + texte) */
    .properties-show-terrain-m2 .properties-show-terrain-m2-row {
        flex: 1 !important;
        justify-content: flex-start !important;
    }
    
    /* Terrasse / Meublé : inverser l’ordre sur mobile pour laisser plus de place au libellé long « Terrasse / extérieur » */
    /* Meublé et Piscine côte à côte, Terrasse en dessous de Piscine */
    .properties-show-feature-meuble,
    .properties-show-feature-piscine {
        order: 1 !important;
    }
    .properties-show-feature-terrasse {
        order: 2 !important;
    }
    /* Aligner Terrasse / extérieur avec les autres : même hauteur d’icône que les emojis (2rem) */
    .properties-show-feature-terrasse > div:first-child {
        min-height: 2rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Caractéristiques du bien : garder les champs côte à côte (2 colonnes) sur mobile */
    #property-caracteristiques-grid,
    .property-caracteristiques-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    
    /* Boutons d'action */
    .form-actions,
    div[style*="display: flex"][style*="justify-content"] {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    .form-actions .btn,
    div[style*="display: flex"] .btn {
        width: 100% !important;
        padding: 0.75rem 1rem !important;
        font-size: 0.875rem !important;
    }
    
    /* Zone de téléchargement photos */
    #photo-upload-area {
        padding: 1.5rem 1rem !important;
    }
    
    #photo-preview-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
    
    /* Section Meublé / Non meublé */
    #is_furnished-container {
        padding: 0.75rem !important;
    }
    
    #is_furnished-container > div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 0.75rem !important;
        align-items: flex-start !important;
    }
    
    /* Section Détails des pièces */
    #room-details-section {
        padding: 1rem !important;
        margin-top: 1.5rem !important;
    }
    
    #room-details-section h3 {
        font-size: 1rem !important;
        margin-bottom: 1rem !important;
    }
    
    #room-details-content > div {
        padding: 0.75rem !important;
        margin-bottom: 1rem !important;
    }
    
    /* Grille de meubles - Mobile très petit : nom (Miroir, Tablette...) et quantité côte à côte */
    div[id*="furniture-list-"] {
        max-height: 250px !important;
        padding: 0.75rem !important;
    }
    
    div[id*="furniture-list-"] > div {
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.5rem !important;
        padding: 0.75rem !important;
        flex-wrap: wrap !important;
    }
    
    div[id*="furniture-list-"] > div > label:first-of-type {
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.5rem !important;
        flex: 1 !important;
        min-width: 0 !important;
    }
    
    div[id*="-quantity"] {
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.5rem !important;
        margin-top: 0 !important;
        flex-shrink: 0 !important;
    }
    
    div[id*="-quantity"] input[type="number"] {
        width: 60px !important;
        min-width: 60px !important;
        max-width: 80px !important;
    }
    
    /* Messages d'erreur */
    #client-validation-errors,
    div[style*="background: #FFEBEE"][style*="border-left: 4px solid #D32F2F"] {
        padding: 1rem !important;
        font-size: 0.875rem !important;
    }
    
    #client-validation-errors ul,
    div[style*="background: #FFEBEE"] ul {
        padding-left: 1rem !important;
    }
    
    /* ==========================================
       SEARCH PROPERTIES (Recherche)
       ========================================== */
    
    .search-property-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .search-property-image {
        height: 200px !important;
    }
}

/* =============================================
   BREAKPOINT 2: Mobile
   480px - 767px (Smartphones en paysage, petits tablettes)
   ========================================== */
@media (min-width: 480px) and (max-width: 767px) {
    /* ==========================================
       PROPERTIES INDEX
       ========================================== */
    
    .properties-index-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem !important;
        margin: 1.5rem 0 !important;
    }
    
    .properties-index-header h1 {
        font-size: 1.75rem !important;
    }
    
    .properties-index-header .btn {
        width: auto !important;
        padding: 0.75rem 1.25rem !important;
        font-size: 0.9375rem !important;
    }
    
    /* Onglets */
    .properties-index-header + div[style*="border-bottom"] > div {
        flex-wrap: wrap !important;
        gap: 0.75rem !important;
    }
    
    .properties-index-header + div[style*="border-bottom"] a {
        padding: 0.75rem 1.25rem !important;
        font-size: 0.9375rem !important;
    }
    
    /* Grille de propriétés */
    .property-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.25rem !important;
    }
    
    /* Boutons d'action - Mobile (480px+) : En haut à droite car les cartes sont en 2 colonnes */
    .property-card .property-actions {
        position: absolute !important;
        top: 0.5rem !important;
        right: 0.5rem !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 0.3rem !important;
        max-width: calc(100% - 1rem) !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
        border-top: none !important;
        width: auto !important;
    }
    
    .property-card .property-actions .btn,
    .property-card .property-actions button,
    .property-card .property-actions a {
        padding: 0.35rem 0.5rem !important;
        font-size: 0.7rem !important;
        white-space: nowrap !important;
        flex-shrink: 1 !important;
        width: auto !important;
        text-align: center !important;
        min-width: fit-content !important;
    }
    
    .property-card .property-actions form {
        width: auto !important;
        display: inline !important;
    }
    
    .property-card .property-actions form button {
        width: auto !important;
    }
    
    /* ==========================================
       PROPERTIES SHOW
       ========================================== */
    
    .properties-show-container {
        padding: 0 1rem !important;
        margin: 1.5rem auto !important;
    }
    
    .properties-show-header {
        flex-wrap: wrap !important;
    }
    
    .properties-show-header .btn,
    .properties-show-header a {
        width: auto !important;
        padding: 0.75rem 1.25rem !important;
        font-size: 0.9375rem !important;
    }
    
    .properties-show-header .btn-report,
    .properties-show-header a.btn-report {
        justify-content: center !important;
        text-align: center !important;
        display: inline-flex !important;
        align-items: center !important;
    }
    
    .properties-show-image-slider {
        height: 300px !important;
    }

    .properties-show-layout {
        gap: 1.1rem !important;
        padding: 1.1rem !important;
    }

    .ps-sidebar-block {
        padding: 1rem 1.1rem !important;
        margin-bottom: 0.7rem !important;
    }
    .ps-sidebar-actions {
        padding: 1rem 1.1rem !important;
    }
    .ps-feature-pill {
        font-size: 0.82rem !important;
    }

    .properties-show-title {
        font-size: 1.3rem !important;
    }

    .properties-show-price {
        font-size: 1.4rem !important;
    }
    
    .properties-show-features {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
        padding: 1.25rem !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }
    
    .properties-show-feature-item {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 0.5rem !important;
        text-align: left !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }
    
    .properties-show-feature-item .properties-show-feature-value,
    .properties-show-feature-item > div:last-child {
        margin-bottom: 0 !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        min-width: 0 !important;
        overflow-wrap: break-word !important;
    }
    
    .properties-show-feature-item > div:first-child {
        flex-shrink: 0 !important;
        margin-bottom: 0 !important;
    }
    
    .properties-show-feature-meuble,
    .properties-show-feature-piscine {
        order: 1 !important;
    }
    .properties-show-feature-terrasse {
        order: 2 !important;
    }
    /* Aligner Terrasse / extérieur avec les autres : même hauteur d’icône que les emojis (2rem) */
    .properties-show-feature-terrasse > div:first-child {
        min-height: 2rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .properties-show-gallery-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1rem !important;
    }
    
    .properties-show-info {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.25rem !important;
    }
    
    .properties-show-actions {
        flex-wrap: wrap !important;
    }
    
    .properties-show-actions .btn,
    .properties-show-actions a {
        flex: 1 1 calc(50% - 0.5rem) !important;
        min-width: calc(50% - 0.5rem) !important;
    }
    
    /* ==========================================
       PROPERTIES CREATE/EDIT
       ========================================== */
    
    .container[style*="max-width: 1000px"] {
        padding: 0 1rem !important;
        margin: 1.5rem auto !important;
    }
    
    .card-body[style*="padding: 2.5rem"] {
        padding: 1.5rem !important;
    }
    
    div[style*="background: linear-gradient"][style*="padding: 2rem"] {
        padding: 1.75rem 1.5rem !important;
    }
    
    div[style*="background: linear-gradient"] h1 {
        font-size: 1.5rem !important;
    }
    
    /* Grilles de formulaire */
    div[style*="display: grid"][style*="grid-template-columns: repeat(2"] {
        grid-template-columns: 1fr !important;
    }

    /* Caractéristiques du bien : garder les champs côte à côte (2 colonnes) */
    #property-caracteristiques-grid,
    .property-caracteristiques-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Catégorie : pleine largeur sur mobile */
    .property-category-wrap {
        max-width: 100% !important;
    }

    /* Conteneurs Type immo/véhicule : pleine largeur si isolés */
    #property-type-immobilier-container,
    #property-type-vehicule-container {
        width: 100% !important;
    }
    
    /* Boutons d'action */
    .form-actions,
    div[style*="display: flex"][style*="justify-content"] {
        flex-wrap: wrap !important;
    }
    
    .form-actions .btn,
    div[style*="display: flex"] .btn {
        flex: 1 1 calc(50% - 0.5rem) !important;
        min-width: calc(50% - 0.5rem) !important;
    }
    
    #photo-preview-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1rem !important;
    }
    
    /* Section Meublé / Non meublé */
    #is_furnished-container > div[style*="display: flex"] {
        flex-direction: row !important;
        gap: 1rem !important;
    }
    
    /* Section Détails des pièces */
    #room-details-section {
        padding: 1.25rem !important;
    }
    
    /* Grille de meubles - Mobile */
    div[id*="furniture-list-"] {
        max-height: 300px !important;
        grid-template-columns: 1fr !important;
    }
    
    div[id*="furniture-list-"] > div {
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.75rem !important;
    }
    
    div[id*="-quantity"] {
        flex-direction: row !important;
        align-items: center !important;
    }
    
    /* ==========================================
       SEARCH PROPERTIES
       ========================================== */
    
    .search-property-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.25rem !important;
    }
    
    .search-property-image {
        height: 220px !important;
    }
}

/* =============================================
   BREAKPOINT 3: Tablette
   768px - 1023px (Tablettes, petits laptops)
   ========================================== */
@media (min-width: 768px) and (max-width: 1023px) {
    /* ==========================================
       PROPERTIES INDEX
       ========================================== */
    
    .properties-index-header {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin: 1.5rem 0 !important;
    }
    
    .properties-index-header h1 {
        font-size: 2rem !important;
    }
    
    .properties-index-header .btn {
        padding: 0.75rem 1.5rem !important;
        font-size: 0.9375rem !important;
    }
    
    /* Grille de propriétés */
    .property-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }
    
    /* Boutons d'action - Tablette : En haut à droite mais avec meilleur espacement */
    .property-card .property-actions {
        position: absolute !important;
        top: 0.5rem !important;
        right: 0.5rem !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 0.4rem !important;
        max-width: calc(100% - 1rem) !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
        border-top: none !important;
    }
    
    .property-card .property-actions .btn,
    .property-card .property-actions button,
    .property-card .property-actions a {
        padding: 0.45rem 0.75rem !important;
        font-size: 0.75rem !important;
        white-space: nowrap !important;
        flex-shrink: 1 !important;
        width: auto !important;
        min-width: fit-content !important;
    }
    
    .property-card .property-actions form {
        width: auto !important;
    }
    
    .property-card .property-actions form button {
        width: auto !important;
    }
    
    /* ==========================================
       PROPERTIES SHOW
       ========================================== */
    
    .properties-show-container {
        max-width: 720px !important;
        padding: 0 1.5rem !important;
        margin: 1.5rem auto !important;
    }

    .properties-show-image-slider {
        height: 400px !important;
    }

    .properties-show-layout {
        gap: 1.5rem !important;
        padding: 1.5rem !important;
    }

    /* Tablet : colonne unique, sidebar prend toute la largeur */
    .ps-sidebar-block {
        padding: 1rem 1.25rem !important;
    }
    .ps-feature-pill {
        font-size: 0.84rem !important;
    }
    
    .properties-show-title {
        font-size: 1.35rem !important;
    }

    .properties-show-price {
        font-size: 1.5rem !important;
    }

    .properties-show-features {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 1rem !important;
        padding: 1.5rem !important;
    }
    
    .properties-show-gallery-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1rem !important;
    }
    
    .properties-show-info {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }
    
    .properties-show-actions {
        flex-direction: row !important;
    }
    
    .properties-show-actions .btn,
    .properties-show-actions a {
        flex: 1 !important;
    }
    
    /* ==========================================
       PROPERTIES CREATE/EDIT
       ========================================== */
    
    .container[style*="max-width: 1000px"] {
        max-width: 720px !important;
        padding: 0 1.5rem !important;
        margin: 1.5rem auto !important;
    }
    
    .card-body[style*="padding: 2.5rem"] {
        padding: 2rem !important;
    }
    
    div[style*="background: linear-gradient"][style*="padding: 2rem"] {
        padding: 2rem 1.5rem !important;
    }
    
    div[style*="background: linear-gradient"] h1 {
        font-size: 1.75rem !important;
    }
    
    /* Grilles de formulaire */
    div[style*="display: grid"][style*="grid-template-columns: repeat(2"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .form-actions,
    div[style*="display: flex"][style*="justify-content"] {
        flex-direction: row !important;
        justify-content: flex-end !important;
    }
    
    .form-actions .btn,
    div[style*="display: flex"] .btn {
        width: auto !important;
        flex: none !important;
    }
    
    #photo-preview-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 1rem !important;
    }
    
    /* Section Détails des pièces - Tablette */
    #room-details-section {
        padding: 1.5rem !important;
    }
    
    /* Grille de meubles - Tablette */
    div[id*="furniture-list-"] {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
        max-height: 350px !important;
    }
    
    /* ==========================================
       SEARCH PROPERTIES
       ========================================== */
    
    .search-property-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }
    
    .search-property-image {
        height: 240px !important;
    }
}

/* =============================================
   BREAKPOINT 4: Desktop Petit/Moyen
   1024px - 1439px (Laptops, écrans standards)
   ========================================== */
@media (min-width: 1024px) and (max-width: 1439px) {
    /* ==========================================
       PROPERTIES INDEX
       ========================================== */
    
    .property-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
        gap: 1.5rem !important;
    }
    
    /* Boutons d'action - Desktop : En haut à droite, optimisé */
    .property-card .property-actions {
        position: absolute !important;
        top: 0.5rem !important;
        right: 0.5rem !important;
        display: flex !important;
        flex-direction: row !important;
        gap: 0.4rem !important;
        flex-wrap: nowrap !important;
        max-width: calc(100% - 1rem) !important;
    }
    
    .property-card .property-actions .btn,
    .property-card .property-actions button,
    .property-card .property-actions a {
        padding: 0.4rem 0.7rem !important;
        font-size: 0.8rem !important;
        white-space: nowrap !important;
        width: auto !important;
        flex-shrink: 1 !important;
        min-width: fit-content !important;
    }
    
    .property-card .property-actions form {
        width: auto !important;
    }
    
    .property-card .property-actions form button {
        width: auto !important;
    }
    
    /* ==========================================
       PROPERTIES SHOW
       ========================================== */
    
    .properties-show-container {
        max-width: 1200px !important;
        padding: 0 2rem !important;
        margin: 2rem auto !important;
    }
    
    .properties-show-image-slider {
        height: 450px !important;
    }
    
    .properties-show-title {
        font-size: 1.35rem !important;
    }

    .properties-show-price {
        font-size: 1.5rem !important;
    }

    .properties-show-features {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
    }
    
    .properties-show-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    }
    
    .properties-show-info {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
    }
    
    /* ==========================================
       PROPERTIES CREATE/EDIT
       ========================================== */
    
    .container[style*="max-width: 1000px"] {
        max-width: 1000px !important;
        padding: 0 2rem !important;
        margin: 2rem auto !important;
    }
    
    .card-body[style*="padding: 2.5rem"] {
        padding: 2.5rem !important;
    }
    
    div[style*="background: linear-gradient"][style*="padding: 2rem"] {
        padding: 2rem !important;
    }
    
    #photo-preview-grid {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 1rem !important;
    }
    
    /* Section Détails des pièces - Desktop */
    #room-details-section {
        padding: 1.5rem !important;
    }
    
    /* Grille de meubles - Desktop */
    div[id*="furniture-list-"] {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
        max-height: 400px !important;
    }
    
    /* ==========================================
       SEARCH PROPERTIES
       ========================================== */
    
    .search-property-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 1.5rem !important;
    }

    .search-property-image {
        height: 260px !important;
    }
}

/* =============================================
   PROPERTIES CREATE — Catégorie / Type
   ============================================= */

/* Desktop : Catégorie limitée à la moitié de la grille */
@media (min-width: 768px) {
    .property-category-wrap {
        max-width: calc(50% - 0.75rem);
    }
}

/* =============================================
   BREAKPOINT 5: Desktop Large
   1440px+ (Grands écrans, moniteurs larges)
   ========================================== */
@media (min-width: 1440px) {
    /* ==========================================
       PROPERTIES INDEX
       ========================================== */
    
    .property-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
        gap: 2rem !important;
    }
    
    /* Boutons d'action - Desktop Large : En haut à droite, taille optimale */
    .property-card .property-actions {
        position: absolute !important;
        top: 0.75rem !important;
        right: 0.75rem !important;
        display: flex !important;
        flex-direction: row !important;
        gap: 0.5rem !important;
        flex-wrap: nowrap !important;
    }
    
    .property-card .property-actions .btn,
    .property-card .property-actions button,
    .property-card .property-actions a {
        padding: 0.45rem 0.85rem !important;
        font-size: 0.8rem !important;
        white-space: nowrap !important;
        width: auto !important;
        flex-shrink: 1 !important;
        min-width: fit-content !important;
    }
    
    .property-card .property-actions form {
        width: auto !important;
    }
    
    .property-card .property-actions form button {
        width: auto !important;
    }
    
    /* ==========================================
       PROPERTIES SHOW
       ========================================== */
    
    .properties-show-container {
        max-width: 1400px !important;
        padding: 0 2.5rem !important;
        margin: 2.5rem auto !important;
    }
    
    .properties-show-image-slider {
        height: 500px !important;
    }
    
    .properties-show-title {
        font-size: 1.4rem !important;
    }

    .properties-show-price {
        font-size: 1.55rem !important;
    }
    
    /* ==========================================
       PROPERTIES CREATE/EDIT
       ========================================== */
    
    .container[style*="max-width: 1000px"] {
        max-width: 1200px !important;
        padding: 0 2.5rem !important;
        margin: 2.5rem auto !important;
    }
    
    .card-body[style*="padding: 2.5rem"] {
        padding: 3rem !important;
    }
    
    div[style*="background: linear-gradient"][style*="padding: 2rem"] {
        padding: 2.5rem !important;
    }
    
    div[style*="background: linear-gradient"] h1 {
        font-size: 2rem !important;
    }
    
    #photo-preview-grid {
        grid-template-columns: repeat(6, 1fr) !important;
        gap: 1.25rem !important;
    }
    
    /* Section Détails des pièces - Desktop Large */
    #room-details-section {
        padding: 2rem !important;
    }
    
    /* Grille de meubles - Desktop Large */
    div[id*="furniture-list-"] {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
        max-height: 400px !important;
    }
    
    /* ==========================================
       SEARCH PROPERTIES
       ========================================== */
    
    .search-property-grid {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 1.5rem !important;
    }

    .search-property-image {
        height: 280px !important;
    }
}

/* =============================================
   AMÉLIORATIONS GÉNÉRALES
   ========================================== */

/* Page détail : grandes images du slider uniquement (exclut les miniatures) */
.properties-show-image-slider .image-slider-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
}

/* Conteneur image des cartes : dimensions fixes, overflow masqué */
.property-card-image-wrap,
.search-property-card .property-card-image-wrap {
    width: 100%;
    height: 240px;
    min-height: 240px;
    max-height: 240px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

/* Badge logo agence sur les cartes d'annonces */
.agency-logo-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 5px rgba(0,0,0,0.30);
    border: 2px solid rgba(255,255,255,0.9);
    z-index: 2;
    pointer-events: none;
}
.agency-logo-badge img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* Badge dans le carrousel recommandé */
.recommended-card-image {
    position: relative;
}

@media (min-width: 768px) {
    .property-card-image-wrap,
    .search-property-card .property-card-image-wrap {
        height: 260px;
        min-height: 260px;
        max-height: 260px;
    }
}

@media (min-width: 1024px) {
    .property-card-image-wrap,
    .search-property-card .property-card-image-wrap {
        height: 280px;
        min-height: 280px;
        max-height: 280px;
    }
}

/* Images dans le conteneur : remplir le wrapper, object-fit pour cadrer sans déformer */
.property-card-image-wrap .property-image,
.property-card-image-wrap img,
.search-property-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
}

/* Scroll horizontal pour les onglets sur mobile */
@media (max-width: 767px) {
    .properties-index-header + div[style*="border-bottom"] > div {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: thin;
        scrollbar-color: #117333 #e0e0e0;
    }
    
    .properties-index-header + div[style*="border-bottom"] > div::-webkit-scrollbar {
        height: 4px;
    }
    
    .properties-index-header + div[style*="border-bottom"] > div::-webkit-scrollbar-track {
        background: #e0e0e0;
    }
    
    .properties-index-header + div[style*="border-bottom"] > div::-webkit-scrollbar-thumb {
        background: #117333;
        border-radius: 2px;
    }
}

/*
 * Fiche annonce + recherche : libellé boost masqué sous lg (tablettes / mobile).
 * Sélecteurs renforcés (conteneur .properties-show-badges) pour éviter toute fuite de spécificité.
 */
@media (max-width: 991.98px) {
    .properties-show-badges .properties-show-badge-boost,
    .properties-show-badge-boost {
        position: relative;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        padding: 0.35rem 0.5rem !important;
        font-size: 0.9rem !important;
        text-transform: none !important;
    }

    .properties-show-badges .properties-show-badge-boost .properties-show-badge-boost-label,
    .properties-show-badge-boost .properties-show-badge-boost-label {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
        clip-path: inset(50%) !important;
    }

    /* Cartes recherche : badge sponsorisé compact */
    .property-card-badge-sponsored {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 0.2rem;
        padding: 0.2rem 0.4rem !important;
        font-size: 0.65rem !important;
    }

    .property-card-badge-sponsored .property-card-badge-sponsored-label {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
        clip-path: inset(50%) !important;
    }

    .property-card-badge-sponsored .property-card-badge-sponsored-icon {
        font-size: 0.95rem;
        line-height: 1;
    }
}

/* Amélioration de la lisibilité des badges sur petits écrans */
@media (max-width: 767px) {
    .badge,
    .properties-show-badge {
        font-size: 0.75rem !important;
        padding: 0.25rem 0.5rem !important;
    }
}

/* Catégorie / caractéristiques des biens : garder côte à côte en responsive (toutes les parties) */
@media (max-width: 767px) {
    /* Liste des annonces (index, favoris) : pièces, m², badge sur une ligne */
    .property-card .property-details,
    .property-details {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 0.5rem 0.75rem !important;
    }
    
    .property-card .property-details span,
    .property-details span {
        white-space: nowrap !important;
    }
    
    /* Recherche : ch. et m² côte à côte */
    .search-property-card .property-specs {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 0.5rem 0.75rem !important;
        flex-shrink: 1 !important;
        min-width: 0 !important;
    }

    .search-property-card .property-spec-line {
        white-space: nowrap !important;
    }

    /* Sans ça, le parent .property-details garde overflow:hidden et flex-shrink:0 hérité
       du desktop empêche .property-specs de rétrécir : le flex-wrap ci-dessus ne se
       déclenche jamais et les caractéristiques en fin de ligne (ex. état du véhicule
       "Neuf"/"Très bon état") sont coupées silencieusement sur petit écran. */
    .search-property-card .property-details {
        overflow: visible !important;
    }
}

/* Modal responsive - centrage des images au clic */
@media (max-width: 767px) {
    #imageModal .image-modal-wrapper {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    #imageModal .image-modal-content {
        align-items: center !important;
        justify-content: center !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    #imageModal .image-modal-nav-prev {
        left: 0.25rem;
    }
    
    #imageModal .image-modal-nav-next {
        right: 0.25rem;
    }
    
    #imageModal .image-modal-btn {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.5rem !important;
    }
    
    #modalImage {
        max-width: 100% !important;
        max-height: 85vh !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
        object-position: center !important;
        display: block !important;
        margin: 0 auto !important;
    }
}

/* =============================================
   RESPONSIVE POUR LES NOUVELLES SECTIONS
   Détails des pièces, Meubles, etc.
   ============================================= */

/* Mobile Très Petit (< 480px) */
@media (max-width: 479px) {
    /* Section détails des pièces */
    #room-details-content > div {
        padding: 0.75rem !important;
    }
    
    #room-details-content h4 {
        font-size: 0.95rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    /* Grille de meubles - très petit écran : nom + quantité côte à côte */
    div[id*="furniture-list-"] {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }
    
    div[id*="furniture-list-"] > div {
        width: 100% !important;
        flex-direction: row !important;
        align-items: center !important;
    }
    
    div[id*="-quantity"] {
        flex-direction: row !important;
        align-items: center !important;
        margin-top: 0 !important;
    }
    
    div[id*="-quantity"] input[type="number"] {
        width: 60px !important;
        min-width: 60px !important;
    }
    
    /* Radio buttons Meublé/Non meublé */
    #is_furnished-container > div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    #is_furnished-container label {
        width: 100% !important;
    }
}

/* Mobile (480px - 767px) */
@media (min-width: 480px) and (max-width: 767px) {
    /* Grille de meubles - 1 colonne sur mobile */
    div[id*="furniture-list-"] {
        grid-template-columns: 1fr !important;
    }
    
    div[id*="furniture-list-"] > div {
        flex-direction: row !important;
        align-items: center !important;
    }
    
    div[id*="-quantity"] {
        flex-direction: row !important;
        align-items: center !important;
    }
}

/* Tablette (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    /* Grille de meubles - 2 colonnes sur tablette */
    div[id*="furniture-list-"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    /* Grille de meubles - colonnes adaptatives */
    div[id*="furniture-list-"] {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    }
}

/* Amélioration générale pour tous les écrans */
#room-details-section {
    overflow-x: hidden !important;
}

/* Scrollbar personnalisée pour la grille de meubles */
div[id*="furniture-list-"] {
    scrollbar-width: thin;
    scrollbar-color: #117333 #f0f0f0;
}

div[id*="furniture-list-"]::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

div[id*="furniture-list-"]::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

div[id*="furniture-list-"]::-webkit-scrollbar-thumb {
    background: #117333;
    border-radius: 3px;
}

div[id*="furniture-list-"]::-webkit-scrollbar-thumb:hover {
    background: #0e5c2a;
}

/* Responsive pour les messages d'erreur */
@media (max-width: 767px) {
    #client-validation-errors,
    div[style*="background: #FFEBEE"][style*="border-left: 4px solid #D32F2F"] {
        font-size: 0.875rem !important;
        padding: 1rem !important;
    }
    
    #client-validation-errors ul li,
    div[style*="background: #FFEBEE"] ul li {
        font-size: 0.875rem !important;
        margin-bottom: 0.5rem !important;
    }
}

/* =============================================
   SECTION PHOTOS EXISTANTES (Édition annonce)
   Info déplacement + hint sur chaque photo en mobile
   ============================================= */

/* Conteneur des photos : pas de max-height — toutes les vignettes restent visibles en défilant la page (évite 6/10 masquées dans une zone scroll interne peu évidente sur mobile). */
.photos-reorder-wrapper {
    overflow: visible;
    max-height: none;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem;
    background: #fafafa;
}

/* Masquer le hint "Sur mobile, maintenez..." sur desktop */
.photos-reorder-hint-mobile {
    display: none;
}

/* Mobile : afficher l'info déplacement clairement et le hint tactile */
@media (max-width: 767px) {
    .photos-reorder-info {
        display: block !important;
        padding: 0.75rem 1rem !important;
        font-size: 0.875rem !important;
        line-height: 1.5 !important;
        margin-bottom: 1rem !important;
    }
    
    .photos-reorder-hint-mobile {
        display: inline !important;
        font-weight: 600;
    }
    
    /* Hint "↔ Déplacer" sous le texte (visible uniquement en mobile, sans chevaucher les écritures) */
    .photo-card-move-hint {
        display: block !important;
        position: static !important;
        text-align: center !important;
        margin-top: 0.35rem !important;
        margin-bottom: 0 !important;
        background: rgba(45, 125, 50, 0.9) !important;
        color: white !important;
        font-size: 0.7rem !important;
        padding: 0.25rem 0.5rem !important;
        border-radius: 4px !important;
        pointer-events: none !important;
        white-space: nowrap !important;
    }
    
    /* Grille photos existantes : garder 2 colonnes sur petit écran pour voir le hint */
    #existing-photos-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
}

/* Masquer le hint sur chaque carte sur desktop (éviter doublon avec le bloc texte) */
@media (min-width: 768px) {
    .photo-card-move-hint {
        display: none !important;
    }
}

/* Responsive pour l'affichage des détails des pièces dans show.blade.php */
@media (max-width: 767px) {
    .room-details-display {
        padding: 1rem !important;
    }
    
    .room-detail-card {
        padding: 0.75rem !important;
        margin-bottom: 1rem !important;
    }
    
    .room-detail-card h3 {
        font-size: 1rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .room-furniture-accordion__header {
        padding: 0.5rem 0 !important;
        min-height: 44px;
    }
    
    .furniture-tags-container {
        gap: 0.375rem !important;
    }
    
    .furniture-tags-container span {
        font-size: 0.8rem !important;
        padding: 0.25rem 0.5rem !important;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .room-details-display {
        padding: 1.25rem !important;
    }
    
    .furniture-tags-container {
        gap: 0.5rem !important;
    }
}

/* Responsive pour les conteneurs de meubles générés dynamiquement */
@media (max-width: 479px) {
    /* Miroir / Tablette et quantité côte à côte sur mobile */
    .furniture-item-container {
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.5rem !important;
        flex-wrap: wrap !important;
    }
    
    .furniture-item-container > label:first-of-type {
        flex: 1 !important;
        min-width: 0 !important;
    }
    
    .furniture-quantity-container {
        flex-direction: row !important;
        align-items: center !important;
        margin-top: 0 !important;
        flex-shrink: 0 !important;
    }
    
    .furniture-quantity-input {
        width: 60px !important;
        min-width: 60px !important;
    }
}

@media (min-width: 480px) and (max-width: 767px) {
    .furniture-item-container {
        flex-direction: row !important;
        align-items: center !important;
    }
    
    .furniture-quantity-container {
        flex-direction: row !important;
        align-items: center !important;
    }
}