/* ===================================
   MAIN CSS - Общие стили для всех страниц
   =================================== */

/* === CSS Variables === */
:root {
    --primary: #848e76;
    --primary-dark: #6b7460;
    --primary-light: #9da890;
    --secondary: #10b981;
    --accent: #8B4513;
    --wood: #D2691E;
    --wood-light: #DEB887;
    --wood-dark: #8B7355;
    --text-dark: #1f2937;
    --text-gray: #6b7280;
    --text-light: #9ca3af;
    --bg-white: #ffffff;
    --bg-gray: #f9fafb;
    --bg-gray-dark: #f3f4f6;
    --border: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-dark);
    background: var(--bg-white);
    line-height: 1.6;
    overflow-x: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* === Word Wrapping === */
* {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6 {
    word-break: break-word;
    hyphens: auto;
}

p, span, a, li, td, th {
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* === Header === */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: all 0.3s ease;
}

header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 0rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: #2d3748;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo img {
    width: 32px;
    height: 32px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
}

nav a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

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

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

nav a:hover::after {
    width: 100%;
}

/* === Dropdown Menu === */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    padding: 0.5rem 0;
}

.dropdown-toggle::after {
    content: '▼';
    font-size: 0.65rem;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-toggle::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 100;
    border: 1px solid var(--border);
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(5px);
}

.dropdown-menu li {
    list-style: none;
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    white-space: nowrap;
    text-align: left;
}

.dropdown-menu a:hover {
    background: var(--bg-gray);
}

.dropdown-menu a::after {
    display: none;
}

/* === Header CTA === */
.header-cta {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.header-cta:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* === Mobile Menu === */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-dark);
    padding: 0.5rem;
    z-index: 1001;
    line-height: 1;
    width: 40px;
    height: 40px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* === Mobile Menu Overlay === */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* === Mobile Menu Panel === */
.mobile-menu-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: white;
    z-index: 1000;
    transition: right 0.3s ease;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    padding: 4rem 1.5rem 2rem;
}

.mobile-menu-panel.active {
    right: 0;
}

.mobile-menu-panel ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mobile-menu-panel li {
    margin: 0;
    border-bottom: 1px solid var(--border);
}

.mobile-menu-panel li:last-child {
    border-bottom: none;
}

.mobile-menu-panel a {
    display: block;
    padding: 1rem 0;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    transition: color 0.3s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.mobile-menu-panel a:hover {
    color: var(--primary);
}

.mobile-menu-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-gray);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
}

.mobile-menu-close:hover {
    background: var(--bg-gray);
    color: var(--text-dark);
}

/* === Buttons === */
.btn {
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
}

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

/* === Footer === */
footer {
    background: var(--text-dark);
    color: white;
    padding: 2rem;
    text-align: center;
}

/* === Modal === */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    padding: 2.5rem;
    max-width: 500px;
    width: 100%;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-gray);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--bg-gray);
    color: var(--text-dark);
}

/* === Forms === */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(107, 142, 35, 0.1);
}

.form-submit {
    width: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 1rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.form-submit:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

#formMessage {
    margin-top: 1rem;
    font-weight: 500;
    text-align: center;
}

/* === Section Base === */
section {
    padding: 5rem 2rem;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.125rem;
    color: var(--text-gray);
    max-width: 600px;
    margin: 0 auto;
}

/* === Services Grid (общий компонент) === */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.service-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

.service-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: white;
}

.service-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.service-card p {
    color: var(--text-gray);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.service-features {
    list-style: none;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.service-features li {
    padding: 0.5rem 0;
    color: var(--text-gray);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.service-features li::before {
    content: '✓';
    color: var(--secondary);
    font-weight: bold;
    font-size: 1.2rem;
}

.service-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}

.service-card-footer {
    margin-top: auto;
    padding-top: 1.5rem;
}

.service-card .btn {
    width: 100%;
    text-align: center;
    margin-top: 0;
}

/* === Benefits Section (общий компонент) === */
.benefits {
    background: var(--bg-gray);
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.benefit-item {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    text-align: center;
    transition: all 0.3s ease;
}

.benefit-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.benefit-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.benefit-item h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.benefit-item p {
    color: var(--text-gray);
}

/* === About Section (общий компонент) === */
.about {
    background: var(--bg-gray);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.requisites-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: var(--shadow);
}

.requisites-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.requisites-item:last-child {
    border-bottom: none;
}

.requisites-label {
    font-weight: 600;
    color: var(--text-gray);
}

.requisites-value {
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    transition: color 0.3s ease;
}

.requisites-value:hover {
    color: var(--primary);
}

/* === Mobile Responsive === */
@media (max-width: 768px) {
    .header-container {
        padding: 1rem;
        position: relative;
    }

    nav {
        display: none;
    }

    .header-cta {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-menu-overlay {
        display: block;
    }

    .hero h1,
    .section-header h2,
    .service-card h3,
    .benefit-item h3 {
        word-break: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }

    .logo span {
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    section {
        padding: 3rem 1rem;
    }

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

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

    .requisites-item {
        flex-direction: column;
        gap: 0.5rem;
    }

    .requisites-value {
        text-align: left;
    }
}
