/* ==========================================================================
   1. БАЗА И БАННЕР
   ========================================================================== */
body {
    overflow-x: hidden;
    position: relative;
}

.banner {
    position: relative;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
        url('../img/foto_back.jpg') center/cover;
    height: 60vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 1;
    border-radius: 0px 0px 30px 30px;
}

.banner-content {
    max-width: 800px;
    padding: 0 1rem;
}

.banner p {
    color: rgb(186 186 186 / 95%);
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    font-weight: 700;
}

.banner h1 {
    color: rgb(241 241 241 / 95%);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 0.4em;
    font-weight: 400;
}

/* ==========================================================================
   2. ГАЛЕРЕЯ И КАТАЛОГ
   ========================================================================== */
.content-block {
    padding: 4rem 2rem;
    text-align: center;
    background: #f9f9f9;
}

.content-block h2 {
    color: #2c3e50;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.gallery {
    justify-content: space-around;
    display: flex;
    gap: 1.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.gallery img {
    width: 17.6rem;
    height: 16.8rem;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.gallery img:hover {
    transform: scale(1.03);
}

.catalog {
    position: relative;
    padding: 4rem 2rem;
    background-color: #f9f9f9;
    z-index: 0;
}

.catalog h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 3rem;
    font-size: 2rem;
}

.catalog-grid {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
}

.catalog-item {
    background: #f2eeee;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    width: 17.6rem;
    height: 16.8rem;
    margin: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.catalog-item:hover {
    transform: translateY(-5px);
}

.catalog-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.catalog-item h3 {
    padding: 1rem;
    color: #2c3e50;
}

/* ==========================================================================
   3. КОНТАКТЫ И ФОРМА
   ========================================================================== */
.contacts-page-container {
    width: 100%;
    max-width: 1200px; /* Добавь ограничение как в каталоге */
    margin: 0 auto;    /* Центровка */
    display: flex;
    justify-content: space-evenly;
    scroll-margin-top: 6rem;
}

@media (min-width: 768px) {
    .contact-form-wrapper {
        margin: 2rem;
    }
}

.contact-info {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: min-content;
    width: max-content;
    padding: 2rem;
    background: white;
    border-radius: 23px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    border: solid;
    border-color: lightgray;
}

.contacts-contents {
    margin-top: 1.5rem;
    margin-bottom: 0.7rem;
}

p.happy {
    margin-bottom: -1rem;
}

.form-section-standalone {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 2rem 1rem;
}

.order-form {
    max-width: 550px;
    width: 100%;
    margin: 0;
    padding: 2rem;
    background: white;
    border-radius: 23px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    border: solid;
    border-color: teal;
}


@media (max-width: 360px) {
    .order-form {
        padding: 2rem 1rem;
    }
}

input,
textarea {
    background-color: #e4e4e4;
    border-radius: 5px;
    resize: none;
}

textarea {
    width: 100%;
    height: 6rem;
    margin-bottom: 1rem;
}

.order-form h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.order-form input {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    box-sizing: border-box;
    background-color: #f4f4f4;
}

.order-form button {
    width: 100%;
    background: #5a7650;
    color: white;
    border: none;
    padding: 0.8rem;
    font-size: 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
    box-sizing: border-box;
}

.order-form button:hover {
    background: #177c3e;
}

.form-field-3 {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

.form-input {
    padding: 4px 7px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    width: 100%;
    background-color: #f4f4f4;
}

.our_contacts_text {
    text-align: center;
}

/* ==========================================================================
   4. СТРАНИЦА "О НАС"
   ========================================================================== */
#about-us {
    scroll-margin-top: 6rem;
}

.about-us-container {
    max-width: 1200px;
    margin: 0rem auto;
    padding: 0 2rem;
    padding-top: 4rem;
    line-height: 1.6;
    color: #7c2a2a;
}

.about-us-container h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 2rem;
    font-size: 2.5rem;
}

.about-section {
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.introduction-section p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.values-philosophy-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    justify-content: center;
}

.value-item {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.value-item h3 {
    color: #5a7650;
    margin-bottom: 0.5rem;
}

.signature {
    margin-top: 2rem;
    font-style: italic;
    text-align: right;
}

.values-philosophy-grid .value-item:nth-child(4),
.values-philosophy-grid .value-item:nth-child(5) {
    grid-column: span 2;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    max-width: 550px;
}

/* ==========================================================================
   5. ПОЛИТИКА И ЧЕКБОКСЫ
   ========================================================================== */
.policy_label {
    display: flex;
    margin: 0.4rem 0rem;
    align-items: center;
}

input.policy_checkbox {
    margin: 0.3rem;
    width: 3.1rem;
}

.policy_link {
    color: #5d5e99;
    text-decoration: underline;
}


@media (max-width: 410px) {
    .policy_text {
        margin-left: 10px;
    }
}

input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    background-color: #f4f4f4;
    cursor: pointer;
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

input[type="checkbox"]:checked {
    background-color: #f4f4f4;
    border-color: #e4e4e4;
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 11px;
    top: 4px;
    width: 6px;
    height: 13px;
    border: solid #006412;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.message {
    margin-top: -1rem;
    margin-bottom: 0.5rem;
}

.alert-success {
    color: #155724;
}

.alert-error {
    color: #721c24;
}

.alert-warning {
    color: #856404;
}

/* ==========================================================================
   6. ДЕКОР
   ========================================================================== */
.nash-catalog {
    position: relative;
    z-index: 3;
}

.decor-bg-chair {
    left: -2%;
    position: absolute;
    z-index: 0;
    pointer-events: none;
    top: -19%;
    right: 1171px;
    width: 429px;
    opacity: 0.55;
    transform: rotate(-8deg);
    filter: contrast(0.8);
}

.decor-bg-sofa {
    left: 74%;
    position: absolute;
    z-index: 0;
    pointer-events: none;
    top: -23%;
    right: -162px;
    width: 546px;
    opacity: 0.52;
    transform: rotate(11deg);
    filter: contrast(0.8);
}

/* ==========================================================================
   7. АДАПТИВ (MEDIA QUERIES)
   ========================================================================== */

/* --- Широкие планшеты и малые мониторы (1180px) --- */
@media (max-width: 1180px) {
    .decor-bg-chair {
        left: -16%;
    }
}

/* --- Планшеты в альбомной ориентации (1024px) --- */
@media (max-width: 1024px) {
    /* Сетка "О нас": переход на 2 колонки */
    .values-philosophy-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Сброс центрирования последних элементов в сетке 3/2 */
    .values-philosophy-grid .value-item:nth-child(4),
    .values-philosophy-grid .value-item:nth-child(5) {
        grid-column: auto;
        margin: 0;
        max-width: none;
    }
}

/* --- Переходное состояние для декора (961px) --- */
@media (max-width: 961px) {
    .decor-bg-chair {
        left: -2%;
        top: 60%;
        width: 225px;
    }

    .decor-bg-sofa {
        left: 75%;
        top: -10%;
        width: 254px;
        transform: rotate(10deg);
    }
}

/* --- Смартфоны и малые планшеты (768px) --- */
@media (max-width: 768px) {
    body {
        padding-top: calc(4.5rem + env(safe-area-inset-top));
    }

    /* Отступы основных секций */
    .catalog,
    .content-block,
    .banner-content,
    .about-us-container {
        padding: 2rem 1rem;
    }

    /* Заголовки */
    .catalog h2,
    .content-block h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    /* Сетка каталога: автоподбор колонок */
    .catalog-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
        justify-content: center;
    }

    .catalog-item {
        width: auto;
        height: auto;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .catalog-item img {
        height: 150px;
        margin: 0;
    }

    /* Галерея проектов: в одну колонку */
    .gallery {
        flex-direction: column;
        align-items: center;
    }

    .gallery img {
        width: 100%;
        height: auto;
    }

    /* Сетка "О нас": в одну колонку */
    .values-philosophy-grid {
        grid-template-columns: 1fr;
    }

    /* Карточка товара и фото */
    .product-container {
        flex-direction: column;
        gap: 1.5rem;
    }

    .main-image {
        height: auto;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }

    textarea {
        width: 100%;
    }

    /* Контакты и Форма: выстраивание в стек */
    .contacts-page-container {
        flex-direction: column;
        margin-top: 1rem;
        padding: 0 1rem;
        align-items: anchor-center;
    }

    .contact-form-wrapper {
        margin-top: 1.5rem;
    }

    .contact-info {
        margin-top: 2rem;
        margin-bottom: 1rem;
        height: auto; /* На мобилке фиксированная высота не нужна */
        max-width: -webkit-fill-available;
    }

    /* Политика и чекбоксы */
    .policy_label {
        display: flex;
        align-items: self-start;
        margin: 0.7rem 0rem;
        margin-bottom: 0rem;
        justify-content: space-evenly;
    }

    input.policy_checkbox {
        margin: 0.3rem 0;
        width: 1.9rem;
    }

    textarea.policy_checkbox {
        background-color: #fd0000;
    }

    .policy_text {
        width: 16rem;
    }

    .policy_link {
        color: #5d5e99;
        text-decoration: underline;
    }

    /* Запрет зума инпутов на iOS */
    input,
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* --- Малые смартфоны (500px) --- */
@media (max-width: 500px) {
    .decor-bg-chair {
        left: 40%;
        top: 70%;
        width: 308px;
        transform: scaleX(-1) rotate(-9deg);
    }
}



