/* Header cart ? mobile mall style (orange / white) */
:root {
    --hc-orange: #ff5722;
    --hc-orange-light: #ff8a50;
    --hc-orange-dark: #e64a19;
    --hc-orange-grad: linear-gradient(90deg, #ff9500 0%, #ff5722 100%);
    --hc-price: #ff5722;
    --hc-bg-list: #ffffff;
    --hc-border: #eeeeee;
    --hc-text: #333333;
    --hc-text-muted: #999999;
}

/* ========== Nav cart button ========== */
.header-cart-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 8px 16px !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #ffffff !important;
    font-weight: 600;
    transition: all 0.3s ease;
}

.header-cart-btn:hover,
.header-cart-btn:focus {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #e1b382 !important;
}

.header-cart-btn__icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header-cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 50%;
    background: var(--hc-orange);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(255, 87, 34, 0.45);
    z-index: 2;
}

.header-cart-btn__label {
    font-weight: 600;
    white-space: nowrap;
}

/* ========== Popover shell ========== */
.header-cart-popover-wrapper.popover {
    border: none !important;
    background: transparent !important;
    max-width: 400px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    box-shadow: none !important;
    font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

.header-cart-popover-wrapper.popover,
.header-cart-popover-wrapper.popover * {
    box-sizing: border-box;
}

/* Popover shell */
.header-cart-popover-wrapper.popover {
    --bs-popover-border-color: transparent;
    --bs-popover-border-width: 0;
    --bs-popover-bg: transparent;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
}

.header-cart-popover-wrapper > .popover-arrow {
    display: none !important;
}

.header-cart-popover-wrapper .popover-body {
    padding: 0 !important;
    min-height: 0 !important;
    background: transparent !important;
    border: none !important;
}

.header-cart-popover-wrapper .popover-body,
.header-cart-popover-wrapper #cartPopoverContent {
    overflow: visible !important;
}

.header-cart-popover-wrapper .hc-panel {
    position: relative;
    width: 380px;
    max-width: 92vw;
    border-radius: 0;
    overflow: hidden;
    background: transparent !important;
}

.header-cart-popover-wrapper .hc-panel__surface {
    position: relative;
    z-index: 2;
    background: #fff !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
    overflow: hidden;
}

.header-cart-popover-wrapper .hc-panel__header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    margin: 0;
    background: var(--hc-orange-grad) !important;
    color: #fff !important;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.06);
}

.header-cart-popover-wrapper .hc-panel__header .hc-panel__title {
    background: transparent !important;
    color: #fff !important;
}

.header-cart-popover-wrapper .hc-panel__title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #fff !important;
    background: transparent !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.header-cart-popover-wrapper .hc-panel__store {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    background: #fafafa !important;
    border-bottom: 1px solid var(--hc-border);
    color: var(--hc-text);
}

.header-cart-popover-wrapper .hc-store__icon {
    display: inline-flex;
    color: #666 !important;
    background: transparent !important;
}

.header-cart-popover-wrapper .hc-store__name {
    font-size: 13px;
    font-weight: 600;
    color: var(--hc-text) !important;
    background: transparent !important;
}

.header-cart-popover-wrapper .hc-panel__list {
    max-height: 360px;
    overflow-y: auto;
    background: var(--hc-bg-list) !important;
}

.header-cart-popover-wrapper .hc-panel__list::-webkit-scrollbar {
    width: 4px;
}

.header-cart-popover-wrapper .hc-panel__list::-webkit-scrollbar-thumb {
    background: #ddd;
}

/* ========== Item row ========== */
.header-cart-popover-wrapper .hc-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #fff !important;
    border-bottom: 1px solid var(--hc-border);
}

.header-cart-popover-wrapper .hc-item:last-child {
    border-bottom: none;
}

.header-cart-popover-wrapper .hc-item__check {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 26px;
    border: 1px solid #ccc;
    border-radius: 50%;
    background: #fff !important;
}

.header-cart-popover-wrapper .hc-item__check--on {
    border-color: var(--hc-orange);
    background: var(--hc-orange) !important;
    box-shadow: inset 0 0 0 3px #fff;
}

.header-cart-popover-wrapper .hc-item__thumb {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 0;
    overflow: hidden;
    background: #f5f5f5 !important;
    border: 1px solid var(--hc-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-cart-popover-wrapper .hc-item__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.header-cart-popover-wrapper .hc-item__img-placeholder {
    font-size: 28px;
    line-height: 1;
}

.header-cart-popover-wrapper .hc-item__body {
    flex: 1;
    min-width: 0;
}

.header-cart-popover-wrapper .hc-item__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.header-cart-popover-wrapper .hc-item__name {
    font-size: 14px;
    font-weight: 500;
    color: var(--hc-text) !important;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    background: transparent !important;
}

.header-cart-popover-wrapper .hc-item__trash,
.header-cart-popover-wrapper .remove-from-cart.hc-item__trash {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent !important;
    color: #bbb !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header-cart-popover-wrapper .hc-item__trash:hover {
    color: var(--hc-orange) !important;
}

.header-cart-popover-wrapper .hc-item__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.header-cart-popover-wrapper .hc-item__price {
    font-size: 17px;
    font-weight: 700;
    color: var(--hc-price) !important;
    background: transparent !important;
}

.header-cart-popover-wrapper .hc-item__qty,
.header-cart-popover-wrapper .cart-qty-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 0;
    overflow: hidden;
    background: #fff !important;
}

.header-cart-popover-wrapper .hc-qty-btn,
.header-cart-popover-wrapper .cart-qty-minus,
.header-cart-popover-wrapper .cart-qty-plus {
    width: 30px;
    height: 28px;
    padding: 0;
    border: none;
    background: #fff !important;
    color: #666 !important;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.header-cart-popover-wrapper .hc-qty-btn:hover,
.header-cart-popover-wrapper .cart-qty-minus:hover,
.header-cart-popover-wrapper .cart-qty-plus:hover {
    background: #f5f5f5 !important;
    color: var(--hc-orange) !important;
}

.header-cart-popover-wrapper .hc-qty-value,
.header-cart-popover-wrapper .cart-qty-value {
    min-width: 36px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--hc-text) !important;
    background: #fff !important;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    line-height: 28px;
}

/* ========== Empty ========== */
.header-cart-popover-wrapper .hc-empty {
    text-align: center;
    padding: 36px 24px 40px;
    background: #fff !important;
}

.header-cart-popover-wrapper .hc-empty__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    line-height: 0;
}

.header-cart-popover-wrapper .hc-empty__icon svg {
    display: block;
}

.header-cart-popover-wrapper .hc-empty__text {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    color: var(--hc-text) !important;
    background: transparent !important;
}

.header-cart-popover-wrapper .hc-empty__hint {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--hc-text-muted) !important;
    background: transparent !important;
}

.header-cart-popover-wrapper .hc-empty__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 18px;
    padding: 9px 28px;
    border: 1.5px solid var(--hc-orange);
    border-radius: 22px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    color: var(--hc-orange) !important;
    background: #fff !important;
    transition: background 0.2s ease, color 0.2s ease;
}

.header-cart-popover-wrapper .hc-empty__link:hover {
    background: var(--hc-orange) !important;
    color: #fff !important;
}

/* ========== Bottom bar ========== */
.header-cart-popover-wrapper .hc-panel__bar {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    min-height: 56px;
    background: #fff !important;
    border-top: 1px solid var(--hc-border);
}

.header-cart-popover-wrapper .hc-panel__total {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 0;
    background: transparent !important;
    white-space: normal;
}

.header-cart-popover-wrapper .hc-panel__total-main {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 6px;
    width: 100%;
    background: transparent !important;
}

.header-cart-popover-wrapper .hc-panel__total-label {
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--hc-text) !important;
    background: transparent !important;
    white-space: nowrap;
}

.header-cart-popover-wrapper .hc-panel__total-amount,
.header-cart-popover-wrapper .cart-total-amount {
    flex-shrink: 0;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--hc-price) !important;
    background: transparent !important;
    white-space: nowrap;
}

.header-cart-popover-wrapper .hc-panel__total-note {
    font-size: 11px;
    line-height: 1.3;
    color: var(--hc-text-muted) !important;
    background: transparent !important;
    white-space: nowrap;
}

.header-cart-popover-wrapper .hc-panel__checkout,
.header-cart-popover-wrapper .hc-panel__bar .checkout-go-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto !important;
    max-width: none !important;
    min-width: 108px;
    height: 44px;
    padding: 0 24px;
    border: none;
    border-radius: 0;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none !important;
    color: #fff !important;
    background: var(--hc-orange) !important;
    box-shadow: none !important;
    transform: none !important;
    transition: background 0.2s ease;
}

.header-cart-popover-wrapper .hc-panel__checkout *,
.header-cart-popover-wrapper .hc-panel__bar .checkout-go-btn * {
    display: none;
}

.header-cart-popover-wrapper .hc-panel__checkout:hover,
.header-cart-popover-wrapper .hc-panel__bar .checkout-go-btn:hover {
    background: var(--hc-orange-dark) !important;
    color: #fff !important;
    transform: none !important;
    box-shadow: none !important;
}

.header-cart-popover-wrapper .hc-panel__bar .checkout-go-btn--disabled,
.header-cart-popover-wrapper .hc-panel__bar .checkout-go-btn--disabled:hover {
    background: #f0f0f0 !important;
    color: #b0b0b0 !important;
    border: 1px solid #e5e5e5;
    pointer-events: none;
    cursor: not-allowed;
    opacity: 1;
}

.header-cart-popover-wrapper .hc-panel--empty .hc-panel__total-amount,
.header-cart-popover-wrapper .hc-panel--empty .cart-total-amount {
    color: #ccc !important;
}

@media (max-width: 576px) {
    .header-cart-btn__label {
        display: none;
    }

    .header-cart-popover-wrapper .hc-panel {
        width: 100%;
    }
}
