/* Cartoon storefront compatibility, 2026-10-12.
 * Keep official 3.8.4 code/CSS and new features. Restore 3.7 storefront
 * proportions only on the retained Cartoon storefront templates.
 * Latest product markup uses .item-card-cell / .acg-body; do not roll back JS.
 */
html.acg-storefront-legacy {
    font-size: 13px;
    --acg-primary: #7a8cff;
    --acg-secondary: #b88cff;
    --acg-danger: #ff6b88;
    --acg-text-strong: #111319;
    --acg-text-muted: #6b7280;
    /* Current query/payment components also need tokens on the old template. */
    --uc-ink: #111319;
    --uc-ink-med: #6b7280;
    --uc-ink-dis: #858585;
    --md-primary: #7a8cff;
    --md-primary-rgb: 122,140,255;
    --md-on-primary: #fff;
    --glass-bg-soft: rgba(255,255,255,.5);
}
.acg-storefront-legacy body { background-repeat: no-repeat; background-attachment: fixed; }
.acg-storefront-legacy .container { width: 100%; max-width: none; }
@media (min-width: 576px) { .acg-storefront-legacy .container { max-width: 540px; } }
@media (min-width: 768px) { .acg-storefront-legacy .container { max-width: 720px; } }
@media (min-width: 992px) { .acg-storefront-legacy .container { max-width: 960px; } }
@media (min-width: 1200px) { .acg-storefront-legacy .container { max-width: 1140px; } }
@media (min-width: 1400px) { .acg-storefront-legacy .container { max-width: 1320px; } }
.acg-storefront-legacy .navbar-acg {
    padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.8); backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    box-shadow: 0 10px 30px rgba(82,63,105,.05); z-index: 1000;
}
.acg-storefront-legacy .navbar-brand { font-size: 1.45rem; }
.acg-storefront-legacy .navbar-acg .nav-link { color: #898989; font-size: 1.2rem; }
.acg-storefront-legacy .navbar-acg .nav-link.active { color: #479afb; font-weight: 600; }
.acg-storefront-legacy .navbar-acg .nav-icon { margin-right: .35rem; font-size: 1.15rem; }
.acg-storefront-legacy .brand-logo { width: 22px; height: 22px; border-radius: 4px; flex-shrink: 0; }
.acg-storefront-legacy .search-input { max-width: 360px; }
.acg-storefront-legacy .search-input .input-group-text { border: 1px solid #90909075; border-right: 0; background: transparent; padding: 0 0 0 10px; border-radius: 12px 0 0 12px; }
.acg-storefront-legacy .search-input .form-control { border: 1px solid #90909075 !important; border-left: 0 !important; border-radius: 0 12px 12px 0; }
.acg-storefront-legacy .br-12 { border-radius: 12px; }
.acg-storefront-legacy .navbar-acg .btn-primary { display: inline-block; height: auto; padding: var(--bs-btn-padding-y) var(--bs-btn-padding-x); border: var(--bs-btn-border-width) solid var(--bs-btn-border-color); color: var(--bs-btn-color); background: var(--bs-btn-bg); font-weight: var(--bs-btn-font-weight); box-shadow: none; }
.acg-storefront-legacy .panel {
    border: none; border-radius: 16px; background: rgba(255,255,255,.5);
    box-shadow: 0 10px 30px rgba(82,63,105,.05);
    backdrop-filter: none; -webkit-backdrop-filter: none; overflow: visible;
}
.acg-storefront-legacy .panel::before {
    content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
    backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
    clip-path: inset(0 round 16px); pointer-events: none;
}
.acg-storefront-legacy .panel + .panel { margin-top: 16px; }
.acg-storefront-legacy .panel-header { gap: 5px; padding: 16px; margin-bottom: 12px; box-shadow: 0 8px 24px rgba(149,157,165,.2); }
.acg-storefront-legacy .panel-header .icon { width: auto; height: auto; font-size: 1.1rem; border-radius: 50%; background: transparent; }
.acg-storefront-legacy .panel-title { color: #111827; font-size: 1.2rem; font-weight: 500; }
.acg-storefront-legacy .panel-body { padding: 0 16px 16px; color: #1f2937; font-size: inherit; line-height: inherit; }
.acg-storefront-legacy .panel-body img { border-radius: 0; }
.acg-storefront-legacy .chip-list { gap: .5rem; padding: 2px 0 .25rem; margin-bottom: 0; }
.acg-storefront-legacy .chip {
    gap: 0; height: auto; padding: .4rem 1rem; border: none; font-size: 1.231rem; font-weight: 400;
    color: #707070; background: rgba(255,248,248,.23); box-shadow: 0 1px 4px rgba(0,0,0,.16);
}
.acg-storefront-legacy .chip.is-primary { color: #fff; background: linear-gradient(90deg,var(--acg-primary),var(--acg-secondary)); }
.acg-storefront-legacy .chip .chip-icon { border-radius: 50%; margin-right: 6px; }
/* Original Bootstrap row proportions, adapted to current official markup. */
.acg-storefront-legacy .item-list { display: flex; flex-wrap: wrap; gap: 0; margin-left: -.75rem; margin-right: -.75rem; }
.acg-storefront-legacy .item-list > * { padding-left: .75rem !important; padding-right: .75rem !important; }
.acg-storefront-legacy .item-card-cell { flex: 0 0 auto; width: 100%; margin-bottom: 1rem; }
@media (min-width: 768px) { .acg-storefront-legacy .item-card-cell { width: 50%; } }
@media (min-width: 992px) { .acg-storefront-legacy .item-card-cell { width: 25%; } }
.acg-storefront-legacy .acg-card { border: none; border-radius: 14px; background: #fff; box-shadow: 0 7px 29px rgba(100,100,111,.2); }
.acg-storefront-legacy .acg-thumb { height: 160px; aspect-ratio: auto; flex-shrink: 0; }
.acg-storefront-legacy .acg-card > .acg-body { padding: 1rem; gap: 0; }
.acg-storefront-legacy .tags { gap: .35rem; margin-bottom: .4rem; }
.acg-storefront-legacy .goods-title { font-size: 15px; font-weight: 700; line-height: 1.35; min-height: 2.7em; color: #1f1f1f; }
.acg-storefront-legacy .price { font-size: 20px; font-weight: 800; color: var(--acg-danger); line-height: inherit; }
.acg-storefront-legacy .price .unit { font-size: 16px; font-weight: 600; color: #ef7d93; margin-right: 0; }
.acg-storefront-legacy .stat-row { align-items: center; justify-content: space-between; gap: .5rem; }
.acg-storefront-legacy .stat-bottom, .acg-storefront-legacy .meta { color: var(--acg-text-muted); font-size: inherit; }
.acg-storefront-legacy .badge-soft { display: inline-block; padding: .15rem .45rem; font-size: 12px; font-weight: 400; line-height: inherit; border: 1px solid transparent; }
.acg-storefront-legacy .badge-soft-primary { color: #5b6ce6; background: rgba(122,140,255,.12); border-color: rgba(122,140,255,.25); }
.acg-storefront-legacy .badge-soft-success { color: #3aa76d; background: rgba(80,200,120,.12); border-color: rgba(80,200,120,.25); }
.acg-storefront-legacy .badge-soft-info { color: #ba95fb; background: rgba(186,149,251,.12); border-color: rgba(186,149,251,.25); }
/* Purchase page: keep current fields, stock checks, payment events and endpoints. */
.acg-storefront-legacy .acg-cover { position: relative; overflow: hidden; }
.acg-storefront-legacy .item-cover { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; object-fit: cover; display: block; }
.acg-storefront-legacy h4 { font-weight: 500; }
.acg-storefront-legacy .abacus .price { font-size: 20px; }
.acg-storefront-legacy .sku-list { gap: .5rem; margin-top: 2px; }
.acg-storefront-legacy .sku { position: relative; gap: 0; padding: .2rem .6rem; border-radius: 16px; font-size: 14px; border: none; color: #929292; background: rgba(255,248,248,.63); box-shadow: 0 1px 4px rgba(0,0,0,.16); }
.acg-storefront-legacy .sku.is-primary { color: #fff; background: linear-gradient(90deg,var(--acg-primary),var(--acg-secondary)); }
.acg-storefront-legacy .sku .badge-money { position: absolute; top: -15px; right: -12px; z-index: 1; padding: 1px 4px; font-size: 11px; font-weight: 500; line-height: 1.1; color: #fff; background: linear-gradient(90deg,#ffb84d,#ff6b88); border: 2px solid #fff; border-radius: 999px; opacity: 1; pointer-events: none; }
.acg-storefront-legacy .form-control { height: auto; border-radius: .375rem; padding: .375rem .75rem; }
.acg-storefront-legacy .vstack label { color: grey; font-size: 14px; font-weight: 400; }
.acg-storefront-legacy .vstack .form-control { font-size: 14px; background: rgba(255,255,255,.49) !important; border: 1px solid #ababab47 !important; }
.acg-storefront-legacy .captcha-input { border-radius: .375rem 0 0 .375rem; border-right: none !important; }
.acg-storefront-legacy .captcha-img { height: 100%; padding: 0; margin-left: 2px; border-left: none; border-radius: 0 .375rem .375rem 0; background: rgba(255,255,255,.49); }
.acg-storefront-legacy .input-group.qty-group { display: flex; align-items: center; gap: 14px; padding: 6px 8px; width: 140px; max-width: 100%; border: 2px solid #ffd6e5; border-radius: .375rem; background: linear-gradient(180deg,#fff,#fff4f8); box-shadow: 0 14px 24px rgba(255,105,135,.18),0 0 0 6px rgba(255,214,229,.35) inset; }
.acg-storefront-legacy .qty-group > button { width: 32px; height: 24px; border-radius: .375rem; color: #fff; font-size: 14px; line-height: 1; font-weight: 700; background: linear-gradient(180deg,#ff74a9,#ff5c8e); }
.acg-storefront-legacy .qty-group > input[type="number"] { flex: 1 1 auto; width: 1%; min-width: 0; padding: 0; border: 0 !important; background: transparent !important; color: #ff5c8e !important; font-weight: 700; }
.acg-storefront-legacy .cash-pay { position: relative; padding: 12px; border: none; border-radius: 16px; background: #ffffff70; box-shadow: 0 10px 28px rgba(149,157,165,.25),0 0 0 6px rgba(122,140,255,.06) inset; }
.acg-storefront-legacy .cash-pay .form-label { gap: .3rem; margin: 4px 0 8px 4px; font-weight: 800; font-size: 1rem; color: #9d93f7; }
.acg-storefront-legacy .cash-pay .pay-list { display: flex; flex-wrap: wrap; gap: .5rem; padding-top: 10px; border-top: 1px dashed #eceff3; }
.acg-storefront-legacy .pay-list .pay { display: inline-flex; align-items: center; width: auto; font-size: inherit; font-weight: inherit; gap: 3px; padding: .4rem .75rem; border: none; border-radius: 12px; background: rgba(255,248,248,.3); box-shadow: 0 7px 29px rgba(100,100,111,.2); max-width: 100%; }
.acg-storefront-legacy .pay-list .pay img { width: 20px; height: 20px; object-fit: cover; border-radius: 6px; }
.acg-storefront-legacy .pay-list .pay span { font-size: 14px; font-weight: 700; color: #a3a3a3; }
.acg-storefront-legacy .item-detail .panel-body p { margin-bottom: 0; line-height: 1.7; }
.acg-storefront-legacy footer { margin-top: 20px; display: flex; justify-content: center; align-items: center; padding: 8px 0; color: #858585; }
.acg-storefront-legacy .lang-switch__btn { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .55rem; border-radius: 10px; color: var(--acg-text-muted); font-size: .9rem; line-height: 1; }
.acg-storefront-legacy .lang-switch__code { font-size: .8rem; font-weight: 600; }
.acg-storefront-legacy .lang-switch__caret { font-size: .62rem; opacity: .55; }
@media (max-width: 991.98px) {
    .acg-storefront-legacy .navbar-acg .container { flex-wrap: wrap; column-gap: .35rem; }
    .acg-storefront-legacy .navbar-brand { flex: 0 1 auto; min-width: 0; margin-right: auto; overflow: hidden; }
    .acg-storefront-legacy .navbar-brand > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .acg-storefront-legacy .navbar-collapse { order: 10; flex-basis: 100%; }
    .acg-storefront-legacy .lang-switch { order: 4; }
    .acg-storefront-legacy .user-info-box, .acg-storefront-legacy .user-login-box { position: static; order: 5; min-width: 0; }
    .acg-storefront-legacy .navbar-toggler { order: 6; flex: 0 0 auto; }
    .acg-storefront-legacy .user-info-box .dropdown-toggle { max-width: 46vw; padding-left: 0; padding-right: 0; }
    .acg-storefront-legacy .user-info-box .dropdown-toggle > .d-flex { min-width: 0; }
    .acg-storefront-legacy #user-balance, .acg-storefront-legacy #username { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    /* The former absolute image could collapse to zero on stacked mobile rows. */
    .acg-storefront-legacy .acg-cover { min-height: 220px; aspect-ratio: 16 / 10; max-height: 360px; }
}
@media (min-width: 576px) and (max-width: 991.98px) { .acg-storefront-legacy .acg-thumb { height: 140px; } }
@media (max-width: 575.98px) {
    .acg-storefront-legacy .acg-thumb { height: 120px; }
    .acg-storefront-legacy .goods-title { -webkit-line-clamp: 1; line-clamp: 1; min-height: 1.35em; }
    .acg-storefront-legacy .chip { padding: .35rem .6rem; font-size: 13px; }
    .acg-storefront-legacy .chip .chip-icon { width: 16px; height: 16px; margin-right: 4px; }
    .acg-storefront-legacy .lang-switch__code, .acg-storefront-legacy .lang-switch__caret { display: none; }
    .acg-storefront-legacy .lang-switch__btn { padding: .3rem .4rem; }
}
@media (max-width: 479.98px) {
    .acg-storefront-legacy .navbar-brand > span { max-width: 30vw; }
    .acg-storefront-legacy .user-info-box .dropdown-toggle { max-width: 38vw; }
    .acg-storefront-legacy #user-balance { display: none; }
    .acg-storefront-legacy #username { font-size: 13px; }
    .acg-storefront-legacy .user-info-box .rounded-circle { width: 28px !important; height: 28px !important; margin-right: .35rem !important; }
}
@media (max-width: 399.98px) {
    .acg-storefront-legacy .navbar-acg .container { column-gap: .2rem; }
    .acg-storefront-legacy .navbar-brand > span { max-width: 22vw; }
    .acg-storefront-legacy .navbar-brand { font-size: 1.15rem; }
}
