/* wp-content/plugins/custom-calculator/css/calculator-styles.css */

/* Подключаем шрифт Montserrat */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

/* Основные стили калькулятора */
.custom-calculator-wrapper {
    font-family: 'Montserrat', sans-serif;
    background: #141416;
    color: #FFFFFF;
    padding: 40px;
    border-radius: 12px;
    max-width: 1000px;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    box-sizing: border-box; /* Учитываем padding в ширине */
}

/* Стили для табов */
.custom-calculator-wrapper .choice-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    border-bottom: 1px solid #171719;
    padding-bottom: 5px;
}

.custom-calculator-wrapper .choice-top li {
    display: flex;
    justify-content: center;
    cursor: pointer;
    color: #B0B0B0;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.custom-calculator-wrapper .choice-top li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #171719;
    color: #B0B0B0;
    margin-right: 12px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.custom-calculator-wrapper .choice-top li.active {
    color: #E1B261;
}

.custom-calculator-wrapper .choice-top li.active span {
    background: #E1B261;
    color: #141416;
    box-shadow: 0 0 8px rgba(225, 178, 97, 0.5);
}

/* Стили для контента */
.custom-calculator-wrapper .choice-bottom {
    position: relative;
    height: 450px; /* Фиксированная высота для десктопа */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

/* Заголовки h2 и h4 внутри калькулятора */
.custom-calculator-wrapper h2 {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 30px !important;
    font-weight: 700 !important;
    margin-bottom: 6px !important;
    color: #FFFFFF !important;
    letter-spacing: 0.5px !important;
    text-align: center !important;
    border-bottom: 1px solid #e1b261 !important;
    padding-bottom: 3px !important;
    line-height: normal !important;
}

.custom-calculator-wrapper h4 {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #E1B261 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    margin: 0 !important;
    line-height: normal !important;
}

.custom-calculator-wrapper .item {
    display: none;
    width: 100%;
    height: 100%;
}

.custom-calculator-wrapper .item.visible {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    height: 100%;
    margin: 0;
}

/* Стили для блока с информацией о метрах ткани */
.custom-calculator-wrapper .fabric-meter-info {
    margin-bottom: 5px;
    text-align: center;
}

.custom-calculator-wrapper .fabric-meter-info p {
    font-size: 16px;
    font-weight: 500;
    color: #B0B0B0;
}

.custom-calculator-wrapper .fabric-meter-info span {
    color: #E1B261;
    font-weight: 600;
}

/* Стили для элементов выбора */
.custom-calculator-wrapper .row-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.custom-calculator-wrapper .child-item {
    background: #171719;
    border: 1px solid #ffffff;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 180px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 80px;
}

.custom-calculator-wrapper .child-item:hover {
    border-color: #E1B261;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.custom-calculator-wrapper .child-item.active {
    border-color: #E1B261;
    background: #FFF;
    color: #E1B261;
    box-shadow: 0 0 10px rgba(225, 178, 97, 0.4);
}

.custom-calculator-wrapper .furniture-img img {
    max-width: 100%;
    height: auto;
    margin-bottom: 6px;
    border-radius: 4px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.custom-calculator-wrapper .child-item span,
.custom-calculator-wrapper .child-item p {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.2;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    margin:0;
}

/* Стили для иконок Font Awesome */
.custom-calculator-wrapper .child-item i {
    font-size: 18px;
    margin-bottom: 5px;
    color: #FFFFFF;
    transition: color 0.3s ease;
}

.custom-calculator-wrapper .child-item.active i {
    color: #E1B261;
}

/* Стили для декоративных элементов */
.custom-calculator-wrapper .decor-item {
    width: 105px;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* Стили для блока цены и контактов */
.custom-calculator-wrapper .payment-details {
    display: none;
    margin-top: 6px;
    background: #171719;
    padding: 6px;
    border-radius: 8px;
    border: 1px solid #ffffff;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 6px;
    height: calc(100% - 6px);
    flex-wrap: wrap;
    overflow: hidden; /* Предотвращаем переполнение */
}

.custom-calculator-wrapper .item.payment.visible .payment-details {
    display: flex;
}

.custom-calculator-wrapper .payment-details .left,
.custom-calculator-wrapper .payment-details .right {
    width: 48%;
    text-align: center;
    margin-bottom: 0;
    min-height: 0;
    box-sizing: border-box; /* Учитываем padding и border в ширине */
}

.custom-calculator-wrapper .payment-details .left p {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 15px; /* Уменьшено расстояние между строками */
    color: #FFF;
    line-height: 1.2; /* Уменьшено для более плотного текста */
}

.custom-calculator-wrapper .payment-details b {
    font-weight: 600;
    color: #E1B261;
}

.custom-calculator-wrapper .payment-details h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #FFFFFF;
    text-align: center;
}

.custom-calculator-wrapper .payment-details .phone a {
    display: block;
    color: #E1B261;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
    transition: color 0.3s ease;
}

.custom-calculator-wrapper .payment-details .phone a:hover {
    color: #FFFFFF;
    text-decoration: underline;
}

/* Изменение цвета суммы "Итого" */
.custom-calculator-wrapper .payment-details .total {
    color: #FFFFFF;
    font-weight: 600;
}

/* Стили для формы обратной связи Contact Form 7 */
.custom-calculator-wrapper .contact-form .wpcf7-form {
    margin-top: 6px;
}

.custom-calculator-wrapper .contact-form .wpcf7-form p {
    margin-bottom: 5px;
    color: #FFFFFF;
}

.custom-calculator-wrapper .contact-form .wpcf7-form input[type="text"],
.custom-calculator-wrapper .contact-form .wpcf7-form input[type="tel"],
.custom-calculator-wrapper .contact-form .wpcf7-form input[type="hidden"] {
    width: 100%;
    padding: 4px;
    border: 1px solid #ffffff;
    border-radius: 8px;
    background: #171719;
    color: #FFFFFF;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    box-sizing: border-box;
}

.custom-calculator-wrapper .contact-form .wpcf7-form input[type="text"]:focus,
.custom-calculator-wrapper .contact-form .wpcf7-form input[type="tel"]:focus {
    border-color: #E1B261;
    outline: none;
    box-shadow: 0 0 5px rgba(225, 178, 97, 0.5);
}

.custom-calculator-wrapper .contact-form .wpcf7-form input[type="submit"] {
    background: #E1B261;
    border: none;
    color: #141416;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    width: 100%;
}

.custom-calculator-wrapper .contact-form .wpcf7-form input[type="submit"]:hover {
    background: #FFFFFF;
    color: #E1B261;
    box-shadow: 0 0 10px rgba(225, 178, 97, 0.4);
}

/* Скрываем поля с классом wpcf7-hidden */
.custom-calculator-wrapper .contact-form .wpcf7-form .wpcf7-hidden,
.custom-calculator-wrapper .contact-form .wpcf7-form input[type="hidden"] {
    display: none !important;
    height: 0;
    margin: 0;
    padding: 0;
    visibility: hidden;
}

.custom-calculator-wrapper .contact-form .wpcf7-form p:has(.wpcf7-hidden) {
    display: none;
    margin: 0;
    padding: 0;
    height: 0;
}

/* Уведомления Contact Form 7 */
.custom-calculator-wrapper .contact-form .wpcf7-response-output {
    margin: 6px 0 0 0;
    padding: 5px;
    border: 1px solid #E1B261;
    border-radius: 8px;
    background: #171719;
    color: #E1B261;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 500;
    text-align: center;
    box-shadow: 0 0 10px rgba(225, 178, 97, 0.2);
    transition: all 0.3s ease;
}

.custom-calculator-wrapper .contact-form .wpcf7-response-output.wpcf7-mail-sent-ok {
    border-color: #E1B261;
    color: #E1B261;
    background: #171719;
}

.custom-calculator-wrapper .contact-form .wpcf7-response-output.wpcf7-validation-errors,
.custom-calculator-wrapper .contact-form .wpcf7-response-output.wpcf7-mail-sent-ng {
    border-color: #ff5555;
    color: #ff5555;
    background: #171719;
}

/* Стили для кнопок "Назад" и "Далее" */
.custom-calculator-wrapper .choice-nav {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}

.custom-calculator-wrapper .choice-nav .prev,
.custom-calculator-wrapper .choice-nav .next {
    background: #171719;
    border: 1px solid #E1B261;
    color: #E1B261;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 28px;
}

.custom-calculator-wrapper .choice-nav .prev:hover,
.custom-calculator-wrapper .choice-nav .next:hover,
.custom-calculator-wrapper .choice-nav .prev:active,
.custom-calculator-wrapper .choice-nav .next:active {
    background: #171719 !important;
    color: #FFF !important; /* Чёрный цвет для максимального контраста */
    box-shadow: 0 0 10px rgba(225, 178, 97, 0.4) !important;
    font-size: 12px !important; /* Временное увеличение шрифта для проверки */
}

.custom-calculator-wrapper .choice-nav .prev.hidden,
.custom-calculator-wrapper .choice-nav .next.hidden {
    display: none;
}

/* Уменьшаем отступы между секциями */
.custom-calculator-wrapper .size,
.custom-calculator-wrapper .pomp,
.custom-calculator-wrapper .filler,
.custom-calculator-wrapper .fabric,
.custom-calculator-wrapper .price,
.custom-calculator-wrapper .decor {
    margin-bottom: 6px;
}

/* Адаптивные стили */
@media (max-width: 768px) {
    .custom-calculator-wrapper {
        padding: 20px;
        max-width: 100%;
        width: 100%; /* Убедимся, что контейнер не превышает ширину экрана */
    }

    .custom-calculator-wrapper .choice-top {
        flex-direction: column;
        align-items: center;
        gap: 4px;
        margin-bottom: 6px;
        padding: 0;
    }

    .custom-calculator-wrapper .choice-top li {
        font-size: 14px;
        max-width: 300px;
        justify-content: center;
    }

    .custom-calculator-wrapper .choice-top li span {
        width: 28px;
        height: 28px;
        font-size: 12px;
        margin-right: 10px;
    }

    .custom-calculator-wrapper h2 {
        font-size: 14px !important;
        margin-bottom: 5px !important;
    }

    .custom-calculator-wrapper h4 {
        font-size: 8px !important;
    }

    .custom-calculator-wrapper .child-item {
        width: 90px;
        padding: 8px;
        min-height: 50px;
    }

    .custom-calculator-wrapper .decor-item {
        width: 70px;
        min-height: 40px;
    }

    .custom-calculator-wrapper .row-items {
        gap: 5px;
    }

    .custom-calculator-wrapper .choice-bottom {
        height: auto; /* Убираем фиксированную высоту, чтобы контент помещался */
        min-height: 600px; /* Минимальная высота для сохранения пропорций */
    }

    .custom-calculator-wrapper .item.visible {
        height: auto; /* Позволяем высоте адаптироваться под контент */
    }

    .custom-calculator-wrapper .payment-details {
        flex-direction: column !important; /* Блоки строго друг под другом */
        align-items: center;
        gap: 5px;
        padding: 5px;
        margin-top: 5px;
        height: auto; /* Позволяем высоте адаптироваться под контент */
        min-height: 400px; /* Минимальная высота для видимости */
        max-width: 100%; /* Убедимся, что ширина не превышает контейнер */
        overflow-x: hidden; /* Предотвращаем горизонтальное переполнение */
        overflow-y: auto; /* Добавляем прокрутку, если контент не помещается */
    }

    .custom-calculator-wrapper .payment-details .left,
    .custom-calculator-wrapper .payment-details .right {
        width: 100% !important; /* Полная ширина для обоих блоков */
        max-width: 100%; /* Ограничиваем ширину */
        margin-bottom: 10px; /* Увеличиваем отступ между блоками */
        box-sizing: border-box;
        display: block; /* Убедимся, что блок отображается */
    }

    .custom-calculator-wrapper .payment-details .right {
        display: block !important; /* Гарантируем, что блок .right виден */
    }

    .custom-calculator-wrapper .payment-details h3 {
        font-size: 12px;
        margin-bottom: 5px;
    }

    .custom-calculator-wrapper .payment-details .left p {
        font-size: 8px;
        margin-bottom: 1px; /* Уменьшено расстояние между строками */
        line-height: 1.1; /* Уменьшено для более плотного текста */
    }

    .custom-calculator-wrapper .payment-details .phone a {
        font-size: 9px;
    }

    .custom-calculator-wrapper .choice-nav .prev,
    .custom-calculator-wrapper .choice-nav .next {
        padding: 4px 10px;
        font-size: 8px;
        min-height: 26px;
    }

    .custom-calculator-wrapper .choice-nav .prev:hover,
    .custom-calculator-wrapper .choice-nav .next:hover,
    .custom-calculator-wrapper .choice-nav .prev:active,
    .custom-calculator-wrapper .choice-nav .next:active {
        background: #141416 !important;
        color: #FFF !important; /* Чёрный цвет для максимального контраста */
        box-shadow: 0 0 10px rgba(225, 178, 97, 0.4) !important;
        font-size: 10px !important; /* Временное увеличение шрифта для проверки */
    }

    .custom-calculator-wrapper .contact-form .wpcf7-form input[type="submit"] {
        padding: 4px 10px;
        font-size: 8px;
    }

    .custom-calculator-wrapper .contact-form .wpcf7-form input[type="text"],
    .custom-calculator-wrapper .contact-form .wpcf7-form input[type="tel"] {
        width: 100%;
        max-width: 100%; /* Убедимся, что поля формы не выходят за пределы */
        box-sizing: border-box;
    }

    .custom-calculator-wrapper .contact-form .wpcf7-response-output {
        font-size: 8px;
        padding: 4px;
    }

    .custom-calculator-wrapper .size,
    .custom-calculator-wrapper .pomp,
    .custom-calculator-wrapper .filler,
    .custom-calculator-wrapper .fabric,
    .custom-calculator-wrapper .price,
    .custom-calculator-wrapper .decor {
        margin-bottom: 5px;
    }
}

@media (max-width: 480px) {
    .custom-calculator-wrapper {
        padding: 15px;
        width: 100%; /* Убедимся, что контейнер не превышает ширину экрана */
    }

    .custom-calculator-wrapper .choice-top li {
        font-size: 12px;
        max-width: 250px;
    }

    .custom-calculator-wrapper .choice-top li span {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .custom-calculator-wrapper h2 {
        font-size: 16px !important;
        margin-bottom: 3px !important; /* Уменьшено */
    }

    .custom-calculator-wrapper h4 {
        font-size: 16px !important;
    }

    .custom-calculator-wrapper .child-item {
        width: 105px; /* Уменьшено */
        padding: 10px; /* Уменьшено */
        min-height: 50px; /* Уменьшено */
    }

    .custom-calculator-wrapper .decor-item {
        width: 78px; /* Уменьшено */
        min-height: 25px; /* Уменьшено */
    }

    .custom-calculator-wrapper .row-items {
        gap: 5px; /* Уменьшено */
        flex-direction: row;
        flex-wrap: wrap;
    }

    .custom-calculator-wrapper .child-item span,
    .custom-calculator-wrapper .child-item p {
        font-size: 13px; /* Уменьшено */
    }

    .custom-calculator-wrapper .child-item i {
        font-size: 20px; /* Уменьшено */
        margin-bottom: 5px; /* Уменьшено */
        padding: 10px;
    }

    .custom-calculator-wrapper .choice-bottom {
        height: auto; /* Убираем фиксированную высоту */
        min-height: 450px; /* Минимальная высота для сохранения пропорций */
    }

    .custom-calculator-wrapper .item.visible {
        height: auto; /* Позволяем высоте адаптироваться под контент */
    }

    .custom-calculator-wrapper .payment-details {
        flex-direction: column !important; /* Блоки строго друг под другом */
        padding: 3px; /* Уменьшено */
        gap: 3px; /* Уменьшено */
        margin-top: 3px; /* Уменьшено */
        height: auto; /* Позволяем высоте адаптироваться под контент */
        min-height: 400px; /* Минимальная высота для видимости */
        max-width: 100%; /* Убедимся, что ширина не превышает контейнер */
        overflow-x: hidden; /* Предотвращаем горизонтальное переполнение */
        overflow-y: auto; /* Добавляем прокрутку, если контент не помещается */
    }

    .custom-calculator-wrapper .payment-details .left,
    .custom-calculator-wrapper .payment-details .right {
        width: 100% !important; /* Полная ширина для обоих блоков */
        max-width: 100%; /* Ограничиваем ширину */
        margin-bottom: 10px; /* Увеличиваем отступ между блоками */
        box-sizing: border-box;
        display: block; /* Убедимся, что блок отображается */
    }

    .custom-calculator-wrapper .payment-details .right {
        display: block !important; /* Гарантируем, что блок .right виден */
    }

    .custom-calculator-wrapper .payment-details h3 {
        font-size: 16px; /* Уменьшено */
        margin-bottom: 3px; /* Уменьшено */
    }

    .custom-calculator-wrapper .payment-details .left p {
        font-size: 12px; /* Уменьшено */
        margin-bottom: 4px; /* Уменьшено расстояние между строками */
        line-height: 1; /* Уменьшено для более плотного текста */
    }

    .custom-calculator-wrapper .payment-details .phone a {
        font-size: 14px; /* Уменьшено */
    }

    .custom-calculator-wrapper .contact-form .wpcf7-form input[type="text"],
    .custom-calculator-wrapper .contact-form .wpcf7-form input[type="tel"] {
        padding: 2px; /* Уменьшено */
        font-size: 10px; /* Уменьшено */
        width: 100%;
        max-width: 100%; /* Убедимся, что поля формы не выходят за пределы */
        box-sizing: border-box;
    }

    .custom-calculator-wrapper .contact-form .wpcf7-form input[type="submit"] {
        padding: 8px 10px; /* Уменьшено */
        font-size: 14px; /* Уменьшено */
    }

    .custom-calculator-wrapper .contact-form .wpcf7-response-output {
        font-size: 6px; /* Уменьшено */
        padding: 2px; /* Уменьшено */
    }

    .custom-calculator-wrapper .choice-nav {
        flex-direction: row;
        gap: 4px; /* Уменьшено */
        margin-top: 5px; /* Уменьшено */
    }

    .custom-calculator-wrapper .choice-nav .prev,
    .custom-calculator-wrapper .choice-nav .next {
        padding: 5px 10px; /* Уменьшено */
        font-size: 16px; /* Уменьшено */
        min-height: 20px; /* Уменьшено */
    }

    .custom-calculator-wrapper .choice-nav .prev:hover,
    .custom-calculator-wrapper .choice-nav .next:hover,
    .custom-calculator-wrapper .choice-nav .prev:active,
    .custom-calculator-wrapper .choice-nav .next:active {
        background: #141416 !important;
        color: #FFF !important; /* Чёрный цвет для максимального контраста */
        box-shadow: 0 0 10px rgba(225, 178, 97, 0.4) !important;
        font-size: 8px !important; /* Временное увеличение шрифта для проверки */
    }

    .custom-calculator-wrapper .size,
    .custom-calculator-wrapper .pomp,
    .custom-calculator-wrapper .filler,
    .custom-calculator-wrapper .fabric,
    .custom-calculator-wrapper .price,
    .custom-calculator-wrapper .decor {
        margin-bottom: 3px; /* Уменьшено */
    }
}