.hvu-wcpf-root {
    --hvu-wcpf-text: #111;
    --hvu-wcpf-muted: #666;
    --hvu-wcpf-border: #d7d7d7;
    --hvu-wcpf-dark: #5b5b5b;
    --hvu-wcpf-light: #fff;
    --hvu-wcpf-danger: #b42318;
    --hvu-wcpf-success: #067647;
    width: 100%;
    color: var(--hvu-wcpf-text);
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

.hvu-wcpf-root *,
.hvu-wcpf-root *::before,
.hvu-wcpf-root *::after {
    box-sizing: border-box;
}

.hvu-wcpf-root .hvu-wcpf-form,
.hvu-wcpf-root .hvu-wcpf-form button,
.hvu-wcpf-root .hvu-wcpf-form input,
.hvu-wcpf-root .hvu-wcpf-form select,
.hvu-wcpf-root .hvu-wcpf-form textarea {
    font-family: inherit !important;
}

.hvu-wcpf-root .hvu-wcpf-form {
    width: 100%;
    margin: 0;
    padding: 0;
}

.hvu-wcpf-root .hvu-wcpf-options,
.hvu-wcpf-root .hvu-wcpf-purchase {
    width: 100%;
}

.hvu-wcpf-root .hvu-wcpf-option-group {
    padding: 22px 0;
    border-bottom: 1px solid var(--hvu-wcpf-border);
}

.hvu-wcpf-root .hvu-wcpf-option-group--row {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(210px, 250px);
    align-items: center;
    gap: 20px;
}

.hvu-wcpf-root .hvu-wcpf-option-label,
.hvu-wcpf-root .hvu-wcpf-summary-label {
    margin: 0;
    color: inherit;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: 0;
    text-transform: none;
}

.hvu-wcpf-root .hvu-wcpf-option-group--full .hvu-wcpf-option-label {
    margin-bottom: 16px;
}

.hvu-wcpf-root .hvu-wcpf-select {
    width: 100%;
    min-height: 54px;
    margin: 0;
    padding: 0 52px 0 15px;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid #c7c7c7;
    border-radius: 9px;
    background:
        linear-gradient(90deg, transparent calc(100% - 55px), #d2d2d2 calc(100% - 55px), #d2d2d2 calc(100% - 54px), transparent calc(100% - 54px)),
        linear-gradient(45deg, transparent 50%, #aaa 50%) calc(100% - 25px) 49%/8px 8px no-repeat,
        linear-gradient(135deg, #aaa 50%, transparent 50%) calc(100% - 17px) 49%/8px 8px no-repeat,
        #fff;
    color: var(--hvu-wcpf-text);
    box-shadow: none;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.2;
}

.hvu-wcpf-root .hvu-wcpf-select:focus {
    outline: 1px solid #222;
    outline-offset: 2px;
}

.hvu-wcpf-root .hvu-wcpf-swatches {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 18px 28px;
}

.hvu-wcpf-root .hvu-wcpf-form button.hvu-wcpf-button.hvu-wcpf-choice {
    min-width: 0;
    min-height: 0;
    margin: 0 !important;
    padding: 0 !important;
    appearance: none;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: inherit !important;
    box-shadow: none !important;
    cursor: pointer;
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    letter-spacing: 0 !important;
    text-align: center;
    text-transform: none !important;
}

.hvu-wcpf-root .hvu-wcpf-swatch-media {
    position: relative;
    display: grid;
    width: 74px;
    height: 74px;
    margin: 0 auto 8px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #fff;
    opacity: .5;
    transform: scale(1);
    transform-origin: center;
    transition: opacity .2s ease, transform .2s ease;
    will-change: opacity, transform;
}

/* Không dùng viền tròn cho màu đang chọn. */
.hvu-wcpf-root .hvu-wcpf-swatch-media::after {
    display: none !important;
    content: none !important;
}

.hvu-wcpf-root .hvu-wcpf-form button.hvu-wcpf-choice:hover .hvu-wcpf-swatch-media,
.hvu-wcpf-root .hvu-wcpf-form button.hvu-wcpf-choice:focus-visible .hvu-wcpf-swatch-media {
    opacity: .75;
}

.hvu-wcpf-root .hvu-wcpf-form button.hvu-wcpf-choice.is-selected .hvu-wcpf-swatch-media {
    opacity: 1;
    transform: scale(1.2);
}

.hvu-wcpf-root .hvu-wcpf-swatch-media img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: 50%;
    object-fit: cover;
}

.hvu-wcpf-root .hvu-wcpf-swatch-fallback {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    border: 1px solid #ddd;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff 0 18%, #dedede 19% 58%, #777 59% 100%);
    color: #111;
    font-size: 13px;
    font-weight: 600;
}

.hvu-wcpf-root .hvu-wcpf-choice-label {
    display: block;
    max-width: 90px;
    color: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.25;
    overflow-wrap: anywhere;
    text-align: center;
}

.hvu-wcpf-root .hvu-wcpf-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 28px;
}

/* Quy cách: chỉ giữ ô chọn bên trong, không có border bao ngoài. */
.hvu-wcpf-root .hvu-wcpf-chips button.hvu-wcpf-button.hvu-wcpf-choice {
    min-width: 130px;
    min-height: 36px;
    padding: 4px 0 !important;
    border: 0 !important;
    background: transparent !important;
    text-align: left;
}

.hvu-wcpf-root .hvu-wcpf-chips button.hvu-wcpf-choice::before {
    display: inline-block;
    width: 22px;
    height: 22px;
    margin-right: 10px;
    border: 1px solid #bfbfbf;
    background: #fff;
    content: "";
    vertical-align: middle;
}

.hvu-wcpf-root .hvu-wcpf-chips button.hvu-wcpf-choice.is-selected::before {
    border-color: #111;
    background: #111;
    box-shadow: inset 0 0 0 5px #fff;
}

.hvu-wcpf-root .hvu-wcpf-chip-label {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.3;
    vertical-align: middle;
}

.hvu-wcpf-root .hvu-wcpf-form button.hvu-wcpf-choice.is-disabled {
    opacity: .35;
    cursor: not-allowed;
}

.hvu-wcpf-root .hvu-wcpf-form button.hvu-wcpf-button.hvu-wcpf-reset {
    display: none;
    min-height: 0;
    margin: 10px 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    color: var(--hvu-wcpf-muted) !important;
    box-shadow: none !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 1.3 !important;
    text-decoration: underline;
    text-transform: none !important;
    cursor: pointer;
}

.hvu-wcpf-root .hvu-wcpf-reset[style*="visibility: visible"],
.hvu-wcpf-root .hvu-wcpf-reset[style*="display: inline"] {
    display: inline-block !important;
}

.hvu-wcpf-root .hvu-wcpf-native-variation {
    display: none !important;
}

.hvu-wcpf-root .hvu-wcpf-stock {
    margin: 12px 0;
    font-size: 14px;
}

.hvu-wcpf-root .hvu-wcpf-stock:empty {
    display: none;
}

.hvu-wcpf-root .hvu-wcpf-summary-row {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 22px 0;
    border-bottom: 1px solid var(--hvu-wcpf-border);
}

.hvu-wcpf-root .hvu-wcpf-qty {
    display: grid;
    grid-template-columns: 48px 66px 48px;
    min-height: 52px;
    overflow: hidden;
    border: 1px solid #c7c7c7;
    border-radius: 9px;
    background: #fff;
}

.hvu-wcpf-root .hvu-wcpf-form button.hvu-wcpf-button.hvu-wcpf-qty-btn,
.hvu-wcpf-root .hvu-wcpf-form input.hvu-wcpf-qty-input {
    min-width: 0;
    height: 50px;
    min-height: 0;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #222 !important;
    box-shadow: none !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    line-height: 50px !important;
    letter-spacing: 0 !important;
    text-align: center;
    text-transform: none !important;
}

.hvu-wcpf-root .hvu-wcpf-form button.hvu-wcpf-button.hvu-wcpf-qty-btn {
    cursor: pointer;
}

.hvu-wcpf-root .hvu-wcpf-form input.hvu-wcpf-qty-input {
    appearance: textfield;
    -moz-appearance: textfield;
    border-right: 1px solid #d3d3d3 !important;
    border-left: 1px solid #d3d3d3 !important;
}

.hvu-wcpf-root .hvu-wcpf-qty-input::-webkit-outer-spin-button,
.hvu-wcpf-root .hvu-wcpf-qty-input::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.hvu-wcpf-root .hvu-wcpf-total {
    color: #000;
    font-size: 34px;
    font-weight: 700;
    line-height: 1.1;
    text-align: right;
    white-space: nowrap;
}

.hvu-wcpf-root .hvu-wcpf-total .price,
.hvu-wcpf-root .hvu-wcpf-total .amount {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
}

.hvu-wcpf-root .hvu-wcpf-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding-top: 22px;
}

.hvu-wcpf-root .hvu-wcpf-form button.hvu-wcpf-button.hvu-wcpf-action.button {
    display: inline-grid !important;
    width: 100%;
    min-width: 0;
    min-height: 56px;
    margin: 0 !important;
    padding: 12px 16px !important;
    place-items: center;
    border: 1px solid var(--hvu-wcpf-dark) !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    letter-spacing: 0 !important;
    text-transform: uppercase !important;
    white-space: nowrap;
}

.hvu-wcpf-root .hvu-wcpf-form button.hvu-wcpf-button.hvu-wcpf-add.button {
    background: #fff !important;
    color: var(--hvu-wcpf-dark) !important;
}

.hvu-wcpf-root .hvu-wcpf-form button.hvu-wcpf-button.hvu-wcpf-buy.button {
    background: var(--hvu-wcpf-dark) !important;
    color: #fff !important;
}

.hvu-wcpf-root .hvu-wcpf-form button.hvu-wcpf-action:disabled,
.hvu-wcpf-root .hvu-wcpf-form button.hvu-wcpf-action.disabled {
    opacity: .45;
    cursor: not-allowed;
}

.hvu-wcpf-root .hvu-wcpf-form.is-loading .hvu-wcpf-action span {
    opacity: .55;
}

.hvu-wcpf-root .hvu-wcpf-message {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 5px;
    font-size: 13px;
}

.hvu-wcpf-root .hvu-wcpf-message.is-error {
    background: #fef3f2;
    color: var(--hvu-wcpf-danger);
}

.hvu-wcpf-root .hvu-wcpf-message.is-success {
    background: #ecfdf3;
    color: var(--hvu-wcpf-success);
}

.hvu-wcpf-root .hvu-wcpf-visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Thanh hành động cố định dưới màn hình. */
body .hvu-wcpf-sticky-spacer {
    display: none !important;
}

body .hvu-wcpf-sticky[hidden] {
    display: none !important;
}

body .hvu-wcpf-sticky.hvu-wcpf-sticky--mounted {
    position: fixed;
    bottom: 0;
    left: var(--hvu-wcpf-sticky-left, 0px);
    z-index: 99990;
    display: block;
    width: var(--hvu-wcpf-sticky-width, 100%);
    max-width: 100vw;
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px));
    border: 0;
    border-top: 1px solid rgba(0, 0, 0, .08);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 -4px 14px rgba(0, 0, 0, .06);
    box-sizing: border-box;
    opacity: 1;
    overflow: hidden;
    pointer-events: auto;
    transform: translateY(0);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    visibility: visible;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

/* Ẩn sticky khi cụm nút thật đã vào màn hình hoặc đã được cuộn qua. */
body .hvu-wcpf-sticky.hvu-wcpf-sticky--mounted.is-hidden-by-source {
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(100% + 4px));
    visibility: hidden;
}

body .hvu-wcpf-sticky .hvu-wcpf-sticky-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    width: 96%;
    margin: 0 2%;
    box-sizing: border-box;
}

body .hvu-wcpf-sticky button.hvu-wcpf-sticky-button {
    display: inline-grid !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 52px !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    place-items: center !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    border: 1px solid #5b5b5b !important;
    border-radius: 7px !important;
    background-image: none !important;
    box-shadow: none !important;
    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    letter-spacing: 0 !important;
    text-align: center !important;
    text-decoration: none !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    opacity: 1 !important;
}

body .hvu-wcpf-sticky button.hvu-wcpf-sticky-add {
    background: #fff !important;
    color: #5b5b5b !important;
}

body .hvu-wcpf-sticky button.hvu-wcpf-sticky-buy {
    background: #5b5b5b !important;
    color: #fff !important;
}

body .hvu-wcpf-sticky button.hvu-wcpf-sticky-button.is-state-disabled {
    border-color: #bdbdbd !important;
    background: #d8d8d8 !important;
    color: #fff !important;
}

body .hvu-wcpf-sticky button.hvu-wcpf-sticky-add.is-state-disabled {
    background: #fff !important;
    color: #bdbdbd !important;
}

body .hvu-wcpf-sticky button.hvu-wcpf-sticky-button:focus-visible {
    outline: 2px solid #111 !important;
    outline-offset: 2px !important;
}

.hvu-wcpf-root.hvu-wcpf-scroll-highlight .hvu-wcpf-options,
.hvu-wcpf-root.hvu-wcpf-scroll-highlight .hvu-wcpf-purchase {
    animation: hvu-wcpf-scroll-highlight .75s ease;
}

@keyframes hvu-wcpf-scroll-highlight {
    0%, 100% { background-color: transparent; }
    35% { background-color: rgba(0, 0, 0, .045); }
}

.hvu-wcpf-notice {
    padding: 14px 16px;
    border: 1px solid #dcdcde;
    background: #fff;
    font-family: inherit;
}

body.single-product.hvu-wcpf-hide-native .product-main .product-info > form.cart:not(.hvu-wcpf-form),
body.single-product.hvu-wcpf-hide-native .product-main .product-info form.variations_form:not(.hvu-wcpf-form) {
    display: none !important;
}

@media (max-width: 849px) {
    .hvu-wcpf-root .hvu-wcpf-option-group {
        padding: 16px 0;
    }

    .hvu-wcpf-root .hvu-wcpf-option-group--row {
        grid-template-columns: minmax(130px, 1fr) minmax(180px, 250px);
        gap: 12px;
    }

    .hvu-wcpf-root .hvu-wcpf-option-label,
    .hvu-wcpf-root .hvu-wcpf-summary-label {
        font-size: 16px;
        font-weight: 500;
    }

    .hvu-wcpf-root .hvu-wcpf-option-group--full .hvu-wcpf-option-label {
        margin-bottom: 12px;
    }

    .hvu-wcpf-root .hvu-wcpf-select {
        min-height: 50px;
        padding-left: 12px;
        border-radius: 7px;
        font-size: 14px;
    }

    .hvu-wcpf-root .hvu-wcpf-swatches {
        gap: 15px 22px;
    }

    .hvu-wcpf-root .hvu-wcpf-swatch-media {
        width: 58px;
        height: 58px;
        margin-bottom: 6px;
    }

    .hvu-wcpf-root .hvu-wcpf-choice-label {
        max-width: 70px;
        font-size: 12px;
    }

    .hvu-wcpf-root .hvu-wcpf-chips {
        gap: 8px 20px;
    }

    .hvu-wcpf-root .hvu-wcpf-chips button.hvu-wcpf-button.hvu-wcpf-choice {
        min-width: 112px;
    }

    .hvu-wcpf-root .hvu-wcpf-chip-label {
        font-size: 13px;
    }

    .hvu-wcpf-root .hvu-wcpf-summary-row {
        grid-template-columns: minmax(130px, 1fr) auto;
        gap: 12px;
        padding: 18px 0;
    }

    .hvu-wcpf-root .hvu-wcpf-qty {
        grid-template-columns: 44px 58px 44px;
        min-height: 48px;
        border-radius: 7px;
    }

    .hvu-wcpf-root .hvu-wcpf-form button.hvu-wcpf-button.hvu-wcpf-qty-btn,
    .hvu-wcpf-root .hvu-wcpf-form input.hvu-wcpf-qty-input {
        height: 46px;
        font-size: 14px !important;
        line-height: 46px !important;
    }

    .hvu-wcpf-root .hvu-wcpf-total {
        font-size: 30px;
    }

    .hvu-wcpf-root .hvu-wcpf-actions {
        gap: 12px;
        padding-top: 18px;
    }

    .hvu-wcpf-root .hvu-wcpf-form button.hvu-wcpf-button.hvu-wcpf-action.button {
        min-height: 52px;
        padding: 10px 12px !important;
        border-radius: 7px !important;
        font-size: 14px !important;
    }
}

@media (max-width: 560px) {
    .hvu-wcpf-root .hvu-wcpf-option-group--row {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .hvu-wcpf-root .hvu-wcpf-summary-row {
        grid-template-columns: 1fr auto;
    }

    .hvu-wcpf-root .hvu-wcpf-total {
        font-size: 27px;
    }
}

@media (max-width: 560px) {
    body .hvu-wcpf-sticky.hvu-wcpf-sticky--mounted {
        padding-top: 8px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    }

    body .hvu-wcpf-sticky button.hvu-wcpf-sticky-button {
        min-height: 48px !important;
        padding: 9px 8px !important;
        font-size: 13px !important;
    }
}

@media (max-width: 420px) {
    .hvu-wcpf-root .hvu-wcpf-actions {
        grid-template-columns: 1fr;
    }

    .hvu-wcpf-root .hvu-wcpf-summary-row {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .hvu-wcpf-root .hvu-wcpf-qty,
    .hvu-wcpf-root .hvu-wcpf-total {
        justify-self: end;
    }
}
