
:root {
    --cta-bg: #018749;
    --cta-text: #ffffff;
}


@keyframes cta-pulse {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}


.cta-widget.cta-type--sidebar {
    position: fixed !important;
    z-index: 999;
    bottom: 120px;
    opacity: 1;
    line-height: 1;
}

.cta-widget.cta-type--sidebar * {
    box-sizing: border-box;
}

.cta-widget.cta-type--sidebar.position--right {
    right: 20px;
}

.cta-widget.cta-type--sidebar.position--left {
    left: 20px;
}


.cta-widget.cta-type--sidebar .cta-sidebar-row {
    width: 70px;
    height: 70px;
    position: relative;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background-color: var(--cta-bg);
}

.cta-widget.cta-type--sidebar.open .cta-sidebar-row {
    animation: none;
}


.cta-widget.cta-type--sidebar .cta-sidebar-row .pulsation {
    width: 100%;
    height: 100%;
    background-color: var(--cta-bg);
    border-radius: 50%;
    position: absolute;
    inset: 0;
    z-index: -1;
    animation: cta-pulse 2s infinite;
}

.cta-widget.cta-type--sidebar .cta-sidebar-row .pulsation:last-of-type {
    animation-delay: 0.5s;
}

.cta-widget.cta-type--sidebar.open .cta-sidebar-row .pulsation,
.cta-widget.cta-type--sidebar .cta-sidebar-row.stop-pulse .pulsation {
    display: none;
}


.cta-widget.cta-type--sidebar .cta-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    background: #22c55e;
    border: 2px solid #fff;
    border-radius: 50%;
    z-index: 10;
}

.cta-widget.cta-type--sidebar.open .cta-dot {
    display: none;
}


.cta-widget.cta-type--sidebar .cta-toggle-btn {
    position: absolute;
    inset: 0;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: 0.2s all;
    color: var(--cta-text);
    border-radius: 50%;
    cursor: pointer;
}

.cta-widget.cta-type--sidebar .cta-toggle-btn.cta-hide {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

.cta-widget.cta-type--sidebar.open .cta-toggle-btn {
    background-color: var(--cta-bg);
}

.cta-widget.cta-type--sidebar .cta-toggle-icons {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    font-size: 30px;
}

.cta-widget.cta-type--sidebar .cta-toggle-icons i,
.cta-widget.cta-type--sidebar .cta-toggle-icons svg {
    position: absolute;
    inset: 0;
    margin: auto;
    transition: 0.2s all;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cta-text) !important;
    fill: var(--cta-text) !important;
}
.cta-widget.cta-type--sidebar .cta-toggle-icons svg {
    stroke: var(--cta-text);
    stroke-width: 2;
}

.cta-widget.cta-type--sidebar .cta-toggle-close {
    transform: rotate(180deg) scale(0);
    opacity: 0;
}

.cta-widget.cta-type--sidebar.open .cta-toggle-close {
    transform: rotate(0) scale(1);
    opacity: 1;
}

.cta-widget.cta-type--sidebar.open .cta-toggle-open {
    transform: rotate(-180deg) scale(0);
    opacity: 0;
}

.cta-widget.cta-type--sidebar .label-contact {
    font-family: "Roboto", sans-serif;
    font-weight: 700;
    font-size: 10px;
    line-height: 11px;
    margin: 0;
    transition: 0.2s all;
    color: var(--cta-text);
}

.cta-widget.cta-type--sidebar.open .label-contact {
    display: none;
}


.cta-widget.cta-type--sidebar .cta-strip-wrap {
    background-color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    position: absolute;
    overflow: hidden;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition:
        0.2s opacity,
        0.2s transform;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.cta-widget.cta-type--sidebar .cta-strip-wrap.cta-hide {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
}

.cta-widget.cta-type--sidebar .icons-line {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    height: 100%;
    transition: transform 0.2s ease;
    will-change: transform;
}

.cta-widget.cta-type--sidebar .cta-strip__seg {
    display: inline-flex;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    justify-content: center;
    align-items: center;
}

.cta-widget.cta-type--sidebar .cta-strip__seg .cta-visual {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.cta-widget.cta-type--sidebar .cta-strip__seg .cta-visual img,
.cta-widget.cta-type--sidebar .cta-strip__seg .cta-visual i,
.cta-widget.cta-type--sidebar .cta-strip__seg .cta-visual svg {
    width: 32px;
    height: 32px;
    font-size: 32px;
    object-fit: contain;
    /* Use the per-item brand color from the picker (set as --cta-color via inline style
     * by Frontend.php item()), fallback to global --cta-bg when no per-item color picked. */
    color: var(--cta-color, var(--cta-bg));
    fill: var(--cta-color, var(--cta-bg));
    display: block;
}

.cta-widget.cta-type--sidebar .cta-strip__seg .cta-label {
    display: none;
}

.cta-widget.cta-type--sidebar .cta-strip__seg a {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}


.cta-widget.cta-type--sidebar .cta-menu-box {
    background: #ffffff;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.2);
    width: 200px;
    position: absolute;
    bottom: 80px;
    right: 0;
    display: flex;
    flex-direction: column;
    padding: 10px 0;
    border-radius: 7px;
    z-index: 20;
    visibility: hidden;
    opacity: 0;
    transition: ease-in-out 0.2s all;
    transform: translate3d(0, -20%, 0);
    pointer-events: none;
}

.cta-widget.cta-type--sidebar.position--left .cta-menu-box {
    right: auto;
    left: 0;
}

.cta-widget.cta-type--sidebar .cta-menu-box::before {
    content: "";
    position: absolute;
    bottom: -7px;
    right: 25px;
    border-right: 8px solid transparent;
    border-top: 8px solid #ffffff;
    border-left: 8px solid transparent;
}

.cta-widget.cta-type--sidebar.position--left .cta-menu-box::before {
    right: auto;
    left: 25px;
}

.cta-widget.cta-type--sidebar.open .cta-menu-box {
    visibility: visible;
    opacity: 1;
    transform: translate3d(0, 0, 0);
    pointer-events: auto;
}


.cta-widget.cta-type--sidebar .cta-menu-box .cta-item {
    width: 100%;
    transition:
        transform 0s 0.2s,
        opacity 0s 0.2s;
    transform: translate3d(0, 50px, 0);
    opacity: 0;
}

.cta-widget.cta-type--sidebar.open .cta-menu-box .cta-item {
    transition:
        transform 0.4s,
        opacity 0.4s;
    transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
    transform: translate3d(0, 0, 0);
    opacity: 1;
}

.cta-widget.cta-type--sidebar .cta-menu-box .cta-item:nth-child(2) {
    transition-delay: 0.05s;
}

.cta-widget.cta-type--sidebar .cta-menu-box .cta-item:nth-child(3) {
    transition-delay: 0.1s;
}

.cta-widget.cta-type--sidebar .cta-menu-box .cta-item:nth-child(4) {
    transition-delay: 0.15s;
}

.cta-widget.cta-type--sidebar .cta-menu-box .cta-item:nth-child(5) {
    transition-delay: 0.2s;
}

.cta-widget.cta-type--sidebar .cta-menu-box .cta-link {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 20px 8px 60px;
    position: relative;
    min-height: 54px;
    text-decoration: none;
}

.cta-widget.cta-type--sidebar .cta-menu-box .cta-link:hover {
    background-color: #eeeeee;
}

.cta-widget.cta-type--sidebar .cta-menu-box .cta-visual {
    position: absolute;
    left: 10px;
    top: 50%;
    margin-top: -20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--animation-color, #0084ff);
    color: #ffffff;
}

.cta-widget.cta-type--sidebar .cta-menu-box .cta-visual svg,
.cta-widget.cta-type--sidebar .cta-menu-box .cta-visual i,
.cta-widget.cta-type--sidebar .cta-menu-box .cta-visual img {
    width: 22px;
    height: 22px;
    font-size: 22px;
    object-fit: contain;
    fill: currentColor;
    display: block;
}

/* Brand-colored icons (have their own multi-color fills) — let them fill the
 * full visual circle and drop the colored bg so colors don't blend. */
.cta-widget .cta-visual:has(use[href="#i-zalo"]) {
    background: transparent !important;
    box-shadow: none;
}
.cta-type--sidebar .cta-visual:has(use[href="#i-zalo"]) svg {
    width: 100% !important;
    height: 100% !important;
}
.cta-widget.cta-type--sidebar .cta-strip__seg .cta-visual:has(use[href="#i-zalo"]) svg {
    width: 44px !important;
    height: 44px !important;
}

/* "Tắt nền màu" toggle (sidebar/footer) — drop the colored circle background and
 * paint the icon directly with the picker color (--cta-color set inline by item()). */
.cta-widget.no-item-bg .cta-visual {
    background: transparent !important;
    box-shadow: none;
}
.cta-widget.no-item-bg .cta-visual i,
.cta-widget.no-item-bg .cta-visual svg,
.cta-widget.no-item-bg .cta-visual img {
    color: var(--cta-color, var(--cta-bg)) !important;
    fill: var(--cta-color, var(--cta-bg)) !important;
}
.cta-widget.cta-type--sidebar.no-item-bg .cta-menu-box .cta-visual i,
.cta-widget.cta-type--sidebar.no-item-bg .cta-menu-box .cta-visual svg {
    width: 28px;
    height: 28px;
    font-size: 28px;
}

.cta-widget.cta-type--sidebar .cta-menu-box .cta-label {
    font-family: "Roboto", sans-serif;
    font-size: 15px;
    color: rgba(0, 0, 0, 0.87);
    font-weight: 500;
    line-height: 17px;
}


.cta-widget.cta-type--footer {
    position: fixed;
    bottom: 8px;
    z-index: 1111;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 12px;
    background: #fff;
    width: calc(100% - 16px);
    margin-left: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.cta-widget.cta-type--footer .cta-link,
.cta-widget.cta-type--footer .cta-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    gap: 3px;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    width: 100%;
}
.cta-type--footer  button {
    font-weight: normal;
}
.cta-widget.cta-type--footer .cta-item {
    flex: 1;
}

.cta-widget.cta-type--footer .cta-label {
    font-size: 11px;
    color: var(--text);
}

.cta-widget.cta-type--footer .cta-visual {
    font-size: 22px;
    color: var(--primary);
}


.cta-widget.cta-type--footer .cta-item--atc .cta-visual {
    position: relative;
}


.cta-widget.cta-type--footer .cta-item--wishlist.active .cta-visual,
.cta-widget.cta-type--footer .cta-item--atc.active .cta-visual {
    color: var(--heading, var(--text));
}


.cta-widget.cta-type--footer .cta-cart-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: var(--primary);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    pointer-events: none;
}

.cta-widget.cta-type--footer [data-cta-action="atc"].loading .cta-visual {
    opacity: 0.5;
}

.cta-widget.cta-type--footer [data-cta-action="atc"].loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
    cursor: not-allowed;
}

.cta-widget.cta-type--footer .added_to_cart,
.cta-widget.cta-type--footer .wc-forward {
    display: none !important;
}


@media (max-width: 768px) {
    .cta-widget.cta-type--sidebar.hide-mobile--1 {
        display: none !important;
    }
}

@media (min-width: 769px) {

    .cta-widget.cta-type--sidebar.hide-desktop--1,
    .cta-widget.cta-type--footer.hide-desktop--1 {
        display: none !important;
    }
}
