/* Form */
/* 
Hidden должен включать/выключать JS для скринридера:
element.hidden = true/false или setAttribute/removeAttribute('hidden', '') или удалить/добавить сам элемент
*/
.test-show-hidden [hidden] {
    display: block; /* ❌ Отображаем только для тестирования */
}


/* Modal */
.modal {
    position: fixed;
    inset: 0; 
    display: grid;
    place-items: safe center; /* центрирует __container */
    padding: 1em;
    z-index: 1000;
}
.modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
}
.modal__container {
    position: relative;
    z-index: 1;
    width: auto;
    max-width: 100%;
   /* min-width: 360px;*/
    max-height: calc(100dvh - 7em); /*.modal paddingY + .modal__container padddingY*/

    display: flex;
    flex-direction: column;

    background-color: #fff;
}
.modal__header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    /*align-items: center;*/
}
.modal__close {
    background: none;
    border: none;
    font-size: 1em;
    font-weight: 500;
    line-height: inherit;
    cursor: pointer;
    color: #333;
}
.modal__content {
    overflow-y: auto;
    overscroll-behavior: contain;

    height: 100%;/*если не хочешь flex на .modal__container, то заменяем на max-height: calc(100dvh - 64px);  чуть меньше, чем у контейнера, с учётом отступов */
    min-height: 0; /* критично для flex-контейнеров в Firefox/Chrome */
}

.modal:not([hidden]) {
  display: grid;
}

.modal[hidden] {
  display: none;
}

/* FAQ */
.js-faq {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.js-faq-item {
    overflow: hidden;
}
.js-faq-q {
    cursor: pointer;
    user-select: none;
}
.js-faq-q:hover {}
.js-faq-a {
    max-height: 0;
    opacity: 0;
    overflow-y: auto;
    /*scrollbar-gutter: stable;  Резервирует место под скроллбар → нет мерцания */
    transition:
        max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s ease,
        padding 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.js-faq-item.active .js-faq-a {
    max-height: 2000px; /* Значение заведомо больше любого ответа */
    opacity: 1;
}



/* Валюта */ 
.js-price-trigger {
    cursor: pointer;
    user-select: none;
}
.js-price-value::after {
    content: attr(data-currency);
}
  

/* Табы */
.js-tabs {}
.js-tab-link {
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}
.js-tab-link.active {}
.js-tab-content {
    transform: translateY(-100%);
    opacity: 0;
    will-change: transform, opacity;
    overflow: hidden; 
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.js-tab-content.active {
    transform: translateY(0);
    opacity: 1;
}



/* Аккордион */
.ac-accordion {}
.ac-trigger {
    cursor: pointer;
    user-select: none;
}
.ac-trigger:hover {}
.ac-text:before {
    display: inline-block;
    content: 'Открыть';
}
.ac-toggle:checked + .ac-text:before {
    display: none;
}
.ac-text:after {
    content: 'Закрыть';
    display: none;
}
.ac-toggle:checked + .ac-text:after {
    display: inline-block;
}
/* Добавить в миксин 
.ac-icon {
    width: 12px;
    height: 12px;
    border-right: 2px solid #333;
    border-bottom: 2px solid #333;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
}
.ac-accordion:has(.ac-toggle:checked) .ac-icon {
    transform: rotate(-135deg);
}*/
.ac-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition:
        max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s ease;
}
.ac-accordion:has(.ac-toggle:checked) .ac-content {
    opacity: 1;
}



/* В случайном порядке сглаживается один или два угла у блока с классом .--rnd */
.--rnd.rnd-tl { border-top-left-radius: 30px; }
.--rnd.rnd-tr { border-top-right-radius: 30px; }
.--rnd.rnd-br { border-bottom-right-radius: 30px; }
.--rnd.rnd-bl { border-bottom-left-radius: 30px; }