/* ==========================================================================
   1. Global Styles & Variables
   ========================================================================== */

:root {
    --color-primary: #0047ab;
    --primary-darken-1: hsl(215.09, 100%, 32%);
    --primary-darken-2: hsl(215.09, 100%, 29%);
    --primary-darken-3: hsl(215.09, 100%, 24%);
    --primary-lighten-1: hsl(215.09, 100%, 44%);
    --color-primary-dark: #111c40;
    --color-secondary: #5b6aa0;
    --color-accent: #3b6aa3;
    --color-light-bg: #f4f6f9;
    --color-text-light: #ffffff;
    --color-text-dark: #333333;
    --color-text-muted: #666666;

    --font-family-base: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-family-heading: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-size-base: 1rem;
    --line-height-base: 1.6;

    --container-width: 1140px;
    --container-padding: 1.5rem;

    --spacing-unit: 1rem;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    /* 1. Добавляем плавную прокрутку для всей страницы */
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-text-dark);
    background-color: var(--color-text-light);
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: calc(var(--spacing-unit) * 0.5);
    line-height: 1.2;
    font-family: var(--font-family-heading);
    font-weight: 600;
}

h3 {
    font-size:  2rem;;
}

p {
    margin-top: 0;
    margin-bottom: var(--spacing-unit);
}

/* ==========================================================================
   2. Layout & Helpers
   ========================================================================== */

.page-wrapper {
    overflow-x: hidden; /* Prevents horizontal scroll */
}

.container {
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

.grid {
    display: flex;
    flex-wrap: wrap;
    gap: calc(var(--spacing-unit) * 2);
}

.grid > * {
    flex-grow: 1;
}

.grid--2-cols > * { flex-basis: 45%; }
.grid--3-cols > * { flex-basis: 30%; }
.grid--4-cols > * { flex-basis: 22%; }

@media (max-width: 992px) {
    .grid--4-cols > * {
        flex-basis: 45%;
    }
}

@media (max-width: 768px) {
    .grid--2-cols > *,
    .grid--3-cols > *,
    .grid--4-cols > * {
        flex-basis: 100%;
    }
}

/* ==========================================================================
   3. Components
   ========================================================================== */

/* --- Header --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    transition: background-color 0.3s ease;
    background-color: rgba(0, 0, 0, 0.616);
}

.header.scrolled {
    background-color: rgba(0, 0, 0, 0.8);
}

.header__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.header__logo {
    margin-top:10px;
    width: 210px;
   
   
}

.header__nav {
    display: flex;
    gap: 2rem;
}

.header__nav-link {
    color: var(--color-text-light);
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 11px;
    transition: color 0.2s;
}

.header__nav-link:hover,
.header__nav-link.active { /* 2. Добавляем стиль для активной ссылки */
    color: gold;
}

/* --- Burger Menu Button --- */
.header__burger-btn {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    z-index: 110; /* Above the nav menu */
}

.header__burger-btn span {
    display: block;
}

/* --- Hero Section --- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 0;
    color: var(--color-text-light);
    background: url('i/head.jpg') center/cover no-repeat;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.482);
    z-index: 0;
}

.hero__container {
    text-align: center;
    z-index: 1;
    position: relative;
}

.hero__title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    max-width: 35ch;
    margin-left: auto;
    margin-right: auto;
    text-wrap: balance;
    text-transform: uppercase;
    text-shadow: 0 4px 3px rgba(0,0,0,.4),0 8px 13px rgba(0,0,0,.1),0 18px 23px rgba(0,0,0,.1);
}

.hero__subtitle {
    font-size: 1.3rem;
    max-width: 60ch;
    margin: 1rem auto 0;
    opacity: 0.9;
}

/* --- Section --- */
.section {
    padding: calc(var(--spacing-unit) * 4) 0;
}

/* 3. Добавляем отступ для якорных ссылок, чтобы контент не уезжал под хедер */
section[id] {
    scroll-margin-top: 120px; /* 70px (высота хедера) + 50px (желаемый отступ) */
}

.section--light-bg { background-color: var(--color-light-bg); }
.section--dark-bg, .section:not(.section--light-bg) {
    background-color: var(--color-primary);
    color: var(--color-text-light);
}
.section--dark-bg .section__title { color: var(--color-text-light); }
.section--dark-bg .section__label { opacity: 0.8; }

.section > .container > .section__label,
.section > .container > .section__title,
.section > .container > .section__description {
    text-align: center;
}

.section__label {
    display: block;
    margin-bottom: calc(var(--spacing-unit) * 0.5);
    font-weight: 500;
    color: var(--color-text-muted);
    opacity: 0.9;
    text-transform: uppercase;
}

.section__title {
    font-size: clamp(1.75rem, 5vw, 2.25rem);
    margin-bottom: var(--spacing-unit);
    text-wrap: balance;
    text-transform: uppercase;
    font-weight: 700;
}

.section__title--dark { color: var(--color-primary-dark); font-weight: 700; }
.section--light-bg .section__label { color: var(--color-text-muted); }

.section__description {
    max-width: 65ch;
    margin-bottom: calc(var(--spacing-unit) * 2);
}

/* Modifier for left alignment */
.section--align-left > .container > .section__label,
.section--align-left > .container > .section__title,
.section--align-left > .container > .section__description {
    text-align: left;
}

/* --- Feature Card --- */
.feature-card {
   
    /* text-align: center; */
}
.feature-card__image-placeholder {
    /* aspect-ratio: 100 / 65; */
   
    margin-bottom: var(--spacing-unit);
}
.feature-card__title {
    text-transform: uppercase;
    font-size: 1.15rem;
    color: var(--color-text-light);
}
.feature-card__text {
    color: var(--color-text-light); 
    
}

/* --- Split Section --- */
.split-section {
    display: flex;
    gap: calc(var(--spacing-unit) * 3);
    align-items: flex-start;
    margin: calc(var(--spacing-unit) * 3) 0;
}

.split-section > * {
    flex: 1;
}

.split-section--reverse .split-section__image-placeholder {
    order: 2;
}

@media (max-width: 768px) {
    .split-section,
    .split-section--reverse {
        flex-direction: column;
    }
    .split-section--reverse .split-section__image-placeholder {
        order: -1;
    }
}

.split-section__image-placeholder {
    width: 100%;
 
}
.split-section__image-placeholder--management { aspect-ratio: 100 / 75; }
.split-section__image-placeholder--city-main { }
.split-section__image-placeholder--building { }
.split-section__image-placeholder--map { aspect-ratio: 100 / 56; background-color: var(--color-accent); }

/* --- Image Placeholders --- */
.image-placeholder {
    width: 100%;
   
}
.image-placeholder--city {
    aspect-ratio: 100 / 55;
}

/* --- Product Card --- */
.product-card {
  
     background-color: var(--primary-darken-2);
    padding: var(--spacing-unit);
     text-align: center; 
}
.product-card__image-placeholder {

    /* Same as card bg, can be different */
     margin-bottom: var(--spacing-unit);
}
.product-card__name {
    font-size: 1.1rem;
    color: var(--color-text-light);
    text-align: left;
      margin-bottom: var(--spacing-unit);
}

.product-card__description {
    font-size: 1rem;
    color: var(--color-text-light);
    text-align: left;
    /* opacity: 0.7; */
}

/* --- Contact Form --- */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit);
}

.contact-form input,
.contact-form textarea,
.contact-form button {
    width: 100%;
    padding: var(--spacing-unit);
    font-family: inherit;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.contact-form textarea {
    resize: vertical;
}

.button {
    background-color: var(--color-accent);
    color: var(--color-text-light);
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.button:hover {
    background-color: var(--color-primary);
}

/* --- Separator --- */
.separator {
    height: 70px;
    margin-top: -2px;
    margin-bottom: -2px;
}

.separator__svg {
    width: 100%;
    height: 100%;
}

.separator__fill-primary {
    fill: var(--color-primary);
}

.separator__fill-light {
    fill: var(--color-light-bg);
}

.separator--reverse .separator__fill-primary {
    fill: var(--color-light-bg);
}
.separator--reverse .separator__fill-light {
    fill: var(--color-primary);
}

/* --- Footer --- */
.footer {
    background-color: #333;
    color: var(--color-text-light);
    padding: calc(var(--spacing-unit) * 2) 0;
    text-align: center;
    font-size: 0.9rem;
}

.footer p {
    margin-bottom: calc(var(--spacing-unit) * 0.5);
    opacity: 0.8;
}

.footer p:last-child {
    margin-bottom: 0;
}

/* --- Checkbox in Form --- */
.form-group-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.form-group-checkbox input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 4px;
    width: auto; /* Override general input styles */
}

.personal-data-checkbox-label a {
    color: var(--color-accent);
    text-decoration: underline;
    cursor: pointer;
}

/* --- Modal --- */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
}

.modal.is-open {
    display: block;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 80%;
    max-width: 800px;
    position: relative;
    border-radius: 8px;
    color: var(--color-text-dark);
}

.modal-content h2 {
    color: var(--color-primary-dark);
    margin-top: 0;
}

.modal-content ul {
    padding-left: 20px;
}

.modal-buttons {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.button--secondary {
    background-color: var(--color-text-muted);
}

.button--secondary:hover {
    background-color: #555;
}

/* ==========================================================================
   4. Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
    :root {
        --font-size-base: 1rem;
        --container-padding: 1rem;
    }

    .section {
        padding: calc(var(--spacing-unit) * 3) 0;
    }

    .header__container {
        justify-content: space-between;
    }

    .header__nav {
        position: fixed;
        inset: 0;
        background-color: rgba(0, 0, 0, 0.95);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2.5rem;

        /* Hide by default */
        opacity: 0;
        visibility: hidden;
        transform: translateY(-100%);
        transition: transform 0.4s ease, opacity 0.4s ease, visibility 0.4s;
    }

    .header__nav.is-open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .header__nav-link {
        font-size: 1.25rem;
    }

    .header__burger-btn {
        display: flex;
        align-items: center;
        position: relative;
        width: 26px;
        height: 26px;
    }

    .header__burger-btn span,
    .header__burger-btn span::before,
    .header__burger-btn span::after {
        display: block;
        position: absolute;
        width: 100%;
        height: 2px;
        background-color: var(--color-text-light);
        transition: transform 0.3s ease, top 0.3s ease;
    }

    .header__burger-btn span::before { content: ''; top: -8px; }
    .header__burger-btn span::after { content: ''; top: 8px; }

    .header__nav.is-open + .header__burger-btn span {
        transform: rotate(45deg);
    }
    .header__nav.is-open + .header__burger-btn span::before { top: 0; transform: rotate(0); }
    .header__nav.is-open + .header__burger-btn span::after { top: 0; transform: rotate(90deg); }

}

/* ==========================================================================
   5. Animations
   ========================================================================== */

.animated-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animated-element.is-visible {
    opacity: 1;
    transform: translateY(0);
}

#advantages {
    padding-bottom: 0;
        margin-bottom: 0;
}
#contacts{
    padding-top:0;
    margin-top:0
}

#advantages .split-section {
    margin-bottom: 0px;
}


#contacts {
    padding-top:40px
}
#contacts .split-section {
    margin-top: 0;
}

#advantages h2, #advantages .section__label {
   color: var(--primary-darken-2);
}

.advantage-card h3 {
    font-size:18px;
    font-weight: 700;
    color: #ccc;
    margin-bottom: 10px;
    text-transform: uppercase;
}
.advantage-card div {
    background-color: var(--color-primary);
    color: var(--color-text-light);
    padding:20px
}

.advantage-card p {
    margin: 0;
}

.advantage-card div:nth-child(even) {
    background-color: var(--primary-darken-2);
}

#products .titlebox , #innovation .titlebox, #about .titlebox{
    color: #fff;
    border-left:4px white solid;
    padding-left: 10px;
}
#products .titlebox .section__label,  #about .titlebox .section__label {
    color: white;
}

#products .subtitlebox {
    margin-bottom: 20px;
}
#innovation .titlebox .section__label {
    color: white;
}

#presence .titlebox, #advantages .titlebox {
    color: var(--primary-darken-2);
     border-left:4px var(--primary-darken-2) solid;
    padding-left: 10px;
}

#presence .titlebox .section__label , #presence h3{
    color: var(--primary-darken-2);
    text-transform: uppercase;
}

.contact-form input.checkbox {
    float: left;
    width: 30px;
}
