:root {
    --nav-tab-height: 5%;
    --modern-content-height: 88%;
    --step-buttons-height: 7%;
    --step-span-count: 16;
    --gif-size-desktop: 24vw;
    --gif-size-mobile: 42vw;
    --modern-step-content-mobile-height: calc(var(--modern-content-height) - var(--gif-size-mobile) + 25px);
    --step-span-desktop-size: calc((100vw / (var(--step-span-count))) - 28px);
    --step-span-mobile-size: 32px;
    --step-nav-mobile-side-padding: 4px;
}

.image-variants img {
    filter: drop-shadow(0 0 2px var(--standart-neon-color));
}

.top-modern-menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-tab-height);
    gap: 10px;

    padding: 6px 8px;

    background: var(--standart-bg-color);
    border-bottom: 1px solid var(--standart-border-color);

    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

/* ===== TABS BLOCK ===== */
.modern-tabs {
    display: flex;
    align-items: center;
    gap: 4px;

    overflow-x: scroll;
    overflow-y: hidden;
    scrollbar-gutter: stable;
    flex: 1;

    padding: 2px 4px;
}

/* TAB */
.modern-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    height: 28px;
    padding: 0 10px;

    border-radius: 6px;

    background: var(--standart-bg-color);
    color: var(--standart-text-1-color);

    font-size: 12px;
    font-weight: 600;

    cursor: pointer;
    user-select: none;

    white-space: nowrap;

    transition: 0.2s ease;
}

/* ACTIVE */
.modern-tab.selected {
    border: 3px solid var(--standart-border-color);
}

/* HOVER */
.modern-tab:hover {
    transform: translateY(-1px);
}

/* ===== BUTTONS ===== */
.head-content {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* BUTTONS */
.modern-tab-add,
.modern-tab-del {
    min-width: 30px;
    height: 30px;

    border: none;
    border-radius: 6px;

    cursor: pointer;

    font-size: 14px;
    font-weight: bold;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: 0.2s ease;

    color: var(--standart-text-1-color);
    border: solid 1px var(--standart-border-color);
}

/* + button */
.modern-tab-add {
    background: var(--standart-button-color);
}

/* x button */
.modern-tab-del {
    background: none;
    color: var(--standart-text-2-color);
}

/* hover */
.modern-tab-add:hover,
.modern-tab-del:hover {
    transform: translateY(-1px);
}

.modern-tabs::-webkit-scrollbar {
    height: 6px;
}

.modern-tabs::-webkit-scrollbar-thumb {
    background: #999;
    border-radius: 6px;
}

/* scrollbar clean */
/* .modern-tabs::-webkit-scrollbar {
    display: block;
} */

/* .modern-tabs {
    scrollbar-width: none;
} */

div.modern-content {
    position: relative;
    width: 100%;
    margin-left: 0;
    height: var(--modern-content-height);
    overflow-y: auto;
    padding: 5px;
}

div#gif-container {
    position: absolute;
    top: 15%;
    right: 1%;
    width: var(--gif-size-desktop);
    max-width: var(--gif-size-desktop);
    height: var(--gif-size-desktop);
    max-height: var(--gif-size-desktop);
    object-fit: contain;
    background: var(--standart-bg-color);

    border: solid 1px var(--standart-border-color);
    box-shadow: 0 5px 20px var(--standart-neon-color);
    border-radius: 35px;
    padding: 15px;
}

div#gif-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: pointer;
    border-radius: 20px;
    padding: 0;
}

div#modern-content {
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow-y: auto;
}

nav.step-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 3%;
    height: var(--step-buttons-height);
    border-top: 2px solid var(--standart-border-color);
}

nav.step-buttons>button {
    padding: 0;
    height: 90%;
    width: 15%;
    border-radius: 5px;
    color: black;
    cursor: pointer;
    font-size: xx-large;
    font-weight: bold;
}

nav.step-buttons.hidden>* {
    display: none;
}

nav.step-buttons>*:hover {
    color: var(--standart-neon-color);

    box-shadow: 0 4px 24px var(--standart-neon-color);
}

div#step-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 15px;
    height: fit-content;
    max-height: 100%;
    width: calc(100% - var(--gif-size-desktop) - 25px);
    padding-top: 5px;
    margin: 0;
}

h2#step-label {
    padding: 5px 10px 0 10px;
    margin: 0;
    border-radius: 0 0 20px 20px;
    font-size: xx-large;
}

div#step-content h4 {
    display: inline-block;
    padding: 5px;
    margin: 5px;
    border-radius: 5px;
    width: fit-content;
    padding-left: 20%;
}

.image-variants::-webkit-scrollbar {
    display: none;
}

.image-variants-container {
    position: relative;

    border-top: 2px solid var(--standart-border-color);
    padding: 0;
    width: 100%;
    min-height: 140px;

    height: fit-content;
}

.image-variants-container.preset::before {
    content: "Вкажіть тип/колір свого шолома (станом на зараз):";
    position: absolute;
    top: -20px;
    width: 100%;
    text-align: center;
    font-size: x-large;
    font-weight: bold;
}

.image-variants {
    position: relative;

    display: inline-flex;
    align-items: flex-start;
    justify-content: space-evenly;

    height: 100%;
    width: 100%;

    gap: 5px;
    padding-top: 15px;

    scrollbar-width: none;
    overflow-x: auto;
}

.image-variants.preset {
    height: 70% !important;
}

.image-variant {
    position: relative;
    min-height: 25vh;
    height: fit-content;
    width: fit-content;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    gap: 5px;
    border: 1px solid #dfe6d1;
    padding: 10px 5px;
    border-radius: 15px 0 15px 15px;
    background: var(--standart-bg-color);
    cursor: pointer;
}

.image-variant.selected {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(107, 125, 58, 0.25);
    border: double 2px #556231;
    background: var(--standart-neon-color);
}

.image-variant.selected::before {
    content: "✓";
    position: absolute;
    font-size: xx-large;
    right: 3px;
    top: -5px;
    font-weight: bold;
    color: green;
    z-index: 0;
}

.image-variant img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 5px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-variant span {
    font-size: 16px;
    text-align: center;
    color: var(--standart-text-1-color);
}

.image-variant.selected span {
    color: black;
    font-weight: bold;
}

.image-variant span.type-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-variant span.color-name {
    text-transform: uppercase;
    font-weight: bold;

    background: none;
}

.image-variant span.type-price {
    font-size: 16px;
    font-style: italic;
}

.image-variant span.type-price::after {
    content: " грн";
}

/* .blocked:not(.selected) {
    position: relative;
    overflow: hidden;
    min-width: 120px;
} */

.blocked:not(.selected)::after {
    content: "🔒";

    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(255, 255, 255, 0.2);

    backdrop-filter: blur(1px);

    font-size: 42px;

    color: rgba(255, 255, 255, 0.8);

    text-shadow:
        0 0 8px rgba(0, 0, 0, .2);

    z-index: 100;

    pointer-events: none;
}

.blocked:not(.selected) {
    cursor: not-allowed;
}

.image-variant.blocked:not(.selected) {
    background-color: rgba(153, 153, 153, 0.479);
}

.color-variants.preset {
    width: 100%;
    height: 25%;
    margin-top: 2%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 0;
    border-radius: 30px;
    background: var(--standart-bg-color);
}

.color-button {
    padding: 8px 16px;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.color-button.selected {
    transform: translateY(-5px);
    box-shadow: 0 0 16px var(--standart-neon-color);
    border: 2px solid var(--standart-neon-color);
}

/* ===== BASE STEP ===== */
.step-span {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;

    min-width: var(--step-span-desktop-size);
    width: fit-content;
    height: var(--step-span-desktop-size);
    border-radius: 50%;

    background-color: var(--standart-button-color);

    font-size: 18px;
    font-weight: 600;
    cursor: pointer;

    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;

    /* box-shadow: 0 2px 6px var(--standart-neon-color); */

    background-repeat: no-repeat !important;
    background-size: 24px auto !important;

    background-position: center;
}

.step-span.for-installation {
    position: relative;

    background-size: 20px auto !important;

    border-radius: 5px;

    background-color: var(--standart-neon-color);
}

.step-span.for-installation::before {
    content: "➕";
    position: absolute;
    right: -4px;
    top: -4px;
    color: blue;
    font-size: medium;
}

@keyframes installationBlink {

    0%,
    100% {
        filter: brightness(1);
        opacity: 1;
    }

    50% {
        filter: brightness(0.45);
        opacity: 0.55;
    }
}

@keyframes nextStepSize {

    0%,
    100% {
        filter: brightness(1);
        opacity: 1;
        transform: scale(1.05);
    }

    50% {
        filter: brightness(0.45);
        opacity: 0.9;
        transform: scale(0.95);
    }
}

/* текст (прихований по дефолту) */
.service-label {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;

    color: var(--standart-linq-color);

    margin-left: 0;
    transition: all 0.3s ease;
}

/* ===== ACTIVE STEP ===== */
.step-span.selected {
    border-radius: 16px 16px 0 0;
    padding: 0 7px;
    min-width: unset;

    background-position: left 8px center;
    padding-left: var(--step-span-desktop-size);

    box-shadow: 0 0 16px var(--standart-neon-color);
    background-color: var(--standart-neon-color);

    animation: installationBlink 0.9s ease-in-out infinite;
}

.step-span.hidden {
    display: none;
}

/* активна цифра */
.step-span.selected::before {
    margin-right: 6px;
}

/* показ тексту */
.step-span.selected .service-label {
    max-width: 260px;
    opacity: 1;
    margin-left: 4px;
}

/* hover ефект */
.step-span:hover {
    transform: translateY(-1px);
}

/* лінія між кроками */
.step-span:not(:last-child)::after {
    content: "";
    position: absolute;
    right: -7px;
    width: 10px;
    height: 2px;
    background: var(--standart-border-color);
    top: 50%;
    transform: translateY(-50%);
}

/* скрол без scrollbar */
.step-nav::-webkit-scrollbar {
    display: none;
}

.step-nav {
    display: flex;
    justify-content: flex-start;
    scrollbar-width: none;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    box-shadow: 0 2px 50px var(--standart-neon-color);
    border-bottom: solid 3px var(--standart-border-color);
}

div.type-description {
    order: 3;
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    height: auto;
    max-height: 20vh;
    border-radius: 20px;
    padding: 15px 10px;
    overflow-y: auto;
    color: var(--standart-text-1-color);
    background: var(--standart-bg-color);
}

div.type-description:not(.step-1) {
    min-height: 15vh;
}

div.type-description span {
    height: fit-content;
}

div.type-description span * {
    text-align: justify;
    padding: 0 !important;
    margin: 0 !important;
}

#desc-general * {
    font-size: 18px !important;
}

#desc-type {
    margin-top: 10px;
    padding-left: 15px;
    border-left: 1cap solid var(--standart-border-color);
    margin-left: 20px;
}

#desc-type * {
    font-size: 16px !important;
}

.modern-installation-variants {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 10px;
    padding: 5px 0;
}

.modern-installation-variants.hidden {
    display: none;
}

.modern-installation-variants input[type="radio"] {
    display: none;
}

/* звичайний стан */
.modern-installation-variants label {
    position: relative;
    display: inline-block;
    padding: 3px 8px;
    font-size: x-large;
    border: 1px solid var(--standart-border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    background: var(--standart-button-color);
    margin-right: 8px;
    color: var(--standart-text-1-color);
}

/* активний (checked) */
.modern-installation-variants input[type="radio"]:checked+label {
    color: black;
    background-color: var(--standart-neon-color);
    border: 3px solid var(--standart-border-color);
    font-weight: bold;
}

/* 

*/

.variants-arrow {
    position: absolute;
    top: 0;
    z-index: 10;

    width: 64px;
    height: 64px;

    color: var(--standart-text-1-color);
    font-size: 36px;
    font-weight: bold;
    border: none;
    cursor: pointer;
}

.variants-arrow.left {
    left: 0;
    border-radius: 0 0 64px 0;
    background: linear-gradient(315deg, transparent 45%, var(--standart-neon-color));

    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 0 0 0 7px;
}

.variants-arrow.right {
    right: 0;
    border-radius: 0 0 0 64px;
    background: linear-gradient(45deg, transparent 45%, var(--standart-neon-color));

    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 0 7px 0 0;
}

#deal-linq {
    position: relative;
    font-weight: bold;
    padding: 5px 20px;
    font-style: italic;
    font-size: x-large;
    max-width: 50%;
    white-space: normal;
    text-align: center;
    color: black;

    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    background: var(--standart-neon-color);
    cursor: pointer;
    overflow: hidden;
}

#deal-linq::before {

    content: "";
    position: absolute;
    top: -20%;
    left: -60%;
    width: 40%;
    height: 140%;

    background: linear-gradient(120deg,
            transparent 0%,
            rgba(255, 255, 255, 0.45) 50%,
            transparent 100%);

    transform: skewX(-20deg);
    animation: shineMove 2.3s ease-in-out infinite;

}

@keyframes shineMove {
    0% {
        left: -60%;
    }

    60% {
        left: 120%;
    }

    100% {
        left: 120%;
    }
}

#deal-linq::after {
    content: " грн";
}

.preview-table-container {
    max-height: 65vh;
    overflow-y: auto;
}

.preview-buttons {
    border-top: double 2px var(--standart-border-color);
    width: 100%;
    display: inline-flex;
    justify-content: space-around;
    align-items: center;
    margin-top: 5px;
    padding-top: 15px;
}

.preview-buttons button {
    padding: 5px 10px;
    font-size: large;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    min-width: 30%;
    background-color: var(--standart-button-color);
    border-color: var(--standart-border-color);
}

#preview-done-but {
    background-color: var(--standart-neon-color);
    color: black;
}

.preview-buttons button:hover {
    color: black;
    background-color: var(--standart-neon-color);
    box-shadow: 0 4px 10px var(--standart-neon-color);
}

#modern-info-dialog {
    position: relative;
    background: var(--standart-bg-color);
}

#modern-info-dialog *:not(button) {
    color: var(--standart-text-1-color);
}

.modern-info-text {
    width: 100%;
    max-height: 60vh;
    overflow-y: auto;
}

#modern-info-dialog::before {
    content: "";
    position: absolute;
    display: block;
    right: 10px;
    width: 64px;
    height: 64px;
}

#modern-info-dialog span {
    position: relative;
    display: block;
    text-align: justify;
    width: 100%;
    padding: 5px 0 5px 0;
}

#modern-info-dialog span.list-dot {
    padding-left: 20px;
}

#modern-info-dialog :not(button, h2) {
    font-size: large;
}

#modern-info-dialog p {
    font-weight: bold;
}

#modern-info-dialog button {
    margin-top: 10px;
    width: 100%;
    font-weight: bold;
    background: none;
    padding: 10px 0;
    font-size: larger;
    cursor: pointer;
}

#modern-info-dialog button:hover {
    color: black;
    background-color: var(--standart-neon-color);
}

#modern-info-dialog span.list-dot::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
    font-weight: bold;
    font-size: x-large;
}

#preview-deal-dialog {
    background: var(--standart-bg-color);
    color: var(--standart-text-1-color);
}

#preview-deal-dialog td {
    border-top: dotted 1px var(--standart-border-color);
}

#preview-deal-dialog th {
    border-top: solid 2px var(--standart-border-color);
}

.td-float {
    text-align: right;
    font-style: italic;
    padding-left: 25px;
}

.td-int {
    text-align: center;
    padding: 0 25px 0 5px;
}

#prev-step {
    border-radius: 50% 0 0 50%;
}

#next-step {
    position: relative;
    border-radius: 0 50% 50% 0;

    overflow: hidden;

    animation: nextStepSize 1.5s ease-in-out infinite;
}

#next-step::before {

    content: "";
    position: absolute;
    top: -20%;
    left: -60%;
    width: 40%;
    height: 140%;

    background: linear-gradient(120deg,
            transparent 0%,
            rgba(255, 255, 255, 0.45) 50%,
            transparent 100%);

    transform: skewX(-20deg);
    animation: shineMove 1.5s ease-in-out infinite;

}

/* ========================= */
/* 📱 MOBILE OVERRIDE       */
/* ========================= */
@media (max-width: 768px) {

    main {
        padding: 3px 0 0 0;
    }

    .image-variants-container {
        width: 100%;
        height: 55%;
    }

    .image-variants-container.preset {
        height: 65% !important;
    }

    .image-variant {
        min-height: fit-content;
        height: 100%;
    }

    .image-variant span {
        font-size: 13px;
    }

    .step-nav {
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;

        position: absolute;
        top: 0;
        left: 0;

        height: 100%;

        padding: 1px calc(var(--step-nav-mobile-side-padding) + 2px) 1px var(--step-nav-mobile-side-padding);

        background: var(--standart-bg-color);
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.08);

        border: none;

        overflow-y: auto;
        overflow-x: hidden;
    }

    div.modern-content {
        padding-left: calc(var(--step-nav-mobile-side-padding) + var(--step-span-mobile-size) + 10px);
    }

    div#modern-content {
        height: var(--modern-step-content-mobile-height);
        min-height: var(--modern-step-content-mobile-height);
    }

    /* тільки кружечки */
    .service-label {
        display: none !important;
    }

    /* компактні кнопки */
    .step-span {
        height: var(--step-span-mobile-size);
        width: var(--step-span-mobile-size);
        min-width: var(--step-span-mobile-size);
        border-radius: 20%;
    }

    /* вимикаємо розширення active */
    .step-span.selected {
        padding: 0;
        border-radius: 40% 0 0 40%;

        transform: scale(1.15, 1.15) !important;
        margin: 3px 0;
    }

    .step-span.selected::before {
        margin-right: 0;
    }

    /* прибираємо лінії */
    .step-span::after {
        display: none;
    }

    /* hover ефект вимикаємо */
    .step-span:hover {
        transform: none;
    }

    .image-variant img {
        height: 50%;
        aspect-ratio: 1 / 1;
        width: auto;
    }

    .image-variant.selected::before {
        content: "✓";
        font-size: large;
    }


    .image-variants-container.preset::before {
        content: "Вкажіть тип/колір свого шолома (станом на зараз):";
        font-size: medium;
        top: -25px;
    }

    div#step-content {
        height: 100%;
        max-height: 100%;
        width: 100%;
        padding-right: 10px;
    }

    div#step-content h4 {
        padding-left: 0;
    }

    div#gif-container {
        position: relative;
        top: 0;
        right: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        max-width: 95%;
        width: 95%;
        max-height: calc(var(--gif-size-mobile) + 25px);
        height: calc(var(--gif-size-mobile) + 25px);
        object-fit: contain;
        border-radius: 35px;
        padding: 25px 0 0 0;
        z-index: 997;
    }

    nav.step-buttons>a {
        font-size: medium;
    }

    h2#step-label {
        position: absolute;
        left: 55px;
        width: calc(100% - 80px);
        text-align: center;
        top: 0;
        padding: 10px 5px 0 5px;

        z-index: 998;
        font-size: large;
    }

    div.type-description {
        order: 0;
        max-height: 35%;
        margin-top: 10px;
    }

    #desc-general * {
        font-size: 13px !important;
        padding-left: 10px;
    }

    #desc-type * {
        font-size: 12px !important;
        padding-left: 15px;
    }

    .modern-installation-variants {
        width: 100%;
        max-height: 10%;
        padding: 0;
    }

    .modern-installation-variants label {
        font-size: medium;
    }

    #modern-info-dialog {
        width: 80vw;
    }

    #modern-info-dialog :not(button, h2) {
        font-size: 15px;
    }

    #modern-info-dialog * {
        padding: 0;
        margin: 0;
    }

    #deal-linq {
        padding: 8px 10px;
        font-size: large;
    }

    div.type-description {
        scroll-behavior: auto;
    }

    .step-span.for-installation::before {
        content: "➕";
        right: -9px;
        top: -9px;
        text-shadow: 1px -1px 3px white;
    }
}