:root {
    --bg: #f5f8fb;
    --surface: #ffffff;
    --text: #102033;
    --muted: #66758a;
    --line: #dde6ef;
    --primary: #0b7a75;
    --primary-dark: #075c58;
    --blue: #184a8c;
    --danger: #c43d3d;
    --success: #27864d;
    --shadow: 0 18px 45px rgba(16, 32, 51, .08);
    --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}
.header-inner { min-height: 74px; display: flex; align-items: center; gap: 18px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 850; letter-spacing: -.03em; }
.logo-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 13px; background: linear-gradient(135deg, var(--primary), var(--blue)); color: #fff; font-size: 13px; }
.main-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.main-nav a { padding: 9px 12px; border-radius: 999px; color: var(--muted); font-size: 14px; }
.main-nav a.active, .main-nav a:hover { background: #edf7f6; color: var(--primary-dark); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.lang-switch { display: flex; background: #edf2f7; border-radius: 999px; padding: 3px; }
.lang-switch a { padding: 6px 8px; border-radius: 999px; color: var(--muted); font-weight: 700; font-size: 12px; }
.lang-switch a.active { background: #fff; color: var(--primary); box-shadow: 0 4px 12px rgba(0,0,0,.05); }
.account-link { color: var(--muted); font-size: 14px; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-toggle { display: none; border: 0; background: #edf2f7; border-radius: 12px; width: 42px; height: 42px; cursor: pointer; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 999px; padding: 10px 16px; cursor: pointer; font-weight: 750; transition: .18s ease; background: #fff; color: var(--text); }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 12px 24px rgba(11,122,117,.20); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { border-color: var(--line); background: #fff; }
.btn-muted { background: #eef3f7; color: var(--muted); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-small { padding: 7px 10px; font-size: 13px; }
.btn-large { padding: 14px 22px; }
.full { width: 100%; }

.site-main { min-height: 68vh; }
.flash { width: min(1180px, calc(100% - 32px)); margin: 18px auto 0; padding: 14px 16px; border-radius: 16px; font-weight: 650; }
.flash-success { background: #e7f7ec; color: #176a38; }
.flash-error { background: #ffecec; color: #9b1d1d; }

.hero { padding: 38px 0 18px; }
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 34px; min-height: 360px; padding: 38px; border-radius: 34px; background: radial-gradient(circle at top right, #d7f4f0, transparent 35%), linear-gradient(135deg, #ffffff 0%, #eef6ff 100%); box-shadow: var(--shadow); }
.eyebrow { color: var(--primary); font-weight: 850; letter-spacing: .06em; text-transform: uppercase; font-size: 12px; }
.hero h1 { margin: 12px 0 12px; font-size: clamp(34px, 5vw, 62px); line-height: 1.02; letter-spacing: -.06em; }
.hero p { margin: 0; color: var(--muted); font-size: 18px; max-width: 680px; }
.hero-search { display: grid; gap: 12px; padding: 18px; background: rgba(255,255,255,.78); border: 1px solid rgba(255,255,255,.85); border-radius: 26px; box-shadow: 0 24px 60px rgba(16,32,51,.12); }

label { display: grid; gap: 7px; font-weight: 740; color: var(--text); }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 16px; padding: 13px 14px; background: #fff; color: var(--text); outline: none; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(11,122,117,.10); }

.section { padding: 28px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head h2, .page-title h1 { margin: 0; letter-spacing: -.04em; }
.section-head a { color: var(--primary); font-weight: 800; }
.category-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.category-tile { min-height: 96px; padding: 18px; display: flex; justify-content: space-between; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 10px 25px rgba(16,32,51,.04); font-weight: 820; }
.category-tile:hover { border-color: rgba(11,122,117,.35); box-shadow: var(--shadow); }
.category-tile small { color: var(--primary); font-size: 22px; }

.listing-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.listing-card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; overflow: hidden; box-shadow: 0 10px 26px rgba(16,32,51,.045); transition: .2s ease; }
.listing-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.listing-image { height: 190px; background: #e8eef5; display: block; }
.listing-image img { width: 100%; height: 100%; object-fit: cover; }
.image-placeholder, .gallery-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); font-weight: 900; background: linear-gradient(135deg, #ecf7f5, #edf1ff); }
.listing-content { padding: 15px; }
.listing-title { display: block; font-weight: 850; font-size: 17px; line-height: 1.25; margin-bottom: 8px; }
.listing-price { font-weight: 900; color: var(--primary-dark); font-size: 19px; margin-bottom: 6px; }
.listing-meta, .listing-date, .muted, .form-hint { color: var(--muted); font-size: 14px; }
.listing-card p { color: var(--muted); margin: 10px 0; font-size: 14px; }

.safety-panel { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 24px; border-radius: 28px; background: #0f2438; color: #fff; box-shadow: var(--shadow); }
.safety-panel p { color: rgba(255,255,255,.78); margin: 0; }
.safety-panel h2 { margin: 0 0 8px; }

.page-block { padding: 34px 0 48px; }
.narrow { max-width: 860px; }
.page-title { margin-bottom: 20px; }
.page-title p { margin: 8px 0 0; color: var(--muted); }
.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); margin-bottom: 22px; }
.filters .btn { align-self: end; }
.empty-state { padding: 34px; border: 1px dashed var(--line); border-radius: 24px; background: #fff; color: var(--muted); text-align: center; font-weight: 700; }

.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.back-link { display: inline-flex; margin-bottom: 14px; color: var(--muted); font-weight: 750; }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.gallery img, .gallery-placeholder { width: 100%; height: 310px; object-fit: cover; border-radius: 24px; background: #e8eef5; }
.gallery img:first-child { grid-column: 1 / -1; height: 440px; }
.detail-card, .seller-card, .profile-card, .card-form { background: #fff; border: 1px solid var(--line); border-radius: 26px; padding: 22px; box-shadow: var(--shadow); }
.detail-card h1 { margin: 0 0 10px; font-size: clamp(28px, 4vw, 44px); letter-spacing: -.05em; }
.detail-price { font-size: 34px; font-weight: 950; color: var(--primary-dark); margin-bottom: 16px; }
.details-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; }
.details-list div { padding: 12px; background: #f6f9fc; border-radius: 16px; }
.details-list dt { color: var(--muted); font-size: 13px; }
.details-list dd { margin: 0; font-weight: 780; }
.preserve-lines { white-space: pre-wrap; }
.seller-card { position: sticky; top: 94px; }
.seller-card h2 { margin-top: 0; }
.contact-box { margin-top: 12px; padding: 12px; border-radius: 16px; background: #f1f8f7; }
.fraud-warning { margin-top: 16px; padding: 14px; border-radius: 18px; background: #fff8e8; color: #593800; }
.fraud-warning ul { padding-left: 18px; margin: 8px 0 0; }
.manage-actions { display: grid; gap: 10px; margin-top: 16px; }

.card-form { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hp { display: none !important; }
.preview-grid, .current-images { display: flex; flex-wrap: wrap; gap: 10px; }
.preview-grid img, .current-images img { width: 92px; height: 92px; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); }
.auth-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.mini-form { display: grid; gap: 12px; margin: 18px 0; }
.logout-form { margin-top: 12px; }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th, .data-table td { padding: 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table th { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.actions-cell { display: flex; flex-wrap: wrap; gap: 6px; }
.actions-cell form { display: inline-flex; }
.badge { display: inline-flex; padding: 5px 10px; border-radius: 999px; font-weight: 850; font-size: 12px; }
.badge-pending { background: #fff1cc; color: #6a4700; }
.badge-published { background: #def7e8; color: #146a38; }
.badge-rejected { background: #ffe2e2; color: #8c1f1f; }
.badge-deleted { background: #e6e8ed; color: #576071; }
.text-page p { font-size: 17px; color: #2d3a49; }
.check-list { display: grid; gap: 10px; padding-left: 0; list-style: none; }
.check-list li { padding: 14px 16px; border-radius: 16px; background: #fff; border: 1px solid var(--line); }

.site-footer { padding: 32px 0; background: #0f2438; color: #fff; }
.footer-grid { display: flex; justify-content: space-between; gap: 24px; align-items: start; }
.footer-grid p { color: rgba(255,255,255,.72); margin: 6px 0 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px; }
.footer-links a { color: rgba(255,255,255,.80); }

@media (max-width: 1040px) {
    .header-inner { flex-wrap: wrap; padding: 12px 0; }
    .menu-toggle { display: inline-grid; place-items: center; margin-left: auto; }
    .main-nav { display: none; width: 100%; order: 5; margin-left: 0; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); padding: 10px; border-radius: 18px; }
    .main-nav.open { display: flex; }
    .header-actions { margin-left: 0; }
    .hero-inner, .detail-layout { grid-template-columns: 1fr; }
    .seller-card { position: static; }
    .category-grid, .listing-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    .container { width: min(100% - 22px, 1180px); }
    .header-actions { width: 100%; justify-content: space-between; flex-wrap: wrap; }
    .hero { padding-top: 18px; }
    .hero-inner { padding: 24px; border-radius: 24px; }
    .category-grid, .listing-grid, .filters, .form-grid, .auth-grid, .details-list { grid-template-columns: 1fr; }
    .listing-image { height: 220px; }
    .gallery, .gallery img:first-child { display: block; height: auto; }
    .gallery img, .gallery-placeholder { height: auto; min-height: 240px; margin-bottom: 10px; }
    .safety-panel, .footer-grid { flex-direction: column; align-items: flex-start; }
    .btn-primary { box-shadow: none; }
}


/* DSC DESIGN FIXES */
.logo-mark {
    width: 44px !important;
    height: 44px !important;
    font-size: 12px !important;
    font-weight: 850 !important;
    letter-spacing: .03em !important;
}

.header-add-btn {
    padding: 8px 18px !important;
    min-height: 46px !important;
    min-width: auto !important;
    line-height: 1.15 !important;
    text-align: center !important;
    white-space: nowrap !important;
}

.password-field {
    position: relative;
    width: 100%;
}

.password-field input {
    padding-right: 54px !important;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    color: var(--muted);
    display: grid;
    place-items: center;
    font-size: 16px;
    padding: 0;
}

.password-toggle:hover {
    background: #edf7f6;
    color: var(--primary-dark);
}


/* ADMIN MESSAGE PAGE */
.message-preview-link {
    display: block;
    color: var(--text);
    max-width: 420px;
}

.message-preview-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.message-full-text {
    background: #f6f9fc;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    white-space: normal;
    margin: 12px 0 18px;
}

.message-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* IMAGE DISPLAY FIX */
.listing-card img,
.listing-image img,
.gallery-main img,
.gallery img,
.card-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    background: #f3f6f9 !important;
}

.listing-card .image,
.listing-image,
.gallery-main,
.gallery {
    background: #f3f6f9 !important;
}


/* PRICE INPUT FIX */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number] {
    -moz-appearance: textfield;
}


/* GALLERY CAROUSEL FULLSCREEN */
.listing-gallery {
    margin-bottom: 16px;
}

.gallery-main {
    position: relative;
    width: 100%;
    height: min(68vh, 560px);
    min-height: 360px;
    border-radius: 26px;
    background: #f3f6f9;
    border: 1px solid var(--line);
    overflow: hidden;
    display: grid;
    place-items: center;
}

.gallery-slide {
    display: none !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    background: #f3f6f9 !important;
    cursor: zoom-in;
}

.gallery-slide.active {
    display: block !important;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: rgba(255,255,255,.86);
    box-shadow: 0 10px 30px rgba(16,32,51,.15);
    color: var(--text);
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
}

.gallery-prev { left: 14px; }
.gallery-next { right: 14px; }

.gallery-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
}

.gallery-thumb {
    flex: 0 0 96px;
    height: 76px;
    border: 2px solid transparent;
    border-radius: 14px;
    padding: 0;
    overflow: hidden;
    background: #f3f6f9;
    cursor: pointer;
    scroll-snap-align: start;
}

.gallery-thumb.active {
    border-color: var(--primary);
}

.gallery-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(5, 12, 22, .94);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 22px;
}

.image-lightbox.open {
    display: flex;
}

.image-lightbox img {
    max-width: 96vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 12px;
}

.image-lightbox-close {
    position: fixed;
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: rgba(255,255,255,.9);
    color: #111;
    font-size: 28px;
    cursor: pointer;
}

@media (max-width: 700px) {
    .gallery-main {
        height: 360px;
        min-height: 300px;
        border-radius: 20px;
    }

    .gallery-nav {
        width: 38px;
        height: 38px;
        font-size: 28px;
    }
}

/* CENTER GALLERY BUTTONS FIX */
.gallery-nav,
.image-lightbox-close {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 0 !important;
    line-height: 1 !important;
}

.gallery-nav {
    font-size: 34px !important;
    font-weight: 500 !important;
}

.image-lightbox-close {
    font-size: 30px !important;
    font-weight: 400 !important;
}

.gallery-prev,
.gallery-next {
    line-height: 1 !important;
}



/* LEGAL PAGES FULL TEXT */
.legal-page {
    max-width: 920px;
}

.legal-page .page-title p {
    color: var(--muted);
    max-width: 760px;
}

.legal-warning {
    background: #fff7e6;
    border: 1px solid #f1d49a;
    color: #5a3900;
    border-radius: 18px;
    padding: 18px 20px;
    margin: 18px 0 24px;
    font-weight: 700;
}

.legal-section {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 22px;
    margin: 16px 0;
    box-shadow: 0 10px 28px rgba(16,32,51,.05);
}

.legal-section h2 {
    margin: 0 0 12px;
    font-size: 22px;
    letter-spacing: -.03em;
}

.legal-section p {
    margin: 0 0 12px;
    color: #24364d;
}

.legal-section p:last-child {
    margin-bottom: 0;
}

.terms-check {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: flex-start;
    gap: 10px;
    font-weight: 600;
    color: var(--muted);
    line-height: 1.45;
}

.terms-check input {
    width: 18px !important;
    height: 18px !important;
    margin-top: 3px;
    flex: 0 0 auto;
}

.terms-check span {
    display: block;
}

/* REAL LOGO IMAGE */
.site-logo-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    display: block;
}



/* DSC IMAGE LOGO */
.site-logo-img {
    width: 46px !important;
    height: 46px !important;
    object-fit: contain !important;
    display: block !important;
    border-radius: 12px;
}

.logo {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}


/* CATEGORY ACCORDION */
.category-accordion-item {
    display: block;
}

.category-toggle {
    width: 100%;
    border: 1px solid var(--line);
    cursor: pointer;
    text-align: left;
}

.category-toggle small {
    transition: transform .18s ease;
}

.category-accordion-item.open .category-toggle small {
    transform: rotate(180deg);
}

.category-subgrid {
    margin-top: 8px;
    padding: 10px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(16,32,51,.05);
    display: grid;
    gap: 6px;
}

.category-subitem {
    display: block;
    padding: 9px 10px;
    border-radius: 12px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.category-subitem:hover {
    background: #edf7f6;
    color: var(--primary-dark);
}

.category-all-link {
    color: var(--primary-dark);
}

/* CATEGORY ACCORDION HIDE FIX */
.category-subgrid[hidden] {
    display: none !important;
}

.category-toggle {
    cursor: pointer !important;
}

.category-toggle span {
    pointer-events: none;
}

.category-toggle small {
    pointer-events: none;
}


/* MAIN CATEGORIES TOGGLE */
.categories-main-toggle {
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 24px;
    font-weight: 850;
    letter-spacing: -.04em;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 0;
}

.categories-main-toggle small {
    color: var(--primary);
    font-size: 18px;
    transition: transform .18s ease;
}

.categories-main-toggle.open small {
    transform: rotate(180deg);
}

.category-grid[hidden] {
    display: none !important;
}


/* HEADER NAV ALIGN FIX */
.main-nav {
    align-items: center !important;
}

.main-nav a {
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 38px !important;
    line-height: 1.1 !important;
}

.header-inner {
    align-items: center !important;
}


/* CHROME HEADER LOGO OVERLAP FIX */
.header-inner {
    display: flex !important;
    align-items: center !important;
    gap: 18px !important;
}

.logo {
    flex: 0 0 auto !important;
    min-width: 190px !important;
    max-width: 220px !important;
    white-space: nowrap !important;
    overflow: visible !important;
    margin-right: 18px !important;
}

.site-logo-img {
    flex: 0 0 46px !important;
}

.logo span {
    display: inline-block !important;
    white-space: nowrap !important;
}

.main-nav {
    flex: 1 1 auto !important;
    margin-left: 0 !important;
    display: flex !important;
    justify-content: center !important;
    gap: 8px !important;
}

.header-actions {
    flex: 0 0 auto !important;
    margin-left: 12px !important;
}

/* MULTI IMAGE PREVIEW FIX */
.preview-item {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: #f3f6f9;
}

.preview-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.preview-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 999px;
    background: rgba(255,255,255,.9);
    color: #111;
    cursor: pointer;
    font-weight: 900;
}


/* EDIT EXISTING IMAGES DELETE */
.editable-current-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    margin: 12px 0 18px;
}

.current-image-item {
    position: relative;
    display: block;
    cursor: pointer;
    border-radius: 16px;
    overflow: hidden;
    background: #f3f6f9;
    border: 2px solid transparent;
}

.current-image-item img {
    width: 100%;
    height: 110px;
    object-fit: cover;
}

.current-image-item input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.current-image-delete {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(255,255,255,.92);
    color: #111;
    display: grid;
    place-items: center;
    font-weight: 900;
    line-height: 1;
}

.current-image-item.marked-delete {
    opacity: .45;
    border-color: var(--danger);
}

.current-image-item.marked-delete::after {
    content: "Буде видалено";
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 6px;
    background: rgba(196,61,61,.92);
    color: #fff;
    border-radius: 10px;
    padding: 4px 6px;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}




/* MOBILE LISTING CLEAN FINAL */
@media (max-width: 768px) {
    html,
    body {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 14px !important;
        padding-right: 14px !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
    }

    .page-block,
    .listing-layout,
    .listing-detail-layout,
    .listing-page-grid {
        width: 100% !important;
        max-width: 100% !important;
        display: block !important;
        overflow: visible !important;
    }

    .listing-gallery {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 18px 0 !important;
        overflow: visible !important;
    }

    .gallery-main {
        position: relative !important;
        width: 100% !important;
        height: 320px !important;
        min-height: 320px !important;
        max-height: 320px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: #f3f6f9 !important;
        border: 1px solid var(--line) !important;
        border-radius: 22px !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    .gallery-slide {
        display: none !important;
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        object-fit: contain !important;
        object-position: center center !important;
        background: #f3f6f9 !important;
    }

    .gallery-slide.active {
        display: block !important;
    }

    .gallery-prev,
    .gallery-next {
        position: absolute !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: 42px !important;
        height: 42px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 10 !important;
        border-radius: 999px !important;
        font-size: 28px !important;
        line-height: 1 !important;
        padding: 0 !important;
    }

    .gallery-prev { left: 10px !important; }
    .gallery-next { right: 10px !important; }

    .gallery-thumbs {
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 10px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding: 10px 0 6px !important;
        margin: 10px 0 0 0 !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .gallery-thumb {
        flex: 0 0 78px !important;
        width: 78px !important;
        min-width: 78px !important;
        height: 62px !important;
        border-radius: 12px !important;
        overflow: hidden !important;
    }

    .gallery-thumb img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    .listing-content-card,
    .listing-info-card,
    .listing-main-card,
    .profile-card,
    .seller-card,
    .safety-box,
    .detail-card,
    [data-contact-box] {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        overflow: visible !important;
    }

    .seller-card .btn,
    .seller-card button,
    [data-show-contact] {
        width: 100% !important;
        max-width: 100% !important;
        white-space: normal !important;
        text-align: center !important;
    }

    .listing-content-card *,
    .listing-info-card *,
    .seller-card *,
    .safety-box *,
    .detail-card * {
        max-width: 100% !important;
        overflow-wrap: break-word !important;
        word-break: normal !important;
    }
}

/* MOBILE ORIENTATION-AWARE GALLERY */
@media (max-width: 768px) {
    .gallery-main.dsc-portrait-active {
        height: clamp(430px, 138vw, 560px) !important;
        min-height: clamp(430px, 138vw, 560px) !important;
        max-height: clamp(430px, 138vw, 560px) !important;
    }

    .gallery-main.dsc-landscape-active {
        height: clamp(240px, 62vw, 330px) !important;
        min-height: clamp(240px, 62vw, 330px) !important;
        max-height: clamp(240px, 62vw, 330px) !important;
    }

    .gallery-main.dsc-square-active {
        height: clamp(300px, 90vw, 390px) !important;
        min-height: clamp(300px, 90vw, 390px) !important;
        max-height: clamp(300px, 90vw, 390px) !important;
    }

    .gallery-main {
        overflow: hidden !important;
        background: #f3f6f9 !important;
    }

    .gallery-slide,
    .gallery-main img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
        object-position: center center !important;
    }

    .listing-content-card,
    .seller-card,
    .safety-box,
    .detail-card {
        overflow: visible !important;
    }
}

/* MOBILE SIMPLE PHOTO STACK - STABLE FIX */
@media (max-width: 768px) {
    .gallery-main,
    .gallery-main.dsc-portrait-active,
    .gallery-main.dsc-landscape-active,
    .gallery-main.dsc-square-active {
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        display: block !important;
        overflow: visible !important;
        background: transparent !important;
        border: 0 !important;
        border-radius: 0 !important;
    }

    .gallery-slide,
    .gallery-slide.active,
    .gallery-main img {
        position: static !important;
        display: block !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        object-fit: contain !important;
        object-position: center !important;
        border-radius: 22px !important;
        background: #f3f6f9 !important;
        margin: 0 0 14px 0 !important;
    }

    .gallery-prev,
    .gallery-next,
    .gallery-thumbs {
        display: none !important;
    }

    .listing-gallery {
        overflow: visible !important;
    }

    .listing-content-card,
    .seller-card,
    .safety-box,
    .detail-card {
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
    }
}

/* SELLER PROFILE + RATING */
.seller-public-block {
    display: grid;
    gap: 10px;
    padding: 14px;
    margin: 12px 0 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #f8fafc;
}

.seller-public-link {
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
}

.seller-rating-line,
.seller-profile-rating > div {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rating-stars {
    display: inline-flex;
    gap: 2px;
    font-size: 20px;
    line-height: 1;
}

.rating-stars .star {
    color: #cbd5e1;
}

.rating-stars .star.active {
    color: #f5b301;
}

.seller-rating-box {
    padding: 14px;
    margin: 16px 0;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
}

.seller-rating-box h3 {
    margin: 0 0 10px;
}

.star-rate-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.star-rate-btn {
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
    color: #f5b301;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.star-rate-btn:hover {
    background: #fff7d6;
    border-color: #f5b301;
}

.rating-note {
    margin: 0;
    color: var(--muted);
}

.seller-profile-card {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    padding: 22px;
    margin: 18px 0 24px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: #fff;
    box-shadow: var(--shadow);
}

.seller-profile-card h1 {
    margin: 0 0 6px;
}

.seller-profile-rating {
    display: grid;
    gap: 10px;
    min-width: 260px;
}

@media (max-width: 768px) {
    .seller-profile-card {
        display: grid;
        gap: 16px;
        padding: 18px;
    }

    .seller-profile-rating {
        min-width: 0;
        width: 100%;
    }

    .star-rate-btn {
        width: 40px;
        height: 40px;
    }
}

/* FAVORITES HEART */
.listing-card {
    position: relative;
}

.favorite-heart-form {
    margin: 0;
}

.favorite-heart-button {
    border: 1px solid rgba(15, 118, 110, 0.2);
    background: rgba(255, 255, 255, 0.94);
    color: var(--primary);
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.favorite-heart-button:hover {
    transform: translateY(-1px) scale(1.04);
    background: #fff;
    border-color: var(--primary);
}

.favorite-heart-button span {
    color: var(--primary);
    line-height: 1;
}

.favorite-heart-button.is-active {
    background: var(--primary);
    border-color: var(--primary);
}

.favorite-heart-button.is-active span {
    color: #fff;
}

.favorite-heart-card {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 8;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

.detail-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}

.detail-title-row h1 {
    margin: 0;
}

.favorite-heart-detail {
    min-width: 58px;
    height: 44px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 14px;
    font-size: 24px;
}

.favorite-heart-detail em {
    font-style: normal;
    font-size: 14px;
    font-weight: 800;
    color: var(--text);
}

.favorite-heart-detail.is-active em {
    color: #fff;
}

@media (max-width: 768px) {
    .favorite-heart-card {
        width: 40px;
        height: 40px;
        font-size: 25px;
        top: 10px;
        right: 10px;
    }

    .detail-title-row {
        align-items: flex-start;
    }

    .favorite-heart-detail {
        min-width: 54px;
        height: 42px;
    }
}

/* ADMIN USERS + FULL DATA */
.admin-quick-panel {
    padding-top: 18px;
}

.admin-users-main-button {
    width: fit-content;
}

.admin-users-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.admin-users-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #fff;
    box-shadow: var(--shadow);
}

.admin-users-table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
}

.admin-users-table th,
.admin-users-table td {
    padding: 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.admin-users-table th {
    background: #f8fafc;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.admin-users-table td span {
    color: var(--muted);
    font-size: 13px;
}

.admin-pill {
    display: inline-flex;
    padding: 5px 9px;
    margin: 2px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.1);
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
}

.admin-pill.danger {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

.admin-user-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 24px;
}

.admin-user-card,
.admin-data-section {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: #fff;
    box-shadow: var(--shadow);
}

.admin-user-form {
    display: grid;
    gap: 14px;
}

.check-row {
    display: flex !important;
    align-items: center;
    gap: 10px;
}

.check-row input {
    width: auto !important;
}

.danger-form {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.btn-danger {
    background: #dc2626 !important;
    color: #fff !important;
    border-color: #dc2626 !important;
}

.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.admin-stat-grid div {
    padding: 14px;
    border-radius: 18px;
    background: #f8fafc;
}

.admin-stat-grid strong {
    display: block;
    font-size: 24px;
}

.admin-stat-grid span {
    color: var(--muted);
}

.admin-data-section {
    margin-top: 22px;
}

.admin-actions-cell {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-actions-cell form {
    margin: 0;
}

.admin-message-list,
.admin-mini-list {
    display: grid;
    gap: 12px;
}

.admin-message-card,
.admin-mini-list div {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #f8fafc;
}

@media (max-width: 768px) {
    .admin-users-title,
    .admin-user-grid {
        display: grid;
        grid-template-columns: 1fr;
    }

    .admin-users-main-button {
        width: 100%;
    }

    .admin-user-card,
    .admin-data-section {
        padding: 16px;
    }

    .admin-stat-grid {
        grid-template-columns: 1fr;
    }
}

/* ADMIN USERS VISIBLE BUTTON */
.admin-users-visible-box {
    margin: 0 0 22px 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #fff;
    box-shadow: var(--shadow);
}

.admin-users-visible-box .btn {
    width: 100%;
    justify-content: center;
    font-size: 18px;
}

/* ADMIN USERS BUTTON V2 */
.admin-users-visible-box {
    margin: 18px 0 26px 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.admin-users-visible-box .btn {
    width: 100%;
    justify-content: center;
    font-size: 18px;
}

/* ADMIN USERS JS BUTTON */
.dsc-admin-users-js-button-wrap {
    margin: 18px 0 28px 0;
}

.dsc-admin-users-js-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 58px;
    padding: 16px 22px;
    border-radius: 18px;
    background: var(--primary);
    color: #fff !important;
    font-weight: 900;
    font-size: 18px;
    text-decoration: none;
    box-shadow: 0 16px 35px rgba(15, 118, 110, 0.24);
}

.dsc-admin-users-js-button:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
}

/* MOBILE HEADER: BURGER ONLY */
@media (max-width: 768px) {
    .header-inner {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
    }

    .logo {
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }

    .menu-toggle {
        display: inline-grid !important;
        place-items: center !important;
        flex: 0 0 46px !important;
        width: 46px !important;
        height: 46px !important;
        margin-left: auto !important;
        z-index: 20 !important;
    }

    .main-nav,
    .header-actions {
        display: none !important;
    }

    .main-nav.open {
        display: grid !important;
        width: 100% !important;
        order: 10 !important;
        margin: 8px 0 0 0 !important;
        padding: 12px !important;
        gap: 8px !important;
        background: #fff !important;
        border: 1px solid var(--line) !important;
        border-radius: 18px !important;
        box-shadow: var(--shadow) !important;
    }

    .main-nav.open a {
        width: 100% !important;
        padding: 12px 14px !important;
    }

    .main-nav.open + .header-actions {
        display: grid !important;
        width: 100% !important;
        order: 11 !important;
        gap: 10px !important;
        margin: 0 !important;
        padding: 12px !important;
        background: #fff !important;
        border: 1px solid var(--line) !important;
        border-radius: 18px !important;
        box-shadow: var(--shadow) !important;
    }

    .main-nav.open + .header-actions .lang-switch,
    .main-nav.open + .header-actions .btn,
    .main-nav.open + .header-actions .account-link {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
    }
}

/* MOBILE HEADER: LOGO + LANGUAGE + BURGER */
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap !important;
    }

    .logo {
        order: 1 !important;
        flex: 1 1 auto !important;
    }

    .header-actions {
        order: 2 !important;
        display: flex !important;
        width: auto !important;
        flex: 0 0 auto !important;
        margin-left: auto !important;
        padding: 0 !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    .header-actions > :not(.lang-switch) {
        display: none !important;
    }

    .header-actions .lang-switch {
        display: inline-flex !important;
        width: auto !important;
    }

    .menu-toggle {
        order: 3 !important;
        margin-left: 8px !important;
    }

    .main-nav {
        order: 10 !important;
    }

    .main-nav.open + .header-actions {
        order: 11 !important;
        display: grid !important;
        width: 100% !important;
        gap: 10px !important;
        margin: 0 !important;
        padding: 12px !important;
        background: #fff !important;
        border: 1px solid var(--line) !important;
        border-radius: 18px !important;
        box-shadow: var(--shadow) !important;
    }

    .main-nav.open + .header-actions > * {
        display: flex !important;
    }
}

/* CUSTOM TRANSLATED FILE INPUT */
.custom-file-input {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.native-file-hidden {
    position: absolute !important;
    left: -9999px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.custom-file-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.custom-file-label {
    color: var(--muted);
    font-weight: 700;
}

@media (max-width: 768px) {
    .custom-file-input {
        display: grid;
        gap: 10px;
    }

    .custom-file-button {
        width: 100%;
    }
}

/* ADMIN 2FA */
.twofa-card {
    max-width: 680px;
    margin: 0 auto;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: #fff;
    box-shadow: var(--shadow);
}

.twofa-card h1 {
    margin-top: 0;
}

.twofa-status {
    display: inline-flex;
    margin: 12px 0 18px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    font-weight: 900;
}

.twofa-status.enabled {
    background: rgba(15, 118, 110, 0.1);
    color: var(--primary);
}

.twofa-secret {
    padding: 16px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid var(--line);
    font-family: monospace;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 0.08em;
    overflow-wrap: anywhere;
}

.twofa-form {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.twofa-form input {
    font-size: 22px;
    letter-spacing: 0.12em;
    text-align: center;
    font-weight: 900;
}

.twofa-details {
    margin-top: 12px;
}

.twofa-details code {
    display: block;
    margin-top: 8px;
    padding: 12px;
    border-radius: 12px;
    background: #f8fafc;
    overflow-wrap: anywhere;
}

/* 2FA DUO QR */
.twofa-qr-box {
    margin: 20px 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #f8fafc;
    text-align: center;
}

.twofa-qr-box h2 {
    margin-top: 0;
}

.twofa-qr-image {
    width: 240px;
    max-width: 100%;
    height: auto;
    padding: 12px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--line);
}
