/*
Theme Name: Фасовщик
Theme URI: https://prostoweb.su
Author: Prostoweb.su
Author URI: https://prostoweb.su
Description: Эксклюзивный шаблон для компании "Фасовщик". Включает настраиваемые блоки главной страницы, алгоритмические поля (SCF) и интеграцию с Contact Form 7.
Version: 1.0.0
Tested up to: 6.9.4
Requires PHP: 7.4
Text Domain: fasovshik
*/

.article img.alignleft { float: left; margin: 1rem 2rem 1rem 0; max-width: 50%; }
.article img.alignright { float: right; margin: 1rem 0 1rem 2rem; max-width: 50%; }
.article img.aligncenter { display: block; margin: 1rem auto; clear: both; }
.article .wp-caption { max-width: 100%; background: #f8f8f8; padding: 1rem; text-align: center; }
.article .wp-caption-text { font-size: 1.4rem; color: #666; margin: 0; padding-top: 0.5rem; }
.article::after { content: ""; display: table; clear: both; }

.hero__benefit-icon {
    width: 8rem;
    height: 8rem;
    background-size: contain !important;
    background-position: center;
    background-repeat: no-repeat;
    display: block;
    flex-shrink: 0;
}
.why-choose-us__icon {
    background-size: contain !important;
    background-position: center;
    background-repeat: no-repeat;
}

/* Прячем стандартный спиннер CF7 */
.wpcf7-spinner {
    display: none !important;
}

/* Состояние отправки для кнопок всех форм */
.wpcf7-form.submitting button[type="submit"],
.wpcf7-form.submitting input[type="submit"],
.wpcf7-form.submitting .btn__primary {
    pointer-events: none;
    position: relative;
    color: transparent !important; /* Текст исчезает, чтобы уступить место лоадеру */
}

/* Белый вращающийся бублик */
.wpcf7-form.submitting button[type="submit"]::after,
.wpcf7-form.submitting input[type="submit"]::after,
.wpcf7-form.submitting .btn__primary::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Делаем системные уведомления CF7 аккуратными */
.wpcf7 form .wpcf7-response-output {
    margin: 2rem 0;
    padding: 1.5rem;
    border-radius: 1rem;
    font-size: 1.6rem;
    border-width: 2px;
}

.wpcf7 form .quiz + .wpcf7-response-output {
    margin-bottom: 18.6rem;
    margin-top: -17.6rem;
}

/* Анимация модального окна */
.modal {
    display: flex !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s linear, visibility 0.2s linear;
}
.modal.modal--open {
    opacity: 1;
    visibility: visible;
}
.modal__container {
    transform: translate(-50%, -60%) scale(0.95);
    transition: transform 0.2s linear;
}
.modal.modal--open .modal__container {
    transform: translate(-50%, -50%) scale(1);
}

.project-discussion__btn {
    gap: 1rem;
}

/* ==========================================
   УНИВЕРСАЛЬНАЯ ГАЛЕРЕЯ ДЛЯ СТАТЕЙ (CSS GRID)
   ========================================== */
.article__img {
    display: grid !important;
    grid-template-columns: repeat(var(--cols, 2), 1fr);
    gap: 3.6rem;
    margin-bottom: 4rem;
    align-items: start;
}

.article__img img {
    width: 100% !important;
    height: auto !important;
    display: block;
    object-fit: cover;
}

/* --- Адаптив для галереи --- */
@media only screen and (max-width: 800px) {
    .article__img {
        gap: 2.4rem;
        grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
    }
}

@media only screen and (max-width: 480px) {
    .article__img {
        gap: 1.6rem;
        grid-template-columns: 1fr;
    }
}

.quiz__step-contTitle {
    margin-top: 3rem !important;
}
