/**
 * Style frontendowe – shortcody Deweloper Oferty
 *
 * v2.0: Dodano style dla elementów dodatkowych (badge statusu,
 *       wiersz ceny łącznej) i rozszerzonej historii cen.
 *       Istniejące style niezmienione.
 */

/* ============ Karta lokalu ============ */
.dew-lokal-card {
    max-width: 600px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0;
    margin: 20px 0;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    color: #333;
    overflow: hidden;
}

.dew-lokal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}
.dew-lokal-header h3 {
    margin: 0;
    font-size: 1.3em;
    color: #1a1a1a;
}

.dew-lokal-investment {
    padding: 12px 20px;
    background: #fafbfc;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    color: #555;
}

/* Statusy */
.dew-lokal-status {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.dew-status-wolny {
    background: #d4edda;
    color: #155724;
}
.dew-status-zarezerwowany {
    background: #fff3cd;
    color: #856404;
}
.dew-status-sprzedany {
    background: #f8d7da;
    color: #721c24;
}

/* Tabela szczegółów lokalu */
.dew-lokal-details {
    width: 100%;
    border-collapse: collapse;
}
.dew-lokal-details td {
    padding: 10px 20px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}
.dew-lokal-details .dew-label {
    width: 45%;
    color: #666;
    font-weight: 500;
}
.dew-lokal-details .dew-price-row td {
    background: #fefce8;
}
.dew-lokal-details .dew-price {
    font-size: 1.15em;
    color: #1a7a1a;
}

/* Akcje pod kartą */
.dew-lokal-actions {
    padding: 16px 20px;
    text-align: center;
}

/* Dane dewelopera */
.dew-developer-info {
    padding: 16px 20px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    font-size: 13px;
    color: #666;
}
.dew-developer-info h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #444;
}

/* ============ Tabela inwestycji ============ */
.dew-inwestycja-wrap {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    color: #333;
}

.dew-inwestycja-header {
    margin-bottom: 16px;
}
.dew-inwestycja-header h3 {
    margin: 0 0 4px 0;
    font-size: 1.4em;
    color: #1a1a1a;
}
.dew-inwestycja-address {
    color: #666;
    margin: 0;
}

.dew-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.dew-inwestycja-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.dew-inwestycja-table thead th {
    background: #2c3e50;
    color: #fff;
    padding: 12px 14px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.dew-inwestycja-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}
.dew-inwestycja-table tbody tr:hover {
    background: #f8f9fa;
}
.dew-td-price {
    font-weight: 600;
    color: #1a7a1a;
}

/* Kolorowe wiersze na podstawie statusu */
.dew-status-row-zarezerwowany {
    background: #fffce8;
}
.dew-status-row-sprzedany {
    background: #fff5f5;
}
.dew-status-row-sprzedany td {
    color: #999;
}

/* ============ Przyciski ============ */
.dew-btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
}
.dew-btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}
.dew-btn-history {
    background: #0d9488;
    color: #fff;
}
.dew-btn-history:hover {
    background: #0f766e;
    color: #fff;
}

/* ============ Modal – popup historii cen ============ */
.dew-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.55);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.dew-modal {
    background: #fff;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    animation: dewModalIn 0.25s ease;
}

@keyframes dewModalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.dew-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #eee;
}
.dew-modal-header h3 {
    margin: 0;
    font-size: 1.2em;
}

.dew-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #888;
    padding: 0 4px;
    line-height: 1;
}
.dew-modal-close:hover {
    color: #333;
}

.dew-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
}

.dew-modal-loading {
    text-align: center;
    color: #888;
    padding: 20px 0;
    font-style: italic;
}

/* Tabela historii w modalu */
/* ============ Historia cen – lista chronologiczna ============ */
.dew-history-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.dew-history-entry {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
}

.dew-history-entry:last-child {
    border-bottom: none;
}

.dew-history-entry.dew-history-current {
    background: #f0fdf4;
    border-bottom: 2px solid #86efac;
    border-radius: 8px 8px 0 0;
}

.dew-history-entry.dew-history-current .dew-history-date {
    color: #166534;
    font-weight: 700;
}

.dew-history-entry.dew-history-current .dew-history-price-main {
    color: #166534;
}

.dew-history-date {
    flex: 0 0 auto;
    min-width: 100px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
}

.dew-history-prices {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.dew-history-price-main {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.dew-history-price-detail {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 400;
}

.dew-no-history {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 20px 0;
}

.dew-lowest-price {
    margin-top: 14px;
    padding: 10px 14px;
    background: #f0f6fc;
    border-left: 3px solid #2271b1;
    border-radius: 4px;
    font-size: 14px;
}

@media (max-width: 640px) {
    .dew-history-entry {
        flex-direction: column;
        gap: 4px;
        padding: 10px 12px;
    }
    .dew-history-date {
        min-width: auto;
    }
}

/* Komunikaty błędów */
.dew-error {
    color: #721c24;
    background: #f8d7da;
    padding: 10px 15px;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
}

/* ============ v2.0: Elementy dodatkowe ============ */

/* Badge statusu elementu dodatkowego */
.dew-addon-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    vertical-align: middle;
}
.dew-addon-obowiazkowy {
    background: #fff3cd;
    color: #856404;
}
.dew-addon-opcjonalny {
    background: #d1ecf1;
    color: #0c5460;
}
.dew-addon-wliczony {
    background: #d4edda;
    color: #155724;
}

/* Cena elementu dodatkowego */
.dew-addon-price {
    font-weight: 600;
    color: #555;
}

/* Wiersz elementu dodatkowego */
.dew-addon-row td {
    background: #f9fafb;
}

/* Wiersz ceny łącznej */
.dew-total-row td {
    background: #edf5e1;
    border-top: 2px solid #c3dea0;
}
.dew-total-price {
    font-size: 1.2em;
    color: #1a7a1a;
}
.dew-total-note {
    font-size: 12px;
    color: #888;
    font-weight: 400;
}

/* Kolumna dodatków w tabeli inwestycji */
.dew-td-addons {
    font-size: 12px;
    color: #666;
}
.dew-addons-summary {
    white-space: normal;
    word-break: break-word;
}

/* ============ Karta lokalu (v2.1) ============ */
.dew-btn-karta {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
    text-decoration: none;
    display: inline-block;
}
.dew-btn-karta:hover {
    background: #c8e6c9;
    color: #1b5e20;
    text-decoration: none;
}

/* ============ Przycisk "Zobacz więcej" (v2.1.1) ============ */
.dew-btn-more {
    background: #f3e5f5;
    color: #7b1fa2;
    border: 1px solid #ce93d8;
    text-decoration: none;
    display: inline-block;
}
.dew-btn-more:hover {
    background: #e1bee7;
    color: #4a148c;
    text-decoration: none;
}

/* ============ Informacja VAT (v2.1) ============ */
.dew-vat-info {
    font-size: 12px;
    color: #888;
    font-style: italic;
    margin: 12px 0 4px 0;
    padding: 0 20px;
}
.dew-inwestycja-wrap .dew-vat-info {
    padding: 0;
    margin-top: 8px;
}

/* ============ Mapa budynku – podświetlenie (v2.1) ============ */
tr.dew-unit-highlighted {
    background-color: #fff3cd !important;
    outline: 2px solid #ffc107;
    outline-offset: -2px;
    animation: dew-highlight-pulse 0.6s ease-in-out;
}
@keyframes dew-highlight-pulse {
    0%   { background-color: #ffc107; }
    50%  { background-color: #fff3cd; }
    100% { background-color: #fff3cd; }
}
[data-dew-unit] {
    cursor: pointer;
}

/* Kolumna akcji w tabeli */
.dew-td-actions {
    white-space: nowrap;
}
.dew-td-actions .dew-btn {
    margin-right: 4px;
    margin-bottom: 4px;
}

/* ============ Panel filtrów (v2.1.1) ============ */
.dew-filtry-wrap {
    margin: 0 0 28px 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    color: #333;
    box-sizing: border-box;
}
.dew-filtry-wrap *,
.dew-filtry-wrap *::before,
.dew-filtry-wrap *::after {
    box-sizing: border-box;
}

/* Główny pasek – horyzontalny na desktopie */
.dew-filtry-wrap .dew-filtry-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: stretch;
    gap: 0;
    margin: 0;
    background: #fff;
    border: 1px solid #e2e5e9;
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    overflow: hidden;
    width: 100%;
}

/* Każda grupa filtrów – sekcja w pasku */
.dew-filtry-wrap .dew-filtr-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    min-width: 0;
    flex-shrink: 1;
    border-right: 1px solid #eef0f2;
    white-space: nowrap;
}
.dew-filtry-wrap .dew-filtr-group:last-child {
    border-right: none;
}
.dew-filtry-wrap .dew-filtr-group-price {
    flex: 1 1 auto;
}

.dew-filtry-wrap .dew-filtr-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.dew-filtry-wrap .dew-filtr-options {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
}

/* Przyciski pięter */
.dew-filtry-wrap .dew-filtr-btn {
    padding: 5px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    color: #6b7280;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    line-height: 1.4;
    font-weight: 500;
}
.dew-filtry-wrap .dew-filtr-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #374151;
}
.dew-filtry-wrap .dew-filtr-btn.active {
    background: #1f2937;
    color: #fff;
    border-color: #1f2937;
}

/* Counter pokoi +/- */
.dew-filtry-wrap .dew-filtr-rooms-options {
    gap: 0;
}
.dew-filtry-wrap .dew-filtr-counter-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #374151;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    line-height: 1;
    padding: 0;
}
.dew-filtry-wrap .dew-filtr-counter-btn:first-child {
    border-radius: 8px 0 0 8px;
}
.dew-filtry-wrap .dew-filtr-counter-btn:last-child {
    border-radius: 0 8px 8px 0;
}
.dew-filtry-wrap .dew-filtr-counter-btn:hover {
    background: #e5e7eb;
}

.dew-filtry-wrap .dew-filtr-rooms-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    height: 32px;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    text-align: center;
    padding: 0 6px;
}

/* Status select */
.dew-filtry-wrap .dew-filtr-select {
    padding: 6px 28px 6px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%236b7280' d='M2 3.5l3 3.5 3-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color 0.15s ease;
    height: 32px;
}
.dew-filtry-wrap .dew-filtr-select:hover {
    border-color: #9ca3af;
}
.dew-filtry-wrap .dew-filtr-select:focus {
    outline: 2px solid #2563eb;
    outline-offset: -1px;
}

/* Przedział cenowy – inline */
.dew-filtry-wrap .dew-filtr-price-inputs {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}
.dew-filtry-wrap .dew-filtr-price-field {
    display: flex;
    align-items: center;
    gap: 4px;
}
.dew-filtry-wrap .dew-filtr-price-prefix,
.dew-filtry-wrap .dew-filtr-price-suffix {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 500;
}
.dew-filtry-wrap .dew-filtr-price-sep {
    color: #d1d5db;
    font-size: 13px;
    padding: 0 2px;
}
.dew-filtry-wrap .dew-filtr-price-field input[type="number"] {
    width: 90px;
    padding: 6px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    text-align: right;
    background: #f9fafb;
    transition: border-color 0.15s ease;
    height: 32px;
    -moz-appearance: textfield;
}
.dew-filtry-wrap .dew-filtr-price-field input[type="number"]::-webkit-inner-spin-button,
.dew-filtry-wrap .dew-filtr-price-field input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.dew-filtry-wrap .dew-filtr-price-field input:hover {
    border-color: #9ca3af;
}
.dew-filtry-wrap .dew-filtr-price-field input:focus {
    outline: 2px solid #2563eb;
    outline-offset: -1px;
    background: #fff;
}

/* Szukaj / Wyczyść – wbudowane w pasek */
.dew-filtry-wrap .dew-filtry-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 18px;
    margin: 0;
    flex-shrink: 0;
    white-space: nowrap;
}
.dew-filtry-wrap .dew-filtr-btn-search {
    padding: 7px 22px;
    border: none;
    border-radius: 10px;
    background: #1f2937;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.dew-filtry-wrap .dew-filtr-btn-search:hover {
    background: #111827;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.dew-filtry-wrap .dew-filtr-btn-clear {
    padding: 7px 14px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    height: 32px;
    display: inline-flex;
    align-items: center;
}
.dew-filtry-wrap .dew-filtr-btn-clear:hover {
    color: #374151;
    background: #f3f4f6;
}

/* Info o wynikach */
.dew-filtr-results-info {
    margin-top: 10px;
    padding: 10px 16px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #92400e;
}

/* ============ Responsywność filtrów ============ */

/* Laptop / mniejszy desktop – grid 2×2 + cena na dole */
@media (max-width: 1200px) {
    .dew-filtry-wrap .dew-filtry-row {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        border-radius: 14px;
    }
    .dew-filtry-wrap .dew-filtr-group {
        border-right: none;
        border-bottom: 1px solid #eef0f2;
        padding: 12px 16px;
    }
    .dew-filtry-wrap .dew-filtr-group:nth-child(odd) {
        border-right: 1px solid #eef0f2;
    }
    .dew-filtry-wrap .dew-filtr-group-price {
        grid-column: 1 / -1;
    }
    .dew-filtry-wrap .dew-filtry-actions {
        grid-column: 1 / -1;
        border-top: none;
        justify-content: center;
    }
}

/* Tablet – stos, 2 kolumny piętro/pokoje */
@media (max-width: 768px) {
    .dew-lokal-card {
        max-width: 100%;
    }
    .dew-inwestycja-table thead th,
    .dew-inwestycja-table tbody td {
        padding: 8px 10px;
        font-size: 13px;
    }
    .dew-modal {
        max-width: 95vw;
    }
    .dew-td-actions {
        white-space: normal;
    }
    .dew-filtry-wrap .dew-filtry-row {
        display: flex !important;
        flex-direction: column !important;
        border-radius: 14px;
    }
    .dew-filtry-wrap .dew-filtr-group {
        border-right: none;
        border-bottom: 1px solid #eef0f2;
        padding: 12px 16px;
        flex-wrap: wrap;
    }
    .dew-filtry-wrap .dew-filtr-group:nth-child(odd) {
        border-right: none;
    }
    .dew-filtry-wrap .dew-filtr-group:last-child {
        border-bottom: none;
    }
    .dew-filtry-wrap .dew-filtr-options {
        flex-wrap: wrap;
    }
    .dew-filtry-wrap .dew-filtr-price-inputs {
        flex-wrap: wrap;
    }
    .dew-filtry-wrap .dew-filtr-price-field {
        flex: 1 1 auto;
    }
    .dew-filtry-wrap .dew-filtr-price-field input[type="number"] {
        width: 100%;
        flex: 1;
    }
    .dew-filtry-wrap .dew-filtr-price-sep {
        display: none;
    }
    .dew-filtry-wrap .dew-filtry-actions {
        padding: 12px 16px;
        border-top: 1px solid #eef0f2;
        justify-content: center;
    }
    .dew-filtry-wrap .dew-filtr-btn-search {
        flex: 1;
        justify-content: center;
    }
}

/* ============ Badges typów pomieszczeń ============ */
.dew-premise-type {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.dew-premise-type-miejsce_parkingowe {
    background: #dbeafe;
    color: #1d4ed8;
}

.dew-premise-type-garaz {
    background: #e0e7ff;
    color: #4338ca;
}

.dew-premise-type-komorka_lokatorska {
    background: #fef3c7;
    color: #92400e;
}

.dew-premise-type-pomieszczenie_przynalezne {
    background: #f3e8ff;
    color: #7c3aed;
}

/* ============ Widok kafelkowy (cards) ============ */

/* --- Legenda / nagłówek --- */
.dew-cards-legend {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 24px;
    padding: 10px 24px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-bottom: 2px solid #cbd5e1;
    border-radius: 8px 8px 0 0;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}

@media (max-width: 768px) {
    .dew-cards-legend {
        display: none;
    }
}

.dew-cards-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* === Karta lokalu / pomieszczenia === */
.dew-unit-card {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 16px 24px;
    padding: 18px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
    transition: background 0.3s;
}

.dew-unit-card:first-child {
    border-top: 1px solid #e5e7eb;
}

/* Gdy jest legenda powyżej — nie podwajaj górnej krawędzi */
.dew-cards-legend + .dew-cards-list .dew-unit-card:first-child {
    border-top: none;
}

.dew-unit-card:hover {
    background: #f9fafb;
}

/* Highlight dla map */
.dew-unit-card.dew-unit-highlighted {
    background: #fef9c3;
    box-shadow: inset 4px 0 0 #eab308;
}

/* Status tło karty */
.dew-unit-card.dew-status-row-sprzedany {
    background: #fef2f2;
}
.dew-unit-card.dew-status-row-zarezerwowany {
    background: #fffbeb;
}

/* -- Top: numer + status + meta -- */
.dew-card-top {
    min-width: 0;
}

.dew-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.dew-card-number {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.3px;
}

.dew-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: #6b7280;
}

.dew-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* -- Info: cena, metraż, m2 -- */
.dew-card-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.dew-card-area {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
}

.dew-card-price {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.dew-card-ppm {
    font-size: 13px;
    color: #6b7280;
}

.dew-card-addons {
    font-size: 12px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
}

/* -- Przyciski -- */
.dew-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* === RESPONSIVE: Mobile cards === */
@media (max-width: 768px) {
    .dew-cards-list {
        gap: 12px;
        padding: 0 4px;
    }

    .dew-unit-card {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 16px 18px;
        border: 1px solid #e5e7eb;
        border-radius: 14px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    }

    .dew-unit-card:first-child {
        border-top: 1px solid #e5e7eb;
    }

    .dew-card-title {
        margin-bottom: 2px;
    }

    .dew-card-number {
        font-size: 22px;
    }

    .dew-card-info {
        gap: 10px;
    }

    .dew-card-price {
        font-size: 15px;
    }

    .dew-card-actions {
        justify-content: center;
        flex-wrap: wrap;
        padding-top: 6px;
        border-top: 1px solid #f3f4f6;
    }

    .dew-card-actions .dew-btn {
        flex: 1;
        min-width: 0;
        text-align: center;
        justify-content: center;
        font-size: 12px;
        padding: 8px 10px;
    }
}

/* ============ Lightbox – karta lokalu ============ */
.dew-lightbox-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.dew-lightbox-overlay.dew-lightbox-visible {
    opacity: 1;
}

.dew-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dew-lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    object-fit: contain;
}

.dew-lightbox-close {
    position: absolute;
    top: -16px;
    right: -16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: none;
    font-size: 24px;
    line-height: 40px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 1;
    color: #374151;
    transition: background 0.2s;
}

.dew-lightbox-close:hover {
    background: #f3f4f6;
}

.dew-lightbox-title {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
}

.dew-lightbox-footer {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.dew-lightbox-download {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    background: #2563eb;
    padding: 6px 16px;
    border-radius: 6px;
    transition: background 0.2s;
}

.dew-lightbox-download:hover {
    background: #1d4ed8;
    color: #fff;
}

.dew-lightbox-newtab {
    color: #d1d5db;
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s;
}

.dew-lightbox-newtab:hover {
    color: #fff;
}

@media (max-width: 640px) {
    .dew-lightbox-overlay {
        padding: 10px;
    }
    .dew-lightbox-close {
        top: -12px;
        right: -8px;
        width: 36px;
        height: 36px;
        font-size: 20px;
        line-height: 36px;
    }
}
