* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background: #f5f6f7;
    color: #222;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: 94%;
    max-width: 1100px;
    margin: 0 auto;
}


/* HEADER */

.site-header {
    background: #fff;
    border-bottom: 1px solid #ddd;
}

.header-inner {
    min-height: 65px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;
}

.logo {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.logo img {
    display: block;
    width: auto;
    height: 46px;
    max-width: 260px;
}

@media (max-width: 700px) {
    .logo img {
        height: 38px;
        max-width: 215px;
    }
}

nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

nav a {
    color: #444;
}

nav a:hover {
    color: #000;
}


/* BUTTONS */

.btn {
    display: inline-block;

    background: #222;
    color: #fff;

    border: 0;
    border-radius: 6px;

    padding: 12px 20px;

    cursor: pointer;
}

.btn:hover {
    opacity: .85;
}

.btn-small {
    padding: 8px 14px;
}


/* MAIN */

main.container {
    min-height: 70vh;
    padding-top: 30px;
    padding-bottom: 40px;
}


/* FORMS */

.form-box {
    max-width: 550px;
    margin: 0 auto;

    background: #fff;

    padding: 30px;

    border-radius: 10px;
    border: 1px solid #ddd;
}

.form-box h1 {
    margin-top: 0;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;

    margin-bottom: 7px;

    font-weight: bold;
}

input,
textarea,
select {
    width: 100%;

    padding: 12px;

    border: 1px solid #ccc;
    border-radius: 6px;

    font-size: 16px;

    background: #fff;
}

textarea {
    min-height: 130px;
    resize: vertical;
}


/* ALERT */

.alert {
    padding: 13px 16px;

    margin-bottom: 20px;

    border-radius: 6px;

    background: #fff3cd;
    border: 1px solid #ffe69c;
}


/* FOOTER */

.site-footer {
    background: #222;
    color: #fff;

    padding: 35px 0;

    margin-top: 40px;
}

.site-footer p {
    color: #bbb;
}


/* MOBILE */

@media (max-width: 700px) {

    .header-inner {
        flex-direction: column;
        padding: 15px 0;
    }

    nav {
        width: 100%;

        justify-content: center;

        flex-wrap: wrap;
    }

    .form-box {
        padding: 20px;
    }
}

.ads-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.ad-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 20px;
}

.ad-card h3 {
    margin-top: 0;
}

@media (max-width: 800px) {

    .ads-list {
        grid-template-columns: 1fr;
    }

}

.form-group small {
    display: block;
    margin-top: 6px;
    color: #777;
}

/* HERO */

.hero {
    text-align: center;
    padding: 45px 20px;
}

.hero h1 {
    font-size: 42px;
    line-height: 1.15;
    margin: 0 0 15px;
}

.hero p {
    color: #666;
    font-size: 18px;
}


/* SEARCH */

.search-box {
    max-width: 850px;
    margin: 30px auto 0;

    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;

    gap: 10px;
}


/* ACTIONS */

.main-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 20px;

    margin-bottom: 40px;
}

.action-button {
    background: #fff;

    border: 1px solid #ddd;
    border-radius: 12px;

    padding: 25px;

    text-align: center;

    transition: transform .15s;
}

.action-button:hover {
    transform: translateY(-2px);
}

.action-button strong,
.action-button span {
    display: block;
}

.action-button strong {
    font-size: 21px;
    margin-top: 8px;
}

.action-button span {
    color: #777;
    margin-top: 5px;
}


/* CATEGORIES */

.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;

    margin-bottom: 40px;
}

.category {
    background: #fff;

    border: 1px solid #ddd;
    border-radius: 20px;

    padding: 9px 15px;
}

.category:hover {
    background: #eee;
}


/* ADS */

.ads-section {
    margin-top: 20px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title span {
    background: #ddd;

    padding: 4px 10px;

    border-radius: 15px;

    font-size: 13px;
}


.ads-grid {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 20px;
}


.ad-card {
    background: #fff;

    border: 1px solid #ddd;

    border-radius: 10px;

    overflow: hidden;

    transition:
        transform .15s,
        box-shadow .15s;
}

.ad-card:hover {
    transform: translateY(-3px);

    box-shadow:
        0 5px 20px rgba(0,0,0,.08);
}


.ad-card-image,
.ad-card-no-image {
    width: 100%;
    height: 200px;

    display: block;

    object-fit: cover;
}

.ad-card-no-image {
    display: flex;

    align-items: center;
    justify-content: center;

    background: #eee;

    font-size: 50px;
}


.ad-card-body {
    padding: 15px;
}

.ad-card h3 {
    margin: 0 0 8px;

    font-size: 18px;
}

.ad-card-category,
.ad-card-location {
    color: #777;

    font-size: 14px;

    margin-top: 5px;
}

.free-label {
    margin-top: 12px;

    font-weight: bold;
}


/* VIEW AD */

.ad-page {
    display: grid;

    grid-template-columns:
        minmax(0, 2fr)
        minmax(250px, 1fr);

    gap: 30px;
}


.ad-main {
    background: #fff;

    border: 1px solid #ddd;

    border-radius: 10px;

    overflow: hidden;
}


.ad-main-image {
    background: #eee;

    height: 500px;

    display: flex;

    align-items: center;
    justify-content: center;
}


.ad-main-image img {
    width: 100%;
    height: 100%;

    object-fit: contain;
}


.ad-thumbnails {
    display: flex;

    gap: 10px;

    padding: 12px;

    overflow-x: auto;
}


.ad-thumbnail {
    border: 2px solid transparent;

    background: none;

    padding: 0;

    cursor: pointer;
}


.ad-thumbnail img {
    width: 80px;
    height: 65px;

    object-fit: cover;
}


.ad-thumbnail:hover {
    border-color: #222;
}


.no-image {
    height: 300px;

    display: flex;

    align-items: center;
    justify-content: center;

    background: #eee;

    font-size: 30px;
}


.ad-info {
    padding: 25px;
}


.ad-category {
    color: #777;

    font-size: 14px;
}


.ad-info h1 {
    font-size: 32px;

    margin: 8px 0;
}


.ad-location {
    color: #666;

    margin-bottom: 25px;
}


.ad-description {
    white-space: normal;

    line-height: 1.6;

    font-size: 17px;
}


.ad-date {
    color: #999;

    font-size: 13px;

    margin-top: 30px;
}


/* SIDEBAR */

.seller-box,
.free-box {
    background: #fff;

    border: 1px solid #ddd;

    border-radius: 10px;

    padding: 22px;

    margin-bottom: 20px;
}


.seller-box h2 {
    margin-top: 0;
}


.seller-name {
    font-size: 20px;

    font-weight: bold;

    margin-bottom: 8px;
}


.seller-date {
    color: #777;

    font-size: 14px;

    margin-bottom: 20px;
}


.btn-full {
    width: 100%;

    text-align: center;
}


.free-box {
    text-align: center;

    font-size: 18px;
}


.free-box strong {
    display: block;

    margin-top: 10px;
}


.free-box p {
    color: #777;

    font-size: 14px;
}


/* EMPTY */

.empty-box {
    background: #fff;

    border: 1px solid #ddd;

    border-radius: 10px;

    padding: 40px;

    text-align: center;
}


/* MOBILE */

@media (max-width: 900px) {

    .ads-grid {
        grid-template-columns:
            repeat(2, 1fr);
    }

    .search-box {
        grid-template-columns: 1fr;
    }

    .ad-page {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 600px) {

    .hero h1 {
        font-size: 32px;
    }

    .main-actions {
        grid-template-columns: 1fr;
    }

    .ads-grid {
        grid-template-columns: 1fr;
    }

    .ad-main-image {
        height: 350px;
    }

    .ad-info h1 {
        font-size: 26px;
    }

}

/* MESSAGES */

.messages-page {
    max-width: 800px;
    margin: 0 auto;
}


.messages-header {
    margin-bottom: 20px;
}


.messages-header h1 {
    margin-bottom: 0;
}


.message-ad {
    background: #fff;

    border: 1px solid #ddd;

    border-radius: 8px;

    padding: 12px 15px;

    margin-bottom: 15px;

    color: #666;
}


.messages-box {
    background: #eee;

    border: 1px solid #ddd;

    border-radius: 10px;

    padding: 20px;

    min-height: 350px;

    display: flex;

    flex-direction: column;

    gap: 12px;
}


.message {
    max-width: 75%;

    padding: 12px 15px;

    border-radius: 12px;
}


.message-me {
    align-self: flex-end;

    background: #222;

    color: #fff;

    border-bottom-right-radius: 3px;
}


.message-other {
    align-self: flex-start;

    background: #fff;

    border: 1px solid #ddd;

    border-bottom-left-radius: 3px;
}


.message-text {
    line-height: 1.45;
}


.message-date {
    font-size: 11px;

    margin-top: 6px;

    opacity: .6;
}


.message-form {
    margin-top: 15px;

    display: grid;

    grid-template-columns: 1fr auto;

    gap: 10px;
}


.message-form textarea {
    min-height: 80px;
}


.no-messages {
    text-align: center;

    color: #777;

    margin: auto;
}


@media (max-width: 600px) {

    .message {
        max-width: 90%;
    }

    .message-form {
        grid-template-columns: 1fr;
    }

}

/* DIALOGS */

.messages-list-page {
    max-width: 800px;
    margin: 0 auto;
}


.dialog-list {
    display: flex;
    flex-direction: column;

    gap: 10px;
}


.dialog {
    display: flex;

    gap: 15px;

    background: #fff;

    border: 1px solid #ddd;

    border-radius: 10px;

    padding: 15px;

    transition:
        transform .15s,
        box-shadow .15s;
}


.dialog:hover {
    transform: translateY(-2px);

    box-shadow:
        0 4px 15px rgba(0, 0, 0, .07);
}


.dialog-avatar {
    flex: 0 0 48px;

    width: 48px;
    height: 48px;

    border-radius: 50%;

    background: #222;

    color: #fff;

    display: flex;

    align-items: center;
    justify-content: center;

    font-weight: bold;

    font-size: 20px;
}


.dialog-content {
    min-width: 0;

    flex: 1;
}


.dialog-top {
    display: flex;

    justify-content: space-between;

    gap: 15px;
}


.dialog-top span {
    color: #999;

    font-size: 12px;

    white-space: nowrap;
}


.dialog-ad {
    color: #666;

    font-size: 13px;

    margin-top: 4px;
}


.dialog-message {
    color: #555;

    margin-top: 5px;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


@media (max-width: 600px) {

    .dialog-top {
        display: block;
    }

    .dialog-top span {
        display: block;

        margin-top: 4px;
    }

}

.wanted-page {
    max-width: 850px;
    margin: 0 auto;
}


.wanted-intro {
    color: #666;

    font-size: 17px;

    line-height: 1.5;

    margin-bottom: 25px;
}


.wanted-list {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 20px;
}


.wanted-card {
    background: #fff;

    border: 1px solid #ddd;

    border-radius: 10px;

    padding: 20px;
}


.wanted-card h3 {
    margin-top: 0;
}


.wanted-card p {
    line-height: 1.5;
}


@media (max-width: 700px) {

    .wanted-list {
        grid-template-columns: 1fr;
    }

}

.notification-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 20px;
    height: 20px;

    padding: 0 6px;

    margin-left: 4px;

    background: #e53935;
    color: #fff;

    border-radius: 10px;

    font-size: 12px;
    font-weight: bold;
}

.notifications-page {
    max-width: 800px;
    margin: 30px auto;
}

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification {
    display: flex;
    gap: 15px;

    padding: 18px;

    background: #fff;

    border: 1px solid #ddd;
    border-radius: 10px;
}

.notification.unread {
    border-left: 4px solid #2196f3;
    background: #f7fbff;
}

.notification-icon {
    font-size: 25px;
}

.notification-content {
    flex: 1;
}

.notification-text {
    font-size: 16px;
    margin-bottom: 8px;
}

.notification-date {
    color: #888;
    font-size: 13px;
    margin-bottom: 10px;
}

.empty-box {
    padding: 30px;
    text-align: center;
    background: #fff;
    border-radius: 10px;
    color: #777;
}

.page-description {
    color: #666;
    margin-bottom: 25px;
}

.wanted-matches {
    margin-top: 40px;
}

.wanted-matches h2,
.wanted-existing h2 {
    margin-bottom: 20px;
}

.wanted-existing {
    margin-top: 50px;
}

.wanted-card {
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    margin-bottom: 15px;
}

.wanted-card h3 {
    margin-top: 0;
}

.wanted-card p {
    color: #555;
    white-space: normal;
}

.wanted-card small {
    color: #888;
}

#ad-map {
    width: 100%;
    height: 400px;
    border-radius: 10px;
    border: 1px solid #ddd;
    overflow: hidden;
}

.leaflet-container {
    font-family: inherit;
}

@media (max-width: 600px) {

    #ad-map {
        height: 300px;
    }

}

.map-page {
    margin: 30px 0;
}

.map-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.map-toolbar h1 {
    margin-bottom: 5px;
}

.map-toolbar p {
    margin-top: 0;
    color: #666;
}

.map-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.map-controls select {
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
}

.main-map {
    width: 100%;
    height: 600px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #ddd;
}

.map-results {
    margin-top: 30px;
}

.map-ad-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.map-ad-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 15px 18px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
}

.map-ad-item strong {
    font-size: 17px;
}

.map-ad-item small {
    color: #777;
}

@media (max-width: 700px) {

    .map-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .map-controls {
        justify-content: space-between;
    }

    .main-map {
        height: 450px;
    }

    .map-ad-item {
        flex-direction: column;
        align-items: stretch;
    }

}

.main-map {
    display: block;
    width: 100%;
    height: 600px !important;
    min-height: 600px;
    border: 2px solid red;
    border-radius: 12px;
    overflow: hidden;
    background: #eee;
}

.main-map {
    display: block;
    width: 100%;
    height: 600px !important;
    min-height: 600px;
    border: 2px solid red;
    border-radius: 12px;
    overflow: hidden;
    background: #eee;
}

.leaflet-container {
    width: 100%;
    height: 100%;
}

/* CSP F2: klasės vietoje inline style atributų */
.csp-honeypot { position:absolute; left:-10000px; width:1px; height:1px; overflow:hidden; }
.mt-6 { margin-top:6px; }
.mt-8 { margin-top:8px; }
.mt-10 { margin-top:10px; }
.mt-15 { margin-top:15px; }
.mt-25 { margin-top:25px; }
.mt-2em { margin-top:2em; }
.mb-6 { margin-bottom:6px; }
.my-30 { margin:30px 0; }
.my-35 { margin:35px 0; }
.my-40 { margin:40px 0; }
.w100-my8 { width:100%; margin:8px 0; }
.inline-form { display:inline; margin:0; }
.inline-block-mr8 { display:inline-block; margin-right:8px; }
.inline-block { display:inline-block; }
.flex-gap8-wrap { display:flex; gap:8px; flex-wrap:wrap; }
.dispute-scroll { max-height:600px; overflow-y:auto; }
.dispute-row { padding:10px 0; border-bottom:1px solid #ddd; }
.dispute-image { display:block; width:auto; max-width:320px; height:auto; max-height:320px; object-fit:contain; border-radius:8px; }
.card-pad { padding:0 14px 14px; }
.transfer-ok { margin:15px 0; padding:12px; background:#d1e7dd; border-radius:8px; }
.transfer-warn { margin:15px 0; padding:12px; background:#fff3cd; border-radius:8px; }
.dispute-thumb { width:100%; max-width:240px; height:150px; object-fit:cover; border-radius:8px; }

.delete-confirm { display:flex; align-items:center; gap:8px; width:100%; }
.delete-confirm-box { width:18px !important; height:18px; min-width:18px; margin:0 !important; padding:0; flex:0 0 18px; }

.admin-role-row { padding:12px 0; border-bottom:1px solid #ddd; }
.admin-role-row:last-child { border-bottom:0; }
.admin-role-form { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-top:8px; }
.admin-role-form input[type="password"] { max-width:260px; margin:0; }
.muted { opacity:.72; }

/* Private message photo attachments — UI fix */
.message-image-wrap {
    margin-top:8px;
    width:fit-content;
    max-width:100%;
}
.message-image-wrap a {
    display:block;
    width:fit-content;
    max-width:100%;
}
.messages-box .message .message-image {
    display:block !important;
    width:auto !important;
    height:auto !important;
    max-width:320px !important;
    max-height:320px !important;
    object-fit:contain !important;
    border-radius:8px;
}
.message-composer {
    margin-top:18px;
    padding:16px;
    background:#fff;
    border:1px solid #ddd;
    border-radius:10px;
}
.message-composer-title {
    margin-bottom:12px;
    font-weight:700;
}
.message-composer .message-form {
    margin:0;
    display:flex;
    flex-direction:column;
    gap:10px;
}
.message-composer .message-form textarea {
    display:block;
    width:100%;
    min-height:90px;
    resize:vertical;
    box-sizing:border-box;
    margin:0;
}
.message-form-actions {
    display:flex;
    gap:10px;
    align-items:flex-end;
    justify-content:space-between;
    flex-wrap:wrap;
}
.message-image-picker {
    display:flex;
    flex-direction:column;
    gap:6px;
    margin:0;
    flex:0 0 auto;
}
.message-image-picker input[type="file"] {
    width:100%;
    box-sizing:border-box;
}
.message-form-hint {
    display:block;
    opacity:.72;
}
.message-composer .message-form > .btn {
    align-self:flex-start;
    min-width:120px;
}
@media (max-width:600px) {
    .messages-box .message .message-image {
        width:auto !important;
        max-width:100% !important;
        max-height:320px !important;
    }
    .message-composer { padding:12px; }
    .message-composer .message-form > .btn { width:100%; }
}


/* Wanted: suggested item preview */
.wanted-matches .wanted-match-image {
    display: block;
    width: 100%;
    height: 200px;
    max-width: 100%;
    object-fit: cover;
}


/* Social sharing */
.share-box { margin-top:20px; padding-top:16px; border-top:1px solid #e2e2e2; }
.share-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.share-actions .btn { width:auto; margin:0; }
.share-status { display:block; min-height:1.3em; margin-top:8px; font-size:.9rem; opacity:.75; }


/* Map popup card: CSP-safe and fixed-size to prevent Leaflet auto-pan jumps */
.map-popup-card {
    width: 220px;
    max-width: 220px;
    overflow: hidden;
    line-height: 1.4;
}
.map-popup-image {
    display: block;
    width: 220px;
    height: 150px;
    max-width: 100%;
    object-fit: cover;
    border-radius: 8px;
    margin: 0 0 8px 0;
}
.leaflet-popup-content .map-popup-card img {
    width: 220px !important;
    height: 150px !important;
    max-width: 100% !important;
    object-fit: cover;
}


/* Home: horizontally scrollable latest ads */
.home-latest-carousel {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    padding: 4px 2px 16px;
    scrollbar-width: thin;
}
.home-latest-carousel .ad-card {
    flex: 0 0 calc((100% - 64px) / 5);
    min-width: 0;
    scroll-snap-align: start;
}
.home-latest-carousel .ad-card:hover { transform: none; }
.home-all-ads-card {
    flex: 0 0 calc((100% - 64px) / 5);
    min-width: 0;
    min-height: 280px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px;
    border: 2px dashed #1f8f5f;
    border-radius: 16px;
    text-align: center;
    text-decoration: none;
    background: rgba(31, 143, 95, 0.06);
}
.home-all-ads-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    font-size: 30px;
    line-height: 1;
    background: #1f8f5f;
    color: #fff;
}
.home-all-ads-card strong {
    font-size: 18px;
    line-height: 1.3;
}
@media (max-width: 1100px) {
    .home-latest-carousel .ad-card, .home-all-ads-card { flex-basis: calc((100% - 48px) / 4); }
}
@media (max-width: 850px) {
    .home-latest-carousel .ad-card, .home-all-ads-card { flex-basis: calc((100% - 32px) / 3); }
}
@media (max-width: 600px) {
    .home-latest-carousel { gap: 12px; padding-bottom: 12px; }
    .home-latest-carousel .ad-card,
    .home-all-ads-card {
        flex-basis: 82%;
        max-width: 320px;
    }
}


/* Clickable latest ads heading */
.section-title-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
}

.section-title-link:hover h2,
.section-title-link:focus-visible h2 {
    text-decoration: underline;
}


/* Home: horizontally scrollable wanted requests */
.home-wanted-section {
    margin-top: 28px;
}
.home-wanted-carousel .wanted-home-card {
    flex: 0 0 calc((100% - 64px) / 5);
    min-width: 0;
    scroll-snap-align: start;
}
.wanted-home-card {
    overflow: hidden;
}
.wanted-home-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 118px;
    font-size: 46px;
    background: rgba(31, 143, 95, 0.08);
}
.wanted-home-description {
    margin: 10px 0 12px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.wanted-label {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(31, 143, 95, 0.10);
    color: #176b48;
}
.wanted-all-description {
    -webkit-line-clamp: 5;
}
@media (max-width: 1100px) {
    .home-wanted-carousel .wanted-home-card { flex-basis: calc((100% - 48px) / 4); }
}
@media (max-width: 850px) {
    .home-wanted-carousel .wanted-home-card { flex-basis: calc((100% - 32px) / 3); }
}
@media (max-width: 600px) {
    .home-wanted-carousel .wanted-home-card {
        flex-basis: 82%;
        max-width: 320px;
    }
}


/* Wanted requests: clickable cards and detail page */
.wanted-card-link { display: block; color: inherit; text-decoration: none; }
.wanted-card-link:hover h3, .wanted-card-link:focus-visible h3 { text-decoration: underline; }
.wanted-detail-card { display: grid; grid-template-columns: minmax(180px, 280px) 1fr; gap: 28px; padding: 24px; border: 1px solid #ddd; border-radius: 14px; background: #fff; }
.wanted-detail-icon { min-height: 260px; display: flex; align-items: center; justify-content: center; border-radius: 12px; font-size: 72px; background: rgba(31,143,95,.08); }
.wanted-detail-content h1 { margin: 10px 0 12px; }
.wanted-detail-description { margin-top: 20px; line-height: 1.6; white-space: normal; }
.wanted-detail-date { margin-top: 18px; color: #777; font-size: 14px; }
.wanted-detail-owner { margin-top: 22px; padding-top: 18px; border-top: 1px solid #eee; }
.wanted-detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
@media (max-width: 650px) { .wanted-detail-card { grid-template-columns: 1fr; padding: 16px; } .wanted-detail-icon { min-height: 160px; } }


/* Admin: permanent ad deletion */
.admin-delete-ad-card .ad-card-image { max-width: 220px; height: 150px; object-fit: cover; border-radius: 10px; }
.admin-permanent-delete-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid #eee; display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.admin-permanent-delete-form label { flex: 1 1 220px; margin: 0; }
.btn-danger { background: #b42318; color: #fff; border-color: #b42318; }
.btn-danger:hover { background: #8f1c13; }


/* Admin: permanent wanted-request deletion */
.admin-delete-wanted-card .wanted-home-icon { max-width: 220px; min-height: 120px; border-radius: 10px; }
.admin-delete-wanted-card > p { overflow-wrap: anywhere; }


/* Ad gallery: extra photos open in a large lightbox */
.ad-photo-lightbox[hidden] { display: none !important; }
.ad-photo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.88);
}
.ad-photo-lightbox-image {
    display: block;
    max-width: 94vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}
.ad-photo-lightbox-close {
    position: fixed;
    top: 14px;
    right: 18px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #111;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
}
body.ad-photo-lightbox-open { overflow: hidden; }


/* Owner: delete own ad */
.owner-ad-delete-box {
    display: block !important;
    width: 100%;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #eee;
}
.owner-ad-delete-form {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.owner-ad-delete-confirm {
    display: flex !important;
    flex: 1 1 260px;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.owner-ad-delete-button {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}


/* Wanted requests: photos and cabinet cards */
.wanted-home-image { width:100%; height:180px; display:block; object-fit:cover; border-radius:10px 10px 0 0; }
.wanted-cabinet-image, .wanted-admin-image { width:100%; max-width:320px; height:180px; display:block; object-fit:cover; border-radius:10px; margin-bottom:12px; }
.wanted-detail-media { flex:0 0 min(440px,42%); }
.wanted-main-photo { display:block; width:100%; padding:0; border:0; background:none; cursor:zoom-in; }
.wanted-main-photo img { width:100%; max-height:520px; display:block; object-fit:contain; border-radius:12px; background:#f5f5f5; }
.wanted-thumbnails { margin-top:10px; }
@media (max-width:760px) { .wanted-detail-media { flex-basis:100%; width:100%; } .wanted-home-image { height:160px; } }
