/* Listing Page Styles */
.listing-page {
    padding-top: 64px;
}

/* Breadcrumb */
.breadcrumb {
    padding: 16px 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.breadcrumb a {
    color: var(--fg-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.breadcrumb a:hover {
    color: var(--fg);
}

.breadcrumb span {
    color: var(--fg-muted);
    margin: 0 4px;
}

.breadcrumb span:last-child {
    color: var(--fg);
}

/* Listing Content */
.listing-content {
    padding: 40px 0;
}

.listing-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

.listing-main {
    min-width: 0;
    overflow: hidden;
}

@media (min-width: 900px) {
    .listing-grid {
        grid-template-columns: minmax(0, 1fr) 340px;
    }
}

/* Gallery */
.listing-gallery {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
}

.gallery-main {
    aspect-ratio: 16/9;
    max-height: 480px;
    background: #e7e5e4;
    overflow: hidden;
    cursor: zoom-in;
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-thumbs-wrapper {
    position: relative;
    background: var(--bg);
    padding: 12px 48px;
}

.gallery-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    z-index: 10;
    -webkit-tap-highlight-color: transparent;
}

.gallery-nav-btn:hover:not(:disabled) {
    background: var(--bg);
    border-color: var(--fg-muted);
}

.gallery-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.gallery-nav-btn svg {
    width: 16px;
    height: 16px;
    stroke: var(--fg);
}

.gallery-nav-prev {
    left: 8px;
}

.gallery-nav-next {
    right: 8px;
}

.thumb {
    flex: 0 0 80px;
    aspect-ratio: 3/2;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s;
    background: none;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

.thumb:hover {
    border-color: var(--fg-muted);
}

.thumb.active {
    border-color: var(--accent);
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Listing Header */
.listing-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

@media (min-width: 600px) {
    .listing-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }
}

.listing-title {
    font-family: 'Fraunces', serif;
    font-size: clamp(24px, 4vw, 32px);
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.listing-location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--fg-muted);
}

.listing-location svg {
    width: 16px;
    height: 16px;
}

.listing-price {
    font-family: 'Fraunces', serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
}

/* Features */
.listing-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

@media (min-width: 600px) {
    .listing-features {
        grid-template-columns: repeat(4, 1fr);
    }
}

.feature-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.feature-item svg {
    width: 24px;
    height: 24px;
    stroke: var(--fg);
    flex-shrink: 0;
}

.feature-label {
    font-size: 12px;
    color: var(--fg-muted);
    margin-bottom: 2px;
}

.feature-value {
    font-weight: 600;
    font-size: 15px;
}

/* Listing Section */
.listing-section {
    margin-bottom: 32px;
}

.listing-section .section-title {
    font-family: 'Fraunces', serif;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
}

/* Tabs */
.listing-tabs {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.tabs-header {
    display: flex;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tabs-header::-webkit-scrollbar {
    height: 0;
}

.tab-btn {
    flex: 1;
    min-width: max-content;
    padding: 14px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--fg-muted);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.tab-btn:hover {
    color: var(--fg);
    background: var(--card);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: var(--card);
}

.tabs-content {
    padding: 24px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Description formatting */
.listing-desc {
    color: var(--fg-muted);
    line-height: 1.8;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Feature Tags */
.features-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.feature-tag {
    display: inline-block;
    padding: 6px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 9999px;
    font-size: 13px;
    color: var(--fg);
    white-space: nowrap;
}

.features-group {
    margin-bottom: 28px;
}

.features-group:last-child {
    margin-bottom: 0;
}

.features-subtitle {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--fg);
    display: flex;
    align-items: center;
    gap: 8px;
}

.features-subtitle::before {
    content: '';
    width: 4px;
    height: 16px;
    background: var(--accent);
    border-radius: 2px;
}

/* Details */
.details-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.listing-details {
    display: grid;
    gap: 0;
}

.detail-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-row:first-child {
    padding-top: 0;
}

.detail-label {
    color: var(--fg-muted);
    font-size: 12px;
    font-weight: 500;
}

.detail-value {
    font-weight: 600;
    font-size: 14px;
    color: var(--fg);
}

/* Nearby / Çevre */
.nearby-category {
    margin-bottom: 20px;
}

.nearby-category:last-child {
    margin-bottom: 0;
}

.nearby-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--fg);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nearby-title::before {
    content: '';
    width: 3px;
    height: 14px;
    background: var(--accent);
    border-radius: 2px;
}

.nearby-list {
    display: grid;
    gap: 6px;
    grid-template-columns: 1fr;
}

.nearby-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    transition: border-color 0.15s;
}

.nearby-item:hover {
    border-color: var(--fg-muted);
}

.nearby-name {
    color: var(--fg);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nearby-distance {
    color: var(--accent);
    font-weight: 600;
    white-space: nowrap;
    margin-left: 12px;
    font-size: 12px;
}

/* Map */
.listing-map {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

/* Sidebar */
.listing-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 900px) {
    .listing-sidebar {
        position: sticky;
        top: 84px;
    }
}

/* Contact Card */
.contact-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.card-title {
    font-family: 'Fraunces', serif;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
    margin-bottom: 12px;
    background: var(--accent);
    color: #fff;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.contact-btn:hover {
    background: var(--accent-hover);
}

.contact-btn.secondary {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--fg);
}

.contact-btn.secondary:hover {
    border-color: var(--fg);
    background: transparent;
}

.contact-btn svg {
    width: 18px;
    height: 18px;
}

.contact-btn:last-child {
    margin-bottom: 0;
}

/* Form Card */
.form-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group:last-of-type {
    margin-bottom: 18px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--fg);
    transition: border-color 0.15s;
    font-family: inherit;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--fg-muted);
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(28, 25, 23, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: var(--card);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.lightbox-close:hover {
    background: var(--bg);
}

.lightbox-close svg {
    width: 20px;
    height: 20px;
    stroke: var(--fg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: var(--card);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.lightbox-nav:hover {
    background: var(--bg);
}

.lightbox-nav svg {
    width: 20px;
    height: 20px;
    stroke: var(--fg);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--card);
    color: #1c1917;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

@media (max-width: 600px) {
    .listing-content {
        padding: 20px 0;
    }

    .gallery-main {
        aspect-ratio: 4/3;
        max-height: 300px;
    }

    .gallery-thumbs-wrapper {
        padding: 8px 40px;
    }

    .listing-header {
        gap: 12px;
    }

    .listing-price {
        font-size: 22px;
    }

    .listing-features {
        gap: 10px;
        margin-bottom: 24px;
    }

    .tabs-content {
        padding: 16px;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
    }

    .lightbox-nav {
        width: 36px;
        height: 36px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-counter {
        bottom: 10px;
    }
}
