@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&family=Open+Sans:wght@400;600&display=swap');

/* Файл: css/styles.css */

:root {
    /* Светлая тема (по умолчанию) */
    --bg-color: #f8f9fa;
    --accent-color: #ff6f4f;
    --text-color: #2c3e50;
    --green: #2ecc71;
    --light-green: #d4f0d2;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --card-bg: white;
    --header-bg: rgba(255, 255, 255, 0.95);
    --footer-bg: var(--text-color);
    --footer-text: white;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #f8f9fa;
    --card-bg: #2d2d2d;
    --header-bg: rgba(45, 45, 45, 0.95);
    --footer-bg: #2d2d2d;
    --footer-text: #f8f9fa;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body {
    margin: 0;
    font-family: 'Open Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    scroll-behavior: smooth;
    line-height: 1.7;
    width: 100%;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

header {
    background-color: var(--header-bg);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background-color 0.3s ease;
}

.container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.left-header-group {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--green);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

nav {
    display: flex;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    transition: var(--transition);
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: var(--transition);
}

nav a:hover::after {
    width: 100%;
}

/* Hamburger Menu Styles */
.hamburger-menu {
    display: none; /* Hidden by default on desktop */
    flex-direction: column;
    cursor: pointer;
    padding: 10px;
    gap: 5px;
    z-index: 1001;
}

.hamburger-menu .bar {
    width: 28px;
    height: 3px;
    background-color: var(--text-color);
    transition: all 0.3s ease;
}

/* Mobile Nav Overlay Styles */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-overlay .close-btn {
    position: absolute;
    top: 25px;
    right: 25px;
    color: #fff;
    font-size: 3.5rem;
    cursor: pointer;
    z-index: 1002;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    text-align: center;
}

.mobile-nav-links a {
    color: #fff;
    text-decoration: none;
    font-size: 2.2rem;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

.mobile-nav-links a:hover {
    color: var(--accent-color);
}

.hero {
    height: 80vh;
    position: relative;
    overflow: hidden;
}

.hero-swiper {
    width: 100%;
    height: 100%;
}

.hero-swiper .swiper-slide {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #f8f9fa;
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    z-index: 2;
    width: 90%;
    max-width: 800px;
    background: rgba(0, 0, 0, 0.4);
    padding: 30px;
    border-radius: 15px;
}

.hero h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 4.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.4);
}

.hero p {
    font-size: 1.6rem;
    margin-bottom: 2.5rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.btn {
    background: var(--accent-color);
    color: white;
    padding: 1.1rem 2.2rem;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.btn:hover {
    background: #ff4a2f;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 111, 79, 0.4);
}

section {
    padding: 6rem 2rem;
    text-align: center;
}

h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 3rem;
    color: var(--text-color);
    margin-bottom: 3.5rem;
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 4px;
    background-color: var(--accent-color);
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3.5rem;
    justify-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2.2rem;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    max-width: 400px;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: auto;
}

.card:hover {
    transform: translateY(-12px);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.2);
}

.card .btn {
    margin-top: auto;
}

.house-swiper {
    width: 100%;
    height: 300px;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.house-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card h3 {
    font-family: 'Montserrat', sans-serif;
    color: var(--text-color);
    font-size: 1.8rem;
    margin: 1rem 0;
}

.price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    margin: 1rem 0;
}

.territory-swiper,
.kitchen-swiper,
.banya-swiper {
    width: 100%;
    max-width: 1200px;
    height: 500px;
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
}

.territory-swiper .swiper-slide img,
.kitchen-swiper .swiper-slide img,
.banya-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kitchen-info,
.banya-info {
    max-width: 800px;
    margin: 2.5rem auto;
    font-size: 1.3rem;
    line-height: 1.8;
}

.contact-info {
    max-width: 600px;
    margin: 0 auto;
    padding: 2.5rem;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
}

.contact-info p {
    margin: 1rem 0;
    font-size: 1.25rem;
}

footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    text-align: center;
    padding: 2.5rem;
    font-size: 1.1rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Swiper Navigation Styles */
.swiper-button-next,
.swiper-button-prev {
    color: var(--accent-color) !important;
    background: rgba(255, 255, 255, 0.8);
    width: 45px !important;
    height: 45px !important;
    border-radius: 50%;
}

.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 22px !important;
}

.swiper-pagination-bullet-active {
    background: var(--accent-color) !important;
}

@media (max-width: 768px) {
    .container {
        justify-content: space-between;
    }

    nav {
        display: none; /* Hide desktop nav on mobile */
    }

    .hamburger-menu {
        display: flex; /* Show hamburger on mobile */
        margin-left: auto;
    }

    .hero {
        height: 60vh;
    }

    .hero h1 {
        font-size: 2.8rem;
    }
    
    .hero p {
        font-size: 1.3rem;
    }

    section {
        padding: 3rem 1rem; /* Add some horizontal padding for sections on mobile */
    }

    h2 {
        font-size: 2.2rem;
    }

    .cards {
        /* Overrides desktop grid for single column flex behavior */
        grid-template-columns: 1fr; /* Still define grid for potential future use or fallback */
        gap: 2rem;
        display: flex; /* Use flexbox for direct column layout */
        flex-direction: column;
        align-items: center; /* Center items horizontally within flex container */
        width: 100%; /* Take full width of parent section's content area */
        margin: 0 auto; /* Ensure the .cards container itself is centered */
        max-width: 100%; /* Ensure it doesn't exceed 100% width */
    }

    .card {
        padding: 1.5rem;
        /* Width accounting for section padding (1rem on each side) */
        width: calc(100% - 2rem); /* Max width of card, adjust as needed. Remove 2rem here as section padding is 1rem each side now */
        max-width: 400px; /* Keep max-width for larger mobile devices */
        margin: 0 auto; /* Center each individual card */
    }
    
    .territory-swiper,
    .kitchen-swiper,
    .banya-swiper {
        height: 300px;
    }

    .contact-info {
        padding: 1.5rem;
    }

    .btn {
        padding: 0.8rem 1.4rem;
        font-size: 1rem;
    }

    .logo {
        font-size: 1.7rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2.2rem;
    }
    .hero p {
        font-size: 1.1rem;
    }

    h2 {
        font-size: 1.9rem;
    }

    .contact-info p {
        font-size: 1.1rem;
    }
    
    /* Fullscreen overlay adjustments for very small mobile screens */
    .fullscreen-overlay .close-btn {
        font-size: 2.2rem;
        top: 15px;
        right: 15px;
        padding: 5px 10px;
    }

    .fullscreen-swiper .swiper-button-next,
    .fullscreen-swiper .swiper-button-prev {
        width: 40px !important;
        height: 40px !important;
    }

    .fullscreen-swiper .swiper-button-next:after,
    .fullscreen-swiper .swiper-button-prev:after {
        font-size: 2rem !important;
    }

    /* Regular swiper navigation buttons on tiny screens */
    .swiper-button-next,
    .swiper-button-prev {
        width: 35px !important;
        height: 35px !important;
    }

    .swiper-button-next:after,
    .swiper-button-prev:after {
        font-size: 20px !important;
    }
}

/* Fullscreen Overlay Styles */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.fullscreen-overlay.active {
    opacity: 1;
    visibility: visible;
}

.fullscreen-swiper {
    width: 90%;
    max-width: 1400px;
    height: 90%;
    position: relative;
}

.fullscreen-swiper .swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
}

.fullscreen-swiper .swiper-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    margin: auto;
}

.fullscreen-overlay.active .fullscreen-swiper .swiper-slide img {
    transform: scale(1);
    opacity: 1;
}

.fullscreen-overlay .close-btn {
    position: absolute;
    top: 25px;
    right: 25px;
    color: #fff;
    font-size: 3.5rem;
    cursor: pointer;
    z-index: 10002;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    padding: 10px 15px;
    transition: var(--transition);
}

.fullscreen-overlay .close-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: rotate(90deg);
}

.fullscreen-swiper .swiper-button-next,
.fullscreen-swiper .swiper-button-prev {
    color: #fff !important;
    background: rgba(0, 0, 0, 0.5);
    width: 55px !important;
    height: 55px !important;
    border-radius: 50%;
    z-index: 10001;
    transition: var(--transition);
}

.fullscreen-swiper .swiper-button-next:hover,
.fullscreen-swiper .swiper-button-prev:hover {
    background: rgba(0, 0, 0, 0.8);
}

.fullscreen-swiper .swiper-button-next:after,
.fullscreen-swiper .swiper-button-prev:after {
    font-size: 2.5rem !important;
}

.fullscreen-swiper .swiper-pagination-bullet-active {
    background: #fff !important;
}

/* Ensure html and body are full width and prevent unwanted horizontal scroll */
html, body {
    width: 100%;
    overflow-x: hidden;
}

/* Theme Switch Styles */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    margin: 0 1rem;
}

.theme-switch {
    display: inline-block;
    height: 34px;
    position: relative;
    width: 60px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
}

.slider:before {
    background-color: #fff;
    bottom: 4px;
    content: "";
    height: 26px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 26px;
    z-index: 1;
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.slider .fa-sun {
    color: #f1c40f;
    font-size: 16px;
    margin-left: 5px;
}

.slider .fa-moon {
    color: #f1c40f;
    font-size: 16px;
    margin-right: 5px;
}

input:checked + .slider {
    background-color: #2c3e50;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Back to Top Button Styles */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, background-color 0.3s ease;
    z-index: 900;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: #ff4a2f;
}