@media screen and (max-width: 768px) {
    .configurator-section {
        padding: 1rem;
    }
}

#configurator {
    min-height: 80vh;
    label.label {
        font-size: 0.8rem;
        font-weight: 900;
        margin-bottom: 0.1rem;
        text-transform: uppercase;
    }
    select {
        font-size: 0.85em;
        height: 3rem;
        line-height: 3rem;
        padding-top: 0;
        padding-bottom: 0;
        padding-left: 1rem;
    }
    .radio-button-input {
        position: absolute;
        opacity: 0;
        width: 0;
        height: 0;
    }
    .radio-button-input + label.button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        height: 100%; /*auto*/
        min-height: 3rem;
        font-size: 0.9em;
        line-height: 1;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        font-weight: bold;
    }
    .radio-button-input:disabled + label.button {
        opacity: 0.45;
        cursor: not-allowed;
    }
    .radio-button-input + label.button.has-subtitle {
        flex-direction: column;
        white-space: normal;
        min-width: 0;
        small {
            padding-top: 0.25rem;
            font-size: 0.7em;
            font-weight: normal;
            line-height: 1.2;
            white-space: normal;
        }
    }
    .radio-button-input + label.button.has-price {
        justify-content: space-between;
        text-align: left;
        padding-left: 1rem;
        padding-right: 1rem;
        span {
            font-weight: 900;
            margin-left: 1rem;
        }
    }
    .radio-button-input:checked + label.button {
        background-color: var(--bulma-secondary);
        border-color: var(--bulma-secondary);
        color: #fff;
    }
    .field.is-grouped > .control.is-expanded {
        flex-basis: 0;
        min-width: 0;
    }
    .field.is-grouped.is-stacked {
        flex-direction: column;
        flex-wrap: nowrap;
    }
    .rezim-buttons .radio-button-input + label.button {
        min-height: 2rem;
        font-size: 0.75rem;
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
        border-radius: 0;
    }
    .rezim-buttons .radio-button-input + label.button.is-outlined {
        background-color: transparent;
        border-color: var(--bulma-secondary);
        color: var(--bulma-secondary);
    }
    .rezim-buttons .radio-button-input:not(:checked) + label.button.is-outlined:hover {
        background-color: var(--bulma-border);
        border-color: var(--bulma-secondary);
        color: var(--bulma-secondary);
    }
    .rezim-buttons .radio-button-input:checked + label.button.is-outlined {
        background-color: var(--bulma-secondary);
        border-color: var(--bulma-secondary);
        color: #fff;
    }
    .rezim-buttons {
        gap: 0;
    }
    .rezim-buttons > .control:not(:last-child) {
        margin-right: 0;
    }
    .rezim-buttons > .control:not(:last-child) label.button {
        border-right: none;
    }
    .rezim-buttons > .control:first-child label.button {
        border-top-left-radius: var(--bulma-radius);
        border-bottom-left-radius: var(--bulma-radius);
    }
    .rezim-buttons > .control:last-child label.button {
        border-top-right-radius: var(--bulma-radius);
        border-bottom-right-radius: var(--bulma-radius);
    }
    @media screen and (max-width: 768px) {
        .radio-button-input + label.button.has-subtitle small {
            display: none;
        }
    }
    .tabs {
        --bulma-tabs-link-active-color: var(--bulma-black);
        font-weight: bold;
        margin-bottom: 0;
    }
    .tabs.tabs-strana {
        --bulma-tabs-link-active-border-bottom-color: var(--bulma-secondary);
    }
    .tabs.is-boxed li:not(.is-active) a {
        background-color: var(--bulma-background);
    }
    .tabs.is-boxed li:not(.is-active) a:hover {
        background-color: var(--bulma-border-weak);
    }
    .tabs-body {
        border: 1px solid var(--bulma-border);
        border-top: none;
        border-radius: 0 0 var(--bulma-radius) var(--bulma-radius);
        padding: 1rem 1.25rem;
    }
    .tab-content {
        color: var(--bulma-label-color);
    }
    .graphics-help-notice-text {
        white-space: pre-line;
    }

    .info-notification {
        display: flex;
        align-items: flex-start;
        gap: 0.75rem;
        background-color: #f5f6fa;
        color: #6b7280;
        font-size: 0.85rem;
        border-radius: 8px;
        box-shadow: none;
        padding: 1rem 1.25rem;
        .icon {
            color: #9ca3af;
            flex-shrink: 0;
            margin-top: 0.1rem;
        }
    }
    .texture-field-header {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 1rem;
        margin-bottom: 0.25rem;
    }
    .texture-field-header .label {
        margin-bottom: 0;
    }
    [data-role="upload-error"],
    .texture-dropzone-copy strong,
    .texture-upload-progress strong {
        font-size: 0.8rem;
    }
    .texture-dropzone {
        position: relative;
        display: grid;
        min-height: 6rem;
        place-items: center;
        overflow: hidden;
        padding: 0.65rem 0.9rem;
        border: 2px dashed var(--bulma-border);
        border-radius: var(--bulma-radius);
        background: var(--bulma-background);
        cursor: pointer;
        font-size: 0.8rem;
        text-align: center;
        transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
    }
    .texture-dropzone:hover,
    .texture-dropzone.is-dragging {
        border-color: var(--bulma-primary);
        background: var(--bulma-primary-soft);
    }
    .texture-dropzone-content {
        display: grid;
        min-width: 0;
        place-items: center;
    }
    .texture-dropzone-content strong,
    .texture-dropzone-content small {
        max-width: 100%;
        overflow-wrap: anywhere;
    }
    .texture-dropzone-content small {
        font-size: 0.7rem;
    }
    .texture-dropzone.is-success {
        border-color: var(--bulma-success);
        color: var(--bulma-success);
    }
    .texture-dropzone-state:not(.is-hidden) {
        display: grid;
        grid-template-columns: 2.25rem minmax(0, 1fr);
        align-items: center;
        justify-items: start;
        width: 100%;
        gap: 0.75rem;
        text-align: left;
    }
    .texture-dropzone-state > .icon {
        width: 2.25rem;
        height: 2.25rem;
    }
    .texture-dropzone-state > .icon i {
        font-size: 2rem;
        line-height: 1;
    }
    .texture-dropzone-copy {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }
    .texture-dropzone-copy strong,
    .texture-dropzone-copy small {
        color: inherit;
    }
    .texture-dropzone.is-uploading {
        cursor: wait;
        pointer-events: none;
    }
    .texture-dropzone.is-uploading .texture-dropzone-content {
        filter: blur(3px);
        opacity: 0.45;
    }
    .texture-upload-progress {
        position: absolute;
        inset: 0;
        align-content: center;
        gap: 0.5rem;
        padding: 1.25rem;
        background: color-mix(in srgb, var(--bulma-scheme-main) 72%, transparent);
    }
    .texture-upload-progress:not(.is-hidden) {
        display: grid;
    }
    .texture-upload-progress .progress {
        width: min(20rem, 100%);
        margin: 0 auto;
    }
    .checkbox-button-input {
        position: absolute;
        opacity: 0;
        width: 0;
        height: 0;
    }
    .checkbox-button-input + label.checkbox-card {
        display: flex;
        align-items: flex-start;
        gap: 0.75rem;
        text-align: left;
        white-space: normal;
        height: auto;
        min-height: 3rem;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
    .checkbox-indicator {
        flex-shrink: 0;
        width: 1.25rem;
        height: 1.25rem;
        border-radius: 50%;
        border: 2px solid #cbd5e1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        i {
            font-size: 0.75rem;
            color: #fff;
            opacity: 0;
        }
    }
    .checkbox-content {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-width: 0;
        font-weight: normal;
        font-size: 0.9rem;
        .checkbox-row {
            display: flex;
            justify-content: space-between;
            align-items: baseline;
            gap: 1rem;
            & span {
                font-size: 1em;
                font-weight: 900;
                white-space: nowrap;
                flex-shrink: 0;
            }
        }
        small {
            font-size: 0.75em;
            font-weight: normal;
            color: #6b7280;
            line-height: 1.2;
            margin-top: 0.15rem;
        }
    }
    .checkbox-card[for="pomoc"] .checkbox-content {
        font-weight: 700;
    }
    .subtab-content {
        padding-top: 1rem;
        label.label {
            font-weight: normal;
            text-transform: none;
        }

    }
    .bg-color-row {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }
    .bg-color-input {
        width: 3rem;
        height: 2.25rem;
        padding: 0;
        border: 1px solid var(--bulma-border);
        border-radius: var(--bulma-radius);
        cursor: pointer;
        &::-webkit-color-swatch-wrapper {
            padding: 0;
        }
        &::-webkit-color-swatch {
            border: none;
            border-radius: var(--bulma-radius);
        }
    }

    .subtab-content .card {
        box-shadow: none;
        border: none;
        font-size: var(--bulma-size-small);
    }
    .subtab-content .card-header {
        box-shadow: none;
        border: none;
        background-color: var(--bulma-background);
        border-bottom: 1px solid var(--bulma-border);
        cursor: pointer;
        &:hover {
            background-color: var(--bulma-border-weak);
        }
        &.is-disabled {
            cursor: not-allowed;
            opacity: 0.5;
            &:hover {
                background-color: var(--bulma-background);
            }
        }
    }
    .subtab-content .card-content {
        border: none;
        background-color: var(--bulma-background);
    }
    .slider-row {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }
    .slider-row-label,
    .slider-heading {
        font-size: var(--bulma-size-small);
        font-weight: 700;
        white-space: nowrap;
    }
    .slider-row-value {
        font-size: var(--bulma-size-small);
        white-space: nowrap;
    }
    .slider-label {
        display: block;
        font-size: var(--bulma-size-small);
        margin-bottom: 0.25rem;
    }
    .slider-input {
        -webkit-appearance: none;
        appearance: none;
        flex: 1;
        width: 100%;
        height: 0.35rem;
        border-radius: 9999px;
        background: var(--bulma-border);
        outline: none;
        &::-webkit-slider-runnable-track {
            width: 100%;
            height: 0.35rem;
            border-radius: 9999px;
            background: var(--bulma-border);
        }
        &::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 1.1rem;
            height: 1.1rem;
            margin-top: calc((0.35rem - 1.1rem) / 2);
            border-radius: 50%;
            background: var(--bulma-primary);
            border: none;
            cursor: pointer;
        }
        &::-moz-range-thumb {
            width: 1.1rem;
            height: 1.1rem;
            border-radius: 50%;
            background: var(--bulma-primary);
            border: none;
            cursor: pointer;
        }
        &::-moz-range-track {
            height: 0.35rem;
            border-radius: 9999px;
            background: var(--bulma-border);
        }
    }

    .checkbox-button-input:checked + label.checkbox-card .checkbox-indicator {
        background-color: var(--bulma-secondary);
        border-color: var(--bulma-secondary);
        i {
            opacity: 1;
        }
    }
    .download-card {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 0.75rem;
        text-align: left;
        white-space: normal;
        height: auto;
        min-height: 3rem;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
        .icon i {
            font-size: 1.2rem;
            padding-left: 0.8rem;
        }
        .download-content {
            margin-left: -0.2rem;
            display: flex;
            flex-direction: column;
            min-width: 0;
            font-size: 0.9rem;
            font-weight: 700;
            small {
                font-size: 0.75em;
                font-weight: normal;
                color: #6b7280;
                line-height: 1.2;
                margin-top: 0.15rem;
            }
        }
    }
    .download-card[aria-disabled="true"] {
        cursor: not-allowed;
        opacity: 0.5;
    }
    .summary-box {
        background-color: var(--bulma-secondary);
        color: white;
        padding: 1rem 1.25rem;
        .summary-total {
            margin-bottom: 0.35rem;
        }
        .summary-breakdown {
            padding-top: 0.75rem;
            border-top: 1px solid rgba(255, 255, 255, 0.25);
            font-size: var(--bulma-size-small);
        }
        .summary-row {
            display: flex;
            justify-content: space-between;
            gap: 1rem;
            padding: 0.15rem 0;
        }
        .summary-row span:last-child {
            flex-shrink: 0;
            text-align: right;
        }
        .button.is-success {
            letter-spacing: -0.05rem;
            padding: 0.8rem 1.5rem;
            font-weight: bold;
            border: 0.15rem solid var(--bulma-success);
            &:hover {
                border-color: white;
            }
        }
    }
    .preview-wrap {
        position: sticky;
        top: 4rem;
    }
    .preview {
        position: relative;
        min-height: 200px;
        background-color: #f5f6fa;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        .view {
            width: 100%;
        }
        .view-3d {
            width: 100%;
        }
        .preview-text {
            padding: 2rem;
            text-align: center;
            color: #6b7280;
            font-weight: bold;
        }
        .preview-img {
            display: block;
            width: 100%;
            height: auto;
            border-radius: 8px;
        }
        .preview-img[hidden], .preview-text[hidden] {
            display: none;
        }
    }
    .preview-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 2;
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 50%;
        border: 1px solid #e0e2e8;
        background-color: #fff;
        color: #6b7280;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        &.preview-prev {
            left: 0.75rem;
        }
        &.preview-next {
            right: 0.75rem;
        }
        &:hover:not(:disabled) {
            border-color: var(--bulma-secondary);
            color: var(--bulma-secondary);
        }
        &:disabled {
            opacity: 0.35;
            cursor: not-allowed;
        }
    }
    .gallery-thumbs {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0.75rem;
        overflow-x: auto;
        margin-bottom: 1rem;
        .thumb {
            flex: 0 0 auto;
            width: 96px;
            height: 96px;
            border-radius: 8px;
            border: 2px solid transparent;
            background-color: #f5f6fa;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0.25rem;
            overflow: hidden;
            font-size: 0.75rem;
            font-weight: bold;
            text-align: center;
            color: #6b7280;
            line-height: 1.2;
            img {
                width: 100%;
                height: 100%;
                object-fit: cover;
                border-radius: 6px;
            }
            &:hover {
                border-color: var(--bulma-secondary);
            }
            &.is-active {
                border-color: var(--bulma-secondary);
            }
        }
    }
    .mobile-view-switch {
        display: none;
    }
    @media screen and (max-width: 768px) {
        padding-bottom: calc(5rem + env(safe-area-inset-bottom));
        scroll-margin-top: var(--bulma-navbar-height, 3.25rem);

        .checkbox-content {
            font-size: 0.8rem;
        }

        .mobile-view-switch {
            position: fixed;
            z-index: 35;
            right: auto;
            bottom: calc(1rem + env(safe-area-inset-bottom));
            left: 50%;
            display: block;
            width: max-content;
            max-width: calc(100vw - 2rem);
            margin: 0;
            border-radius: var(--bulma-radius-rounded, 9999px);
            outline: 0.2rem solid var(--bulma-success);
            transform: translateX(-50%);
            filter: drop-shadow(0 0.2rem 0.35rem rgba(0, 0, 0, 0.3));
        }
        .mobile-view-switch ul {
            flex-grow: 0;
            justify-content: center;
        }
        .mobile-view-switch a {
            min-width: 3rem;
            border-width: 0.15rem;
            border-color: white;
            background-color: var(--bulma-success);
            color: var(--bulma-success-invert);
        }
        .mobile-view-switch li:not(:first-child) a {
            border-left-width: 1px;
        }
        .mobile-view-switch li:not(:last-child) a {
            border-right-width: 1px;
        }
        .mobile-view-switch li.is-active a {
            border-color: white;
            background-color: var(--bulma-success-dark);
            color: var(--bulma-success-dark-invert);
        }
        .mobile-view-switch .icon {
            font-size: 1.25rem;
        }
        [data-mobile-view-panel] {
            display: none;
        }
        &[data-mobile-view="configurator"] [data-mobile-view-panel="configurator"],
        &[data-mobile-view="gallery"] [data-mobile-view-panel="gallery"],
        &[data-mobile-view="price"] [data-mobile-view-panel="price"] {
            display: block;
        }
        &[data-mobile-view="gallery"] .configurator-form-column,
        &:not([data-mobile-view="gallery"]) .configurator-gallery-column {
            display: none;
        }
        &[data-mobile-view="gallery"] .configurator-gallery-column {
            display: flex;
            height: calc(100dvh - var(--bulma-navbar-height, 3.25rem) - 5.25rem);
            flex-direction: column;
            padding-bottom: 0;
            padding-left: 0.75rem !important;
        }
        &[data-mobile-view="gallery"] .gallery-thumbs {
            flex: 0 0 auto;
            margin-top: 0 !important;
        }
        &[data-mobile-view="gallery"] .preview-wrap {
            position: static;
            flex: 1 1 auto;
            min-height: 0;
        }
        &[data-mobile-view="gallery"] .preview,
        &[data-mobile-view="gallery"] .preview .view,
        &[data-mobile-view="gallery"] .view-3d,
        &[data-mobile-view="gallery"] #root {
            height: 100%;
            min-height: 0;
        }
        &[data-mobile-view="gallery"] .preview-img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            object-position: center;
        }
        &[data-mobile-view="price"] > .columns {
            display: flex;
            min-height: calc(100dvh - var(--bulma-navbar-height, 3.25rem) - 7rem);
            flex-direction: column;
            justify-content: center;
        }
        &[data-mobile-view="price"] .configurator-form-column {
            width: 100%;
        }
        &[data-mobile-view="price"] .summary-box {
            margin-top: 0 !important;
        }
    }
}