:root {
    --step-span-count: 16;
    --gif-size-desktop: 24vw;
    --gif-size-mobile: 45vw;
    --step-span-desktop-size: calc((100vw / (var(--step-span-count))) - 40px);
    --step-span-mobile-size: 36px;
}

.top-modern-menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 5%;
    gap: 10px;

    padding: 6px 8px;

    background: #ffffff;
    border-bottom: 1px solid #e9eedf;

    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: #f3f5ef;
    color: #5f6f3a;

    font-size: 12px;
    font-weight: 600;

    cursor: pointer;
    user-select: none;

    white-space: nowrap;

    transition: 0.2s ease;
}

/* ACTIVE */
.modern-tab.selected {
    background: linear-gradient(135deg, #6b7d3a, #a3b86c);
    color: #fff;
}

/* 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;

    background: #f3f5ef;
    color: #5f6f3a;
}

/* + button */
.modern-tab-add {
    background: linear-gradient(135deg, #6b7d3a, #a3b86c);
    color: #fff;
}

/* x button */
.modern-tab-del {
    background: #fff3f3;
    color: #b34a4a;
}

/* 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: 85%;
    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: none;

    border: solid 1px #dfe6d1;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-radius: 35px;
    padding: 15px;
}

div#gif-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: pointer;
    border-radius: 20px;
}

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 20px;
    height: 10%;
    border-top: 2px solid #e9eedf;
}

nav.step-buttons>button {
    padding: 8px 16px;
    height: 90%;
    width: 20%;
    border-radius: 5px;
    background-color: greenyellow;
    color: black;
    border: none;
    cursor: pointer;
    font-size: x-large;
    font-weight: bold;
}

nav.step-buttons.hidden>* {
    display: none;
}

nav.step-buttons>a {
    text-decoration: none;
    padding: 8px 14px;
    border: dotted 3px greenyellow;
    border-radius: 10px;
    color: greenyellow;
    font-weight: bold;
    background: linear-gradient(to right, olive, green);
    cursor: pointer;
    font-size: x-large;
}

nav.step-buttons>a:hover {
    border: solid 3px greenyellow;
    color: yellow;

    background: linear-gradient(to left, olive, green);
}

div#step-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 15px;
    height: fit-content;
    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 #e9eedf;
    padding: 0;
    padding-top: 5px;
    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: #f9f9f9;
    cursor: pointer;
}

.image-variant.selected {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(107, 125, 58, 0.25);
    border: double 2px #556231;
    background:
        radial-gradient(circle at center,
            rgba(176, 188, 118, 0.14) 0%,
            rgba(176, 188, 118, 0.05) 45%,
            transparent 85%);
}

.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: black;
}

.image-variant span.type-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-variant span.color-name {
    text-transform: uppercase;
    font-weight: bold;
}

.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;
}

.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 8px 16px rgba(107, 125, 58, 0.25);
    border: 2px solid #2200fc;
}

/* ===== 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: #f3f5ef;
    color: #6b7d3a;

    font-size: 18px;
    font-weight: 600;
    cursor: pointer;

    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;

    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);

    background-repeat: no-repeat !important;
    background-size: 24px auto !important;

    background-position: center;
}

.step-span.for-installation {
    background-size: 20px auto !important;

    border-radius: 0;

    animation: installationBlink 0.9s ease-in-out infinite;
}

@keyframes installationBlink {

    0%,
    100% {
        filter: invert(1) brightness(1);
        opacity: 1;
    }

    50% {
        filter: invert(1) brightness(0.45);
        opacity: 0.55;
    }
}

/* текст (прихований по дефолту) */
.service-label {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;

    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 6px 16px rgba(107, 125, 58, 0.9);
}

.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: #dfe6d1;
    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 rgba(0, 0, 0, 0.4);
    border-bottom: solid 3px black;
}

div.type-description {
    order: 3;
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    height: auto;
    max-height: 20vh;
    overflow-y: auto;
}

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: 2px solid #dfe6d1;
    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 {
    display: inline-block;
    padding: 5px 16px;
    font-size: x-large;
    border: 1px solid #dfe6d1;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    background: #fff;
    margin-right: 8px;
}

/* hover */
.modern-installation-variants label:hover {
    border-color: #b7c3a0;
}

/* активний (checked) */
.modern-installation-variants input[type="radio"]:checked+label {
    background: #2f6f3e;
    color: #fff;
    border-color: #2f6f3e;
}

.variants-arrow {
    position: absolute;
    top: 0;
    z-index: 10;

    width: 64px;
    height: 64px;

    color: yellow;
    font-size: 36px;
    font-weight: bold;
    background: white;
    border: none;
    cursor: pointer;
}

.variants-arrow.left {
    left: 0;
    border-radius: 0 0 64px 0;
    background: linear-gradient(315deg, transparent 45%, black);

    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%, black);

    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 0 7px 0 0;
}

#modern-price::after {
    content: " грн";
}

.preview-table-container {
    max-height: 65vh;
    overflow-y: auto;
}

.preview-buttons {
    border-top: double 2px black;
    width: 100%;
    display: inline-flex;
    justify-content: space-around;
    align-items: center;
    margin-top: 5px;
    padding-top: 15px;
}

.preview-buttons button {
    padding: 5px 10px;
    background: none;
    border: solid 2px black;
    font-size: large;
    color: black;
    cursor: pointer;
}

.preview-buttons button:hover {
    color: white;
    background-color: black;
}

#modern-info-dialog {
    position: relative;

}

.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;
    border: solid 2px black;
    background: none;
    padding: 10px 0;
    font-size: larger;
    cursor: pointer;
}

#modern-info-dialog button:hover {
    color: white;
    background-color: black;
}

#modern-info-dialog span.list-dot::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
    font-weight: bold;
    font-size: x-large;
}

#preview-deal-dialog td {
    border-top: dotted 1px black;
}

#preview-deal-dialog th {
    border-top: solid 2px black;
}

.td-float {
    text-align: right;
    font-style: italic;
    padding-left: 25px;
}

.td-int {
    text-align: center;
    padding: 0 25px 0 5px;
}

/* ========================= */
/* 📱 MOBILE OVERRIDE       */
/* ========================= */
@media (max-width: 768px) {

    main {
        padding-left: 0;
        padding-right: 0;
    }

    .image-variants-container {
        width: 100%;
    }

    .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: 10px 6px;

        background: #fff;
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.08);

        border: none;

        overflow-y: auto;
        overflow-x: hidden;
    }

    div.modern-content {
        padding: 5px 5px 5px 70px;
    }

    div#modern-content {
        height: calc(100% - var(--gif-size-mobile));
        min-height: calc(100% - var(--gif-size-mobile));
    }

    /* тільки кружечки */
    .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);
    }

    /* вимикаємо розширення active */
    .step-span.selected {
        padding: 0;
        border-radius: 0;

        transform: scale(1.1, 1.1) !important;
        margin: 15px 0;
    }

    .step-span.selected::before {
        margin-right: 0;
    }

    /* прибираємо лінії */
    .step-span::after {
        display: none;
    }

    /* hover ефект вимикаємо */
    .step-span:hover {
        transform: none;
    }

    .image-variant img {
        width: 64px;
        height: 64px;
    }

    .image-variant.selected::before {
        content: "✓";
        font-size: large;
    }


    .image-variants-container.preset::before {
        content: "Оберіть тип/колір свого шолома:";
        font-size: large;
    }

    div#step-content {
        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: 100%;
        width: 100%;
        max-height: var(--gif-size-mobile);
        height: var(--gif-size-mobile);
        object-fit: contain;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
        border-radius: 35px;
        padding-top: 0;
        z-index: 997;
    }

    nav.step-buttons>a {
        font-size: medium;
    }

    h2#step-label {
        position: absolute;
        left: 65px;
        width: calc(100% - 70px);
        text-align: center;
        top: 0;
        padding: 7px 5px 2px 5px;

        background: linear-gradient(to bottom,
                rgba(255, 255, 255, 1),
                rgba(255, 255, 255, 0.5));
        color: black;
        z-index: 998;
        font-size: large;
    }

    div.type-description {
        order: 0;
        max-height: 35%;
    }

    #desc-general * {
        font-size: 13px !important;
        padding-left: 10px;
        border-left: 2px solid #dfe6d1;
    }

    #desc-type * {
        font-size: 12px !important;
        padding-left: 15px;
        border-left: 2px solid #dfe6d1;
    }

    .modern-installation-variants {
        width: 100%;
    }

    .modern-installation-variants label {
        font-size: small;
    }

    #modern-info-dialog {
        width: 80vw;
    }

    #modern-info-dialog :not(button, h2) {
        font-size: 15px;
    }

    #modern-info-dialog * {
        padding: 0;
        margin: 0;
    }

    div.type-description {

        scroll-behavior: auto;

    }
}