/* ========================================
   Emlak Portalı - İlan Listeleme & Detay CSS
   ======================================== */

/* --- Breadcrumb --- */
.breadcrumb {
    padding: 1rem 0;
    font-size: 0.85rem;
    color: var(--text-light);
}

.breadcrumb a {
    color: var(--primary);
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    margin: 0 0.5rem;
    color: var(--text-lighter);
}

/* --- Listing Page Layout --- */
.listing-page {
    padding: 2rem 0;
}

.listing-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
}

/* --- Filters Sidebar --- */
.filters-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 5rem;
}

.filters-card h3 {
    font-size: 1.1rem;
    color: var(--secondary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
}

.filters-card .form-group {
    margin-bottom: 0.75rem;
}

.filters-card label {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.filters-card input,
.filters-card select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.price-range {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

/* --- Listing Results --- */
.listing-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.listing-results-header h2 {
    font-size: 1.25rem;
    color: var(--secondary);
}

.results-count {
    color: var(--text-light);
    font-size: 0.9rem;
}

.sort-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
}

/* --- Listing List View --- */
.listing-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.listing-list-item {
    display: grid;
    grid-template-columns: 300px 1fr;
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.listing-list-item:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.listing-list-image {
    height: 100%;
    min-height: 200px;
    position: relative;
    overflow: hidden;
}

.listing-list-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.listing-list-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.listing-list-body h3 {
    font-size: 1.1rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.listing-list-body h3 a:hover {
    color: var(--primary);
}

.listing-list-price {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.listing-list-location {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.listing-list-description {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.listing-list-features {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: var(--text-light);
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.listing-list-features span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* --- Detail Page --- */
.detail-page {
    padding: 2rem 0;
}

.detail-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
}

/* --- Gallery --- */
.gallery {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.gallery-main {
    position: relative;
    height: 450px;
    overflow: hidden;
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.gallery-nav:hover {
    background: var(--primary);
    color: var(--white);
}

.gallery-prev {
    left: 1rem;
}

.gallery-next {
    right: 1rem;
}

.gallery-counter {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(0,0,0,0.7);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

.gallery-thumbs {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    overflow-x: auto;
}

.gallery-thumb {
    width: 80px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    flex-shrink: 0;
}

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

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

/* --- Detail Info --- */
.detail-info {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.detail-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.detail-header h1 {
    font-size: 1.5rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.detail-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.detail-location {
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.detail-badges {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* --- Features Grid --- */
.detail-features {
    padding: 1.5rem;
}

.detail-features h3 {
    font-size: 1.1rem;
    color: var(--secondary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.feature-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.feature-item span:first-child {
    color: var(--text-light);
}

.feature-item span:last-child {
    font-weight: 600;
    color: var(--secondary);
}

/* --- Description --- */
.detail-description {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
}

.detail-description h3 {
    font-size: 1.1rem;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.detail-description p {
    color: var(--text);
    line-height: 1.8;
    white-space: pre-line;
}

/* --- Sidebar --- */
.detail-sidebar {
    position: sticky;
    top: 5rem;
}

.sidebar-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.sidebar-card-header {
    background: var(--secondary);
    color: var(--white);
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
}

.sidebar-card-body {
    padding: 1.25rem;
}

/* --- Agent Card --- */
.agent-card {
    text-align: center;
}

.agent-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 0.75rem;
}

.agent-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 0.25rem;
}

.agent-phone {
    color: var(--primary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.agent-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-call {
    background: var(--success);
    color: var(--white);
    border: none;
    padding: 0.75rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-call:hover {
    background: #16a34a;
}

.btn-whatsapp {
    background: #25d366;
    color: var(--white);
    border: none;
    padding: 0.75rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-whatsapp:hover {
    background: #20bd5a;
}

/* --- Credit Calculator --- */
.credit-calc .form-group {
    margin-bottom: 0.75rem;
}

.credit-calc label {
    font-size: 0.85rem;
    font-weight: 500;
}

.credit-calc input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.credit-result {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
    margin-top: 0.75rem;
}

.credit-result .amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.credit-result .label {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* --- Map --- */
.detail-map {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.detail-map h3 {
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    color: var(--secondary);
    border-bottom: 1px solid var(--border);
}

.map-placeholder {
    height: 300px;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 1rem;
    padding: 1rem;
    text-align: center;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .listing-layout,
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .filters-card {
        position: static;
    }

    .detail-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .listing-list-item {
        grid-template-columns: 1fr;
    }

    .listing-list-image {
        min-height: 180px;
    }

    .gallery-main {
        height: 280px;
    }

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

@media (max-width: 480px) {
    .gallery-main {
        height: 220px;
    }

    .detail-header h1 {
        font-size: 1.25rem;
    }

    .detail-price {
        font-size: 1.35rem;
    }
}
