/* ==========================================================================
   Contact Buttons – Floating Contact & Social Media Widget
   Lightweight, pure CSS, zero external library dependency
   ========================================================================== */

.zcb-widget {
    position: fixed;
    bottom: var(--zcb-offset-y, 24px);
    z-index: var(--zcb-z-index, 9990);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--zcb-gap, 12px);
    transform: scale(var(--zcb-scale, 1));
    transform-origin: bottom right;
    font-family: inherit;
    line-height: 1.3;
    box-sizing: border-box;
    pointer-events: none;
}

.zcb-widget *,
.zcb-widget *::before,
.zcb-widget *::after {
    box-sizing: border-box;
}

/* Position Left / Right + RTL Support */
.zcb-widget[data-position="right"] {
    right: var(--zcb-offset-x, 24px);
    left: auto;
    align-items: flex-end;
    transform-origin: bottom right;
}

.zcb-widget[data-position="left"] {
    left: var(--zcb-offset-x, 24px);
    right: auto;
    align-items: flex-start;
    transform-origin: bottom left;
}

[dir="rtl"] .zcb-widget[data-position="right"] {
    left: var(--zcb-offset-x, 24px);
    right: auto;
    align-items: flex-start;
}

[dir="rtl"] .zcb-widget[data-position="left"] {
    right: var(--zcb-offset-x, 24px);
    left: auto;
    align-items: flex-end;
}

/* Admin Live Preview container mode */
.zcb-widget.zcb-is-preview {
    position: absolute;
}

/* Items List Container */
.zcb-items {
    display: flex;
    flex-direction: column;
    gap: var(--zcb-gap, 12px);
    align-items: inherit;
    pointer-events: none;
}

/* Individual Contact Button */
.zcb-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--zcb-btn-size, 50px);
    height: var(--zcb-btn-size, 50px);
    background-color: var(--zcb-item-bg, #0989ff);
    color: var(--zcb-item-color, #ffffff) !important;
    border-radius: var(--zcb-radius, 50%);
    text-decoration: none !important;
    pointer-events: auto;
    cursor: pointer;
    transition:
        transform var(--zcb-speed, 300ms) cubic-bezier(0.22, 1, 0.36, 1),
        opacity var(--zcb-speed, 300ms) ease,
        box-shadow 0.25s ease,
        filter 0.25s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.zcb-widget[data-shadow="yes"] .zcb-item,
.zcb-widget[data-shadow="yes"] .zcb-toggle {
    box-shadow: 0 8px 22px -4px rgba(15, 23, 42, 0.26), 0 3px 8px -2px rgba(15, 23, 42, 0.14);
}

.zcb-item:focus-visible,
.zcb-toggle:focus-visible {
    outline: 3px solid rgba(9, 137, 255, 0.5);
    outline-offset: 2px;
}

/* Icon inside Button */
.zcb-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: calc(var(--zcb-btn-size, 50px) * 0.5);
    height: calc(var(--zcb-btn-size, 50px) * 0.5);
    flex-shrink: 0;
}

.zcb-item-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.zcb-item-icon i {
    font-size: calc(var(--zcb-btn-size, 50px) * 0.48);
    line-height: 1;
}

.zcb-item-icon .zcb-custom-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Text Label (Hidden in Style 1 & Style 2, visible in Style 3: Icon + Text) */
.zcb-item-label {
    display: none;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.01em;
    color: var(--zcb-item-color, #ffffff);
}

/* ==========================================================================
   Style 1: Floating Icons (floating_icons)
   ========================================================================== */
.zcb-widget[data-style="floating_icons"] .zcb-toggle {
    display: none !important;
}

/* ==========================================================================
   Style 2: Expandable Widget (expandable)
   ========================================================================== */
.zcb-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: calc(var(--zcb-btn-size, 50px) + 6px);
    height: calc(var(--zcb-btn-size, 50px) + 6px);
    border-radius: var(--zcb-radius, 50%);
    background-color: var(--zcb-toggle-bg, #0989ff);
    color: var(--zcb-toggle-color, #ffffff);
    border: none;
    padding: 0;
    cursor: pointer;
    pointer-events: auto;
    transition: transform var(--zcb-speed, 300ms) cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease;
}

.zcb-toggle:hover {
    transform: scale(1.07);
}

.zcb-toggle-icon {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: calc(var(--zcb-btn-size, 50px) * 0.54);
    height: calc(var(--zcb-btn-size, 50px) * 0.54);
    transition: transform var(--zcb-speed, 300ms) cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

.zcb-toggle-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.zcb-toggle-icon-close {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

.zcb-widget.zcb-is-open .zcb-toggle-icon-open {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.zcb-widget.zcb-is-open .zcb-toggle-icon-close {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Expandable items hidden state */
.zcb-widget[data-style="expandable"]:not(.zcb-is-open) .zcb-items {
    pointer-events: none;
}

.zcb-widget[data-style="expandable"]:not(.zcb-is-open) .zcb-item {
    opacity: 0;
    pointer-events: none;
    transform: translateY(18px) scale(0.65);
}

.zcb-widget[data-style="expandable"].zcb-is-open .zcb-item {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    transition-delay: calc(var(--zcb-item-index, 0) * 35ms);
}

/* ==========================================================================
   Style 3: Icon + Text (icon_text)
   ========================================================================== */
.zcb-widget[data-style="icon_text"] .zcb-toggle {
    display: none !important;
}

.zcb-widget[data-style="icon_text"] .zcb-item {
    width: auto;
    min-height: var(--zcb-btn-size, 50px);
    height: var(--zcb-btn-size, 50px);
    padding: 0 18px 0 14px;
    border-radius: var(--zcb-pill-radius, 30px);
    gap: 10px;
}

.zcb-widget[data-style="icon_text"] .zcb-item-label {
    display: inline-block;
}

.zcb-widget[data-style="icon_text"] .zcb-tooltip {
    display: none !important;
}

/* ==========================================================================
   Tooltip Styling
   ========================================================================== */
.zcb-tooltip {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) scale(0.94);
    background: rgba(15, 23, 42, 0.92);
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 7px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.zcb-widget[data-position="right"] .zcb-tooltip {
    right: calc(100% + 12px);
}

.zcb-widget[data-position="left"] .zcb-tooltip {
    left: calc(100% + 12px);
}

.zcb-widget[data-tooltip="yes"] .zcb-item:hover .zcb-tooltip,
.zcb-widget[data-tooltip="yes"] .zcb-toggle:hover .zcb-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) scale(1);
}

/* ==========================================================================
   Hover Effects
   ========================================================================== */
.zcb-widget[data-hover="scale"] .zcb-item:hover {
    transform: scale(1.1);
}

.zcb-widget[data-hover="lift"] .zcb-item:hover {
    transform: translateY(-4px);
}

.zcb-widget[data-hover="glow"] .zcb-item:hover {
    filter: brightness(1.12);
    box-shadow: 0 0 0 5px rgba(9, 137, 255, 0.22), 0 8px 20px rgba(0, 0, 0, 0.25);
}

.zcb-widget[data-hover="rotate"] .zcb-item:hover .zcb-item-icon {
    transform: rotate(12deg) scale(1.1);
    transition: transform 0.25s ease;
}

/* Pulse Attention Effect */
.zcb-item.zcb-has-pulse::before,
.zcb-widget[data-animation="pulse"] .zcb-toggle::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-color: inherit;
    z-index: -1;
    animation: zcbPulseRing 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes zcbPulseRing {
    0% {
        transform: scale(1);
        opacity: 0.55;
    }

    75%,
    100% {
        transform: scale(1.42);
        opacity: 0;
    }
}

/* ==========================================================================
   Mobile Responsive Overrides
   ========================================================================== */
@media (max-width: 767.98px) {
    .zcb-widget.zcb-hide-mobile {
        display: none !important;
    }

    .zcb-widget {
        bottom: var(--zcb-mobile-offset-y, 18px);
    }

    .zcb-widget[data-mobile-position="right"] {
        right: var(--zcb-mobile-offset-x, 16px);
        left: auto;
        align-items: flex-end;
    }

    .zcb-widget[data-mobile-position="left"] {
        left: var(--zcb-mobile-offset-x, 16px);
        right: auto;
        align-items: flex-start;
    }

    .zcb-item {
        width: var(--zcb-mobile-btn-size, 46px);
        height: var(--zcb-mobile-btn-size, 46px);
    }

    .zcb-item-icon {
        width: calc(var(--zcb-mobile-btn-size, 46px) * 0.5);
        height: calc(var(--zcb-mobile-btn-size, 46px) * 0.5);
    }

    .zcb-toggle {
        width: calc(var(--zcb-mobile-btn-size, 46px) + 6px);
        height: calc(var(--zcb-mobile-btn-size, 46px) + 6px);
    }

    .zcb-widget[data-mobile-tooltip="no"] .zcb-tooltip {
        display: none !important;
    }

    /* Mobile Display Style Override */
    .zcb-widget[data-mobile-style="floating_icons"] .zcb-toggle {
        display: none !important;
    }

    .zcb-widget[data-mobile-style="floating_icons"] .zcb-item {
        opacity: 1 !important;
        pointer-events: auto !important;
        transform: none !important;
        width: var(--zcb-mobile-btn-size, 46px);
        padding: 0;
    }

    .zcb-widget[data-mobile-style="floating_icons"] .zcb-item-label {
        display: none !important;
    }

    .zcb-widget[data-mobile-style="icon_text"] .zcb-toggle {
        display: none !important;
    }

    .zcb-widget[data-mobile-style="icon_text"] .zcb-item {
        opacity: 1 !important;
        pointer-events: auto !important;
        transform: none !important;
        width: auto;
        height: var(--zcb-mobile-btn-size, 46px);
        padding: 0 14px 0 12px;
        border-radius: var(--zcb-pill-radius, 26px);
        gap: 8px;
    }

    .zcb-widget[data-mobile-style="icon_text"] .zcb-item-label {
        display: inline-block !important;
        font-size: 13px;
    }

    .zcb-widget[data-mobile-style="expandable"] .zcb-toggle {
        display: inline-flex !important;
    }

    .zcb-widget[data-mobile-style="expandable"]:not(.zcb-is-open) .zcb-item {
        opacity: 0;
        pointer-events: none;
        transform: translateY(16px) scale(0.65);
    }

    .zcb-widget[data-mobile-style="expandable"] .zcb-item-label {
        display: none !important;
    }
}