/* mainpage */
.image {
    box-sizing: border-box;
    border-radius: 30px;
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.title_text {
    display: grid;
    color: var(--primary);
}
.left_grid {
    display: grid;
    grid-column: 1;
}
.right_grid {
    display: grid;
    grid-column: 2;
    justify-self: end; /* Прижмет содержимое к правому краю */
    align-self: start; /* Прижмет содержимое к верхнему краю */
}
.title-left-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
}
.icon-line {
    display: flex;
    flex-direction: row;
    gap: 15px;
    align-items: center;
    justify-content: flex-start;
    flex-shrink: 0;
    position: relative;
}
.gift_icon {
    flex-shrink: 0;
    width: fit-content;
    height: 30px;
    position: relative;
    overflow: visible;
}
.title-text-large {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    align-self: stretch;
    flex-shrink: 0;
    position: relative;
    text-align: left;
}

.div-span {
    color: #b82f36;
    font-family: "PlayfairDisplay";
    font-size: 61px;
    line-height: 110%;
}
.div-span2 {
    font-family: "Commissioner-SemiBold", sans-serif;
    font-size: 24px;
    color: #b82f36;
    font-family: "PlayfairDisplayItalic";
    font-size: 61px;
    line-height: 110%;
    font-style: italic;
}
.title_right_bar {
    display: flex;
    flex-direction: column;
    width: 100vh;
    gap: 11px;
    justify-self: end; /* Прижмет содержимое к правому краю */
    align-self: start; /* Прижмет содержимое к верхнему краю */
}
.title-text {
    color: var(--b82f36, #b82f36);
    text-align: right;
    font-family: "Commissioner-SemiBold", sans-serif;
    font-size: 24px;
    font-weight: 600;
    left: 100%;
    width: 100%;
}
.form {
    background: #ffffff;
    border-radius: 12px;
    border-style: solid;
    border-color: rgba(51, 51, 51, 0.2);
    border-width: 1px;
    padding: 15px 24px 15px 24px;
    width: 100%;
    height: 138px;
}
.div3 {
    color: rgba(102, 102, 102, 0.8);
    text-align: left;
    font-family: "Poppins-Regular", sans-serif;
    font-size: 16px;
    font-weight: 400;
    position: relative;
    width: 100%;
    height: max-content;
}
.vector {
    width: 93px;
    height: 47px;
    left: 1071px;
    top: 505px;
    overflow: visible;
}

.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9998;
}
.loader.hidden {
    display: none;
}
.loader-spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid var(--primary);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@font-face {
    font-family: "PlayfairDisplayItalic"; /* Имя шрифта */
    src: url("fonts/PlayfairDisplay-Italic.ttf") format("truetype");
    font-weight: normal;
    font-style: italic;
}
@font-face {
    font-family: "PlayfairDisplay"; /* Имя шрифта */
    src: url("fonts/PlayfairDisplay.ttf") format("truetype");
    font-weight: normal;
    font-style: medium;
}
.main-content {
    display: grid;
    height: fit-content;
}
.desktop {
    display: flex;
    flex-direction: column;
    height: 95vh;
    width: 100%;
    gap: 1vw;
    padding-bottom: 5vh;
}
.mobile {
    display: none;
}
.textarea {
    text-align: start;
    width: 100%;
    min-height: 50px;
    height: 120px;
    padding: 10px;
    margin-top: 5px;
    margin-bottom: 15px;
    border-radius: 5px;
    font-size: 18px;
    overflow: hidden;
    resize: none;
    color: #212529;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #bdbdbd;
    font-family: "Commissioner-SemiBold", sans-serif;
    font-weight: 400;
    color: var(--gray_element);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.textarea.active {
    color: #212529;
    background-clip: padding-box;
    border: 1px solid #e24949;
    color: var(--gray_element);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
input:focus,
textarea:focus {
    border-color: var(--primary); /* Жёлтая граница */
    outline: none; /* Убираем стандартную подсветку */
    color: #000000;
}

.title_right_bar button {
    width: 100%;
}
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal.hidden {
    display: none;
}

.modal-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    background: #fff;
    padding: 20px;
    padding-inline: 40px;
    border-radius: 8px;
    max-width: 500px;
    width: 60%;
    height: fit-content;
    text-align: center;
}
.modal-title {
    align-self: flex-center;
    justify-content: space-between;
    color: black;
    font-weight: 600;
    font-size: larger;
    align-items: center;
}
.slider-container {
    display: flex;
    flex-direction: column;
    gap: 50px;
    width: 100%;
    margin: 20px;
    margin-top: 7px;
}
.noUi-marker-horizontal.noUi-marker-large {
    height: 10px;
}
.noUi-pips-horizontal {
    height: 1px;
}
.noUi-pips-horizontal {
    top: -70%;
}
.noUi-marker {
    position: absolute;
    background: wheat;
    display: none;
}
.slider-container input {
    width: 100%;
}
button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px;
    height: fit-content;
    width: 100%;
    border-radius: 10px;
}
button.loading {
    background-color: #ccc;
    color: #666;
    cursor: not-allowed;
}

#apply-loader {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 10px;
    border: 2px solid #fff;
    border-top: 2px solid #888;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

#apply-loader.done {
    border: none;
    width: 16px;
    height: 16px;
    color: var(--primary);
    font-size: 16px;
    animation: none;
}
.button:hover #apply-loader.done {
    color: white;
}
/* Трек */
#price-range-slider.noUi-target {
    background: #e6e6e6;
    height: 8px;
    border-radius: 6px;
}
/* Подсветка выбранного диапазона */
#price-range-slider .noUi-connect {
    background: var(--primary) !important;
}
/* Ручки */
#price-range-slider .noUi-handle {
    width: 20px;
    height: 20px;
    background: #fff;
    border: 2px solid var(--primary);
    border-radius: 50%;
    top: -7px; /* центровка */
    cursor: pointer;
    transition: box-shadow 0.2s;
    left: 408px;
}
#price-range-slider .noUi-handle:hover {
    box-shadow: 0 0 0 6px rgba(var(--primary-rgb), 0.2);
}
/* убираем «насечки» внутри ручки */
#price-range-slider .noUi-handle:before,
#price-range-slider .noUi-handle:after {
    display: none;
}
/* метки-пипсы */
.noUi-pips .noUi-value {
    font-size: 13px;
    color: #666;
}
.noUi-pips .noUi-marker-large {
    background: var(--primary);
}
.example-chips {
    display: none;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0 0;
}
.example-chip {
    display: inline-flex;
    align-items: center;
    justify-content: start;
    gap: 0.4rem;
    padding: 0.4rem 0.7rem;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1.1;
    user-select: none;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
}
.example-chip:hover {
    background: #eef0f3;
    border-color: #d8dbe2;
}
.example-chip:active {
    transform: translateY(1px);
}
.example-chip .insert {
    font-weight: 600;
}
/* когда чипсы "оторваны" от лэйаута и висят поверх */
.example-chips.is-floating {
    display: flex;
    position: fixed; /* не влияет на сетку */
    z-index: 10010; /* выше формы (10000) и оверлея (9990) */
    max-height: min(48vh, 420px);
    overflow: auto;
    padding-block: 12px;
    padding-inline: 2px;
    border-radius: 14px;
    background: #fff;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.example-chips.is-floating.show {
    opacity: 1;
    pointer-events: auto;
}
.error-form {
    font-family: "Commissioner-SemiBold", sans-serif;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 15px;
    color: black;
    width: fit-content;
    padding: 0.375rem 0.375rem;
    border: 1px solid #d30505;
    border-radius: 10px;
}

.textarea.prompt-input {
    resize: none; /* авто-рост возьмём на JS */
}
.textarea.prompt-input::placeholder {
    opacity: 0.7;
}
/* Оверлей затемнения */
.prompt-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}
.prompt-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* Контейнер выпадающих подсказок */
.prompt-suggest {
    position: relative; /* контекст не обязателен, но ок */
}

/* Сам выпадающий список */
.prompt-suggest__list {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    max-height: 320px;
    overflow: auto;
    background: #fff;
    border: 1px solid #e4e6eb;
    border-radius: 10px;
    z-index: 60; /* выше оверлея */
}

/* Один пункт */
.prompt-suggest__item {
    padding: 10px 12px;
    cursor: pointer;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 8px;
}
.prompt-suggest__item:hover,
.prompt-suggest__item[aria-selected="true"] {
    background: #f5f7fa;
}
.prompt-suggest__title {
    font-weight: 600;
}
.prompt-suggest__hint {
    color: #667085;
    font-size: 0.9rem;
}

/* Чтобы панель встала прямо под textarea на маленьких экранах */
@media (max-width: 640px) {
    .prompt-suggest__list {
        max-height: 60vh;
    }
}
/* Фуллскрин-оверлей */
.focus-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    z-index: 9990;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}
.focus-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Запрет скролла, когда активен фокус-режим */
body.focus-mode {
    overflow: hidden;
}

/* Поднимаем активную форму над оверлеем */
.focus-active {
    position: relative; /* создаём stacking context */
    z-index: 10000; /* выше, чем оверлей */
}

/* Можно чуть выделить само поле */
.focus-active .prompt-input {
    background: #fff;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@media screen and (max-width: 480px) {
    #price-range-slider {
        overflow: visible;
    }

    #price-range-slider .noUi-handle {
        width: 20px;
        height: 20px;
        border: 2px solid var(--primary);
        background: #fff;
        border-radius: 50%;
        cursor: pointer;
        top: -7px;
        left: 267px;
        position: absolute;
        z-index: 2;
    }

    .slider-container {
        padding-bottom: 10px;
        width: 280px;
    }
    #price-range-slider {
        overflow: visible;
    }
    .noUi-pips-horizontal {
        top: 100%;
        height: auto;
        overflow: visible;
    }
    .noUi-value {
        white-space: nowrap;
        font-size: 0.7rem;
        text-align: center;
        transform: translateX(-50%);
        position: absolute;
        left: 50%;
    }

    .noUi-value:empty {
        display: none;
    }
    .modal-content {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 20px;
        background: #fff;
        padding: 20px;
        padding-inline: 40px;
        border-radius: 4px;
        max-width: 1000px;
        width: 95%;
        height: fit-content;
        text-align: center;
    }
    .main-content {
        grid-column: 1/13;
        display: flex;
        flex-direction: column;
        width: 100%;
        padding-inline: 15px;
    }
    .mobile {
        display: grid;
        width: 100%;
        height: fit-content;
        grid-column: span 12;
        -webkit-mask-image: linear-gradient(
            to bottom,
            black 75%,
            transparent 100%
        );
        mask-image: linear-gradient(to bottom, black 90%, transparent 100%);
    }

    .desktop {
        display: none;
    }
    .title_objects {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        height: calc(100vh - 40px);
    }
    #title_form {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 90%;
        padding: 25px;
        height: fit-content;
        background: white;
        border-radius: 20px;
        transition: 0.3s ease-in-out;
    }
    #title_form h2 {
        width: 100%;
        margin-bottom: 15px;
        font-size: 21px;
    }
    #title_form label {
        width: 100%;
        font-size: 17px;
    }

    #title_form input {
        width: 100%;
        height: 100px;
        padding: 10px;
        margin-top: 5px;
        margin-bottom: 15px;
        border: 1px solid #ccc;
        border-radius: 5px;
        font-size: 14px;
    }

    #title_form button {
        width: 100%;
        padding: 10px;
        background: #b22222;
        color: white;
        font-size: 16px;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        font-family: "Commissioner-SemiBold", sans-serif;
        font-size: 18px;
        font-weight: 600;
    }

    #title_form button:hover {
        background: #8b0000;
    }

    .close-btn {
        position: absolute;
        top: 10px;
        right: 10px;
        font-size: 18px;
        cursor: pointer;
    }
}

/* Мобилки: чипсы видимы и идут под textarea обычным потоком */
@media (max-width: 480px) {
    .example-chips.is-floating {
        display: flex !important; /* переопределяем базовое display:none */
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 0px;
    }
    .example-chips {
        display: none !important; /* плавающую версию отключаем на мобилке */
    }
    .example-chip {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        padding: 0.45rem 0.7rem;
        border: 1px solid #e5e7eb;
        border-radius: 9999px;
        background: #fff;
        font-size: 0.95rem;
    }
    /* --- СТИЛИ ДЛЯ ЗВЕЗДНОГО ФОНА --- */

    /* Важно: контейнер мобилки должен обрезать торчащие звезды */
    .mobile .title_objects {
        position: relative;
        overflow: hidden;
        background-color: #f4f4f4; /* Цвет фона под звездами */
        /* Убираем старую картинку, если она была в CSS, здесь она перекроется */
    }

    /* Чтобы форма была точно ПОВЕРХ звезд */
    #title_form {
        position: relative;
        z-index: 10;
    }

    /* --- 1. ВНЕШНИЙ КОНТЕЙНЕР (Где стоит + Как повернута + Размер) --- */
    .star-pos {
        position: absolute;
        width: 0;
        height: 0;
        z-index: 0; /* Звезды лежат внизу */
        pointer-events: none; /* Чтобы клики сквозь них проходили */
    }

    /* --- 2. ВНУТРЕННИЙ КОНТЕЙНЕР (Пульсация) --- */
    .star-pulse {
        position: absolute;
        width: 0;
        height: 0;
        animation: breath 4s ease-in-out infinite;
    }

    /* --- 3. ЛУЧИ (Визуал) --- */
    .bg-shape,
    .sm-shape {
        position: absolute;
        background: #d63031; /* Ваш красный цвет */
        border-radius: 50%;
        filter: blur(8px); /* Мягкое размытие */
        opacity: 1;
    }

    .bg-shape {
        width: 350px;
        height: 30px;
    }
    .sm-shape {
        width: 200px;
        height: 30px;
    }

    /* Крест */
    .shape-1 {
        transform: translate(-50%, -50%) rotate(90deg);
    }
    .shape-2 {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    .shape-3 {
        transform: translate(-50%, -50%) rotate(-45deg);
    }
    .shape-4 {
        transform: translate(-50%, -50%) rotate(45deg);
    }

    /* Анимация пульсации */
    @keyframes breath {
        0% {
            transform: scale(1);
            opacity: 1;
        }
        50% {
            transform: scale(1.2);
            opacity: 0.9;
        }
        100% {
            transform: scale(1);
            opacity: 1;
        }
    }

    /* --- НАСТРОЙКИ ПОЗИЦИЙ --- */

    /* 1. Верх-право */
    .pos-1 {
        top: 20%;
        left: 85%;
        transform: rotate(-15deg);
        zoom: 1;
    }

    /* 2. Низ-лево (ОГРОМНАЯ) */
    .pos-2 {
        top: 85%;
        left: 10%;
        transform: rotate(30deg);
        zoom: 1.3;
    }
    .pos-2 .star-pulse {
        animation-delay: -2s;
    }

    /* 3. Низ-право (МАЛЕНЬКАЯ) */
    .pos-3 {
        top: 80%;
        left: 95%;
        transform: rotate(10deg);
        zoom: 0.6;
    }
    .pos-3 .star-pulse {
        animation-delay: -1s;
    }

    /* 4. Верх-лево */
    .pos-4 {
        top: 10%;
        left: 5%;
        transform: rotate(-45deg);
        zoom: 0.8;
    }
    .pos-4 .star-pulse {
        animation-delay: -3s;
    }
}

.query_line {
    background-color: white;
    color: black;
    border: 2px solid var(--primary);
    border-radius: 2px;
}
