.cascading-select {
    position: relative;
    width: 100%;
}

.cs-display {
    border: 1px solid #ccc;
    /* padding: .75rem .5rem; */
    padding: 1rem .75rem;
    border-radius: .375rem;
    cursor: pointer;
    background: #fff;
    min-height: calc(3.5rem + 2px);
    /* igual que Bootstrap form-floating */
    display: flex;
    align-items: center;
}

.cs-display.has-value {
    font-size: 1rem;
    padding-top: 1.625rem;
    padding-bottom: .625rem;
}

.cs-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: .375rem;
    max-height: 250px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    font-size: 0.9rem;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.cs-dropdown.show {
    display: block;
}

.cs-category {
    font-weight: 700;
    padding: 8px;
    cursor: pointer;
    background: #f8f9fa;
}

.cs-category:hover {
    background-color: #5897fb;
    color: white;
}

.cs-children {
    display: none;
    padding-left: 15px;
}

.cs-item {
    padding: 6px 8px;
    cursor: pointer;
}

.cs-item:hover {
    background: #e9ecef;
}

/* Integración con form-floating */
.form-floating>.cascading-select>.cs-display {
    /* height: calc(3.5rem + 2px);
    line-height: 1.25; */
    height: calc(3.5rem + calc(var(--bs-border-width) * 2));
    min-height: calc(3.5rem + calc(var(--bs-border-width) * 2));
    line-height: 1.25;
}

.form-floating>label {
    transition: all .1s ease-in-out;
}

.cascading-select .cs-display.has-value+label,
.form-floating>.cascading-select:focus-within+label,
.cascading-select.has-value+label {
    transform: scale(.85) translateY(-0.75rem) translateX(.15rem);
    opacity: .65;
}

.custom-dropdown-arrow {
    margin-left: 0.5rem;
    transition: transform 0.2s ease-in-out;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #777;
    position: absolute;
    top: 50%;
    right: 0.6rem;
}

.cs-dropdown.show+.custom-dropdown-arrow {
    transform: rotate(180deg);
    /* Rota hacia arriba */
}