/*
 * sujiyuncart：Bootstrap 4 组件样式（精简）
 * 原购物车运行在用户中心内，依赖用户中心加载的 bootstrap.min.css；
 * 独立继承前台后缺失，这里只补配置页/结算页用到的组件，不引入 reboot，避免影响前台头尾。
 */
.fade { transition: opacity .15s linear; }
.fade:not(.show) { opacity: 0; }
.collapse:not(.show) { display: none; }

/* 按钮组切换：隐藏原生单选/复选框 */
.btn-group-toggle > .btn input[type="radio"],
.btn-group-toggle > .btn input[type="checkbox"],
.btn-group-toggle > .btn-group > .btn input[type="radio"],
.btn-group-toggle > .btn-group > .btn input[type="checkbox"] {
    position: absolute;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}
.btn { display: inline-block; cursor: pointer; user-select: none; text-align: center; vertical-align: middle; }
.btn.disabled, .btn:disabled { opacity: .65; cursor: not-allowed; }

/* 下拉（bootstrap-select 依赖） */
.dropup, .dropright, .dropdown, .dropleft { position: relative; }
.dropdown-toggle { white-space: nowrap; }
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    float: left;
    min-width: 10rem;
    padding: .5rem 0;
    margin: .125rem 0 0;
    font-size: 14px;
    color: #212529;
    text-align: left;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, .15);
    border-radius: 4px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .08);
}
.dropdown-menu.show { display: block; }
.dropup .dropdown-menu { top: auto; bottom: 100%; margin-top: 0; margin-bottom: .125rem; }
.dropdown-item {
    display: block;
    width: 100%;
    padding: .375rem 1rem;
    clear: both;
    font-weight: 400;
    color: #212529;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    text-decoration: none;
}
.dropdown-item:hover, .dropdown-item:focus { color: #16181b; background-color: #f5f7fa; text-decoration: none; }
.dropdown-item.active, .dropdown-item:active { color: #fff; background-color: var(--Original, #0052d9); }
.dropdown-item.disabled, .dropdown-item:disabled { color: #adb5bd; pointer-events: none; background-color: transparent; }
.dropdown-header { display: block; padding: .5rem 1rem; font-size: 12px; color: #6c757d; white-space: nowrap; }
.dropdown-divider { height: 0; margin: .5rem 0; overflow: hidden; border-top: 1px solid #e9ecef; }

/* 表单控件 */
.form-control {
    display: block;
    width: 100%;
    height: 38px;
    padding: .375rem .75rem;
    font-size: 14px;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus { border-color: var(--Original, #0052d9); outline: 0; }
.form-control.is-invalid { border-color: #f5222d; }
.invalid-feedback { display: none; width: 100%; margin-top: .25rem; font-size: 12px; color: #f5222d; }
.is-invalid ~ .invalid-feedback { display: block; }

.form-check { position: relative; display: block; padding-left: 1.25rem; }
.form-check-input { position: absolute; margin-top: .3rem; margin-left: -1.25rem; }
.form-check-label { margin-bottom: 0; cursor: pointer; }

.custom-control { position: relative; display: block; min-height: 1.5rem; padding-left: 1.5rem; }
.custom-control-input { position: absolute; left: 0; z-index: -1; width: 1rem; height: 1.25rem; opacity: 0; }
.custom-control-label { position: relative; margin-bottom: 0; vertical-align: top; cursor: pointer; }
.custom-control-label::before,
.custom-control-label::after {
    position: absolute;
    top: .25rem;
    left: -1.5rem;
    display: block;
    width: 1rem;
    height: 1rem;
    content: "";
}
.custom-control-label::before { background-color: #fff; border: 1px solid #adb5bd; border-radius: 3px; }
.custom-control-input:checked ~ .custom-control-label::before {
    border-color: var(--Original, #0052d9);
    background-color: var(--Original, #0052d9);
}
.custom-control-input:checked ~ .custom-control-label::after {
    background: no-repeat 50% / 50% 50% url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/%3e%3c/svg%3e");
}

/* 提示、弹窗、警告、加载 */
.tooltip { position: absolute; z-index: 1070; display: block; font-size: 12px; word-wrap: break-word; opacity: 0; }
.tooltip.show { opacity: .95; }
.tooltip .arrow { position: absolute; display: block; width: .8rem; height: .4rem; }
.tooltip .arrow::before { position: absolute; content: ""; border-color: transparent; border-style: solid; }
.bs-tooltip-top, .bs-tooltip-auto[x-placement^=top] { padding: .4rem 0; }
.bs-tooltip-top .arrow, .bs-tooltip-auto[x-placement^=top] .arrow { bottom: 0; }
.bs-tooltip-top .arrow::before, .bs-tooltip-auto[x-placement^=top] .arrow::before { top: 0; border-width: .4rem .4rem 0; border-top-color: #000; }
.bs-tooltip-bottom, .bs-tooltip-auto[x-placement^=bottom] { padding: .4rem 0; }
.bs-tooltip-bottom .arrow, .bs-tooltip-auto[x-placement^=bottom] .arrow { top: 0; }
.bs-tooltip-bottom .arrow::before, .bs-tooltip-auto[x-placement^=bottom] .arrow::before { bottom: 0; border-width: 0 .4rem .4rem; border-bottom-color: #000; }
.bs-tooltip-right, .bs-tooltip-auto[x-placement^=right] { padding: 0 .4rem; }
.bs-tooltip-right .arrow, .bs-tooltip-auto[x-placement^=right] .arrow { left: 0; width: .4rem; height: .8rem; }
.bs-tooltip-right .arrow::before, .bs-tooltip-auto[x-placement^=right] .arrow::before { right: 0; border-width: .4rem .4rem .4rem 0; border-right-color: #000; }
.tooltip-inner { max-width: 260px; padding: .25rem .5rem; color: #fff; text-align: center; background-color: #000; border-radius: 4px; }

.modal-open { overflow: hidden; }
.modal { position: fixed; top: 0; left: 0; z-index: 1050; display: none; width: 100%; height: 100%; overflow-x: hidden; overflow-y: auto; outline: 0; }
.modal-dialog { position: relative; width: auto; max-width: 500px; margin: 1.75rem auto; pointer-events: none; }
.modal-dialog-centered { display: flex; align-items: center; min-height: calc(100% - 3.5rem); }
.modal-content { position: relative; display: flex; flex-direction: column; width: 100%; pointer-events: auto; background-color: #fff; border-radius: 6px; outline: 0; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem; border-bottom: 1px solid #e9ecef; }
.modal-title { margin: 0; font-size: 16px; }
.modal-body { position: relative; flex: 1 1 auto; padding: 1rem; }
.modal-backdrop { position: fixed; top: 0; left: 0; z-index: 1040; width: 100vw; height: 100vh; background-color: #000; }
.modal-backdrop.fade { opacity: 0; }
.modal-backdrop.show { opacity: .5; }
.close { float: right; font-size: 21px; font-weight: 700; line-height: 1; color: #000; opacity: .5; background: transparent; border: 0; cursor: pointer; }
.close:hover { opacity: .75; }

.alert { position: relative; padding: .75rem 1.25rem; margin-bottom: 1rem; border: 1px solid transparent; border-radius: 4px; }
.alert-danger { color: #721c24; background-color: #f8d7da; border-color: #f5c6cb; }

@keyframes spinner-border { to { transform: rotate(360deg); } }
.spinner-border { display: inline-block; width: 2rem; height: 2rem; vertical-align: text-bottom; border: .25em solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spinner-border .75s linear infinite; }
.spinner-border-sm { width: 1rem; height: 1rem; border-width: .2em; }

.text-muted { color: #6c757d !important; }
.text-primary { color: var(--Original, #0052d9) !important; }
.pointer { cursor: pointer; }
.mr-1 { margin-right: .25rem !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
