/* Storefront dimensions from the pre-upgrade theme, on the current markup.
   Keep the 3.8.3 templates, controls, theme switching and security behavior. */
html {
    font-size: 13px;
}

body.uc-body .container,
.uc-topbar__inner {
    width: 100%;
    max-width: none;
}

@media (min-width: 576px) {
    body.uc-body .container,
    .uc-topbar__inner { max-width: 540px; }
}

@media (min-width: 768px) {
    body.uc-body .container,
    .uc-topbar__inner { max-width: 720px; }
}

@media (min-width: 992px) {
    body.uc-body .container,
    .uc-topbar__inner { max-width: 960px; }
}

@media (min-width: 1200px) {
    body.uc-body .container,
    .uc-topbar__inner { max-width: 1140px; }
}

@media (min-width: 1400px) {
    body.uc-body .container,
    .uc-topbar__inner { max-width: 1320px; }
}

.shop-brand { font-size: 1.45rem; }
.shop-brand img { width: 22px; height: 22px; }
.shop-nav__item { font-size: 1.2rem; }
.shop-nav__item .nav-icon { font-size: 1.15rem; }
.shop-search__box { height: 32px; }
.shop-search__box input { font-size: 1rem; }
.shop-btn { font-size: 1rem; }

/* Restore the panel gutters that determine the original card/image widths. */
main.container .panel { border-width: 0; }
main.container .panel + .panel { margin-top: 16px; }
main.container .panel-header {
    gap: 5px;
    padding: 16px;
    margin-bottom: 12px;
}
main.container .panel-header .icon {
    width: auto;
    height: auto;
    font-size: 1.1rem;
    background: transparent;
}
main.container .panel-title {
    font-size: 1.2rem;
    line-height: 1.2;
    font-weight: 500;
}
main.container .panel-body {
    padding: 0 16px 16px;
    font-size: 14px;
    line-height: normal;
}

.chip-list {
    gap: .5rem;
    margin-bottom: 0;
    padding: 2px 0 .25rem;
}
.chip {
    height: auto;
    gap: 6px;
    padding: .4rem 1rem;
    border-width: 0;
    font-size: 1.231rem;
    font-weight: 400;
    line-height: normal;
}

/* Match the old col-12 / col-md-6 / col-lg-3 layout without changing JS. */
.item-list {
    grid-template-columns: minmax(0, 1fr);
    column-gap: 1.5rem;
    row-gap: 1rem;
    padding-bottom: 1rem;
}
@media (min-width: 768px) {
    .item-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 992px) {
    .item-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.item-list .acg-card { border-width: 0; }
.item-list .acg-thumb {
    height: 160px;
    aspect-ratio: auto;
    flex-shrink: 0;
}
.acg-card > .acg-body {
    padding: 1rem;
    gap: 0;
}
.item-list .goods-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    min-height: 2.7em;
}
.item-list .tags {
    gap: .35rem;
    margin-bottom: .4rem;
}
.item-list .stat-row {
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}
.item-list .price,
.item-buy .abacus .price {
    font-size: 20px;
    font-weight: 800;
    line-height: normal;
}
.item-list .price .unit,
.item-buy .abacus .price .unit {
    font-size: 16px;
    font-weight: 600;
    line-height: normal;
}
.item-list .stat-bottom,
.item-list .meta {
    font-size: 14px;
    line-height: normal;
}
main.container .badge-soft,
.item-list .acg-tag {
    padding: .15rem .45rem;
    font-size: 12px;
    font-weight: 400;
    line-height: normal;
}
.item-buy > h4 {
    font-size: calc(1.275rem + .3vw);
    letter-spacing: normal;
    margin: 0;
}
@media (min-width: 1200px) {
    .item-buy > h4 { font-size: 1.5rem; }
}
.item-buy .form-label,
.item-buy .sku,
.cash-pay > label { font-size: 14px; }
.item-buy .form-label { font-weight: 400; }
.item-buy .form-control { height: auto; font-size: 14px; }
.item-buy .sku-list { gap: .5rem; margin-top: 2px; }
.item-buy .sku { padding: .2rem .6rem; border-width: 0; }
.item-buy .badge-soft { border-width: 1px; border-style: solid; }
.item-buy .abacus { margin-bottom: 1rem !important; }
.item-buy .buy-divider { display: none; }
.item-buy .input-group.qty-group {
    align-items: center;
    gap: 14px;
    padding: 6px 8px;
    width: 140px;
    border-width: 2px;
}
.item-buy .qty-group > button {
    width: 32px;
    height: 24px;
    font-size: 14px;
    line-height: 1;
}
.item-buy .qty-group > input[type="number"] {
    flex: 1 1 auto;
    min-width: 0;
    width: 1%;
    padding: 0;
    font-weight: 700;
}
.item-buy .cash-pay { padding: .5rem; border-width: 0; }
.item-buy .cash-pay > label {
    gap: .3rem;
    margin: 4px 0 8px 4px;
    font-size: 14px;
    font-weight: 800;
}
.item-buy .cash-pay > label i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 12px;
}
.item-buy .pay-list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    padding-top: 10px;
    border-top: 1px dashed var(--glass-border-soft);
}
.item-buy .pay-list .pay {
    display: inline-flex;
    width: auto;
    align-items: center;
    gap: 3px;
    padding: .4rem .75rem;
    border-width: 0;
    font-size: 14px;
    font-weight: 400;
}
.item-buy .pay-list .pay img { width: 20px; height: 20px; }
.item-buy .pay-list .pay span { font-size: 14px; font-weight: 700; }
.acg-cover { border-width: 0; }
.item-cover { max-height: none; }
.item-detail .panel-body img { max-width: 100%; }
.item-detail .panel-body p { margin-bottom: 0; line-height: 1.7; }

@media (min-width: 992px) {
    .acg-cover { position: relative; }
    .item-cover { position: absolute; inset: 0; }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .item-list .acg-thumb { height: 140px; }
}

@media (max-width: 575.98px) {
    .item-list .acg-thumb { height: 120px; }
    .item-list .goods-title {
        -webkit-line-clamp: 1;
        line-clamp: 1;
        min-height: 1.35em;
    }
    .chip { padding: .35rem .6rem; font-size: 13px; gap: 4px; }
    .chip .chip-icon { width: 16px; height: 16px; }

    /* Keep every navigation control reachable with the custom GPT link. */
    .shop-nav {
        flex-wrap: wrap;
        height: auto;
        min-height: 60px;
        padding: 10px 12px;
        gap: 8px;
        border-radius: 20px;
    }
    .shop-brand { flex: 1 1 0; min-width: 0; font-size: 1.15rem; }
    .shop-brand__name { min-width: 0; max-width: 100%; }
    .shop-nav__right { order: 1; margin-left: 0; gap: 0; }
    .shop-nav .pifa-gpt-recharge-link { order: 2; flex-basis: 100%; margin-right: 0 !important; }
    .shop-nav__list,
    .shop-search,
    .shop-auth { display: none !important; }
    .shop-burger { display: inline-flex; }
    .shop-drawer,
    .shop-drawer__shade { display: block; }
}
