/* Widoki ogłoszeń - Profesjonalny design */

/* Dostępność: jednolity focus dla przycisków */
[class*="btn"]:focus-visible,
[class*="button"]:focus-visible,
button:focus-visible,
input[type="button"]:focus-visible,
input[type="submit"]:focus-visible {
    outline: 2px solid #003d82;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(0, 61, 130, 0.25);
}

/* ============================================
   LISTING COMPONENTS - Wszystkie klasy .listing-*
   ============================================ */

/* Lista ogłoszeń i kontenery */
#listingsList,
#userListingsList,
#savedListingsList {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 1.5rem 0;
}

#listingsList.listings-feed {
    gap: 0;
    margin: 0.75rem 0 0;
}

.listings-page-header {
    margin-bottom: 0.75rem;
    padding: 1.25rem;
    border: 1px solid #dbe7f3;
    border-radius: 18px;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 55%, #f5f7f9 100%);
}

.listings-page-header__content {
    max-width: 760px;
}

.listings-page-header h1 {
    margin: 0;
    font-size: 32px;
    color: #003153;
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.listings-page-header p {
    max-width: 760px;
    margin: 0.55rem 0 0;
    color: #475569;
    font-size: 0.96rem;
    line-height: 1.55;
}

.listings-feed__regular-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Podstawowa struktura ogłoszenia */
.listing {
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem 1rem 0.625rem 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s, transform 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.listing.listing--featured {
    border: 2px solid rgba(243, 156, 18, 0.4);
    box-shadow: 0 4px 16px rgba(243, 156, 18, 0.15);
}

.listing.listing--featured:hover {
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.25);
}

/* Sekcja wyróżnionych ogłoszeń — top (max 3 losowe, strona 1) */
.featured-top-section {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.featured-top-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 10px;
}

.featured-top-separator {
    position: relative;
    width: 100%;
    height: 20px;
    flex: 0 0 20px;
}

.featured-top-separator::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 0;
    width: 100%;
    border-top: 1px solid rgba(243, 156, 18, 0.25);
}

.featured-top-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #b8860b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.featured-top-header svg {
    stroke: #d4a017;
    flex-shrink: 0;
}

.featured-top-section .listing.listing--featured-top {
    border: 2px solid rgba(243, 156, 18, 0.5);
    background: #fff;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.12);
}

.featured-top-section .listing.listing--featured-top:hover {
    box-shadow: 0 4px 16px rgba(243, 156, 18, 0.22);
}

.listing-content {
    display: flex;
    justify-content: space-between;
    flex: 1;
    position: relative;
}

/* Nagłówek ogłoszenia */
.listing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.9375rem;

}

.listing-info {
    flex: 1;
    min-width: 0;
}

.listing-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #22313f;
    margin: 0;
    line-height: 1.3;
    flex: 1;
    word-break: break-word;
    overflow-wrap: break-word;
}

.listing-title a {
    color: #003153;
    text-decoration: none;
    transition: color 0.2s ease;
}

.listing-title a:hover {
    color: #0B4A73;
}

/* Stopka ogłoszenia */
.listing-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    flex-wrap: wrap;
    gap: 10px;
}

/* Interakcje z ogłoszeniem */
.listing:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.listing:hover .listing-title {
    color: #003153;
}

.listing-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    color: #656565;
}

.listing-value {
    font-weight: bold;
    color: #003153;
}

/* Meta informacje ogłoszenia */
.listing-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin-bottom: 0;
    font-size: 14px;
    color: #4b5563;
    flex: 1 1 0;
    min-width: 0;
}

/* Moje ogłoszenia - układ listing-footer z badges i actions w jednej linii */
#userListingsList .listing-meta {
    display: contents;
    /* Pozwala dzieciom (badges, details-row) być bezpośrednimi flex children */
}

#userListingsList .listing-footer {
    flex-wrap: wrap;
    row-gap: 12px;
}

#userListingsList .listing-badges {
    order: 1;
    flex: 0 0 auto;
}

#userListingsList .details-row {
    order: 3;
    flex: 1 1 100%;
}

#userListingsList .listing-actions {
    order: 2;
    flex: 0 0 auto;
    margin-left: auto;
}

.listing-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Akcje i przyciski ogłoszenia */
.listing-actions {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
    white-space: nowrap;
}

/* Szczegóły ogłoszenia - Detail View */
.listing-detail-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    gap: 30px;
    margin-top: 1.25rem;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Panel informacyjny w widoku szczegółów */
.listing-info-panel {
    background: white;
    border-radius: 8px;
    padding: 0.625rem;
    border: 1px solid #ddd;
    width: 350px;
    box-sizing: border-box;
    height: auto;
    min-height: fit-content;
    transition: height 0.3s ease;
}

/* ============================================
   WIDOK SZCZEGÓŁÓW OGŁOSZENIA - REFAKTORYZACJA
   ============================================ */

/* Nagłówek z przyciskami akcji */
.listing-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

/* Kontener dla przycisków akcji */
.listing-action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Przyciski akcji - ikony */
.action-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn-icon:hover {
    background: #e9ecef;
    border-color: #ced4da;
    color: #003153;
}

.action-btn-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.action-btn-icon.saved svg polygon {
    fill: #000000;
    stroke: #000000;
}

.action-btn-icon.action-btn-report:hover {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.action-btn-icon.action-btn-admin-ban {
    color: #dc2626;
    border-color: #fca5a5;
}

.action-btn-icon.action-btn-admin-ban:hover {
    background: #fef2f2;
    border-color: #dc2626;
    color: #991b1b;
}

.action-btn-icon.action-btn-admin-ban.disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: default;
}

.action-btn-icon.action-btn-admin-delete {
    color: #dc2626;
    border-color: #fca5a5;
}

.action-btn-icon.action-btn-admin-delete:hover {
    background: #fef2f2;
    border-color: #dc2626;
    color: #991b1b;
}

.action-btn-icon.action-btn-admin-promote {
    color: #b45309;
    border-color: #fcd34d;
}

.action-btn-icon.action-btn-admin-promote:hover {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}

.access-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.55);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

.access-modal {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 480px;
    overflow: hidden;
}

.access-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.access-modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    color: #213445;
}

.access-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s ease;
}

.access-modal-close:hover {
    color: #1f2937;
}

.access-modal-body {
    padding: 1.5rem;
}

.access-modal-field {
    margin-bottom: 1rem;
}

.access-modal-field:last-child {
    margin-bottom: 0;
}

.access-modal-field label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    font-size: 0.9375rem;
    color: #213445;
}

.access-modal-field select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #213445;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.access-modal-field select:focus {
    border-color: #003153;
    box-shadow: 0 0 0 3px rgba(0, 49, 83, 0.1);
    outline: none;
}

.access-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem 1.25rem;
    border-top: 1px solid #e5e7eb;
}

/* Wrapper dla przycisku share z dropdown */
.share-btn-wrapper {
    position: relative;
}

.share-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.25rem;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    min-width: 150px;
}

.share-dropdown.show {
    display: block;
}

.share-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: none;
    border: none;
    color: #333;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.share-option:first-child {
    border-radius: 8px 8px 0 0;
}

.share-option:last-child {
    border-radius: 0 0 8px 8px;
}

.share-option:hover {
    background: #f8f9fa;
}

.share-option svg {
    flex-shrink: 0;
}

/* Wiersz tytułu z przyciskiem kontaktu */
.listing-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1rem;
    padding: 0 1.25rem;
}

/* Tytuł ogłoszenia */
.listing-detail-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.3;
    flex: 1;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Przycisk kontaktu przy tytule */
.listing-title-row .contact-btn-primary {
    flex-shrink: 0;
}

/* Siatka dwukolumnowa */
.listing-detail-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* Panel meta danych */
.listing-meta-panel {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    position: sticky;
    top: 1rem;
}

.meta-section {
    padding: 1.25rem;
}

.meta-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #003153;
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #003153;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.meta-item:last-child {
    border-bottom: none;
}

.meta-item-muted {
    opacity: 0.7;
}

.meta-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.meta-label svg {
    stroke: #888;
    flex-shrink: 0;
}

.meta-value {
    font-size: 0.95rem;
    color: #1a1a1a;
    font-weight: 500;
    padding-left: 1.625rem;
    overflow-wrap: break-word;
    word-break: break-word;
}

.meta-value-highlight {
    color: #003153;
    font-weight: 600;
}

/* Przycisk kontaktu */
.contact-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: #003153;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.contact-btn-primary:hover {
    background: #0B4A73;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 49, 83, 0.25);
}

.contact-btn-primary svg {
    stroke: currentColor;
    flex-shrink: 0;
}

/* Sekcja opisu */
.listing-description-section {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    min-height: 200px;
}

.description-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #003153;
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #003153;
}

.description-content {
    line-height: 1.7;
    color: #333;
    white-space: pre-line;
}

.no-description {
    color: #888;
    font-style: italic;
    margin: 0;
}

/* Link wrapper dla ogłoszenia w architekturze MPA */
.listing-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.listing-link:hover .listing-title {
    color: #003153;
}

/* ============================================
   PAGE LAYOUT
   ============================================ */

/* Główny kontener */
.listings-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.page-header {
    margin-bottom: 3rem;
    text-align: center;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #374151;
    margin: 0 0 1rem 0;
}

.page-subtitle {
    font-size: 1.25rem;
    color: #656565;
    margin: 0;
}

/* Listings - Profesjonalny design */

/* Listings Controls */
.listings-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.listings-controls-left {
    display: flex;
    gap: 16px;
    align-items: center;
    flex: 1;
}

.sort-control {
    min-width: 200px;
    padding: 0.75rem 2rem 0.625rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    transition: all 0.2s ease;
}

.sort-control:focus {
    outline: none;
    border-color: #003153;
    box-shadow: 0 0 0 2px rgba(0, 49, 83, 0.1);
}

.sort-control option {
    color: #000;
}

#filterForm+.filter-actions .sort-control {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    font-size: 14px;
    box-sizing: border-box;
    flex-shrink: 0;
    cursor: pointer;
}

#filterForm+.filter-actions {
    align-items: center;
    margin-top: 0;
    margin-bottom: 0.75rem;
    border-top: 0;
}

#filterForm+.filter-actions .search-box input {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    font-size: 14px;
    min-height: 44px;
    box-sizing: border-box;
}

/* ============================================
   MODAL ANKIETY USUWANIA OGŁOSZENIA
   ============================================ */

.deletion-survey-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.deletion-survey-overlay[hidden] {
    display: none;
}

.deletion-survey-modal {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    max-width: 420px;
    width: 100%;
    position: relative;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    animation: deletionSurveyIn 0.2s ease;
}

@keyframes deletionSurveyIn {
    from { opacity: 0; transform: scale(0.96) translateY(-8px); }
    to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

@media (max-width: 992px) {
    .listings-page-header {
        padding: 1rem;
    }

    .listings-page-header__content {
        max-width: none;
    }

    .listings-page-header h1 {
        font-size: 28px;
    }

    .listing-detail-grid {
        gap: 1rem;
    }
    
    .detail-page-section {
        width: 95%;
    }

    .page-title {
        font-size: 2.25rem;
    }

    .page-subtitle {
        font-size: 1.15rem;
    }

    #filterForm+.filter-actions .sort-control {
        padding-top: 0.625rem;
        padding-bottom: 0.625rem;
    }

    #filterForm+.filter-actions .search-box input {
        padding-top: 0.625rem;
        padding-bottom: 0.625rem;
    }

    .listings-container {
        padding: 1.5rem 1rem;
    }

    .listings-controls {
        padding: 0.875rem 1.125rem;
        gap: 16px;
    }

    .sort-control {
        padding: 0.625rem 0.875rem;
        /* 10px 14px */
    }

    .listings-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 16px;
    }

    .listing-card {
        padding: 1.125rem;
    }

    .listing-content {
        gap: 10px;
    }

    .listing-header {
        align-items: center;
        flex-wrap: nowrap;
    }

    .listing-info {
        flex-grow: 1;
    }

    .listing-title {
        font-size: 1.15em;
        margin-bottom: 0;
        flex-basis: auto;
    }

    .listing-footer {
        padding-top: 0.5rem;
    }

    .listing-meta {
        gap: 12px;
        font-size: 13.5px;
    }

    .listing-actions {
        justify-content: flex-end;
        flex-grow: 1;
        min-width: 200px;
    }

    .listing-detail-container {
        padding: 1.5rem 1rem;
        gap: 15px;
    }

    .listing-info-panel {
        width: 100%;
        order: 2;
    }

    .listing-info-panel .contact-btn.primary {
        width: 50%;
        max-width: 250px;
        margin: 0 auto;
    }
}

/* 900px - Widok szczegółów ogłoszenia */
@media (max-width: 900px) {
    .listing-detail-grid {
        grid-template-columns: 1fr;
    }

    .listing-meta-panel {
        position: static;
        order: -1;
    }
}

/* 768px - Tablet portrait */
@media (max-width: 768px) {
    .listings-page-header {
        margin-bottom: 0.75rem;
        padding: 0.75rem;
        border-radius: 16px;
    }

    .listings-page-header h1 {
        font-size: 26px;
    }

    .listings-page-header p {
        margin-top: 0.5rem;
        font-size: 0.94rem;
        line-height: 1.55;
    }

    #filterForm+.filter-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 0.75rem;
    }

    #filterForm+.filter-actions #enableNotifications {
        order: -1;
        align-self: stretch;
        justify-content: center;
        min-height: 44px;
        box-sizing: border-box;
    }

    .listing {
        padding: 0.75rem 0.75rem 0.5rem 0.75rem;
    }

    .listing-header {
        margin-top: 0.625rem;
    }

    .listings-container {
        width: 100%;
        padding: 0.9375rem;
    }

    .listings-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 0.75rem;
    }

    .listings-controls-left {
        gap: 12px;
    }

    .sort-control {
        min-width: 0;
        padding: 0.625rem 0.75rem;
        /* 10px 12px */
    }

    .sort-control,
    .search-box {
        width: 100%;
        max-width: none;
    }

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

    .listing-card {
        padding: 0.9375rem;
    }

    .listing-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .listing-meta {
        min-width: 150px;
    }

    .listing-actions {
        gap: 6px;
    }

    .detail-title {
        font-size: 1.5rem;
    }

    .listing-sidebar {
        padding: 1.5rem;
    }

    .listing-info-panel {
        padding: 1rem;
    }

    .info-item {
        gap: 8px;
        margin-bottom: 0.75rem;
    }

    .info-item span {
        font-size: 14px;
    }

    .page-title {
        font-size: 2rem;
    }

    .page-subtitle {
        font-size: 1.1rem;
    }

    /* Moje ogłoszenia - responsywność */
    #userListingsList .listing-badges {
        order: 1;
    }

    #userListingsList .listing-actions {
        order: 2;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .access-modal {
        max-width: 400px;
    }

    #userListingsList .details-row {
        order: 3;
    }
}

/* 600px - Widok szczegółów ogłoszenia - mobile */
@media (max-width: 600px) {
    .listing-action-buttons {
        gap: 0.5rem;
    }

    .listing-title-row {
        flex-direction: column;
        align-items: stretch;
        gap: 1.25rem;
        padding: 0 1rem;
    }

    .listing-title-row .contact-btn-primary {
        width: 100%;
    }

    .listing-detail-title {
        font-size: 1.4rem;
    }

    .meta-section {
        padding: 1rem;
    }

    .listing-description-section {
        padding: 1rem;
    }

    .sort-control {
        padding: 0.625rem 0.75rem;
        /* 10px 12px */
        font-size: 14px;
    }
}

/* 576px - Mobile */
@media (max-width: 576px) {
    .listings-page-header {
        padding: 0.625rem;
    }

    .listings-page-header h1 {
        font-size: 22px;
    }

    .featured-top-header {
        font-size: 0.8rem;
    }

    .detail-page-section {
        width: 100%;
        padding: 0 10px;
        box-sizing: border-box;
    }

    #listingsList .details-row,
    #userListingsList .details-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 12px;
        row-gap: 10px;
        width: 100%;
        overflow: visible;
    }

    #listingsList .details-row .detail-item,
    #userListingsList .details-row .detail-item {
        max-width: none;
        min-width: 0;
    }

    #listingsList .details-row .detail-item.region,
    #userListingsList .details-row .detail-item.region {
        grid-column: 1 / -1;
    }

    .listing {
        padding: 0.75rem;
    }

    .page-header {
        margin-bottom: 2rem;
    }

    .page-title {
        font-size: 1.75rem;
    }

    .page-subtitle {
        font-size: 1rem;
    }

    .listings-controls {
        padding: 0.625rem;
    }

    .sort-control {
        padding: 0.625rem 0.75rem;
        /* 10px 12px */
        font-size: 14px;
    }

    #filterForm+.filter-actions {
        gap: 10px;
        margin-bottom: 0.625rem;
    }

    #filterForm+.filter-actions .listings-controls-left {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        width: 100%;
    }

    #filterForm+.filter-actions .listings-controls-left>div {
        width: 100%;
    }

    #filterForm+.filter-actions .sort-control {
        width: 100%;
        min-width: 0;
        max-width: none;
    }

    #filterForm+.filter-actions #enableNotifications {
        min-height: 42px;
    }

    #filterForm+.filter-actions .search-box {
        width: 100%;
        min-width: 0;
    }

    .listing-title {
        font-size: 1.1em;
    }

    .listing-meta {
        gap: 10px;
        font-size: 14px;
    }

    .listing-actions {
        justify-content: center;
        width: 100%;
    }

    .listing-description {
        font-size: 14px;
    }

    .listing-info-panel .contact-btn.primary {
        max-width: none;
        margin-left: 0;
        margin-right: 0;
    }

    .detail-title {
        font-size: 1.35rem;
    }

    .detail-description {
        font-size: 0.95rem;
    }

    .access-modal {
        max-width: 360px;
    }

    .info-section h3 {
        font-size: 1.15rem;
    }

    .info-item {
        padding: 0.65rem 0;
    }

    .info-item svg {
        width: 18px;
        height: 18px;
    }

    .info-item span {
        font-size: 0.875rem;
    }

    /* Moje ogłoszenia - responsywność */
    #userListingsList .listing-footer {
        flex-direction: column;
        align-items: stretch;
    }

    #userListingsList .listing-badges {
        justify-content: flex-start;
    }

    #userListingsList .listing-actions {
        justify-content: flex-start;
        margin-left: 0;
        width: 100%;
        gap: 8px;
    }

    #userListingsList .action-btn span {
        display: none;
    }

    #userListingsList .action-btn {
        padding: 0.5rem;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 1 1 0;
        box-sizing: border-box;
    }

    .empty-state {
        padding: 3rem 1.5rem;
    }

    .empty-state h3 {
        font-size: 1.35rem;
    }

    .empty-state p {
        font-size: 0.95rem;
    }

    .deletion-survey-modal {
        padding: 1.5rem 1.25rem;
        border-radius: 12px;
    }

    .deletion-survey-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    /* Lista ogłoszeń i kontenery */
    .listings-page-header h1 {
        font-size: 20px;
    }

    .listings-page-header p {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    #listingsList,
    #userListingsList,
    #savedListingsList {
        margin: 1rem 0 0 0;
    }

    .listing {
        padding: 0.625rem;
    }

    .listing-header {
        margin: 0;
    }

    .listings-container,
    .listing-detail-container {
        padding: 0.5rem;
        gap: 8px;
        max-width: 100%;
    }

    .page-header {
        margin-bottom: 1.5rem;
    }

    .page-title {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .page-subtitle {
        font-size: 0.95rem;
    }

    .listing-card {
        padding: 1rem;
    }

    .listing-meta {
        gap: 8px;
        font-size: 13px;
        flex-wrap: wrap;
        width: 100%;
    }

    .listing-footer {
        gap: 8px;
        flex-wrap: wrap;
    }

    .listing-actions {
        gap: 6px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    #userListingsList .listing-actions {
        gap: 10px;
        flex-wrap: wrap;
        margin-bottom: 0.5rem;
    }

    #userListingsList .action-btn {
        flex: 1 1 calc(50% - 5px);
        min-height: 42px;
        padding: 0.375rem 0.625rem;
        font-size: 12.5px;
    }

    #userListingsList .action-btn span {
        display: inline;
    }

    #userListingsList .action-btn svg {
        width: 16px;
        height: 16px;
    }

    .listing-description {
        font-size: 14px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .listing-info-panel {
        padding: 0.5rem;
    }

    .listings-controls {
        gap: 10px;
    }

    .sort-control {
        padding: 0.5rem 0.625rem;
        /* 8px 10px */
        font-size: 14px;
        min-height: 44px;
    }

    .listings-controls-left {
        gap: 8px;
        width: 100%;
    }

    .search-filters {
        padding: 1rem;
    }

    .listing-content,
    .listing-sidebar {
        padding: 1rem 0.25rem;
    }

    .detail-title {
        font-size: 1.25rem;
    }

    .detail-description {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .access-modal {
        max-width: 100%;
        margin: 0.5rem;
        border-radius: 8px;
    }

    .access-modal-header {
        padding: 0.875rem 1rem;
    }

    .access-modal-header h3 {
        font-size: 1rem;
    }

    .access-modal-body {
        padding: 1rem;
    }

    .access-modal-footer {
        padding: 0.75rem 1rem;
        flex-direction: column;
    }

    .access-modal-footer .btn {
        width: 100%;
        justify-content: center;
    }

    .info-section {
        margin-bottom: 1.5rem;
    }

    .info-section h3 {
        font-size: 1.05rem;
        margin-bottom: 0.85rem;
    }

    .contact-section {
        padding: 1.25rem;
    }

    .empty-state {
        padding: 2.5rem 1rem;
    }

    .empty-state h3 {
        font-size: 1.25rem;
    }

    .empty-state p {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }

    .empty-state-icon {
        width: 3.5rem;
        height: 3.5rem;
        margin-bottom: 1.25rem;
    }

    .deletion-survey-modal {
        padding: 1.25rem 1rem;
    }
}

/* 420px - Mobile extra small */
@media (max-width: 420px) {
    .listing-detail-container {
        gap: 6px;
        overflow-x: hidden;
    }

    .listing-info-panel {
        padding: 0.375rem;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    #listingsList .details-row,
    #userListingsList .details-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 2px;
        row-gap: 8px;
        overflow: visible;
    }

    #listingsList .details-row .detail-item.region,
    #userListingsList .details-row .detail-item.region {
        grid-column: 1 / -1;
    }

    #filterForm+.filter-actions .sort-control {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        font-size: 13px;
    }

    #filterForm+.filter-actions .search-box input {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        font-size: 13px;
    }

    .listing-detail-container {
        gap: 6px;
        overflow-x: hidden;
    }

    .listing-info-panel {
        padding: 0.375rem;
        box-sizing: border-box;
        overflow-x: hidden;
    }
}

@media (prefers-reduced-motion: reduce) {
    .deletion-survey-modal {
        animation: none;
    }
}

.deletion-survey-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}

.deletion-survey-close:hover {
    background: #f0f0f0;
    color: #333;
}

.deletion-survey-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 0.625rem 0;
    padding-right: 2rem;
    text-align: center;
    line-height: 1.3;
}

.deletion-survey-subtitle {
    font-size: 0.875rem;
    color: #666;
    text-align: center;
    margin: 0 0 1.5rem 0;
    line-height: 1.5;
}

.deletion-survey-options {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    margin-bottom: 1.75rem;
}

.deletion-survey-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0.875rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
    user-select: none;
}

.deletion-survey-option:hover {
    background: #f5f7fa;
}

.deletion-survey-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.deletion-survey-radio {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 2px solid #c8cdd5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s ease;
}

.deletion-survey-option input[type="radio"]:checked ~ .deletion-survey-radio {
    border-color: #003153;
}

.deletion-survey-option input[type="radio"]:checked ~ .deletion-survey-radio::after {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    background: #003153;
    border-radius: 50%;
}

.deletion-survey-option-text {
    font-size: 1rem;
    color: #222;
    line-height: 1.4;
}

.deletion-survey-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #f0f0f0;
}