@media (max-width: 1024px) {
    html, body { overflow-x: hidden; max-width: 100%; }

    body { background: none; }
    body::before {
        display: block;
        position: fixed;
        top: 50%;
        left: 50%;
        width: 100vh;
        height: 100vw;
        transform: translate(-50%, -50%) rotate(90deg);
        background-image: url("../images/background_body.png");
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        z-index: -1;
    }

    .footer { background-color: #212d38; }
}

@media (max-width: 1024px) {
    .navbar { padding: 12px 20px; }
    .logo img { height: 50px; }
    .title_connected h1,
    .title_disconnect h1 { font-size: 38px; }
}

@media (max-width: 888px) {
    .navbar { padding: 10px 16px; }
    .logo img { height: 44px; }
    .title_connected h1,
    .title_disconnect h1 { font-size: 32px; }

    .burger-btn { display: flex; order: 3; }

    .logo { order: 1; }
    .title_disconnect,
    .btn-deposer-nav { order: 2; }

    .btn-deposer-nav { display: none; }

    .nav-connection {
        position: absolute;
        top: 100%;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background-color: var(--bleu);
        width: 230px;
        max-width: 80vw;
        padding: 8px;
        border-radius: 0 0 0 12px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
        transition: max-height 0.3s ease, opacity 0.25s ease;
    }

    .nav-connection.is-open {
        max-height: 80vh;
        opacity: 1;
        pointer-events: auto;
    }

    .nav-connection a {
        width: 100%;
        padding: 12px 14px;
        font-size: 16px;
        border-radius: 8px;
        justify-content: flex-start;
        gap: 10px;
        display: flex;
        align-items: center;
    }

    .nav-connection a span { display: inline; }

    .nav-deposer-mobile {
        display: flex !important;
        background-color: var(--rouge);
        margin-bottom: 6px;
        font-weight: 700;
    }
    .nav-deposer-mobile:hover {
        background-color: #ff1f1c;
        border-color: transparent;
    }
}

@media (max-width: 600px) {
    .navbar { padding: 8px 12px; }
    .logo img { height: 38px; }
    .title_connected h1,
    .title_disconnect h1 { font-size: 26px; }
    .btn-deposer-nav { display: none; }
}

@media (max-width: 480px) {
    .title_connected,
    .title_disconnect { display: none; }
}

@media (max-width: 1024px) {
    .container-center { gap: 40px; padding: 0 2rem; }
    .box { width: 45vh; height: 60vh; }
}

@media (max-width: 888px) {
    .container-center {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 2rem 1rem;
        gap: 24px;
        height: auto;
        min-height: 90vh;
    }
    .box { width: 85%; max-width: 420px; height: auto; aspect-ratio: 3 / 4; min-height: 320px; padding: 20px; padding-top: 30px; display: flex; align-items: flex-start; justify-content: center; }
}

@media (max-width: 480px) {
    .box { width: 90%; aspect-ratio: 3 / 4; min-height: 280px; }
    .container-center a { font-size: 18px; padding: 10px 24px; }
}

@media (max-width: 360px) {
    .box { min-height: 240px; }
}

@media (max-width: 888px) {
    .footer-bottom { padding: 14px; }
    .footer-bottom p { font-size: 11px; }
}

@media (max-width: 480px) {
    .footer-bottom p {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        font-size: 11px;
    }
}

@media (max-width: 1024px) {
    .block-inscription { width: 90%; }
}

@media (max-width: 888px) {
    .container-inscription { padding: 1rem; }
    .block-inscription {
        width: 95%;
        padding: 1.5rem 1rem;
    }
    .inscription-colonnes { flex-direction: column; }
    .inscription-col:first-child {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.2);
        padding-bottom: 1rem;
    }
    .block_ligne { flex-direction: column; gap: 0.4rem; }
    .inscription-footer input[type="submit"] { width: 60%; }
}

@media (max-width: 480px) {
    .block-inscription h2 { font-size: 26px; }
    .inscription-footer input[type="submit"] { width: 80%; }
    .block-connection { width: 95%; padding: 2rem 1rem 1.5rem; }
    .block-connection input[type="submit"] { width: 70%; }
}

@media (max-width: 360px) {
    .inscription-footer input[type="submit"] { width: 100%; }
}

@media (max-width: 1200px) {
    .container-annonces { padding: 2rem 4rem; }
    .annonce-top { width: 95%; }
    .annonce-grid { width: 95%; grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
    .container-annonces { padding: 2rem 2rem; }
    .annonce-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 888px) {
    .container-annonces { padding: 1rem; }
    .annonce-top { width: 100%; flex-direction: column; }
    .annonce-search { width: 100%; min-width: 0; box-sizing: border-box; }
    .search-form { width: 100%; min-width: 0; }
    .search-row { min-width: 0; }
    .search-bar { min-width: 0; }
    .annonce-grid { width: 100%; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .search-filters { flex-wrap: wrap; gap: 0.8rem; justify-content: flex-start; width: 100%; }
    .search-filter-group { flex: 1; min-width: 120px; }
}

@media (max-width: 600px) {
    .annonce-grid { grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
    .search-filters { gap: 0.6rem; }
    .price-range input { width: 65px; }
}

@media (max-width: 480px) {
    .annonce-grid { grid-template-columns: 1fr; }
    .annonce-img { height: 220px; }
    .search-row { flex-direction: column; align-items: stretch; }
    .search-row button { width: 100%; }
    .search-filters { flex-direction: column; }
    .search-filter-group { min-width: unset; width: 100%; }
    .search-filters select { width: 100%; }
    .price-range { width: 100%; box-sizing: border-box; }
    .price-range input { flex: 1; width: auto; min-width: 0; }
}

@media (max-width: 1200px) {
    .annonce-detail-block { width: 95%; }
}

@media (max-width: 1024px) {
    .container-annonce-detail { padding: 1.5rem 2rem; }
    .annonce-detail-block { padding: 2rem; }
    .annonce-detail-sidebar { width: 240px; min-width: 240px; }
}

@media (max-width: 888px) {
    .container-annonce-detail { padding: 1rem; }
    .annonce-detail-block { width: 100%; padding: 1.5rem 1rem; }
    .annonce-detail-top { flex-direction: column; }
    .annonce-detail-sidebar { width: 100%; min-width: unset; position: static; }
    .annonce-detail-left { width: 100%; }
    .galerie-principale { height: 260px; }
}

@media (max-width: 600px) {
    .annonce-detail-prix { font-size: 26px; }
    .annonce-detail-infos h2 { font-size: 22px; }
    .galerie-principale { height: 220px; }
    .miniature { width: 56px; height: 56px; }
}

@media (max-width: 480px) {
    .galerie-principale { height: 180px; }
    .annonce-detail-block { padding: 1rem 0.8rem; }
    .annonce-detail-tags { flex-wrap: wrap; }
}

@media (max-width: 1024px) {
    .block-creation { width: 90%; }
}

@media (max-width: 888px) {
    .container-creation { padding: 1rem; }
    .block-creation { width: 100%; padding: 1.5rem 1rem; }
    .creation-colonnes { flex-direction: column; }
    .creation-col:first-child {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.2);
        padding-bottom: 1rem;
    }
    .creation-col { padding: 0 0.5rem; }
}

@media (max-width: 480px) {
    .block-creation h2 { font-size: 26px; }
    .creation-footer input[type="submit"] { padding: 10px 24px; font-size: 14px; }
    .photo-label { padding: 1.5rem 1rem; }
}

@media (max-width: 1200px) {
    .catalogue-search-form { margin: 0 4rem; }
    .catalogue-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
    .container-catalogue { padding: 1.5rem 2rem; }
    .catalogue-search-form { margin: 0 2rem; }
    .catalogue-grid { grid-template-columns: repeat(3, 1fr); }
    .catalogue-block { width: 100%; }
}

@media (max-width: 888px) {
    .container-catalogue { padding: 1rem; }
    .catalogue-search-form { margin: 0; padding: 1rem; }
    .catalogue-search-row { flex-direction: column; }
    .catalogue-search-row button { width: 100%; }
    .catalogue-filters { flex-wrap: wrap; }
    .catalogue-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .catalogue-titre { font-size: 35px; }
}

@media (max-width: 480px) {
    .catalogue-grid { grid-template-columns: 1fr; }
    .catalogue-titre { font-size: 28px; }
    .filter-radio { padding: 6px 14px; font-size: 13px; }
}

@media (max-width: 1024px) {
    .detail-block { width: 95%; }
    .detail-pieces-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 888px) {
    .container-detail { padding: 1rem; }
    .detail-block { width: 100%; padding: 1.5rem 1rem; }
    .detail-top { flex-direction: column; align-items: center; }
    .detail-img { width: 100%; }
    .detail-annonces-grid { grid-template-columns: repeat(2, 1fr); }
    .detail-pieces-grid { grid-template-columns: repeat(3, 1fr); }
    .detail-filtres { flex-wrap: wrap; }
}

@media (max-width: 480px) {
    .detail-annonces-grid { grid-template-columns: 1fr; }
    .detail-pieces-grid { grid-template-columns: repeat(2, 1fr); }
    .detail-infos h2 { font-size: 22px !important; }
}

@media (max-width: 1024px) {
    .container-messages { padding: 1.5rem 2rem; }
    .messages-sidebar { width: 260px; min-width: 240px; }
}

@media (max-width: 888px) {
    .container-messages { flex-direction: column; padding: 1rem; gap: 1rem; }
    .messages-sidebar { width: 100%; min-width: unset; }
    .conv-list { max-height: 30vh; }
    .messages-chat { min-height: unset; }
    .chat-body { max-height: 40vh; min-height: 260px; }
    .chat-header { flex-direction: column; align-items: flex-start; gap: 0.8rem; }
    .chat-header-actions { width: 100%; justify-content: flex-end; }
}

@media (max-width: 480px) {
    .chat-form { flex-direction: column; }
    .chat-form textarea { height: 80px; }
    .chat-form button { width: 100%; }
    .msg-bubble { max-width: 85%; }
    .conv-list { max-height: 25vh; }
}

@media (max-width: 1024px) {
    .profil-container { margin: 2rem auto; max-width: 700px; }
}

@media (max-width: 888px) {
    .profil-container { margin: 1rem; padding: 1.5rem 1rem; }
    .profil-top,
    .profil-mid,
    .profil-bottom { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .profil-container h1 { font-size: 26px; }
    .deco-btn { width: 100%; text-align: center; padding: 0.8rem 2rem; }
}

@media (max-width: 888px) {
    .mes-annonces-tabs { overflow-x: auto; }
    .mes-annonces-tab { white-space: nowrap; padding: 10px 16px; }
    .mes-annonce-card { flex-wrap: wrap; }
}

@media (max-width: 480px) {
    .mes-annonce-img { width: 60px; height: 60px; }
    .mes-annonce-info h3 { font-size: 13px; }
    .mes-annonce-prix { font-size: 14px; }
    .mes-annonce-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 1024px) {
    .cgv-block { width: 90%; }
}

@media (max-width: 888px) {
    .container-cgv { padding: 1rem; }
    .cgv-block { width: 100%; }
    .cgv-titre { font-size: 32px; }
    .cgv-section { padding: 1.2rem; }
}

@media (max-width: 480px) {
    .cgv-titre { font-size: 26px; }
    .cgv-section h2 { font-size: 17px; }
    .cgv-section p,
    .cgv-section ul li { font-size: 13px; }
}

@media (max-width: 888px) {
    .erreur-block { padding: 2.5rem 1.5rem; }
    .erreur-code { font-size: 70px; }
    .erreur-titre { font-size: 22px; }
}

@media (max-width: 480px) {
    .erreur-code { font-size: 55px; }
    .erreur-titre { font-size: 18px; }
    .erreur-actions { flex-direction: column; width: 100%; }
    .btn-erreur-retour,
    .erreur-actions .btn-deposer-nav { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
    #captcha-puzzle { width: 100%; }
}

@media (max-width: 888px) {
    .historique-card-body { grid-template-columns: 1fr; }
    .historique-champ-full { grid-column: span 1; }
}

@media (max-width: 480px) {
    .historique-card-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}

@media (max-width: 888px) {
    .block-inscription[style*="max-width:600px"] { width: 95%; }
}

@media (max-width: 480px) {
    .block-inscription div[style*="display:flex"] {
        flex-direction: column;
        width: 100%;
    }
    .block-inscription div[style*="display:flex"] a {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 888px) {
    header { padding-top: 8vh; }
}

@media (max-width: 480px) {
    header { padding-top: 9vh; }
    .msg-success,
    .msg-error { font-size: 14px; }
}

@media (max-width: 360px) {
    header { padding-top: 10vh; }
}