:root {
    --animation-duration: 0.3s;
    --tg-theme-button-color: #3390ec;
    --tg-theme-button-text-color: #ffffff;
    --safe-area-top: env(safe-area-inset-top);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--tg-theme-bg-color, #fff);
    color: var(--tg-theme-text-color, #000);
    padding-bottom: env(safe-area-inset-bottom);
    padding-top: var(--safe-area-top);
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 8px 16px;
    background: var(--tg-theme-bg-color, #fff);
    display: flex;
    align-items: center;
    height: 56px;
    z-index: 1000;
    padding-top: calc(8px + var(--safe-area-top));
}

.profile-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.profile-button:active {
    background-color: var(--tg-theme-secondary-bg-color, #f5f5f5);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--tg-theme-button-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tg-theme-button-text-color);
    font-weight: bold;
}

.main-content {
    padding: 72px 16px 16px 16px;
}

.filter-card {
    background: var(--tg-theme-secondary-bg-color, #f5f5f5);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
}

.filter-button {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    border: none;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.filter-button:active {
    background-color: rgba(0, 0, 0, 0.05);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--tg-theme-bg-color, #fff);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--animation-duration) ease;
}

.overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.overlay-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: var(--tg-theme-bg-color, #fff);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2001;
    padding-top: calc(16px + var(--safe-area-top));
}

.overlay-content {
    padding: 72px 16px 16px 16px;
    height: 100%;
    overflow-y: auto;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    cursor: pointer;
}

.checkbox-item:active {
    background-color: var(--tg-theme-secondary-bg-color, #f5f5f5);
}

.checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid var(--tg-theme-button-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox.checked {
    background-color: var(--tg-theme-button-color);
}

.checkbox.checked::after {
    content: "✓";
    color: white;
}

.inputs {
    display: grid;
    gap: 8px;
    padding: 16px;
}

.input {
    flex: 1;
    background: var(--tg-theme-bg-color, #fff);
    border: 1px solid var(--tg-theme-secondary-bg-color, #f5f5f5);
    padding: 12px;
    border-radius: 8px;
    font: inherit;
    color: inherit;
}

.selector {
    display: flex;
    gap: 8px;
    padding: 16px;
    flex-wrap: wrap;
}

.button {
    flex: 1;
    min-width: 60px;
    padding: 12px;
    border: 2px solid var(--tg-theme-button-color);
    border-radius: 8px;
    background: none;
    color: var(--tg-theme-button-color);
    font: inherit;
    cursor: pointer;
    word-wrap: break-word; /* или word-break: break-word; */
    text-align: center; /* Для выравнивания текста */
}

.button.selected {
    background: var(--tg-theme-button-color);
    color: white;
}

/* Profile Section */
.profile-section {
    padding: 16px;
}

.profile-card {
    background: var(--tg-theme-secondary-bg-color, #f5f5f5);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.profile-stats {
    display: flex;
    gap: 16px;
    margin-top: 12px;
}

.stat-item {
    flex: 1;
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 4px;
}

.stat-label {
    color: var(--tg-theme-hint-color, #999);
    font-size: 14px;
}

/*home*/


/* Property Details */
.property-details {
    padding-bottom: 80px; /* Space for MainButton */
}

/* Carousel */
.carousel-container {
    position: relative;
    margin: -16px -16px 16px -16px;
    background: var(--tg-theme-secondary-bg-color);
}

.carousel {
    position: relative;
    height: 300px;
    overflow: hidden;
    display: flex;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.carousel img {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    scroll-snap-align: start;
}

.carousel-dots {
    position: absolute;
    bottom: 16px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 1;
}

.carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: white;
    transform: scale(1.2);
}

.favorite-button {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--tg-theme-button-color);
    cursor: pointer;
    z-index: 1;
    transition: all 0.3s ease;
}

.favorite-button.active .favorite-icon {
    color: #ff3b30;
    transform: scale(1.1);
}

/* Property Main Info */
.property-main-info {
    margin-bottom: 24px;
}

.property-price {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
}

.property-quick-info {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.info-tag {
    padding: 6px 12px;
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 16px;
    font-size: 14px;
}

/* Info Sections */
.info-section {
    margin-bottom: 24px;
}

.info-section h2 {
    font-size: 20px;
    margin-bottom: 12px;
}

/* Amenities */
.amenities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.amenity-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 12px;
    font-size: 14px;
}

/* Similar Properties */
.similar-properties {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 4px;
    margin: 0 -16px;
    padding: 0 16px;
}

.similar-property-card {
    flex: 0 0 280px;
    scroll-snap-align: start;
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 12px;
    overflow: hidden;
}

.similar-property-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.similar-property-info {
    padding: 12px;
}

.similar-property-price {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.similar-property-details {
    font-size: 14px;
    color: var(--tg-theme-hint-color);
}

#map {
    height: 400px;
    width: 100%;
    border-radius: 12px;
    background-color: var(--tg-theme-bg-color, #fff);
    transition: all 0.3s ease;
}

.form-input {
    display: flex;
    flex-direction: column;
    gap: 8px;
}


/* Base styles */
.about-container {
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
}

/* Welcome Banner */
.welcome-banner {
    text-align: center;
    padding: 24px 20px;
    background: var(--tg-theme-secondary-bg-color, #f5f5f5);
    border-radius: 12px;
    margin-bottom: 20px;
}

.welcome-icon {
    font-size: 44px;
    margin-bottom: 16px;
}

.welcome-banner h1 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--tg-theme-text-color);
}

.welcome-banner p {
    color: var(--tg-theme-hint-color, #8e8e93);
    line-height: 1.4;
}

/* Stats Section */
.stats-wrapper {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--tg-theme-secondary-bg-color, #f5f5f5);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: transform 0.2s ease;
}

.stat-card:active {
    transform: scale(0.98);
}

.stat-icon {
    font-size: 22px;
    margin-bottom: 8px;
    color: var(--tg-theme-button-color);
}

.stat-number {
    font-size: 18px;
    font-weight: 600;
    color: var(--tg-theme-text-color);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--tg-theme-hint-color, #8e8e93);
}

/* Features Section */
.features-section {
    margin-bottom: 20px;
}

.about-title {
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--tg-theme-text-color);
}

.feature-cards {
    display: grid;
    gap: 10px;
}

.feature-card {
    background: var(--tg-theme-secondary-bg-color, #f5f5f5);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.2s ease;
}

.feature-card:active {
    transform: scale(0.98);
}

.feature-icon {
    font-size: 24px;
    color: var(--tg-theme-button-color);
}

.feature-text h3 {
    font-size: 15px;
    margin-bottom: 4px;
    color: var(--tg-theme-text-color);
}

.feature-text p {
    font-size: 13px;
    color: var(--tg-theme-hint-color, #8e8e93);
    line-height: 1.3;
}

/* Contact Section */
.contact-section {
    margin-bottom: 20px;
}

.contact-info {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.info-card {
    background: var(--tg-theme-secondary-bg-color, #f5f5f5);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.info-content h3 {
    font-size: 15px;
    margin-bottom: 6px;
    color: var(--tg-theme-text-color);
}

.info-content a {
    color: var(--tg-theme-link-color, var(--tg-theme-button-color));
    text-decoration: none;
    font-size: 14px;
}

/* Social Media Section */
.social-section {
    margin-bottom: 20px;
}

.social-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.social-button {
    padding: 12px;
    border-radius: 12px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color, #fff);
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.social-button:active {
    opacity: 0.7;
}



/* Responsive Design */
@media (max-width: 480px) {
    .stats-wrapper {
        grid-template-columns: 1fr;
    }

    .social-links {
        grid-template-columns: 1fr;
    }

    .stat-card {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px;
    }

    .stat-icon {
        margin-bottom: 0;
    }
}




/* Contact Buttons */
.contact-buttons {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.contact-button {
    padding: 12px;
    border-radius: 12px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.contact-button:active {
    opacity: 0.7;
}

.contact-button.telegram {
    background: #0088cc;
    color: #ffffff;
}

.contact-button.website {
    background: var(--tg-theme-secondary-bg-color, #f5f5f5);
    color: var(--tg-theme-text-color);
}

/* Map Section */
.map-section {
    margin-bottom: 20px;
}


.simple-container {
    text-align: center;
    padding: 20px;
    color: var(--tg-theme-text-color);
}