body {
    margin: 0;
    font-family: "Inter", system-ui, sans-serif;
    background-color: #f9f9f9;
    color: #1a1a1a;
}

#viewer-container {
    width: 100%;
    height: 70vh;
    display: flex;
    flex-direction: row;
    background-color: #f9f9f9;
    position: relative;
}

#rd3d-menu {
    position: relative;
    background: #ffffff;
    width: 25%;
    height: 100%;
    padding: 16px;
    border-radius: 0 0 0 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    font-family: inherit;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10;
    margin-left: auto;
    overflow-y: auto;
}

#rd3d-canvas {
    width: 75%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: auto;
}

/* Panels & Toggles */
.doorTypeWrapper,
.openingWrapper,
.detailsWrapper,
.barsWrapper,
.priceWrapper {
    background-color: #f9f9f9;
    border: 1px solid #d9d9d9;
    border-radius: 16px;
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
}

/* openingWrapper is DIFFERENT */
.openingWrapper {
    background-color: #f9f9f9;
    border-radius: 16px;
    width: 100%;

    transition:
        max-height 0.3s ease,
        opacity 0.2s ease,
        padding 0.2s ease,
        margin 0.2s ease,
        border-width 0.2s ease;
}

.barsNoOpening {
    overflow: hidden;

    /* hidden by default */
    max-height: 0;
    opacity: 0;
    padding: 0;
    margin: 0;
    border-width: 0;
    pointer-events: none;

    transition:
        max-height 0.3s ease,
        opacity 0.2s ease,
        padding 0.2s ease,
        margin 0.2s ease,
        border-width 0.2s ease;
}

.barsOpening {
    overflow: hidden;

    transition:
        max-height 0.3s ease,
        opacity 0.2s ease,
        padding 0.2s ease,
        margin 0.2s ease,
        border-width 0.2s ease;
}

/* FULLY hidden */
.openingWrapper.is-hidden,
.barsNoOpening.is-hidden,
.barsOpening.is-hidden {
    max-height: 0;
    opacity: 0;
    padding: 0;
    margin: 0;
    border-width: 0;
    pointer-events: none;
}

/* Visible */
.openingWrapper.is-visible,
.barsNoOpening.is-visible,
.barsOpening.is-visible {
    max-height: 500px; /* or JS-controlled height */
    opacity: 1;
    padding: 12px;
    margin-bottom: 10px;
    border-width: 1px;
    pointer-events: auto;
}

.parameter-titel:hover {
    background-color: #efefef;
}

.arrow {
    font-size: 16px;
    color: #ff5c14;
}

.doorTypeWrapperInner,
.openingInner,
.detailsInner,
.barsInner,
.priceInner {
    background-color: #f9f9f9;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    padding: 12px;
    overflow: hidden;
    max-height: 1000px;
    transition: max-height 0.3s ease;
}

.parameterTitel,
.openingTitel,
.detailsTitel,
.barsTitel {
    background-color: #f9f9f9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    margin-bottom: 16px;
    z-index: 2;
    width: 100%;
}

.doorTypeWrapperInner:not(.open),
.openingInner:not(.open),
.detailsInner:not(.open),
.barsInner:not(.open) {
    max-height: 40px;
}

.doorTypeButtonsWrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.openingButtonWrapper {
    display: flex;
    gap: 10px;
    justify-content: center;
    max-width: 300px;
}

.openingButton {
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 8px;
}

.RALcontainer {
    display: flex;
    justify-content: center;
    align-items: center;
}

.glasArt,
.glasSaftey {
    margin-top: 8px;
}

.barsOpening {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.topBarsOpening,
.topHorizontalBarsOpening,
.sideVertBarsOpening,
.sideHorBarsOpening {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.addToCart {
    display: flex;
    flex-direction: column;
    justify-content: center; /* Optional: centers items vertically within the container */
    align-items: center; /* Optional: centers items horizontally */
}

/* Inputs */
.parameter-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.parameter input {
    width: 100%;
    padding: 6px;
    border-radius: 4px;
    border: 1px solid #d9d9d9;
    font-family: inherit;
}

.parameter-slider {
    width: 100%;
    margin: 5px 0;
}

.custom-slider {
    width: 100%;
    height: 6px;
    background: #ddd;
    border-radius: 3px;
    outline: none;
    accent-color: #ff5c14; /* Modern browsers support this for slider thumb */
    cursor: pointer;
    margin-top: 5px;
}

/* Optional: Style the thumb and track more precisely for WebKit browsers */
.custom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #ff5c14;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
    transition: background 0.2s ease-in-out;
}

.custom-slider::-webkit-slider-thumb:hover {
    background: #ff5c14;
}

.custom-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #ff5c14;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: background 0.2s ease-in-out;
}

.custom-slider::-moz-range-thumb:hover {
    background: #ff5c14;
}

.parameter-value {
    font-size: 15px;
    font-weight: 500;
    margin-top: 5px;
}

.size,
.openingSize {
    display: flex;
    gap: 10px;
}

.height,
.width {
    flex: 1;
}

.leftPart,
.rightPart,
.topPart {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.leftPart div,
.rightPart div,
.topPart div {
    flex: 1;
    text-align: center;
}

.totalPrice {
    text-align: center;
    font-weight: bold;
}

.openingToggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.openingToggleSwitch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
}

.openingToggleInput {
    opacity: 0;
    width: 0;
    height: 0;
}

.openingToggleSlider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background-color: #ccc;
    border-radius: 999px;
    transition: background-color 0.25s;
}

.openingToggleSlider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.25s;
}

.openingToggleInput:checked + .openingToggleSlider {
    background-color: #ff5c14;
}

.openingToggleInput:checked + .openingToggleSlider::before {
    transform: translateX(20px);
}

.delivery-info {
    margin-top: 10px;
    text-align: center;
    line-height: 1.4;
    color: #777;
}

.delivery-link {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    text-decoration: underline;
    margin-bottom: 4px;
    transition: color 0.2s ease;
}

.delivery-link:hover {
    color: #ff8c00;
}

.delivery-info small {
    display: block;
    font-size: 11px;
    color: #888;
}

.menu-footer-info {
    margin-top: 16px;
    padding-top: 8px;
    font-size: 10px;
    color: #999;
    text-align: center;
    border-top: 1px solid #eee;
    margin-bottom: 130px;
}

.menu-footer-info a {
    color: #999;
    text-decoration: underline;
}

.menu-footer-info a:hover {
    color: #ff8c00;
}

.bench-safety-dropdown {
    margin-top: 12px;
    font-size: 12px;
    color: #666;
}

.bench-safety-header {
    cursor: pointer;
    padding: 8px 0;
    font-weight: 600;
    text-align: center;
    color: #444;
}

.bench-safety-header:hover {
    color: #ff8c00;
}

.bench-safety-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.bench-safety-dropdown.open .bench-safety-content {
    max-height: 500px; /* enough for the content */
}

.bench-max-load {
    font-weight: 600;
    margin-bottom: 6px;
    text-align: center;
}

.bench-safety-content ul {
    padding-left: 16px;
    margin: 0;
}

.bench-safety-content li {
    margin-bottom: 4px;
    font-size: 11px;
    color: #777;
}

.bench-safety-header {
    cursor: pointer;
    padding: 8px 0;
    font-weight: 600;
    text-align: center;
    color: #444;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.bench-safety-header:hover {
    color: #ff8c00;
}

.bench-safety-arrow {
    font-size: 12px;
    transition: transform 0.25s ease;
}

/* Rotate arrow when open */
.bench-safety-dropdown.open .bench-safety-arrow {
    transform: rotate(180deg);
}

/* Mobile menu */
@media (max-width: 1000px) {
    #rd3d-menu {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #ffffff;
        z-index: 20;
        flex-direction: column;
        border-top-left-radius: 16px;
        border-top-right-radius: 16px;
        overflow: hidden;
        width: 100%;
        transition: height 0.3s ease;
    }

    .menuArrow {
        height: 50px;
        display: flex;
        flex-direction: column; /* stack items vertically */
        align-items: center; /* center horizontally */
        justify-content: center; /* center vertically */
        font-size: 18px;
        cursor: grab;
        user-select: none;
        border-top-left-radius: 16px;
        border-top-right-radius: 16px;
        padding-bottom: 40px;
        margin-top: 0px;
        padding-top: 30px;
        margin-bottom: 30px;
    }

    .menuContent {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 12px;
        background: #ffffff;
    }

    #menuArrow:active {
        cursor: grabbing;
        background-color: #ff5c14;
    }
}
