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;
}

#bs3d-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;
}

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

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

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

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

.layoutWrapperInner,
.materialWrapperInner,
.OverallDimensionsWrapperInner,
.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,
.layoutTitel,
.materialTitel,
.priceTitel {
    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%;
}

.layoutWrapperInner:not(.open),
.materialWrapperInner:not(.open),
.OverallDimensionsWrapperInner:not(.open) {
    max-height: 40px;
}

/* Images & Buttons */

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

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

/* Popup */
.bs3d-popup {
    position: absolute;
    left: 50%;
    top: 16px;
    transform: translate(-50%, 20px); /* X: center; Y: offset */
    background-color: #fd5d14;
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.2;
    opacity: 0;
    pointer-events: none;
    z-index: 10000;
    transition:
        opacity 0.25s ease,
        transform 0.25s ease;

    /* Keep it fully visible on small screens */
    max-width: calc(
        100% - 24px
    ); /* 12px margin on each side inside container */
    box-sizing: border-box;
    overflow-wrap: anywhere; /* prevent long text overflow */
}

.bs3d-popup[data-show="1"] {
    opacity: 1;
    transform: translate(-50%, 0); /* slide up into place */
}

/* 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 {
    display: flex;
    gap: 10px;
}

.height,
.width {
    flex: 1;
}

.numberOfShelfsDiv,
.numberOfVerticalFramePostsDiv,
.topExtensionDiv,
.sideOffsetDiv,
.backGuardPanelHeightDiv,
.materialSelection,
.woodFinish,
.woodSheen,
.metalTexture,
.shelfWidthDiv,
.shelfDepthDiv,
.bottomShelfHeightDiv,
.topShelfHeightDiv {
    margin-bottom: 8px;
}

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

/* Mobile menu */
@media (max-width: 1000px) {
    #bs3d-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;
    }

    .menuArrowBs3d {
        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: 20px;
    }

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

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