/* =========================================================
   Thiên Ân – Listings pages (my-listings, form, detail)
   Depends on: main.css (tokens, .btn, .house-card, .badge…)
   ========================================================= */

.page-container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 32px 20px 80px;
}

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.page-title {
    font-family: var(--font-heading);
    font-size: clamp(1.7rem, 3vw, 2.2rem);
    margin: 0;
    color: var(--black);
}

.page-subtitle {
    color: var(--gray);
    margin: 4px 0 0;
    font-size: 0.95rem;
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--gray-100);
    margin-bottom: 24px;
}

.tab {
    appearance: none;
    background: transparent;
    border: 0;
    padding: 12px 18px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.tab:hover { color: var(--black); }

.tab.is-active {
    color: var(--gold);
    border-bottom-color: var(--gold);
}

.tab-count {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--gray-100);
    color: var(--gray);
    font-size: 0.75rem;
    font-weight: 700;
}

.tab.is-active .tab-count {
    background: var(--gold-soft);
    color: var(--gold-dark);
}

/* ===== Listing card extra status badges ===== */
.badge-pending  { background: #9ca3af; }
.badge-paused   { background: #6b7280; }
.badge-sold     { background: var(--gold); color: var(--black); }
.badge-expired  { background: #4b5563; }
.badge-rejected { background: #b91c1c; }

/* ===== Card actions (owner) ===== */
.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
}

.card-action {
    appearance: none;
    background: transparent;
    border: 1px solid var(--gray-200);
    color: var(--black);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
    font-family: inherit;
}

.card-action:hover {
    background: var(--gold);
    color: var(--white);
    border-color: var(--gold);
}

.card-action.danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    color: var(--white);
}

/* ===== Form (listing-form.html) ===== */
.listing-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    background: var(--white);
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-card);
    padding: 32px;
    box-shadow: var(--shadow-sm);
}

.form-section {
    border-top: 1px solid var(--gray-100);
    padding-top: 22px;
}

.form-section:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.form-section h3 {
    margin: 0 0 14px;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--black);
}

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

@media (max-width: 768px) {
    .form-grid-2,
    .form-grid-3,
    .form-grid-4 { grid-template-columns: 1fr; }
}

.form-group textarea {
    width: 100%;
    min-height: 110px;
    padding: 12px 14px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-input);
    background: var(--white);
    color: var(--black);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-input);
    background: var(--white);
    color: var(--black);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.form-group textarea::placeholder {
    color: var(--gray-300);
}

.form-group select:focus,
.form-group textarea:focus,
.form-group input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.18);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    color: var(--black);
}

.checkbox-row input { width: auto; }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

/* ===== Map picker ===== */
.map-search-wrap {
    margin-bottom: 12px;
}

.map-container {
    width: 100%;
    height: 380px;
    border-radius: var(--radius-card);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    background: var(--gray-100);
}

.map-fallback {
    padding: 20px;
    color: var(--gray);
    text-align: center;
    font-size: 0.92rem;
}

.map-fallback code {
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: 4px;
}

.map-coords {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--gray);
    flex-wrap: wrap;
}

.map-coords strong { color: var(--black); margin-right: 4px; }

/* ===== Detail page ===== */
.detail-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 32px;
}

@media (max-width: 1024px) {
    .detail-grid { grid-template-columns: 1fr; }
}

.detail-main { min-width: 0; }
.detail-side { min-width: 0; }

.detail-hero img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: var(--radius-card);
}

.detail-info {
    margin-top: 20px;
}

.detail-info h1 {
    font-family: var(--font-heading);
    font-size: clamp(1.4rem, 2.4vw, 2rem);
    margin: 0 0 8px;
    color: var(--black);
}

.detail-price {
    font-family: var(--font-heading);
    color: var(--gold);
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 12px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    color: var(--gray);
    font-size: 0.94rem;
    margin: 8px 0 18px;
}

.detail-meta span strong {
    color: var(--black);
    margin-right: 4px;
}

.detail-section {
    margin-top: 28px;
}

.detail-section h2 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-100);
}

.detail-desc {
    white-space: pre-wrap;
    line-height: 1.7;
    color: var(--black);
}

.detail-side-card {
    position: sticky;
    top: 96px;
    background: var(--white);
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-card);
    padding: 22px;
    box-shadow: var(--shadow-sm);
}

.detail-address-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--gray);
    font-size: 0.92rem;
}

.detail-address-list strong { color: var(--black); margin-right: 6px; }

.detail-map-preview {
    width: 100%;
    height: 280px;
    border-radius: var(--radius-card);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    background: var(--gray-100);
}

.detail-map-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    color: var(--gold);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
}

.detail-map-link:hover {
    text-decoration: underline;
}

.coords-debug {
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--gray);
}

/* ===== Upload widget (drag-drop) ===== */
.form-hint {
    margin: -6px 0 14px;
    color: var(--gray);
    font-size: 0.88rem;
}

.upload-dropzone {
    display: block;
    width: 100%;
    border: 2px dashed var(--gray-200);
    border-radius: var(--radius-card);
    padding: 28px 20px;
    text-align: center;
    color: var(--gray);
    background: var(--gray-50);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    outline: none;
}

.upload-dropzone:hover,
.upload-dropzone:focus-visible {
    border-color: var(--gold);
    background: var(--gold-soft);
    color: var(--black);
}

.upload-dropzone.is-dragover {
    border-color: var(--gold);
    background: var(--gold-soft);
    color: var(--black);
    transform: scale(1.005);
}

.upload-dropzone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.upload-dropzone-inner svg { color: var(--gold); }

.upload-dropzone p { margin: 4px 0; font-size: 0.95rem; }

.upload-dropzone .upload-pick {
    color: var(--gold);
    font-weight: 700;
    text-decoration: underline;
}

.upload-meta { color: var(--gray); font-size: 0.82rem; }

/* Grid that lays out the media tiles */
.upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.upload-tile {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-card);
    background: var(--white);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.upload-tile.is-main {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.22);
}

.upload-tile.error {
    border-color: #fecaca;
    background: #fef2f2;
}

.upload-tile-media {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.upload-tile-media img,
.upload-tile-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.upload-tile-icon {
    font-size: 2rem;
    color: var(--gray);
}

.upload-main-tag {
    position: absolute;
    top: 6px;
    left: 6px;
    background: var(--gold);
    color: var(--white);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    letter-spacing: 0.4px;
}

.upload-tile-body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.upload-tile-name {
    font-size: 0.82rem;
    color: var(--black);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-progress {
    width: 100%;
    height: 4px;
    background: var(--gray-100);
    border-radius: 999px;
    overflow: hidden;
}

.upload-progress > span {
    display: block;
    height: 100%;
    background: var(--gold);
    transition: width 0.18s linear;
}

.upload-status {
    font-size: 0.78rem;
    color: var(--gray);
}
.upload-status.error { color: #b91c1c; }
.upload-status.ok    { color: var(--green); }
.upload-status.main  { color: var(--gold-dark); font-weight: 700; }

.upload-tile-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.upload-action {
    appearance: none;
    border: 1px solid var(--gray-200);
    background: var(--white);
    border-radius: 6px;
    padding: 4px 10px;
    font-family: inherit;
    font-size: 0.78rem;
    cursor: pointer;
    color: var(--black);
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.upload-action:hover {
    background: var(--gold);
    color: var(--white);
    border-color: var(--gold);
}

.upload-action.danger {
    color: #b91c1c;
}
.upload-action.danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    color: var(--white);
}

/* ===== Detail page: gallery & videos ===== */
.detail-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.detail-gallery-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
    background: var(--gray-100);
}

.detail-videos {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 8px;
}

.detail-video {
    width: 100%;
    max-height: 480px;
    border-radius: var(--radius-card);
    background: #000;
}

/* ===== Listing catalog (category pages /for-sale, …) ===== */
.listing-catalog-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 88px 20px 96px;
}

.lc-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
    font-size: 0.875rem;
    color: var(--gray);
}

.lc-breadcrumb a {
    color: var(--gold-dark);
}

.lc-breadcrumb__sep {
    margin: 0 6px;
    opacity: 0.6;
}

.listing-catalog-head {
    margin-bottom: 28px;
}

.listing-filter {
    background: var(--white);
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-card);
    padding: 16px;
    margin-bottom: 22px;
    box-shadow: var(--shadow-sm);
}

.listing-filter__row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    align-items: end;
}

.listing-filter__field.lg {
    grid-column: span 2;
}

@media (max-width: 640px) {
    .listing-filter__field.lg {
        grid-column: span 1;
    }
}

.listing-filter__field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gray);
    margin-bottom: 4px;
}

.listing-filter__input,
.listing-filter__select {
    width: 100%;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-input);
    padding: 10px 12px;
    font-size: 0.9rem;
    background: var(--white);
}

.listing-filter__actions {
    display: flex;
    flex-direction: column;
}

.listing-filter__submit {
    min-height: 42px;
    background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dark) 100%);
    border: 1px solid var(--gold-dark);
    font-weight: 700;
}

.listing-filter__submit:hover {
    filter: brightness(1.06);
}

.listing-sort-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-100);
}

.listing-sort-bar__count {
    margin: 0;
    font-size: 0.95rem;
    color: var(--black);
}

.listing-sort-bar__modes {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.listing-sort-bar__btn {
    appearance: none;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 8px 12px;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    font-family: inherit;
    transition: color 0.18s ease, border-color 0.18s ease;
}

.listing-sort-bar__btn:hover {
    color: var(--black);
}

.listing-sort-bar__btn.is-active {
    color: var(--gold-dark);
    border-bottom-color: var(--gold);
}

/* —— Strip kết quả: Danh Sách Tin + đếm (trái), sắp xếp (phải) — theme sáng —— */
.listing-results-strip.lc-results-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: var(--white);
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
}

.listing-results-strip__left {
    flex: 1 1 200px;
    min-width: 0;
}

.listing-results-strip__title {
    margin: 0 0 6px;
    font-family: var(--font-heading, "Playfair Display", Georgia, serif);
    font-size: 1.22rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--gold-dark);
}

.listing-results-strip__meta {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--gray);
}

.listing-results-strip__total {
    font-weight: 700;
    color: var(--black);
}

.listing-results-strip__right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.listing-results-strip__sort.lc-catalog-sort-select {
    min-width: 200px;
    max-width: 100%;
    cursor: pointer;
    outline: none;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-input);
    background-color: var(--white);
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.25;
    color: var(--black);
    min-height: 42px;
    padding: 10px 34px 10px 12px;
    box-sizing: border-box;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M3 5l3 3 3-3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    appearance: none;
    -webkit-appearance: none;
}

.listing-results-strip__sort.lc-catalog-sort-select:focus-visible {
    border-color: var(--gold-dark);
    box-shadow: 0 0 0 2px var(--gold-line);
}

@media (max-width: 576px) {
    .listing-results-strip.lc-results-strip {
        flex-direction: column;
        align-items: stretch;
    }

    .listing-results-strip__right {
        width: 100%;
    }

    .listing-results-strip__sort.lc-catalog-sort-select {
        width: 100%;
        min-width: 0;
    }
}

.listing-catalog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 576px) {
    .listing-catalog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .listing-catalog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    .listing-catalog-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.skeleton--catalog {
    display: flex;
    flex-direction: column;
}

.listing-grid-msg {
    padding: 48px 20px;
}

.listing-grid-msg__inner {
    max-width: 420px;
    margin: 0 auto;
    text-align: center;
    color: var(--gray);
}

.listing-grid-msg--empty .listing-grid-empty__icon,
.listing-grid-msg__inner .listing-grid-empty__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    color: var(--gold-dark);
}

.listing-grid-msg--error {
    color: #7c2d12;
}

.listing-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.listing-pagination .btn:disabled {
    opacity: 0.45;
    pointer-events: none;
}

.listing-card-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    left: 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    z-index: 3;
    pointer-events: none;
}

.badge-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--white);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.14);
}

.badge-chip--urgent {
    background: #dc2626;
    animation: lcPulse 1.35s ease-in-out infinite;
}

.badge-chip--vip {
    background: linear-gradient(90deg, #c9a84c, #f0d78c);
    color: var(--black);
}

.badge-chip--ok {
    background: #16a34a;
    font-size: 0.56rem;
}

@keyframes lcPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 6px 12px rgba(220,38,38,0.25); }
    50% { transform: scale(1.04); box-shadow: 0 8px 16px rgba(220,38,38,0.45); }
}

.listing-card--catalog.house-card {
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.listing-card--catalog.house-card:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: var(--shadow-lg);
}

.price-stack .price-original {
    margin: 2px 0 0;
    font-size: 0.82rem;
    color: var(--gray);
}

.location-chips a.chip {
    text-decoration: none;
    cursor: pointer;
}

/* ===== Da Nang filter stack (SearchBox / zones / tags / bar) ===== */
.sr-only,
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.listing-sort-bar--compact {
    margin-bottom: 12px;
    padding-bottom: 6px;
}

.danang-listing-filter {
    margin-bottom: 20px;
}

/* Full width — cùng bề ngang với strip "Danh Sách Tin" */
.lc-catalog-toolbar-box {
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
    padding: 16px 20px;
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-card);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

/* —— Catalog toolbar —— */
.danang-catalog-filter-strip {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 12px 14px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.lc-catalog-toolbar-box::-webkit-scrollbar {
    height: 6px;
}

.lc-catalog-toolbar-box::-webkit-scrollbar-thumb {
    background: var(--gray-200);
    border-radius: 4px;
}

.dn-catalog-cell {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
}

.dn-catalog-cell--search {
    flex: 1 1 28%;
    min-width: min(280px, 100%);
    max-width: none;
}

.dn-catalog-cell--ward,
.dn-catalog-cell--district {
    flex: 0 1 16%;
    min-width: 150px;
    max-width: 220px;
}

.dn-catalog-cell--filters {
    flex: 1 1 auto;
    min-width: 0;
}

.dn-catalog-toolbar__label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gray);
    margin-bottom: 4px;
    line-height: 1.2;
    white-space: nowrap;
}

.dn-catalog-toolbar__control {
    width: 100%;
    min-width: 0;
}

/* Khớp chiều cao với select (toolbar) */
.danang-catalog-filter-strip .dn-search__inner {
    min-height: 42px;
    box-sizing: border-box;
}

.danang-catalog-filter-strip .dn-search__input {
    padding-top: 6px;
    padding-bottom: 6px;
}

.lc-catalog-toolbar-box select.dn-filter-bar__select,
.lc-catalog-toolbar-box select.dn-catalog-toolbar__select {
    width: 100%;
    outline: none;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-input);
    background-color: var(--white);
    color: var(--black);
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.25;
    padding: 10px 34px 10px 12px;
    cursor: pointer;
    min-height: 42px;
    box-sizing: border-box;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M3 5l3 3 3-3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    appearance: none;
    -webkit-appearance: none;
}

.lc-catalog-toolbar-box select.dn-filter-bar__select:focus,
.lc-catalog-toolbar-box select.dn-filter-bar__select:focus-visible,
.lc-catalog-toolbar-box select.dn-catalog-toolbar__select:focus,
.lc-catalog-toolbar-box select.dn-catalog-toolbar__select:focus-visible {
    outline: none;
    border-color: var(--gold-dark);
    box-shadow: 0 0 0 2px var(--gold-line);
}

/* FilterBar trong catalog: không auto-fit wrap — giữ một hàng với scrollbar ngang khi chật */
.danang-catalog-filter-strip .dn-catalog-cell--filters > .dn-filter-bar {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    align-items: flex-end;
    margin-top: 0;
}

.danang-catalog-filter-strip .dn-catalog-cell--filters > .dn-filter-bar > .dn-filter-bar__field {
    flex: 1 1 0;
    min-width: min(138px, 22vw);
    max-width: none;
}

.danang-catalog-filter-strip .dn-catalog-cell--filters > .dn-filter-bar > .dn-filter-bar__field:nth-child(2) {
    flex: 1.15 1 0;
    min-width: min(154px, 24vw);
}

.danang-catalog-filter-strip .dn-catalog-cell--filters > .dn-filter-bar > .dn-filter-bar__actions {
    flex: 0 0 auto;
    margin-left: 4px;
    align-self: flex-end;
}

.danang-catalog-filter-strip .dn-catalog-cell--filters > .dn-filter-bar > .dn-filter-bar__actions::before {
    content: "";
    display: block;
    height: 1.05rem;
    margin-bottom: 4px;
    font-size: 0.78rem;
    visibility: hidden;
}

.danang-catalog-filter-strip .dn-catalog-cell--filters .dn-filter-bar__reset {
    min-height: 42px;
    white-space: nowrap;
    padding-left: 14px;
    padding-right: 14px;
}

@media (max-width: 991px) {
    .lc-catalog-toolbar-box {
        width: 100%;
    }

    .danang-catalog-filter-strip {
        width: 100%;
        max-width: 100%;
    }

    .dn-catalog-cell--search {
        flex: 1 1 200px;
        width: auto;
        max-width: none;
        min-width: 160px;
    }
}

@media (max-width: 767px) {
    .lc-catalog-toolbar-box {
        padding: 12px;
    }

    .danang-catalog-filter-strip {
        flex-wrap: wrap;
        width: 100%;
    }

    .dn-catalog-cell--search {
        flex: 1 1 100%;
        width: 100%;
        max-width: 100%;
    }

    .dn-catalog-cell--ward,
.dn-catalog-cell--district {
        flex: 1 1 calc(50% - 8px);
        width: auto;
        min-width: 136px;
    }

    .dn-catalog-cell--filters {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
    }

    .danang-catalog-filter-strip .dn-catalog-cell--filters > .dn-filter-bar {
        flex-wrap: wrap;
        width: 100%;
        justify-content: flex-start;
    }

    .danang-catalog-filter-strip .dn-catalog-cell--filters > .dn-filter-bar > .dn-filter-bar__field,
    .danang-catalog-filter-strip .dn-catalog-cell--filters > .dn-filter-bar > .dn-filter-bar__field:nth-child(2) {
        flex: 1 1 calc(50% - 10px);
        width: auto;
        min-width: 132px;
        max-width: none;
    }

    .danang-catalog-filter-strip .dn-catalog-cell--filters > .dn-filter-bar > .dn-filter-bar__actions {
        flex: 1 1 100%;
        justify-content: flex-start;
        margin-left: 0;
    }

    .danang-catalog-filter-strip .dn-catalog-cell--filters > .dn-filter-bar > .dn-filter-bar__actions::before {
        display: none;
    }

    .danang-catalog-filter-strip .dn-catalog-cell--filters > .dn-filter-bar > .dn-filter-bar__actions .dn-filter-bar__reset {
        width: auto;
        min-width: 140px;
    }
}

.dn-search__inner {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-input);
    padding: 4px 10px;
    background: var(--white);
}

.dn-search__input {
    flex: 1;
    border: 0;
    outline: none;
    font-size: 0.95rem;
    padding: 8px 4px;
    font-family: inherit;
    min-width: 0;
    background: transparent;
    color: var(--black);
}

/* Avoid duplicate clear control when type="search" is used */
.dn-search__input::-webkit-search-cancel-button,
.dn-search__input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

.dn-search__input::placeholder {
    color: var(--gray);
}

:root[data-theme='dark'] .dn-search__inner,
.dark .dn-search__inner {
    background: var(--color-bg-card);
    border-color: var(--color-border);
}

:root[data-theme='dark'] .dn-search__input,
.dark .dn-search__input {
    color: var(--color-text);
}

:root[data-theme='dark'] .dn-search__input::placeholder,
.dark .dn-search__input::placeholder {
    color: var(--color-text-muted);
}

.dn-search__icon {
    color: var(--gold-dark);
    flex-shrink: 0;
}

.dn-search__clear {
    appearance: none;
    border: 0;
    background: var(--gray-100);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    color: var(--gray);
}

.dn-search__clear:hover {
    background: var(--gold-soft);
    color: var(--black);
}

.dn-zone__scroll {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}

.dn-chip {
    flex: 0 0 auto;
    scroll-snap-align: start;
    border: 1px solid var(--gray-200);
    background: var(--white);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    color: var(--black);
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.dn-chip:focus-visible {
    outline: 2px solid #B8960C;
    outline-offset: 2px;
}

.dn-chip--active,
.dn-chip[aria-pressed="true"] {
    background: linear-gradient(180deg, #c9a84c 0%, #B8960C 100%);
    border-color: #B8960C;
    color: var(--white);
}

.dn-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 16px;
}

.dn-tag__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.dn-tag__pill {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--gray-200);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    color: var(--gray);
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.dn-tag__input:focus-visible + .dn-tag__pill {
    outline: 2px solid #B8960C;
    outline-offset: 2px;
}

.dn-tag__input:checked + .dn-tag__pill {
    border-color: #B8960C;
    background: var(--gold-soft);
    color: var(--black);
}

.dn-filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    align-items: end;
    margin-top: 4px;
}

.dn-filter-bar__field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gray);
    margin-bottom: 4px;
}

.dn-filter-bar__select {
    width: 100%;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-input);
    padding: 10px 12px;
    font-size: 0.9rem;
    background: var(--white);
    font-family: inherit;
}

.dn-filter-bar__actions {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}

.dn-filter-bar__reset {
    min-height: 42px;
    border-color: #B8960C;
    color: #9a7c0c;
}

.dn-filter-bar__reset:hover {
    border-color: var(--gold-dark);
    color: var(--black);
}

/* ===== 360° tour upload (listing form) ===== */
.tour-section-wrap {
    border-top: 1px solid var(--gray-100);
    padding-top: 8px;
}

.tour-section-hint {
    max-width: 52rem;
}

.tour-upload-card {
    margin-top: 8px;
}

.tour-upload-dropzone .upload-dropzone-inner svg {
    color: var(--gold-dark);
}

.tour-upload-grid .upload-tile-media {
    aspect-ratio: 2 / 1;
}

.upload-tile-media .tour-badge-360 {
    position: absolute;
    bottom: 8px;
    left: 8px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.tour-preview-btn {
    border-color: var(--gold-dark) !important;
    color: var(--gold-dark);
}

.tour-preview-btn:hover {
    background: var(--gold) !important;
    color: var(--black) !important;
    border-color: var(--gold) !important;
}

.dark .tour-upload-dropzone.upload-dropzone {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--gray-200);
}

.dark .tour-upload-dropzone.upload-dropzone:hover,
.dark .tour-upload-dropzone.upload-dropzone:focus-visible {
    background: rgba(201, 168, 76, 0.08);
}

/* Full-screen panorama viewer */
.panorama-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(5, 5, 8, 0.92);
    display: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
}

.panorama-modal.is-open {
    display: flex;
}

.panorama-modal[hidden]:not(.is-open) {
    display: none !important;
}

#panoCanvas {
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    display: block;
    touch-action: none;
}

.pano-chrome {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    padding: 14px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent);
}

.pano-chrome > * {
    pointer-events: auto;
}

.pano-label {
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.65);
    flex: 1 1 160px;
    min-width: 0;
}

.pano-toolbar {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.pano-btn {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    line-height: 1;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}

.pano-btn:hover {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--black);
}

.pano-btn-close:hover {
    background: #b91c1c;
    border-color: #fecaca;
    color: #fff;
}

.pano-help {
    width: 100%;
    flex-basis: 100%;
    margin: 0;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.72);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
}

@media (max-width: 540px) {
    .pano-btn {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }
}

/* ===== Listing form – dark mode ===== */
:root[data-theme='dark'] .page-title,
.dark .page-title {
    color: var(--color-text);
}

:root[data-theme='dark'] .page-subtitle,
.dark .page-subtitle {
    color: var(--color-text-muted);
}

:root[data-theme='dark'] .listing-form,
.dark .listing-form {
    background: var(--color-bg-card);
    border-color: var(--color-border);
    box-shadow: var(--shadow-sm);
}

:root[data-theme='dark'] .form-section,
.dark .form-section {
    border-top-color: var(--color-border);
}

:root[data-theme='dark'] .form-section h3,
.dark .form-section h3 {
    color: var(--color-text);
}

:root[data-theme='dark'] .form-group label,
.dark .form-group label,
:root[data-theme='dark'] .checkbox-row,
.dark .checkbox-row {
    color: var(--color-text);
}

:root[data-theme='dark'] .form-group input,
.dark .form-group input,
:root[data-theme='dark'] .form-group textarea,
.dark .form-group textarea,
:root[data-theme='dark'] .form-group select,
.dark .form-group select {
    background: var(--color-bg);
    border-color: var(--color-border);
    color: var(--color-text);
}

:root[data-theme='dark'] .form-group input::placeholder,
.dark .form-group input::placeholder,
:root[data-theme='dark'] .form-group textarea::placeholder,
.dark .form-group textarea::placeholder {
    color: var(--color-text-muted);
}

:root[data-theme='dark'] .form-group input:focus,
.dark .form-group input:focus,
:root[data-theme='dark'] .form-group textarea:focus,
.dark .form-group textarea:focus,
:root[data-theme='dark'] .form-group select:focus,
.dark .form-group select:focus {
    border-color: var(--color-gold);
    box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.22);
}

:root[data-theme='dark'] .form-group select option,
.dark .form-group select option {
    background: var(--color-bg-card);
    color: var(--color-text);
}

:root[data-theme='dark'] .map-coords,
.dark .map-coords {
    color: var(--color-text-muted);
}

:root[data-theme='dark'] .map-coords strong,
.dark .map-coords strong {
    color: var(--color-text);
}

:root[data-theme='dark'] .map-container,
.dark .map-container {
    border-color: var(--color-border);
    background: var(--gray-50);
}

:root[data-theme='dark'] .form-hint,
.dark .form-hint {
    color: var(--color-text-muted);
}

:root[data-theme='dark'] .upload-dropzone,
.dark .upload-dropzone {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--color-border);
    color: var(--color-text-muted);
}

:root[data-theme='dark'] .upload-dropzone:hover,
:root[data-theme='dark'] .upload-dropzone:focus-visible,
:root[data-theme='dark'] .upload-dropzone.is-dragover,
.dark .upload-dropzone:hover,
.dark .upload-dropzone:focus-visible,
.dark .upload-dropzone.is-dragover {
    background: rgba(212, 160, 23, 0.08);
    border-color: var(--color-gold);
    color: var(--color-text);
}

:root[data-theme='dark'] .upload-tile,
.dark .upload-tile {
    background: var(--color-bg-card);
    border-color: var(--color-border);
}

:root[data-theme='dark'] .upload-tile-name,
.dark .upload-tile-name {
    color: var(--color-text);
}

:root[data-theme='dark'] .upload-tile.error,
.dark .upload-tile.error {
    border-color: rgba(248, 113, 113, 0.45);
    background: rgba(185, 28, 28, 0.12);
}

:root[data-theme='dark'] .form-message--error,
.dark .form-message--error {
    color: #fca5a5;
    background: rgba(185, 28, 28, 0.15);
    border: 1px solid rgba(248, 113, 113, 0.35);
    padding: 10px 14px;
    border-radius: var(--radius-input);
}

:root[data-theme='dark'] .form-message--success,
.dark .form-message--success {
    color: #86efac;
    background: rgba(22, 163, 74, 0.15);
    border: 1px solid rgba(134, 239, 172, 0.35);
    padding: 10px 14px;
    border-radius: var(--radius-input);
}

:root[data-theme='dark'] .tabs,
.dark .tabs {
    border-bottom-color: var(--color-border);
}

:root[data-theme='dark'] .tab,
.dark .tab {
    color: var(--color-text-muted);
}

:root[data-theme='dark'] .tab:hover,
.dark .tab:hover {
    color: var(--color-text);
}

:root[data-theme='dark'] .tab-count,
.dark .tab-count {
    background: var(--gray-100);
    color: var(--color-text-muted);
}

:root[data-theme='dark'] .card-action,
.dark .card-action {
    border-color: var(--color-border);
    color: var(--color-text);
}

:root[data-theme='dark'] .card-actions,
.dark .card-actions {
    border-top-color: var(--color-border);
}
