body {
    padding: 0;
    margin: 0;
    outline: none;
    min-height: 100vh;
    font-family: var(--main-font);
    background: linear-gradient(135deg, #f5faf9 0%, #e8f5e9 100%);
}

img {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    object-fit: cover;
    object-position: center;
}
input, textarea, select {
    margin: 0;
    padding: 0;
    outline: none;
}
h1, h2, h3, h4, h5, h6, p, ul, li, ol {
    margin: 0;
    padding: 0;
    outline: none;
}
ul, li, ol {
    list-style-type: none;
}

/* Modal */
.ns-modal {
    /* inset: 0 follows the visible screen on phones (100vh is taller than the screen
       while the browser toolbars are showing, which pushed pop-ups under the bottom bar) */
    box-sizing: border-box;
    position: fixed;
    inset: 0;
    width: auto;
    height: auto;
    z-index: 9999;
    display: grid;
    place-items: center;
    background: rgb(188,188,188,.5);
}

/* Response Model */
.ns-modal .ns-box {
    width: 100%;
    max-width: 350px;
    box-sizing: border-box;
    background: white;
    border-radius: 12px;
    display: grid;
    row-gap: 15px;
    padding: 2rem;
    justify-content: center;
    text-align: center;
}
.ns-modal .ns-action-wrap {
    display: flex; 
    justify-content: flex-end; 
    gap: 10px;
}
.ns-modal.progress .ns-box .pop {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: scale(0);
    margin: 15px auto;
}
.ns-modal.progress .ns-box .ripple {
    position: absolute;
    width: 120%;
    height: 120%;
    border-radius: 50%;
    opacity: 0;
}
.ns-modal.progress .ns-box .pop.success  {
    background: #4CAF50;
}
.ns-modal.progress .ns-box .pop.success .ripple {
    background: rgba(76, 175, 80, 0.5);
}
.ns-modal.progress .ns-box .pop.error {
    background: #E53935;
}
.ns-modal.progress .ns-box .pop.error .ripple {
    background: rgba(229, 57, 53, 0.5);
}
.ns-modal.progress .ns-box .pop.loading  {
    background: transparent;
}
.ns-modal.progress .ns-box .pop.loading .ripple {
    background: transparent;
}
.ns-modal.progress .ns-box .pop.success .icon,
.ns-modal.progress .ns-box .pop.error .icon {
    font-size: 32px;
    color: white;
    opacity: 0;
}
.ns-modal.progress .ns-box .pop.loading .icon {
    font-size: 64px;
    color: #287868;
    opacity: 0;
}

/* Font Awesome Animation */
.spin-pulse {
	animation-name: fa-spin; 
    animation-direction: var(--fa-animation-direction, normal); 
    animation-duration: var(--fa-animation-duration, 1s); 
    animation-iteration-count: var(--fa-animation-iteration-count, infinite); 
    animation-timing-function: var(--fa-animation-timing, steps(8));
}
.shake {
	animation-name: fa-shake;
    animation-duration: var(--fa-animation-direction, 1s); 
    animation-iteration-count: var(--fa-animation-iteration-count, infinite); 
    animation-timing-function: var(--fa-animation-timing, linear);
}
.font-pulse, .font-spin-pulse {
	animation-name: font-spin;
    animation-direction: var(--fa-animation-direction, normal);
    animation-duration: var(--fa-animation-duration, 1s);
    animation-iteration-count: var(--fa-animation-iteration-count, infinite);
    animation-timing-function: var(--fa-animation-timing, steps(8));
}
@keyframes font-spin {
	0% { transform:rotate(0deg); }
	100% { transform:rotate(1turn); }
}
@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); }
}
@keyframes fadeIn {
    0% { opacity: 0; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes rippleEffect {
    0% { transform: scale(0); opacity: 0.5; }
    100% { transform: scale(2.5); opacity: 0; }
}

/* Main Carts */
/* Cart Header */
.cart-header { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    gap: 16px; 
    flex-wrap: wrap; 
    margin-bottom: 20px;
}
.cart-header .cart-title { 
    font-family: var(--main-font); 
    font-size: 1.2rem; 
    font-weight: 800; 
    color: var(--color-default); 
}
.cart-header .cart-sub { 
    font-family: var(--sec-font); 
    font-size: .82rem; 
    color: var(--color-text-muted); 
    margin-top: 2px; 
}

/* Cart Step */
.cart-steps {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    font-family: var(--sec-font);
}
.cart-steps .cart-step-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--color-text-muted);
}
.cart-steps .cart-step-row .num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #eceff1;
    color: var(--color-text-muted);
    font-size: .75rem;
}
.cart-steps .cart-step-row.done .num {
    background: var(--color-default);
    color: #fff;
}
.cart-steps .cart-step-row.active { color: var(--color-dark); }
.cart-steps .cart-step-row.active .num {
    background: linear-gradient(135deg,var(--color-default),var(--color-dark));
    color: #fff;
}
.cart-steps .cart-step-divider {
    width: 28px;
    height: 1px;
    background: #e7f1ef;
}

/* Cart Body */
.cart-wrap { 
    display: grid; 
    grid-template-columns: 1fr 360px; 
    gap: 22px; 
    align-items: start; 
}
@media (max-width: 980px) { 
    .cart-wrap { grid-template-columns: 1fr; } 
}

/* Cart Items */
.cart-wrap .cart-card { 
    background: white;
    border: 1px solid #e7f1ef;
    border-radius: 22px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.09);
}
.cart-wrap .cart-card:not(:last-child) { margin-bottom: 18px; }
.cart-wrap .cart-card .cart-info { padding: 20px 22px; }
.cart-wrap .cart-items { 
    display: flex; 
    align-items: center; 
    gap: 16px; 
    padding: 18px 22px; 
    border-bottom: 1px solid #e7f1ef;
}
.cart-wrap .cart-items.error {
    background: #FFC5BA;
}
.cart-wrap .cart-items-remove {
    width: 30px;
    display: grid;
    place-items: center;
}
.cart-wrap .cart-items-remove button {
    font-size: .80rem;
    color: #c62828;
    cursor: pointer;
    background: transparent;
    border: 0;
}
.cart-wrap .cart-items:last-child { border-bottom: none; }
.cart-wrap .cart-items-thumb { 
    width: 62px; 
    height: 62px; 
    border-radius: 12px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: #fff; 
    font-size: 1.5rem; 
    flex-shrink: 0; 
    overflow: hidden;
}
.cart-wrap .cart-items-thumb img {
    width: 100%;
    box-sizing: border-box;
    object-position: center;
}
.cart-wrap .cart-items-info { 
    flex: 1; 
    min-width: 0; 
}
.cart-wrap .cart-items-quantity { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    background: linear-gradient(135deg, #f5faf9 0%, #e8f5e9 100%);
    border-radius: 10px; 
    padding: 4px; 
    width: 108px; 
    flex-shrink: 0; 
}
.cart-wrap .cart-items-quantity input {
    text-align: center;
    background: transparent;
    -moz-appearance: textfield;
}
.cart-wrap .cart-items-quantity input[type="number"]::-webkit-outer-spin-button,
.cart-wrap .cart-items-quantity input[type="number"]::-webkit-inner-spin-button {;
    -webkit-appearance: none;
    appearance: none;
}
.cart-wrap .cart-items-quantity button { 
    width: 30px; 
    height: 30px; 
    border: none; 
    background: #fff; 
    border-radius: 8px; 
    cursor: pointer; 
    font-weight: 700; 
    color: var(--color-dark); 
    box-shadow: 0 1px 3px rgba(0,0,0,.1); 
}
.cart-wrap .cart-items-quantity button:disabled { 
    opacity: .4; 
    cursor: not-allowed; 
}
.cart-wrap .cart-items-quantity input {
    width: 60px;
    border: 0;
    font-weight: 700; 
    font-size: .88rem;
}
.cart-wrap .cart-items-subtotal { 
    width: 110px; 
    text-align: right; 
    font-family: var(--main-font); 
    font-weight: 800; 
    font-size: .95rem; 
    color: var(--color-dark); 
    flex-shrink: 0; 
}

/* Cart Empty */
.cart-wrap .cart-empty { 
    padding: 64px 24px; 
    text-align: center; 
    color: var(--color-text-muted); 
}
.cart-wrap .cart-empty i { 
    font-size: 3rem; 
    opacity: .35; 
    margin-bottom: 14px; 
    display: block; 
}
.cart-wrap .cart-empty .title { 
    font-family: var(--main-font); 
    font-weight: 700; 
    color: var(--color-default); 
    font-size: 1.05rem; 
    margin-bottom: 6px; 
}
.cart-wrap .cart-empty a { 
    color: var(--color-default); 
    font-weight: 600; 
    text-decoration: none; 
}

/* Cart Summary */
.cart-wrap .cart-summary { 
    position: sticky; 
    top: 88px; 
}
.cart-wrap .cart-summary-header {
    padding: 18px 22px;
    border-bottom: 1px solid #e7f1ef;
    display: flex;
    align-items: center;
    gap: 18px;
    font-family: var(--trd-font);
    font-size: .95rem;
    font-weight: 700;
    color: var(--color-dark);
}
.cart-wrap .cart-summary-body { 
    padding: 20px 22px; 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
}
.cart-wrap .cart-summary-row { 
    display: flex; 
    justify-content: space-between; 
    font-size: .80rem; 
    color: var(--color-text-sub); 
}
.cart-wrap .cart-summary-row span.val {
    color: var(--color-dark); 
    font-weight: 600;
}
.cart-wrap .cart-summary-divider {
    height: 1px; 
    background: #e7f1ef;
    margin: 2px 0;
}
.cart-wrap .cart-summary-row.grand { 
    font-size: 1.05rem; 
    font-weight: 800; 
    color: var(--color-dark); 
}
.cart-wrap .cart-summary-row.grand .val { color: var(--color-dark); }

/* Cart Promo Section */
.cart-wrap .cart-promo-wrap { 
    display: flex; 
    gap: 8px;
    flex-direction: column;
}
.cart-wrap .cart-promo-input { 
    flex: 1; 
    padding: 10px 12px; 
    border-radius: 10px; 
    border: 1px solid #e7f1ef;
    font-family: var(--main-font); 
    font-size: .82rem; 
    outline: none; 
    transition: .22s; 
}
.cart-wrap .cart-promo-input:focus { 
    border-color: var(--color-light); 
    box-shadow: 0 0 0 3px rgba(25,118,210,.08); 
}
.cart-wrap .cart-promo-btn { 
    padding: 10px 16px; 
    border-radius: 10px; 
    border: none; 
    background: var(--color-dark); 
    color: #fff; 
    font-size: .82rem; 
    font-weight: 700; 
    cursor: pointer; 
    transition: .22s;
    white-space: nowrap; 
}
.cart-wrap .cart-promo-btn:hover { opacity: .88; }
.cart-wrap .cart-promo-msg { 
    font-size: .74rem; 
    margin-top: -4px; 
}
.cart-wrap .cart-promo-msg.success { color: #388e3c; }
.cart-wrap .cart-promo-msg.error { color: #c62828; }

/* Cart Checkout Button */
.cart-wrap .cart-checkout { 
    width: 100%; 
    padding: 14px 0; 
    border-radius: 10px; 
    border: none; 
    background: linear-gradient(135deg,var(--color-default),var(--color-dark)); 
    color: #fff; 
    font-weight: 700; 
    font-size: .9rem; 
    cursor: pointer; 
    transition: .22s;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px; 
}
.cart-wrap .cart-checkout:hover { opacity: .9; }
.cart-wrap .cart-checkout:disabled { opacity: .5; cursor: not-allowed; }

/* Cart Summary */
.cart-wrap .cart-summary-load {
    padding: 64px 24px;
    text-align: center;
    color: var(--color-text-muted);
}
.cart-wrap .cart-summary-load i {
    font-size: 2rem; 
    margin-bottom: 12px; 
    display: block;
}
.cart-wrap .cart-summary-status {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 24px 26px;
    margin-bottom: 18px;
}
.cart-wrap .cart-summary-icon {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--color-default), var(--color-dark));
    color: #fff;
    font-size: 1.4rem;
}
.cart-wrap .cart-summary-info .title {
    font-family: var(--main-font);
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--color-dark);
}
.cart-wrap .cart-summary-info .sub {
    font-family: var(--sec-font);
    font-size: .82rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}
.cart-wrap .cart-summary-info .sub span {
    font-weight: 700;
    color: var(--color-default);
}

/* Stat Cards */
.stats-row {
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; 
    margin-bottom: 22px;
}

/* Mobile Responsive */
@media (max-width:900px) { 
    .stats-row { 
        grid-template-columns: repeat(2,1fr); 
    } 
}
@media (max-width:480px) { 
    .stats-row { 
        grid-template-columns: 1fr 1fr; 
    } 
}

/* Stat Cards Body */
.stat-card {
    background: white; 
    border-radius: 14px; 
    box-shadow: 0 4px 24px rgba(0,0,0,0.09);
    padding: 18px 20px; 
    display: flex; 
    align-items: center; 
    gap: 14px;
    border-left: 4px solid transparent; 
    transition: transform .15s,box-shadow .15s;
}
.stat-card:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 8px 32px rgba(0,0,0,0.13);
}
.stat-card .stat-icon {
    width: 44px; 
    height: 44px; 
    border-radius: 12px;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 1.2rem; 
    flex-shrink: 0;
}
.stat-card .stat-label { 
    font-family: var(--trd-font); 
    font-size: .74rem; 
    color: var(--color-text-muted); 
    margin-bottom: 2px; 
}
.stat-card .stat-value { 
    font-family: var(--sec-font); 
    font-size: 1.3rem; 
    font-weight: 800; 
    color: var(--color-default); 
}
.stat-card .stat-delta { 
    font-family: var(--sec-font); 
    font-size: .72rem; 
    margin-top: 2px; 
}
.stat-card .stat-delta.delta-up { 
    color: #388e3c; 
}
.stat-card .stat-delta.delta-down {
    color: #d32f2f;
}

/* Button Loader (loadJS / callbackJS): label stays hidden in place, spinner on top */
.btn-busy {
    color: transparent !important;
    cursor: progress !important;
    pointer-events: none;
}
.btn-busy-rel {
    position: relative;
}
.btn-busy > *:not(.btn-loader) {
    visibility: hidden;
}
.btn-busy > .btn-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: visible;
    font-size: 1em;
    line-height: 1;
}

/* Top loading bar while a request the user started is running */
.busy-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 100000;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s;
}
.busy-bar.on {
    opacity: 1;
}
.busy-bar::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40%;
    background: var(--color-default, #287868);
    animation: busy-bar 1.1s ease-in-out infinite;
}
@keyframes busy-bar {
    0% { left: -40%; }
    100% { left: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .busy-bar::before { animation: none; left: 0; width: 100%; opacity: .6; }
}


/* Invoice sync / e-Invoice status badges (content/js/einvoice.js): e-Invoice Submission table + View Order */
.einv-sub { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font: 700 .74rem var(--sec-font, inherit); white-space: nowrap; }
.einv-sub i { font-size: .66rem; }
.einv-sub.valid     { background: var(--cat-green-bg, #e7f6ec); color: var(--cat-green, #15803d); }
a.einv-sub.valid:hover { text-decoration: underline; }
.einv-sub.invalid,
.einv-sub.failed    { background: var(--cat-red-bg, #fdecec); color: var(--cat-red, #b42318); }
.einv-sub.pending   { background: #fff4e5; color: #b45309; }
.einv-sub.none      { background: #f0f4f3; color: #5f6b85; }
.einv-sub.is-sample { opacity: .75; border: 1px dashed currentColor; }
.einv-sub-note { margin-top: 4px; font-size: .78rem; color: var(--cat-muted, #5f6b85); max-width: 230px; white-space: normal; }
.einv-sub-note.err { color: var(--cat-red, #b42318); }
.einv-no-inv { color: var(--cat-muted, #5f6b85); font-weight: 400; }
