/* ==========================================================================
   1. ОСНОВНОЙ КОНТЕЙНЕР (ВЗЯТО ИЗ INDEX)
   ========================================================================== */
.contacts-page-container {
    width: 100%;
    max-width: 1200px; /* Добавь ограничение как в каталоге */
    margin: 0 auto;    /* Центровка */
    display: flex;
    justify-content: space-evenly;
    scroll-margin-top: 6rem;
    padding-top: 2rem; /* Чтобы не заехало под хедер на отдельной странице */
    padding-bottom: 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;
}

h1 {
    text-align: center;
}

/* ==========================================================================
   2. СТИЛИ ФОРМЫ (ВЗЯТО ИЗ INDEX)
   ========================================================================== */
.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;
}

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

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

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

.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;
}

.form-input {
    padding: 4px 7px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    width: 100%;
    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;
}

/* ==========================================================================
   3. ПОЛИТИКА И ЧЕКБОКС (ВЗЯТО ИЗ INDEX)
   ========================================================================= */
.policy_label {
    display: flex;
    margin: 0.4rem 0rem;
    margin-bottom: 0rem;
    align-items: center;
}

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

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

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; }

/* ==========================================================================
   4. АДАПТИВ (ВЗЯТО ИЗ INDEX @MEDIA 768PX)
   ========================================================================== */
@media (max-width: 768px) {
    .contacts-page-container {
        flex-direction: column;
        margin-top: 0rem;
        padding: 0rem 1rem 2rem; /* Увеличил отступ сверху для мобилки */
        align-items: anchor-center;
    }

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

    .contact-info{
        margin-top: 1rem;
        margin-bottom: 1rem;
        height: auto; /* На мобилке фиксированная высота не нужна */
        /* max-width: -webkit-fill-available; */
        width: -webkit-fill-available; /* Для Safari/Chrome */
        width: -moz-available;         /* Для Firefox */
        width: 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;
    }

    .policy_text {
        width: 16rem;
    }

    /* Фикс зума на iPhone */
    input, textarea, select {
        font-size: 16px !important;
    }
}

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