/* Базовые стили и переменные */
:root {
    --primary: #4a8f29;
    --primary-dark: #3a7320;
    --secondary: #f5f5e9;
    --accent: #e8c07d;
    --text: #333;
    --light: #fff;
    --shadow: 0 5px 15px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3 {
    line-height: 1.2;
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: var(--primary);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.btn {
    display: inline-block;
    background: var(--primary);
    color: var(--light);
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    font-size: 2.5rem;
    color: var(--primary);
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--accent);
    margin: 15px auto;
}

/* Шапка */
header {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    background: var(--light);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
}

.logo i {
    margin-right: 10px;
    color: var(--accent);
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    color: var(--text);
    font-weight: 600;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--primary);
    bottom: -5px;
    left: 0;
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--primary);
}

/* Герой секция */
.hero {
    height: 100vh;
/*    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('https://images.unsplash.com/photo-1585320806297-9794b3e4eeae?ixlib=rb-1.2.1&auto=format&fit=crop&w=1489&q=80') no-repeat center center/cover;*/
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('/media/bg.avif') no-repeat center center/cover;
    color: var(--light);
    display: flex;
    align-items: center;
    text-align: center;
    padding-top: 80px;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    animation: fadeInDown 1s ease;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    animation: fadeInUp 1s ease;
}

.hero-btns {
    display: flex;
    justify-content: center;
    gap: 20px;
    animation: fadeIn 1.5s ease;
}

.hero-btns .btn {
    font-size: 1.1rem;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--light);
    color: var(--light);
}

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

/* Обо мне */
.about {
    background: var(--secondary);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-img {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.about-text h2 {
    color: var(--primary);
    font-size: 2rem;
    margin-bottom: 20px;
}

.about-text p {
    margin-bottom: 15px;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.skill {
    background: var(--light);
    padding: 8px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
}

.skill i {
    color: var(--primary);
    margin-right: 5px;
}

/* Услуги */
.services {
    background: var(--light);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background: var(--secondary);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: var(--shadow);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.service-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 20px;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

/* Портфолио */
.portfolio {
    background: var(--secondary);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.portfolio-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    height: 250px;
    box-shadow: var(--shadow);
}

.portfolio-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(74, 143, 41, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: var(--light);
    padding: 20px;
    text-align: center;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-item:hover .portfolio-img {
    transform: scale(1.1);
}

.portfolio-overlay h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

/* Отзывы */
.testimonials {
    background: var(--light);
}

.testimonials-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.testimonial {
    background: var(--secondary);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    position: relative;
}

.testimonial::before {
    content: '\201C';
    font-size: 5rem;
    color: var(--primary);
    opacity: 0.2;
    position: absolute;
    top: 10px;
    left: 10px;
}

.testimonial p {
    margin-bottom: 20px;
    font-style: italic;
    position: relative;
    z-index: 1;
}

.testimonial-author {
    display: flex;
    align-items: center;
}

.author-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
    border: 3px solid var(--primary);
}

.author-info h4 {
    color: var(--primary);
    margin-bottom: 5px;
}

/* Контакты */
.contact {
    background: var(--secondary);
}

.contact-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 50px;
}

.contact-info h3 {
    color: var(--primary);
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.contact-details {
    margin-bottom: 30px;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: var(--light);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    margin-right: 15px;
    flex-shrink: 0;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-link {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: var(--light);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--primary);
    outline: none;
}

.contact-form textarea {
    min-height: 150px;
    resize: vertical;
}

/* Футер */
footer {
    background: var(--primary);
    color: var(--light);
    text-align: center;
    padding: 30px 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-logo {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--light);
}

.footer-links {
    display: flex;
    list-style: none;
    margin-bottom: 20px;
}

.footer-links li {
    margin: 0 15px;
}

.footer-links a {
    color: var(--light);
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent);
}

.copyright {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Адаптивность */
@media (max-width: 992px) {
    .section-title {
        font-size: 2.2rem;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .about-img {
        order: -1;
        max-width: 500px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 60px 0;
    }

    .section-title {
        font-size: 2rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .nav-links {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: var(--light);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: all 0.5s ease;
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li {
        margin: 15px 0;
    }

    .hamburger {
        display: block;
    }

    .hero-btns {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 250px;
    }
}

@media (max-width: 576px) {
    .section-title {
        font-size: 1.8rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .service-card, .testimonial {
        padding: 20px;
    }
}

/* Стили для модального окна портфолио */
.portfolio-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    background: var(--light);
    border-radius: 10px;
    overflow: hidden;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 25px;
    color: var(--light);
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: var(--accent);
}

.modal-carousel {
    display: flex;
    align-items: center;
    position: relative;
    height: 70vh;
}

.carousel-slide {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#modalImage {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.carousel-btn {
    background: rgba(0, 0, 0, 0.5);
    color: var(--light);
    border: none;
    font-size: 2rem;
    padding: 15px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    height: 100%;
    opacity: 0.65;
}

.carousel-btn:hover {
/*    background: rgba(0, 0, 0, 0.8);*/
    background: var(--primary);
}

.modal-caption {
    padding: 20px;
    background: var(--secondary);
    text-align: center;
}

.modal-caption h3 {
    color: var(--primary);
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .modal-carousel {
        height: 50vh;
    }
    
    .carousel-btn {
        padding: 10px;
        font-size: 1.5rem;
    }
}

/* Исправление белой полосы и адаптации подвала */
html, body {
    width: 100%;
    overflow-x: hidden; /* Предотвращает горизонтальный скролл */
}

.footer-content {
    max-width: 100%;
    padding: 0 15px;
    text-align: center;
}

.footer-links {
    flex-wrap: wrap; /* Позволяет ссылкам переноситься на новую строку */
    justify-content: center;
    margin-bottom: 15px;
}

.footer-links li {
    margin: 5px 10px; /* Уменьшаем отступы между ссылками */
}

.copyright {
    white-space: normal; /* Разрешаем перенос текста */
    padding: 0 10px;
    margin-bottom: 10px;
}

/* Адаптация навигации в подвале для мобильных */
@media (max-width: 576px) {
    .footer-links {
        flex-direction: column; /* Ссылки в столбик на очень маленьких экранах */
    }
    
    .footer-links li {
        margin: 5px 0;
    }
    
    .copyright {
        font-size: 0.8rem;
        line-height: 1.4;
    }
}

/* Исправление формы для мобильных */
@media (max-width: 768px) {
    .contact-form input,
    .contact-form textarea {
        width: 100%;
    }
    
    .contact-form .btn {
        width: 100%;
        max-width: 100%;
    }
}

/* Стили для кнопки в портфолио */
.portfolio-cta {
    text-align: center;
    margin-top: 50px;
    animation: fadeIn 1s ease;
}

.portfolio-cta .btn {
    padding: 15px 40px;
    font-size: 1.1rem;
    display: inline-block;
}

/* Анимация для кнопки */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Адаптивность */
@media (max-width: 768px) {
    .portfolio-cta {
        margin-top: 30px;
    }
    
    .portfolio-cta .btn {
        width: 100%;
        max-width: 300px;
    }
}

/* Стили для блока с соглашением */
.privacy-agreement {
    margin-top: -20px;
    margin-bottom: 10px;
/*    text-align: center;*/
    font-size: 0.8rem;
    color: #666;
    line-height: 1.4;
    opacity: 0.7;
}

.privacy-link {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.privacy-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

@media (max-width: 768px) {
    .privacy-agreement {
        font-size: 0.7rem;
/*        margin: 15px 0;*/
    }
}

/* Стили для страницы политики */
.privacy-section {
    padding: 80px 0;
    background: var(--secondary);
}

.privacy-header {
    text-align: center;
    margin-bottom: 40px;
}

.privacy-header h1 {
    color: var(--primary);
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.last-updated {
    color: #666;
    font-style: italic;
}

.privacy-content {
    max-width: 800px;
    margin: 0 auto;
    background: var(--light);
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.privacy-content h2 {
    color: var(--primary);
    margin: 30px 0 15px;
    font-size: 1.5rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.privacy-content p {
    margin-bottom: 15px;
    line-height: 1.6;
    text-align: justify;
}

.privacy-subheader {
    font-weight: 600;
    margin: 20px 0 10px !important;
}

@media (max-width: 768px) {
    .privacy-section {
        padding: 40px 0;
    }
    
    .privacy-header h1 {
        font-size: 2rem;
    }
    
    .privacy-content {
        padding: 20px;
    }
}

/* Фикс для шапки */
.privacy-section {
    margin-top: 80px; /* Отступ под фиксированную шапку */
}

@media (max-width: 768px) {
    .privacy-section {
        margin-top: 60px;
    }
}

/* Мобильная адаптация политики */
@media (max-width: 576px) {
    .privacy-header h1 {
        font-size: 1.8rem;
        line-height: 1.3;
        padding: 0 15px;
        word-break: break-word;
    }
    
    .privacy-content {
        width: 95%;
        padding: 20px 15px;
        margin: 0 auto;
    }
    
    .privacy-content h2 {
        font-size: 1.3rem;
        margin: 25px 0 10px;
    }
    
    .privacy-content p {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .privacy-subheader {
        font-size: 0.95rem;
    }
}

@media (max-width: 400px) {
    .privacy-header h1 {
        font-size: 1.5rem;
    }
    
    .privacy-content {
        padding: 15px 10px;
    }
}

.privacy-title {
    font-size: 2.2rem;
    margin: 0 auto;
    max-width: 90%;
}

@media (max-width: 768px) {
    .privacy-title {
        font-size: 2rem;
        max-width: 100%;
    }
}

.privacy-content {
    box-sizing: border-box;
    width: 100%;
    max-width: 900px; /* Увеличили максимальную ширину */
    margin: 0 auto;
    padding: 30px;
    line-height: 1.7;
}

@media (max-width: 768px) {
    .privacy-content {
        padding: 25px;
        box-shadow: none;
        border-radius: 0;
    }
}