/*
Theme Name: Matrix
Author: Larkod
Description: Matrix.
Version: 1.0
*/

/* === БАЗОВЫЙ (ЗАКРЫТЫЙ) ТАБ === */
.martix__tab {
    width: 100%;
    max-width: 1143px;
    margin: 0 auto 15px; /* Отступ между табами */
    background: #fff;
    border: 1px solid #390A97;
    border-radius: 50px;
    /* Плавный переход для самой карточки при расширении */
    transition: max-width 0.4s ease, margin 0.4s ease, border-radius 0.4s ease, padding 0.4s ease;
    overflow: hidden; 
}

/* Шапка (кликабельная) */
.martix__tab-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* padding: 15px 40px; */
    cursor: pointer;
    user-select: none;
    margin-bottom: -14px;
}

/* Обертка для плавного раскрытия высоты */
.martix__tab-body {
    display: grid;
    grid-template-rows: 0fr; /* Скрыто по умолчанию */
    transition: grid-template-rows 0.4s ease;
}

/* Внутренний контейнер, ширина которого не меняется */
.martix__tab-container {
    overflow: hidden; /* Обязательно для скрытия контента при 0fr */
    width: 100%;
    max-width: 1143px;
    margin: 0 auto;
}

/* Сам текст */
.martix__tab-info {
    padding: 0 40px; /* Отступы по бокам как в шапке */
    opacity: 0;
    transform: translateY(-10px); /* Легкий эффект выезда */
    transition: opacity 0.4s ease, transform 0.4s ease, padding 0.4s ease;
}


/* === ОТКРЫТОЕ СОСТОЯНИЕ === */
.martix__tab--open {
    max-width: 1276px;
    margin-top: 36px;
    margin-bottom: 26px;
    border-radius: 30px; /* Делаем углы чуть мягче у большой карточки */
}

/* Раскрываем Grid */
.martix__tab--open .martix__tab-body {
    grid-template-rows: 1fr;
}

/* Показываем контент */
.martix__tab--open .martix__tab-info {
    opacity: 1;
    transform: translateY(0);
    padding-top: 20px;
    padding-bottom: 47px;
}



/* Контейнер для контента, чтобы прелоадер позиционировался относительно него */
.martix__tab-info-box {
    position: relative;
    min-height: 200px; /* Чтобы блок не схлопывался во время загрузки */
    transition: opacity 0.3s ease;
}

/* Состояние загрузки: контент полупрозрачный */
.martix__tab-info-box.is-loading .years-content-inner {
    opacity: 0.3;
    pointer-events: none;
}

/* Сам прелоадер (крутящиеся шарики) */
.matrix-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none; /* Скрыт по умолчанию */
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 10;
}

.martix__tab-info-box.is-loading .matrix-loader {
    display: flex;
}

.matrix-loader .dot {
    width: 12px;
    height: 12px;
    background-color: #390A97; /* Твой фирменный цвет */
    border-radius: 50%;
    animation: matrixBounce 1.4s infinite ease-in-out both;
}

.matrix-loader .dot:nth-child(1) { animation-delay: -0.32s; }
.matrix-loader .dot:nth-child(2) { animation-delay: -0.16s; }
.matrix-loader .dot:nth-child(3) { animation-delay: 0s; }

@keyframes matrixBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Для кликабельности ячеек */
.martix__tab-info-cell {
    cursor: pointer;
}

.lark-page__container
{
    width: calc(100% - 14px);
    max-width: 1337px;
    margin: auto;
    margin-top: 160px;
}

.lark-page__title
{
    border: 1.5px solid #9B6BFD;
    border-radius: 50px;
    background: linear-gradient(100deg,#EDBDFF 1%, #E2F7FF 17%,#FFFED9 51%, #D1C9FF 81%, #F3D0FF 100%);
    padding: 9px 62px;

    text-transform: uppercase;
    color: #9B6BFD;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 18px;
    text-align: center;
    width: fit-content;
    margin: auto;
}

.lark-page__content
{
    background: #fff;
    margin: auto;
    margin-top: 50px;
    border: 1px solid #9B6BFD;
    padding-top: 40px;
    padding-left: 60px;
    padding-right: 60px;
    padding-bottom: 140px;
    border-radius: 40px;
    width: fit-content;
}

.lark-page__content *
{
    color: #390A97;
    font-family: Arimo, sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 133%;
}

@media (width <= 768px) {
    .lark-page__container
    {
        margin-top: 100px;
    }

    .lark-page__content *
    {
        font-size: 12px;
    }
}


/* --- Адаптация для Contact Form 7 --- */

/* Убираем дефолтные отступы CF7, если они есть */
.wpcf7 form p {
    margin: 0;
    padding: 0;
}

.cf7-field-box {
    position: relative;
    margin-bottom: 20px; /* Отступ между полями, отрегулируй по вкусу */
}

/* Растягиваем системную обертку CF7 */
.cf7-field-box .wpcf7-form-control-wrap {
    display: block;
    width: 100%;
}

/* Стили плавающего текста */
.cf7-field-box .floating-label {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    transition: 0.3s;
    background: rgba(255,255,255,0.8);
    color: #390A97;
    font-size: 15px;
    font-family: 'Arimo', sans-serif;
    padding: 0 5px;
    pointer-events: none; /* Пропускаем клики сквозь текст */
    z-index: 2;
}

.wpcf7-form .form-field-box .wpcf7-form-control-wrap
{
    left: 0;
}

.cf7-field-box .floating-label b {
    color: #F95954;
}

.wpcf7-form .checkout__form-datail-fields
{
    width: 300px;
    margin: auto;
    grid-template-columns: 1fr;
}

/* Магия анимации: если внутри блока есть инпут в фокусе ИЛИ не пустой инпут — поднимаем текст */
.cf7-field-box:has(.form-field:focus) .floating-label,
.cf7-field-box:has(.form-field:not(:placeholder-shown)) .floating-label {
    top: 0;
    opacity: 0;
}

.form-password-btn img:last-child, .profile__data-form-input-box .form-password-btn img:first-child {
    display: none;
}

.form-password-btn img:last-child, .profile__data-form-input-box .form-password-btn img:last-child
{
    display: block;
}

.form-password-btn img:last-child, .profile__data-form-input-box.hide .form-password-btn img:first-child {
    display: block;
}

.form-password-btn img:last-child, .profile__data-form-input-box.hide .form-password-btn img:last-child
{
    display: none;
}

.profile__data-form-input-box
{
    position: relative;
}

.profile__orders-list
{
    max-height: 300px;
    position: relative;
    overflow: auto;
}

/* Основные стили для самого блока (убедись, что у него задана высота) */
.profile__orders-list {
    overflow-y: auto; /* Включаем вертикальный скролл */
    /* max-height: 400px;  Укажи нужную тебе высоту, если ее еще нет */
    
    /* Для Firefox: цвет ползунка и прозрачный фон */
    scrollbar-color: rgb(155, 107, 253) transparent;
    scrollbar-width: thin; /* Делает скроллбар более аккуратным (опционально) */
}

/* --- Стили для Chrome, Safari, Edge --- */

/* 1. Ширина самого скроллбара */
.profile__orders-list::-webkit-scrollbar {
    width: 6px; /* Можно сделать чуть толще, например 8px */
}

/* 2. Фон скроллбара (трек) - делаем прозрачным */
.profile__orders-list::-webkit-scrollbar-track {
    background: transparent; 
}

/* 3. Сам ползунок (бегунок) */
.profile__orders-list::-webkit-scrollbar-thumb {
    background-color: rgb(155, 107, 253); 
    border-radius: 10px; /* Скругляем углы для красоты */
}

/* Эффект при наведении на ползунок (по желанию, делает цвет чуть темнее/насыщеннее) */
.profile__orders-list::-webkit-scrollbar-thumb:hover {
    background-color: rgb(135, 87, 233); 
}

.profile__orders-list .profile__order-item
{
    padding-right: 20px;
}

.profile__order-item-link
{
    text-decoration: none;
    color: rgb(155, 107, 253);
}

/* Затемненный фон позади попапа */
.payment-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: none; /* Скрыто по умолчанию, JS включит display: flex */
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

/* Сам попап */
.payment-popup {
    box-sizing: border-box;
    width: 365px;
    height: 346px;
    background: #FFFFFF;
    border: 1px solid #9B6BFD;
    border-radius: 20px;
    padding-top: 113px; /* Отступ сверху, как ты просил */
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Надпись */
.payment-popup-text {
    font-family: 'Inter', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 25px;
    line-height: 30px;
    color: #9B6BFD;
    text-align: center;
    margin: 0;
}

/* Кнопка */
.payment-popup-btn {
    box-sizing: border-box;
    width: 237px;
    height: 30px;
    margin-top: 113px; /* Расстояние ровно 113px между надписью и кнопкой */
    background: linear-gradient(91.28deg, #EDBDFF 4.1%, #E2F7FF 18.38%, #FFFED9 49.37%, #D1C9FF 76.12%, #F3D0FF 93.28%);
    border: 0.5px solid #9B6BFD;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.payment-popup-btn:hover {
    opacity: 0.8;
}

/* Текст внутри кнопки */
.payment-popup-btn span {
    font-family: 'Arimo', sans-serif;
    font-style: normal;
    font-weight: 700;
    font-size: 13px;
    line-height: 15px;
    color: #9B6BFD;
    text-align: center;
}

@media (width <= 1024px) {
    .martix__tab {
        position: relative;
    }

    .martix__tab-title
    {
        width: 100%;
    }

    .martix__tab-head .martix__tab-actions
    {
        position: absolute;
        right: 20px;
        top: 4px;
    }

    .martix__tab .martix__tab-container
    {
        min-height: 42px;
        padding: 0;
        border: none;
    }

    .martix__tab-body
    {
        margin-top: -50px;
        position: relative;
        z-index: -1;
    }

    .martix__tabs .martix__tab
    {
        border-radius: 20px;
    }

    .martix__tabs .martix__tab.martix__tab--open
    {
        margin-top: 0;
        border: 1px solid #9b6bfd;
        border-radius: 20px;
    }

    .martix__tab--open .martix__tab-body
    {
        margin-top: 0px;
        z-index: 1;
    }

    .martix__tab--open .martix__tab-head
    {
        margin-bottom: 0;
        margin-top: 0px;
        padding: 20px;
        padding-left: 40px;
    }

    .martix__tab--open .martix__tab-head .martix__tab-actions
    {
        right: 20px;
        top: 25px;
    }

    .martix__tab-head .martix__tab-actions span {
        right: calc(100% + 35px);
    }

    .martix__tab--open .martix__tab-head .martix__tab-actions span {
        top: -8px;
        right: 29px;
    }
}