/* CSS за страницата с детайли на имот */
:root {
    --blue: #006eb2;
    --green: #5cb85c;
    --red: #d9534f;
    --orange: #f0ad4e;
    --text: #515151;
    --subtext: #767676;
    --white: #fff;
    --hover: #0068ae;
    --border-color: #ddd;
    --primary-color: #006eb2;
    --text-color: #515151;
    --light-bg: #f9f9f9;
    --primary-font: 'Montserrat', sans-serif; /* Default fallback */
}

body {
    background-color: #fff;
}

/* Основен контейнер */
.property-details-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 15px;
    font-family: var(--primary-font);
    color: var(--text);
    background-color: #fff;
    margin-bottom: -40px;
}

/* Съобщение за грешка */
.error-message {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.error-message p {
    color: #721c24;
    margin-bottom: 15px;
    font-size: 18px;
}

/* Хедър на имота */
.property-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.property-title-container {
    flex: 1;
    min-width: 300px;
}

.property-title {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: var(--text);
}

.property-location {
    display: flex;
    align-items: center;
    color: var(--subtext);
    font-size: 16px;
    margin-bottom: 10px;
}

.property-location i {
    margin-right: 8px;
    color: var(--blue);
}

.property-price-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-left: 20px;
}

.property-type-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    margin-bottom: 10px;
}

.property-type-badge.sale {
    background-color: var(--green);
}

.property-type-badge.rent {
    background-color: var(--blue);
}

.property-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

/* Информация за агенция */
.agency-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
}

@media (max-width: 768px) {
    .agency-info {
        align-items: center;
    }

    h3 {
        font-size: 14px;
    }

    p {
        font-size: small;
    }
}

.agency-logo {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 10px;
}

.agency-logo img {
    width: 50px;
    height: 50px;
    object-fit: cover;
}

.agency-title {
    color: var(--blue);
    align-items: center;
    display: flex;
    gap: 10px;
}

.agency-address {
    text-align: left;
}

.agency-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Галерия със снимки */
.property-gallery {
    margin: 10px 0;
    max-height: 500px;
    height: 500px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 10px;
    max-height: 500px;
    height: 500px;
}

.gallery-main {
    position: relative;
    height: 100%;
    overflow: hidden;
    border-radius: 3px;
    cursor: pointer;
    max-height: 500px;
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    max-height: 500px;
}

.gallery-main:hover img {
    transform: scale(1.05);
}

.gallery-thumbs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    grid-gap: 10px;
    height: 100%;
    max-height: 500px;
}

.gallery-thumb {
    position: relative;
    overflow: hidden;
    border-radius: 3px;
    cursor: pointer;
    height: 100%;
    max-height: 250px;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    max-height: 250px;
}

.gallery-thumb:hover img {
    transform: scale(1.05);
}

.gallery-thumb.empty {
    background-color: #fff;
}

.image-count {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 2;
}

.more-images {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    font-weight: 600;
}

.no-images {
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    height: 500px;
}

.no-images img {
    max-width: 150px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-images p {
    color: #999;
    font-size: 16px;
}

.property-info-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 400;
    color: white;
    margin-bottom: 10px;
    background-color: var(--theme-accent);
}

@media (max-width: 768px) {
    .property-info-badge {
        font-size: 12px;
        font-weight: 400;
        padding: 3px 8px;
    }
}

.property-info-price {
    font-size: 24px;
    font-weight: 500;
    color: #515151;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

@media (max-width: 768px) {
    .property-info-price {
        font-size: 18px;
        font-weight: 300;
    }
}


.price-icon {
    font-size: 32px;
    margin-right: 10px;
    color: var(--theme-accent);
}

@media (max-width: 768px) {
    .price-icon {
        font-size: 24px;
    }
}

.property-info-badge.sale {
    background-color: var(--theme-accent);
}

.property-info-badge.rent {
    background-color: var(--theme-accent);
}

/* Основни характеристики */
.container-sm {
    max-width: 1200px;
    margin: 10px auto;
    padding: 0 15px;
    font-family: var(--primary-font);
    color: var(--text);
}

.property-features {
    margin-bottom: 30px;
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.features-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 10px;
}

.feature-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background-color: #ebf3ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blue);
    font-size: 18px;
}

.feature-details {
    display: flex;
    flex-direction: column;
}

.feature-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.feature-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--theme-accent);
}

/* Мобилни стилове за основните характеристики */
@media (max-width: 768px) {
    .features-grid {
        gap: 5px;
    }

    .feature-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
        margin-bottom: 0;
    }

    .feature-item {
        padding: 8px;
        background-color: #f9f9f9;
        border-radius: 8px;
        margin-bottom: 0;
    }

    .feature-icon {
        width: 28px;
        height: 28px;
        min-width: 28px;
        font-size: 12px;
    }

    .feature-label {
        font-size: 11px;
        margin-bottom: 2px;
    }

    .feature-value {
        font-size: 13px;
    }

    .property-features {
        padding: 15px 10px;
    }
}

/* Описание на имота */
.property-description {
    margin-bottom: 30px;
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.description-content {
    line-height: 1.6;
    font-size: 16px;
    white-space: pre-line;
}

/* Допълнителни характеристики */
.property-extras {
    margin-bottom: 30px;
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.extras-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.extras-list li {
    display: flex;
    align-items: center;
    font-size: 15px;
}

.extras-list li i {
    color: var(--green);
    margin-right: 10px;
    font-size: 16px;
}

/* Контактна форма */
.property-contact {
    margin-bottom: 30px;
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.contact-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.contact-info {
    flex: 1;
    min-width: 300px;
}

.contact-info p {
    margin-bottom: 20px;
    line-height: 1.6;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-method {
    display: flex;
    align-items: center;
}

.contact-method i {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 110, 178, 0.1);
    border-radius: 50%;
    margin-right: 15px;
    color: var(--blue);
}

.contact-form {
    flex: 1;
    min-width: 300px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: var(--text);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: var(--primary-font);
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: var(--blue);
    color: white;
}

.btn-primary:hover {
    background-color: var(--hover);
}

/* Подобни имоти */
.similar-properties {
    margin-bottom: 30px;
}

.similar-properties-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.loading-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    color: var(--subtext);
}

/* PhotoSwipe стилове */
.pswp__thumbnails {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1500;
    display: flex;
    overflow-x: auto;
    padding: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.5) transparent;
}

.pswp__thumbnails::-webkit-scrollbar {
    height: 5px;
}

.pswp__thumbnails::-webkit-scrollbar-track {
    background: transparent;
}

.pswp__thumbnails::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
}

.pswp__thumbnail {
    flex: 0 0 auto;
    width: 80px;
    height: 80px;
    margin-right: 10px;
    opacity: 0.7;
    transition: opacity 0.3s, transform 0.3s;
    cursor: pointer;
    border: 2px solid transparent;
}

.pswp__thumbnail:hover {
    opacity: 0.9;
}

.pswp__thumbnail.active {
    opacity: 1;
    border-color: #fff;
    transform: scale(1.05);
}

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

/* Стилове за секцията с брокери */
.brokers-section {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.brokers-title {
    font-size: 16px;
    color: var(--blue);
    margin-bottom: 15px;
    font-weight: 600;
}

.broker-info {
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 5px;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
}

.broker-image {
    flex-shrink: 0;
}

.broker-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.broker-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.broker-detail {
    display: flex;
    align-items: center;
    gap: 10px;
}

.broker-detail i {
    width: 20px;
    margin-right: 10px;
    color: var(--blue);
}

.broker-detail span {
    font-size: 14px;
}

/* Responsive стилове за мобилни устройства */
@media (max-width: 768px) {
    .broker-info {
        padding: 8px;
    }

    .broker-detail {
        margin-bottom: 5px;
    }
}

@media (max-width: 768px) {
    .property-header {
        flex-direction: column;
    }

    .property-price-container {
        margin-left: 0;
        margin-top: 15px;
        align-items: flex-start;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        height: auto;
    }

    .gallery-main {
        height: 300px;
    }

    .gallery-thumbs {
        height: 200px;
    }

    .features-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .contact-container {
        flex-direction: column;
    }

    .similar-properties-container {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 480px) {
    .property-title {
        font-size: 24px;
    }

    .gallery-main {
        height: 250px;
    }

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

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

/* Адаптивен дизайн */