:root {
    --primary: #4361ee;
    --secondary: #56b99c;
    --accent: #4895ef;
    --light: #f8f9fa;
    --dark: #212529;
    --success: #4cc9f0;
    --warning: #f8961e;
    --danger: #f94144;
    --black: #17202A;
    --green: #00825C
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: #ffffff;
    margin: 0 auto;
}

header {
    text-align: center;
    padding: 20px 0;
    background: linear-gradient(135deg, var(--green), var(--secondary));
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
    margin: 15px auto 30px;
}

header h1 {
    margin-bottom: 0;
}

header p {
    margin-top: 8px;
}

h1, h2, h3 {
    margin-top: 0;
}

h1 {
    font-size: 2.2rem;
}

.container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}
@media (max-width: 768px) {
    .container {
        gap: 15px;
    }
}

.calculator-section, .visualization-section{
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.description-section {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    max-width: 1200px;
    margin: 30px auto 0;
}
.description-section > div {
    padding: 25px;
}

.input-group {
    margin-bottom: 20px;
    margin-right: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
}

input, select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border 0.3s;
}

input:focus, select:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

button {
    background: var(--green);
    color: white;
    padding: 14px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s;
    margin-top: 10px;
}

button:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.results {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
    border-left: 4px solid var(--green);
}

.result-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.result-value {
    font-weight: 700;
    color: var(--primary);
}

.calculation-details {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

.cost-summary {
    background: #e9f7ef;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.total-cost {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--primary);
    margin-top: 10px;
}

#3d-container {
    width: 100%;
    height: 400px;
    background: #f0f0f0;
    border-radius: 8px;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

.color-picker {
    display: flex;
    margin-top: 10px;
}

.color-option {
    display: inline-block;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
    cursor: pointer;
    border: 2px solid transparent;
}

.color-option.selected {
    border-color: var(--dark);
}

.controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.controls button {
    width: auto;
    padding: 8px 16px;
}

.gate-details {
    margin-top: 10px;
    padding-left: 15px;
}

@media (max-width: 900px) {
    .container {
        grid-template-columns: 1fr;
    }
}

.calculators-grid {
    display: flex;
    gap: 45px;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 20px auto;
}
@media (max-width: 1280px) {
    .calculators-grid {
        gap: 30px;
        padding: 0 20px;
    }
}

@media (max-width: 768px) {
    .calculators-grid {
        gap: 20px;
    }
}

.calculator-card {
    flex: 1 1 48%;
    background: white;
    overflow: hidden;
    position: relative;
}

.calculator-card:hover {

}

.calculator-card a {
    text-decoration: none;
    display: block;
}

.calculator-card img {
    width: 100%;
    object-fit: cover;
}

.calculator-card .card-info {
    display: flex;
    justify-content: space-between;
}

.calculator-card h2 {
    font-size: 32px;
    padding: 0;
    margin: 0;
    color: var(--black);
}

.calculator-card p {
    font-size: 18px;
    margin: 0;
    color: #1F312C;
}
.calculator-card .btn-calculate {
    margin: auto 0;
}
@media (max-width: 768px) {
    .calculator-card h2 {
        font-size: 20px;
    }
    .calculator-card p {
        font-size: 12px;
    }
}

.coming-soon {
    position: relative;
    opacity: 0.8;
}

.coming-soon::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
}

.coming-soon span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--primary);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: bold;
    z-index: 1;
}

.fence-text {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-top: 40px;
    line-height: 1.7;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 1280px) {
    padding: 0 20px;
}

.fence-text h2, .fence-text h3 {
    color: var(--dark);
}

.fence-text ul {
    padding-left: 20px;
}

.fence-text li {
    margin-bottom: 8px;
}

@media (max-width: 600px) {
    .calculators-grid {
        grid-template-columns: 1fr;
    }
}

/* Навигационное меню */
.main-nav {
    background-color: #444547;
    border-bottom: 1px solid #98999E;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-radius: 0px;
}

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

.logo {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
}
.logo img {
    display: block;
}

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

.nav-links li {
    margin-left: 25px;
    position: relative;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav-links a:hover {
    opacity: 0.8;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    padding: 10px 0;
    list-style: none;
    z-index: 100;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    color: var(--dark);
    display: block;
    padding: 8px 15px;
}

.dropdown-menu a:hover {
    background: #f5f7fa;
}

.arrow {
    font-size: 0.7em;
}

.coming-soon-link {
    position: relative;
    opacity: 0.7;
}

.coming-soon-link::after {
    content: 'скоро';
    position: absolute;
    top: -8px;
    right: -25px;
    background: var(--accent);
    color: white;
    font-size: 0.7em;
    padding: 2px 5px;
    border-radius: 10px;
}

/* Футер */
.footer {
    background: #444547;
    color: white;
    padding: 40px 0;
    margin-top: 50px;
}

.footer .container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.footer-section {
    text-align: center;
}
.footer-section h3 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section li {
    margin-bottom: 10px;
}

.footer-section a {
    color: #ddd;
    text-decoration: none;
}

.footer-section a:hover {
    color: white;
}

.footer-section p {
    margin: 5px 0;
    color: #ddd;
}

.btn {
    display: inline-block;
    background: var(--green);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.3s;
}

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

@media (max-width: 991px) {
    .btn {
        font-size: 12px;
        padding: 5px 10px;
        border-radius: 3px;
    }
}

.header {
    display: flex;
    flex-direction: column;
}

.header picture{
    width: 100%;
    display: block;
    height: auto;
}
.header picture img{
    width: 100%;
}

.header .header-content {
    display: flex;
    flex-direction: row;
    max-width: 1200px;
    margin: 60px auto 0;
    padding: 0 20px;
}

.header .header-content .header-content-image {
    flex-grow: 1;
    flex-basis: 500px;
    position: relative;
}

.header .header-content .header-text {
    flex-grow: 0.5;
}

.green-line {
    width: 165px;       /* Line width */
    height: 4px;       /* Line thickness */
    background-color: #0C7E5C;
}

.header .calculator {
    position: absolute;
    top: -405px;
    left: -100px;
    height: 682px;
}


.header .header-text {

}

.header .header-text h1 {
    margin-top: 35px;
    margin-bottom: 0;
    font-size: 64px;
    color: #17202A;
}

.header .header-text p {
    font-size: 32px;
    margin-top: 0;
    color: #1F312C;
    white-space: normal;
    word-wrap: break-word; /* legacy */
    overflow-wrap: break-word; /* современный аналог */
}

@media (max-width: 1280px) {
    .header .header-content {
        margin: 60px 20px 0;
        padding: 0;
    }
    .header .header-text h1 {
        font-size: 52px;
    }
    .header .header-text p {
        font-size: 24px;
    }
    .header .header-content-image {
        display: none;
    }
}

@media (max-width: 768px) {
    .header .header-content {
        margin: 0 16px;
        padding: 0;
    }
    .green-line {
        display: none;
    }
    .header .header-text h1 {
        margin-top: 32px;
        font-size: 28px;
    }
    .header .header-text p {
        font-size: 16px;
    }
}


/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100vh; /* Full viewport height */
    overflow: auto; /* Allows scroll if modal content is too large */
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 25px;
    border-radius: 8px;
    max-width: 500px;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Форма обратной связи */
.form-group {
    margin-right: 25px;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
}

.honeypot {
    position: absolute;
    left: -5000px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .main-nav .container {
        flex-direction: column;
    }
    
    .nav-links {
        margin-top: 0;
    }
    
    .nav-links li {
        margin-left: 15px;
    }
    
    .modal-content {
        margin: 20% auto;
        width: 90%;
    }
}