* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: Arial, sans-serif;
    background-color: #f0f4f8;
    color: #333;
    line-height: 1.6;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
header {
    background: #2c3e50;
    color: #fff;
    padding: 1rem 0;
}
header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.logo a {
    color: #fff;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}
nav ul {
    list-style: none;
    display: flex;
}
nav ul li {
    margin-left: 20px;
}
nav ul li a {
    color: #fff;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.3s;
}
nav ul li a:hover {
    background: #1a252f;
}
main {
    min-height: 70vh;
    padding: 40px 0;
}
footer {
    background: #2c3e50;
    color: #fff;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}
footer a {
    color: #fff;
    text-decoration: underline;
}
h1 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}
.form-group label {
    width: 200px;
    font-weight: bold;
    color: #2c3e50;
}
.form-group select,
.form-group input[type="number"],
.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="email"] {
    padding: 8px;
    border: 1px solid #b0c4de;
    border-radius: 4px;
    flex: 1;
    min-width: 200px;
}
.form-group input[type="radio"] {
    margin-left: 10px;
    margin-right: 5px;
}
.form-group button {
    background: #2c3e50;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}
.form-group button:hover {
    background: #1a252f;
}

.result {
    background: #e7f0ff;
    padding: 20px;
    border-radius: 4px;
    margin-top: 30px;
    border-left: 5px solid #2c3e50;
}
.result .price {
    font-size: 28px;
    color: #2c3e50;
    font-weight: bold;
}
.result .button {
    display: inline-block;
    background: #2c3e50;
    color: #fff;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 10px;
}
.result .button:hover {
    background: #1a252f;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}
.success {
    background: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}

@media (max-width: 768px) {
    .form-group label {
        width: 100%;
        margin-bottom: 5px;
    }
    nav ul {
        flex-direction: column;
        margin-top: 10px;
    }
    nav ul li {
        margin-left: 0;
        margin-bottom: 5px;
    }
    header .container {
        flex-direction: column;
        text-align: center;
    }
}
.layout-visual {
    margin-top: 30px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.layout-visual h3 {
    margin-top: 0;
    color: #2c3e50;
}
#layoutCanvas {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    background: #fff;
}
.services-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: space-between;
}

.service-item {
    flex: 1 1 180px; /* минимальная ширина 180px, дальше будет сжиматься */
    min-width: 140px; /* на очень узких экранах не даст стать слишком маленьким */
}

.service-item label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 4px;
    font-weight: 600;
    color: #2c3e50;
    white-space: nowrap; /* чтобы текст не переносился */
}

.service-item select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #b0c4de;
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: white;
}

/* Если нужно сделать ещё уже, можно уменьшить padding и шрифт */
@media (max-width: 700px) {
    .service-item {
        flex: 1 1 140px;
    }
    .service-item label {
        font-size: 0.85rem;
    }
    .service-item select {
        padding: 5px;
    }
}

@media (max-width: 500px) {
    .services-row {
        flex-direction: column;
        gap: 10px;
    }
    .service-item {
        width: 100%;
    }
}