:root {
    /* Colors - Apple style */
    --color-background: #ffffff;
    --color-text-primary: #1d1d1f;
    --color-text-secondary: #86868b;
    --color-accent: #0071e3;
    --color-divider: rgba(0, 0, 0, 0.08);

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-size-hero: 32px;
    --font-size-title: 24px;
    --font-size-body: 17px;
    --font-size-caption: 15px;
    --font-size-small: 13px;
    --line-height-tight: 1.1;
    --line-height-normal: 1.47;
    --line-height-relaxed: 1.58;

    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    --spacing-section: 56px;

    /* Swiper */
    --swiper-theme-color: #ffffff;
    --swiper-pagination-bullet-inactive-color: rgba(255, 255, 255, 0.5);
    --swiper-pagination-bullet-inactive-opacity: 1;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    overscroll-behavior: none;
}

html, body {
    touch-action: pan-x pan-y;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-body);
    line-height: var(--line-height-normal);
    color: var(--color-text-primary);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    width: 100%;
    min-height: 100vh;
    padding-bottom: env(safe-area-inset-bottom);
}

/* Sections */
.section {
    padding-top: var(--spacing-section);
}

.section:first-child {
    padding-top: 0;
}

.section--welcome {
    padding-top: 0;
}

.section-content {
    padding: 0 var(--spacing-lg);
}

/* Typography */
.section-title {
    font-size: var(--font-size-title);
    font-weight: 600;
    line-height: var(--line-height-tight);
    letter-spacing: -0.01em;
    margin: 0 0 var(--spacing-md) 0;
    color: var(--color-text-primary);
}

.main-title {
    font-size: var(--font-size-hero);
    font-weight: 600;
    line-height: var(--line-height-tight);
    letter-spacing: -0.02em;
    margin: var(--spacing-lg) 0 var(--spacing-md) 0;
    color: var(--color-text-primary);
}

.text {
    font-size: var(--font-size-body);
    line-height: var(--line-height-relaxed);
    color: var(--color-text-primary);
    margin: var(--spacing-md) 0 0 0;
}

/* Text List */
.text-list {
    list-style: none;
    padding: 0;
    margin: var(--spacing-md) 0 0 0;
}

.text-list__item {
    font-size: var(--font-size-body);
    line-height: var(--line-height-relaxed);
    color: var(--color-text-primary);
    padding-left: var(--spacing-md);
    position: relative;
    margin-bottom: var(--spacing-xs);
}

.text-list__item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 4px;
    height: 4px;
    background-color: var(--color-text-primary);
    border-radius: 50%;
}

.text-list__item:last-child {
    margin-bottom: 0;
}

/* Carousel / Swiper */
.swiper {
    width: 100vw;
    aspect-ratio: 9/10;
    margin: var(--spacing-md) 0 0 0;
    margin-left: calc(-1 * var(--spacing-lg));
    border-radius: 0;
    overflow: hidden;
    touch-action: pan-x;
}

.section-content > .swiper:first-child {
    margin-top: 0;
}

.section--welcome .swiper {
    border-radius: 0;
    aspect-ratio: 9/10;
}

.swiper-slide {
    background: var(--color-background);
}

.swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    pointer-events: none;
}

.swiper-pagination {
    bottom: var(--spacing-sm) !important;
}

.swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    transition: opacity 0.2s ease;
}

/* Floor plan & Location sections - black pagination bullets */
#floor-plan .swiper-pagination-bullet,
#location .swiper-pagination-bullet {
    background-color: rgba(0, 0, 0, 0.3);
}

#floor-plan .swiper-pagination-bullet-active,
#location .swiper-pagination-bullet-active {
    background-color: #000000;
}

/* Yandex Map */
.yandex-map {
    width: 100vw;
    aspect-ratio: 9/10;
    margin: var(--spacing-md) 0 0 0;
    margin-left: calc(-1 * var(--spacing-lg));
    overflow: hidden;
}

.yandex-map iframe {
    width: 100% !important;
    height: 100% !important;
    border: none;
}

.section-content > .yandex-map:first-child {
    margin-top: 0;
}

/* Main Properties (Welcome section) */
.main-properties {
    display: flex;
    justify-content: space-between;
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-divider);
}

.main-property {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
}

.main-property__value {
    font-size: var(--font-size-body);
    font-weight: 600;
    color: var(--color-text-primary);
    letter-spacing: -0.01em;
}

.main-property__key {
    font-size: var(--font-size-small);
    color: var(--color-text-secondary);
    margin-top: var(--spacing-xs);
    letter-spacing: 0.02em;
}

/* Properties (Info sections) */
.properties {
    margin: var(--spacing-lg) 0 0 0;
    padding: 0;
}

.property {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--color-divider);
}

.property:last-child {
    border-bottom: none;
}

.property__key {
    font-size: var(--font-size-caption);
    font-weight: 400;
    color: var(--color-text-secondary);
    margin: 0;
    flex-shrink: 0;
}

.property__value {
    font-size: var(--font-size-caption);
    font-weight: 500;
    color: var(--color-text-primary);
    margin: 0;
    text-align: right;
    padding-left: var(--spacing-md);
}

/* Contact */
.contact {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
}

.contact__link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: var(--font-size-body);
    font-weight: 500;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.contact__link:first-child {
    background-color: #2BA0D9;
    color: #ffffff;
}

.contact__link:first-child:active {
    background-color: #2BA0D9;
    transform: scale(0.98);
}

.contact__link:last-child:not(:first-child) {
    background-color: #1cc838;
    color: #ffffff;
    border: 1px solid #1cc838;
}

.contact__link:last-child:not(:first-child):active {
    background-color: #1cc838;
    transform: scale(0.98);
}

/* Phone button with copy functionality */
.contact__link--phone {
    position: relative;
    cursor: pointer;
    border: none;
    font-family: var(--font-family);
    width: 100%;
    -webkit-tap-highlight-color: transparent;
}

.contact__link--phone:active {
    transform: scale(0.96);
}

.contact__link-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: opacity 0.2s ease;
}

.contact__link--phone.copying .contact__link-content {
    opacity: 0;
}

.contact__link-phone-number {
    font-size: var(--font-size-body);
    font-weight: 500;
}

.contact__link-hint {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.7;
}

.contact__link-feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s ease;
    font-size: var(--font-size-body);
    font-weight: 500;
    white-space: nowrap;
}

.contact__link--phone.copying .contact__link-feedback {
    opacity: 1;
}

/* Footer spacing */
.section:last-child {
    padding-bottom: var(--spacing-2xl);
}

/* Fullscreen Gallery */
.fullscreen-gallery {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background-color: #000000;
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    touch-action: pan-x pan-y;
}

.fullscreen-gallery.active {
    display: block;
    opacity: 1;
}

.fullscreen-gallery__close {
    position: fixed;
    top: var(--spacing-md);
    right: var(--spacing-md);
    top: calc(var(--spacing-md) + env(safe-area-inset-top));
    right: calc(var(--spacing-md) + env(safe-area-inset-right));
    width: 44px;
    height: 44px;
    background-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10001;
    color: #ffffff;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.fullscreen-gallery__close:active {
    background-color: rgba(255, 255, 255, 0.25);
    transform: scale(0.95);
}

.fullscreen-gallery__swiper {
    width: 100%;
    height: 100%;
    margin: 0;
    aspect-ratio: unset;
}

.fullscreen-gallery__swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000000;
}

.fullscreen-gallery__swiper .swiper-zoom-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-gallery__swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: auto;
}

.fullscreen-gallery__swiper .swiper-pagination {
    bottom: calc(var(--spacing-lg) + env(safe-area-inset-bottom)) !important;
}

/* Make thumbnail slides clickable */
.swiper-slide {
    cursor: pointer;
}

/* Desktop Stub */
.desktop-stub {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--color-background);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.desktop-stub__content {
    text-align: center;
    max-width: 400px;
    padding: var(--spacing-lg);
}

.desktop-stub__icon {
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-lg);
}

.desktop-stub__title {
    font-size: 28px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0 0 var(--spacing-md) 0;
    letter-spacing: -0.02em;
}

.desktop-stub__text {
    font-size: var(--font-size-body);
    color: var(--color-text-secondary);
    line-height: var(--line-height-relaxed);
    margin: 0;
}

/* Show stub on desktop (>= 768px) */
@media (min-width: 768px) {
    .desktop-stub {
        display: flex;
    }

    #app {
        display: none;
    }
}
