/*
 * bootstrap38ip compatibility & visual refinement layer
 * Scope principle: do not alter WHMCS grid math or add global form margins.
 */
:root {
    --jf-primary: #2563eb;
    --jf-primary-dark: #1d4ed8;
    --jf-primary-soft: #eff6ff;
    --jf-text: #172033;
    --jf-muted: #667085;
    --jf-border: #e5eaf1;
    --jf-surface: #ffffff;
    --jf-bg: #f6f8fb;
    --jf-radius: 10px;
    --jf-shadow: 0 6px 24px rgba(15, 23, 42, .06);
}

html { scroll-behavior: smooth; }
body.whmcs-body {
    color: var(--jf-text);
    background: var(--jf-bg);
    font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Top navigation: more compact, restrained enterprise style. */
.whmcs-body > .navbar.fixed-top {
    min-height: 68px;
    border-bottom: 1px solid rgba(15, 23, 42, .06);
    box-shadow: 0 3px 16px rgba(15, 23, 42, .05) !important;
}
.whmcs-body .navbar-brand { min-width: 0; }
.whmcs-body .navbar-brand .fw-bold { letter-spacing: .01em; }
.whmcs-body .navbar .nav-link {
    color: #344054;
    font-weight: 500;
    border-radius: 7px;
}
.whmcs-body .navbar .nav-link:hover,
.whmcs-body .navbar .nav-link:focus { color: var(--jf-primary); background: var(--jf-primary-soft); }
.whmcs-body .dropdown-menu {
    border: 1px solid var(--jf-border);
    border-radius: 10px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, .10);
    padding: .45rem;
}
.whmcs-body .dropdown-item { border-radius: 7px; padding: .62rem .78rem; }
.whmcs-body .dropdown-item:hover { background: var(--jf-primary-soft); color: var(--jf-primary-dark); }

/* Shared components: conservative override, preserving WHMCS sizing and grid. */
.whmcs-body .card {
    border-color: var(--jf-border);
    border-radius: var(--jf-radius);
    box-shadow: 0 3px 14px rgba(15, 23, 42, .035);
}
.whmcs-body .card-header {
    border-bottom-color: var(--jf-border);
    background: #fbfcfe;
    font-weight: 600;
}
.whmcs-body .btn { border-radius: 7px; font-weight: 500; }
.whmcs-body .btn-primary,
.whmcs-body .bg-primary { background-color: var(--jf-primary) !important; border-color: var(--jf-primary) !important; }
.whmcs-body .btn-primary:hover,
.whmcs-body .btn-primary:focus { background-color: var(--jf-primary-dark) !important; border-color: var(--jf-primary-dark) !important; }
.whmcs-body .text-primary { color: var(--jf-primary) !important; }
.whmcs-body .form-control,
.whmcs-body .custom-select,
.whmcs-body select.form-control {
    border-color: #d8dee8;
    border-radius: 7px;
    box-shadow: none;
}
.whmcs-body .form-control:focus,
.whmcs-body .custom-select:focus {
    border-color: #8db4ff;
    box-shadow: 0 0 0 .18rem rgba(37, 99, 235, .12);
}
.whmcs-body .table { background: #fff; }
.whmcs-body .table thead th { border-bottom-width: 1px; color: #475467; background: #f8fafc; }
.whmcs-body .alert { border-radius: 8px; }

/* Theme's hard-coded customer sidebar. Keep it calm and readable. */
.whmcs-body aside.col-lg-3 .card { box-shadow: var(--jf-shadow) !important; }
.whmcs-body aside.col-lg-3 .list-group-item {
    border: 0;
    border-radius: 7px !important;
    margin-bottom: 3px;
    color: #475467;
    padding: .66rem .72rem;
}
.whmcs-body aside.col-lg-3 .list-group-item:hover { background: #f2f6ff; color: var(--jf-primary-dark); }
.whmcs-body aside.col-lg-3 .list-group-item.active {
    color: var(--jf-primary-dark) !important;
    background: #eaf2ff !important;
    font-weight: 600;
}

/* Shopping cart: the main client-area sidebar is not rendered in header.tpl.
 * Also suppress the Standard Cart category sidebar if the active orderform emits it.
 * Do NOT hide .secondary-cart-sidebar: it usually contains the order summary/total.
 */
body.is-shopping-cart main > .container { max-width: 1240px; }
body.is-shopping-cart main { padding-top: 1rem; }
body.is-shopping-cart #order-standard_cart > .row > .cart-sidebar,
body.is-shopping-cart #order-standard_cart .cart-sidebar.primary-cart-sidebar {
    display: none !important;
}
body.is-shopping-cart #order-standard_cart > .row > .cart-body,
body.is-shopping-cart #order-standard_cart .cart-body {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
}
body.is-shopping-cart #order-standard_cart .products .product,
body.is-shopping-cart #order-standard_cart .product-info,
body.is-shopping-cart #order-standard_cart .view-cart-items,
body.is-shopping-cart #order-standard_cart .summary-container {
    border-radius: var(--jf-radius);
}
body.is-shopping-cart #order-standard_cart .form-control {
    margin: 0;
}

/* Chinese desktop layouts look better with slightly denser content. */
@media (min-width: 992px) {
    .whmcs-body main > .container { max-width: 1240px; }
    .whmcs-body .card-body { padding: 1.15rem 1.25rem; }
}

@media (max-width: 991.98px) {
    .whmcs-body > .navbar.fixed-top { min-height: 62px; }
    .whmcs-body .navbar-brand small { display: none; }
    .whmcs-body .navbar-collapse { padding: .8rem 0 1rem; }
    body.is-shopping-cart main > .container { padding-left: 12px; padding-right: 12px; }
}

/* Shopping cart hero: keep the brand atmosphere without overpowering the purchase flow. */
body.is-shopping-cart .jf-hero-gradient {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 10%, rgba(255,255,255,.14), transparent 30%),
        radial-gradient(circle at 82% 85%, rgba(147,197,253,.20), transparent 32%),
        linear-gradient(135deg, #1e3a8a 0%, #2563eb 58%, #3b82f6 100%) !important;
}
body.is-shopping-cart .jf-hero-gradient::after {
    content: "";
    position: absolute;
    right: -70px;
    top: -110px;
    width: 280px;
    height: 280px;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 50%;
    pointer-events: none;
}
body.is-shopping-cart .jf-hero-gradient .container {
    position: relative;
    z-index: 1;
}
body.is-shopping-cart .jf-hero-gradient h1 {
    letter-spacing: .02em;
}
body.is-shopping-cart main > .container {
    margin-top: 26px !important;
}

@media (max-width: 767.98px) {
    body.is-shopping-cart .jf-hero-gradient .container {
        padding-top: 1.35rem !important;
        padding-bottom: 1.35rem !important;
    }
    body.is-shopping-cart main > .container {
        margin-top: 18px !important;
        padding-left: 12px;
        padding-right: 12px;
    }
}
