/* Hide spin buttons on room dimension number inputs */
#room-width-input::-webkit-inner-spin-button,
#room-width-input::-webkit-outer-spin-button,
#room-length-input::-webkit-inner-spin-button,
#room-length-input::-webkit-outer-spin-button,
#room-height-input::-webkit-inner-spin-button,
#room-height-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
#room-width-input,
#room-length-input,
#room-height-input {
    -moz-appearance: textfield;
}

.wall {
    clip-path: inset(0);
    border: 1px solid #ccc;
}

.cabinet {
    border: 2px solid #ccc;
    position: absolute;
    cursor: pointer;
    z-index: 4;
}

.cabinet-panel {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.shelf-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(0, 0, 0, 0.45);
    z-index: 2;
}

.cabinet-label {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    padding: 2px 5px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 10px;
    white-space: nowrap;
    line-height: 1.4;
    z-index: 100;
}

.cabinet:hover {
    z-index: 1000;
}

.cabinet:hover .cabinet-label {
    display: block;
}

.cab-dim-label {
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
    font-weight: 600;
    pointer-events: none;
    z-index: 3;
    white-space: nowrap;
    overflow: hidden;
    line-height: 1;
}

.wall-label {
    position: absolute;
    bottom: 4px;
    width: 100%;
    text-align: center;
    font-size: 11px;
    color: #666;
    pointer-events: none;
    z-index: 5;
}

.panel-swatch {
    width: 40px;
    height: 40px;
    border: 2px solid #ccc;
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
}

.panel-swatch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.panel-swatch.active {
    border-color: #0d6efd;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.4);
}

.handle-swatch {
    width: 80px;
    height: 50px;
    border: 2px solid #ccc;
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    text-align: center;
    padding: 2px;
    line-height: 1.2;
}

.handle-swatch img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.handle-swatch.active {
    border-color: #0d6efd;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.4);
}

.color-swatch {
    width: 28px;
    height: 28px;
    border: 2px solid #ccc;
    cursor: pointer;
    border-radius: 4px;
    flex-shrink: 0;
}

.color-swatch.active {
    border-color: #0d6efd;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.4);
}

.cabinet.selected {
    border: 2px solid #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.35);
}

.cabinet-add-button {
    position: absolute;
}

.corner-block {
    position: absolute;
    background: repeating-linear-gradient(
        45deg,
        rgba(0,0,0,0.08),
        rgba(0,0,0,0.08) 4px,
        transparent 4px,
        transparent 10px
    );
    pointer-events: none;
    z-index: 2;
}

.layout-option {
    cursor: pointer;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 10px 14px;
    text-align: center;
    transition: border-color 0.15s, box-shadow 0.15s;
    user-select: none;
}

.layout-option:hover {
    border-color: #86b7fe;
}

.layout-option.selected {
    border-color: #0d6efd;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.2);
}

.layout-option img {
    display: block;
    width: 80px;
    height: 60px;
    object-fit: contain;
    margin: 0 auto;
}

.layout-label {
    font-size: 12px;
    margin-top: 6px;
    color: #666;
}

.layout-option.selected .layout-label {
    color: #0d6efd;
    font-weight: 600;
}

#panels img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
    border-radius: 4px;
}

#cabinetModelPicker .list-group-item {
    border-left: none;
    border-right: none;
    border-radius: 0;
    padding: 0.85rem 1.25rem;
    font-size: 0.95rem;
    color: #212529;
    cursor: pointer;
    transition: background-color 0.1s, color 0.1s;
}

#cabinetModelPicker .list-group-item:first-child {
    border-top: none;
}

#cabinetModelPicker .list-group-item:hover {
    background-color: #f0f5ff;
    color: #0d6efd;
}

#cabinetModelPicker .list-group-item:active {
    background-color: #d8e8ff;
}

#cabinetModelPicker .modal-header {
    border-bottom: 2px solid #dee2e6;
    background: #f8f9fa;
}

.cab-warning-icon {
    position: absolute;
    top: 3px;
    left: 50%;
    transform: translateX(-50%);
    background: #ffc107;
    color: #000;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 2px;
    z-index: 10;
    cursor: help;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    pointer-events: all;
}

.tabletop-swatch {
    width: 100px;
    border: 2px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    padding-bottom: 4px;
    flex-shrink: 0;
}
.tabletop-swatch.active {
    border-color: #0d6efd;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.4);
}
.tabletop-swatch-img {
    width: 96px;
    height: 80px;
    overflow: hidden;
}
.tabletop-swatch-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.tabletop-swatch-none, .tabletop-swatch-noimg {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    color: #999;
    font-size: 1.5rem;
}
.tabletop-swatch-label {
    font-size: 0.7rem;
    line-height: 1.2;
    margin-top: 2px;
    word-break: break-word;
}
.tabletop-swatch-sub {
    font-size: 0.65rem;
    color: #666;
}

.door-separator {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(0, 0, 0, 0.4);
    transform: translateX(-50%);
    z-index: 2;
    pointer-events: none;
}

/* Parts list collapsible cabinet headers */
.parts-cab-header::before {
    content: '\25B6'; /* right triangle */
    display: inline-block;
    font-size: 0.6em;
    margin-right: 0.4em;
    transition: transform 0.2s;
    vertical-align: middle;
}
.parts-cab-header:not(.collapsed)::before {
    transform: rotate(90deg);
}
