/* Колесо подарков «Гладко Тут» — в стиле сайта (style.css: --ink, --rust, --pale, --line) */

/* ---- Кнопка-колесо в левом нижнем углу ---- */
.gtf-dock {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 50; /* ниже плашки cookie (60): пока она открыта, кнопка под ней */
}
.gtf-trigger {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 20px 6px 6px;
    border: 0;
    border-radius: 999px;
    background: var(--rust, #ac412d);
    color: #fff;
    font: 500 15px/1 'Golos Text', sans-serif;
    box-shadow: 0 10px 28px #ac412d55;
    transition: background .2s, transform .2s;
}
.gtf-trigger:hover { background: #853322; transform: translateY(-2px); }
.gtf-trigger__wheel {
    width: 46px;
    height: 46px;
    flex: none;
    border-radius: 50%;
    animation: gtf-turn 7s linear infinite;
}
.gtf-trigger__wheel svg { display: block; width: 100%; height: 100%; }
.gtf-trigger::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    animation: gtf-pulse 2.6s ease-out infinite;
    pointer-events: none;
}
/* Крестик «свернуть» и мини-колесо в нижней панели — только на телефонах */
.gtf-hide, .gtf-mini { display: none; }
.gtf-hide {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid #dddcd4;
    border-radius: 50%;
    background: #fff;
    color: #272820;
    font: 400 18px/1 'Golos Text', sans-serif;
    box-shadow: 0 2px 8px #0002;
}
.gtf-mini {
    width: 46px;
    height: 46px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
}
.gtf-mini .gtf-trigger__wheel { width: 100%; height: 100%; }
@keyframes gtf-turn { to { transform: rotate(360deg); } }
@keyframes gtf-pulse {
    0% { box-shadow: 0 0 0 0 #ac412d66; }
    70%, 100% { box-shadow: 0 0 0 16px #ac412d00; }
}

/* ---- Окно ---- */
.gtf-dialog {
    width: min(1000px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
    padding: 0;
    border: 0;
    border-radius: 24px;
    background: #fff;
    color: var(--ink, #272820);
    box-shadow: 0 30px 100px #21160c55;
    overflow: auto;
}
.gtf-dialog[open] {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    animation: gtf-pop .35s cubic-bezier(.2, .8, .3, 1);
}
.gtf-dialog::backdrop { background: #1f1a1499; backdrop-filter: blur(2px); }
html.gtf-lock { overflow: hidden; }
@keyframes gtf-pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }

.gtf-close {
    position: absolute;
    top: 14px;
    right: 16px;
    z-index: 3;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #6b6a62;
    font-size: 30px;
    line-height: 1;
}
.gtf-close:hover { background: var(--pale, #f5f4ee); color: var(--ink, #272820); }

/* ---- Колесо ---- */
.gtf-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 48px 40px;
    background: #efdcd1;
}
.gtf-stage-note {
    margin: 0;
    font: italic 20px/1.2 Georgia, serif;
    color: #853322;
}
.gtf-wheel-wrap {
    position: relative;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
}
.gtf-wheel {
    width: 100%;
    height: 100%;
    transition: transform 6s cubic-bezier(.12, .7, .1, 1);
    filter: drop-shadow(0 16px 26px #5a2a1a40);
}
.gtf-wheel svg { display: block; width: 100%; height: 100%; }
.gtf-wheel text {
    font: 600 13.5px 'Manrope', sans-serif;
    dominant-baseline: middle;
}
.gtf-light { fill: #f5f4ee; animation: gtf-blink 1.4s steps(1) infinite; }
.gtf-light:nth-of-type(even) { animation-delay: .7s; }
.gtf-dialog.is-spinning .gtf-light { animation-duration: .35s; }
.gtf-dialog.is-spinning .gtf-light:nth-of-type(even) { animation-delay: .175s; }
@keyframes gtf-blink { 50% { fill: #c9a27e; } }

.gtf-pointer {
    position: absolute;
    top: -8px;
    left: 50%;
    z-index: 2;
    width: 30px;
    height: 40px;
    background: var(--rust, #ac412d);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    transform: translateX(-50%);
    transform-origin: 50% 0;
    filter: drop-shadow(0 2px 2px #0004);
}
.gtf-dialog.is-spinning .gtf-pointer { animation: gtf-tick .12s ease-in-out infinite alternate; }
@keyframes gtf-tick { to { transform: translateX(-50%) rotate(-9deg); } }

.gtf-hub {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    width: 25%;
    aspect-ratio: 1;
    padding: 0;
    border: 4px solid #272820;
    border-radius: 50%;
    background: #fff;
    color: var(--rust, #ac412d);
    font: italic clamp(14px, 2.2vw, 19px)/1 Georgia, serif;
    transform: translate(-50%, -50%);
    box-shadow: 0 6px 18px #0003;
    transition: transform .2s;
}
.gtf-hub:hover:not(:disabled) { transform: translate(-50%, -50%) scale(1.05); }
.gtf-hub:disabled { cursor: default; }

/* ---- Форма и результат ---- */
.gtf-panel {
    display: flex;
    align-items: center;
    padding: 56px 44px 44px;
}
.gtf-form, .gtf-result { width: 100%; }
.gtf-panel .eyebrow { color: var(--rust, #ac412d); }
.gtf-panel h2 {
    margin: 14px 0 12px;
    font: 500 clamp(30px, 3vw, 42px)/1.15 'Manrope', sans-serif;
    letter-spacing: -1.4px;
}
.gtf-panel h2 em { font-family: Georgia, serif; color: var(--rust, #ac412d); letter-spacing: -1px; }
.gtf-panel h2:focus { outline: none; }
.gtf-lead {
    margin: 0 0 22px;
    color: #6b6a62;
    font-size: 15px;
    line-height: 1.6;
}
.gtf-field {
    display: block;
    margin-bottom: 14px;
    font-size: 14px;
}
.gtf-field input {
    display: block;
    width: 100%;
    height: 50px;
    margin-top: 8px;
    padding: 0 15px;
    border: 1px solid var(--line, #dddcd4);
    border-radius: 3px;
    background: #fff;
    color: var(--ink, #272820);
    font: 16px 'Golos Text', sans-serif;
}
.gtf-field input:focus { outline: none; border-color: var(--rust, #ac412d); box-shadow: 0 0 0 3px #ac412d1f; }
.gtf-field input[aria-invalid="true"] { border-color: #b3261e; }
.gtf-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.gtf-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 6px 0 10px;
    font-size: 13px;
    line-height: 1.5;
    color: #4b4a43;
    cursor: pointer;
}
.gtf-check input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--rust, #ac412d); }
.gtf-check a { text-decoration: underline; }
.gtf-error { min-height: 1.3em; margin: 0 0 10px; color: #b3261e; font-size: 14px; }
.gtf-panel .button { width: 100%; }
.gtf-panel .button:disabled { opacity: .6; cursor: default; transform: none; }
.gtf-note { display: block; margin-top: 12px; color: #6b6a62; font-size: 12px; text-align: center; }

.gtf-code {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 0 0 20px;
    padding: 18px;
    border: 1px dashed var(--rust, #ac412d);
    border-radius: 4px;
    background: var(--pale, #f5f4ee);
    text-align: center;
}
.gtf-code span, .gtf-code small { color: #6b6a62; font-size: 13px; }
.gtf-code strong {
    font: 700 30px/1.1 'Manrope', sans-serif;
    letter-spacing: .12em;
    color: var(--rust, #ac412d);
    user-select: all;
}
.gtf-contacts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.gtf-contact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 54px;
    padding: 12px 14px;
    border: 1px solid var(--rust, #ac412d);
    border-radius: 3px;
    background: #fff;
    color: var(--rust, #ac412d);
    font-size: 15px;
    font-weight: 500;
    transition: background .2s, color .2s, transform .2s;
}
.gtf-contact svg {
    width: 22px;
    height: 22px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.gtf-contact:hover { background: var(--rust, #ac412d); color: #fff; transform: translateY(-2px); }
.gtf-contact--wa { background: var(--rust, #ac412d); color: #fff; }
.gtf-contact--wa:hover { background: #853322; }
.gtf-copied { min-height: 1.3em; margin: 12px 0 0; color: #4b4a43; font-size: 13px; text-align: center; }
.gtf-result { animation: gtf-pop .4s ease; }

.gtf-confetti {
    position: fixed;
    top: -14px;
    z-index: 5;
    width: 8px;
    height: 13px;
    border-radius: 1px;
    pointer-events: none;
    animation: gtf-fall linear forwards;
}
@keyframes gtf-fall { to { transform: translate3d(var(--gtf-dx), 105vh, 0) rotate(var(--gtf-rot)); opacity: .7; } }

/* ---- Телефоны ---- */
@media (max-width: 760px) {
    .gtf-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 18px; }
    .gtf-dialog[open] { grid-template-columns: 1fr; }
    .gtf-stage { padding: 44px 24px 22px; gap: 14px; }
    .gtf-wheel-wrap { max-width: 270px; }
    .gtf-hub { font-size: 13px; border-width: 3px; }
    .gtf-stage-note { font-size: 17px; }
    .gtf-panel { padding: 26px 20px 24px; }
    .gtf-panel h2 { font-size: 30px; }
    /* над нижней панелью «Первая консультация · Записаться» */
    .gtf-dock { left: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); }
    .gtf-trigger { padding-right: 16px; font-size: 14px; }
    .gtf-trigger__wheel { width: 40px; height: 40px; }
    .gtf-hide { display: grid; place-items: center; }
    /* свёрнуто крестиком: плавающей кнопки нет, колесо — между ценой и «Записаться» */
    .gtf-collapsed .gtf-dock { display: none; }
    .gtf-collapsed .gtf-mini { display: block; }
    .gtf-collapsed #mobile-basket { grid-template-columns: minmax(0, 1fr) auto auto; }
}

@media (prefers-reduced-motion: reduce) {
    .gtf-trigger__wheel, .gtf-trigger::after, .gtf-light { animation: none; }
    .gtf-wheel { transition-duration: 1.5s; }
}

/* Ссылка в блоке акции */
.promo-fortune {
    display: inline-block;
    margin: 18px 0 0 22px;
    color: #f2cdbb;
    font-size: 15px;
    text-decoration: underline;
    text-underline-offset: 4px;
}
.promo-fortune:hover { color: #fff; }
@media (max-width: 760px) { .promo-fortune { display: block; margin: 18px 0 0; } }
