/* ESSB Social Contact - Frontend */

/* Buttons container */
.essb-sc-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Direction */
.essb-sc-buttons.essb-sc-type-icon {
    flex-direction: row;
}

.essb-sc-float-left_sidebar .essb-sc-buttons,
.essb-sc-float-right_sidebar .essb-sc-buttons {
    flex-direction: column;
}

.essb-sc-float-bottom_right_vertical .essb-sc-buttons,
.essb-sc-float-bottom_left_vertical .essb-sc-buttons {
    flex-direction: column;
}

/* Individual button */
.essb-sc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
    cursor: pointer;
    border: none;
    line-height: 1;
}

.essb-sc-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
    text-decoration: none;
}

.essb-sc-btn:active {
    transform: scale(0.96);
}

/* Icon */
.essb-sc-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.essb-sc-btn-icon svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Button text */
.essb-sc-btn-text {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

/* ========== Style: Square ========== */
.essb-sc-style-square .essb-sc-btn {
    border-radius: 0;
}

/* ========== Style: Round ========== */
.essb-sc-style-round .essb-sc-btn {
    border-radius: 50%;
}

/* ========== Style: Rounded ========== */
.essb-sc-style-rounded .essb-sc-btn {
    border-radius: 8px;
}

/* ========== No Space Between Buttons ========== */
.essb-sc-no-space {
    gap: 0 !important;
}

.essb-sc-no-space .essb-sc-btn {
    border-radius: 0 !important;
}

.essb-sc-no-space .essb-sc-btn:first-child {
    border-radius: 0 !important;
}

.essb-sc-no-space .essb-sc-btn:last-child {
    border-radius: 0 !important;
}

/* Horizontal: first gets left radius, last gets right radius */
.essb-sc-no-space .essb-sc-btn:first-child {
    border-top-left-radius: 8px !important;
    border-bottom-left-radius: 8px !important;
}

.essb-sc-no-space .essb-sc-btn:last-child {
    border-top-right-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
}

/* Round style horizontal */
.essb-sc-style-round.essb-sc-no-space .essb-sc-btn:first-child {
    border-top-left-radius: 21px !important;
    border-bottom-left-radius: 21px !important;
}

.essb-sc-style-round.essb-sc-no-space .essb-sc-btn:last-child {
    border-top-right-radius: 21px !important;
    border-bottom-right-radius: 21px !important;
}

/* Vertical: first gets top radius, last gets bottom radius */
.essb-sc-float-left_sidebar .essb-sc-no-space .essb-sc-btn,
.essb-sc-float-right_sidebar .essb-sc-no-space .essb-sc-btn,
.essb-sc-float-bottom_right_vertical .essb-sc-no-space .essb-sc-btn,
.essb-sc-float-bottom_left_vertical .essb-sc-no-space .essb-sc-btn {
    border-radius: 0 !important;
}

.essb-sc-float-left_sidebar .essb-sc-no-space .essb-sc-btn:first-child,
.essb-sc-float-right_sidebar .essb-sc-no-space .essb-sc-btn:first-child,
.essb-sc-float-bottom_right_vertical .essb-sc-no-space .essb-sc-btn:first-child,
.essb-sc-float-bottom_left_vertical .essb-sc-no-space .essb-sc-btn:first-child {
    border-top-left-radius: 8px !important;
    border-top-right-radius: 8px !important;
}

.essb-sc-float-left_sidebar .essb-sc-no-space .essb-sc-btn:last-child,
.essb-sc-float-right_sidebar .essb-sc-no-space .essb-sc-btn:last-child,
.essb-sc-float-bottom_right_vertical .essb-sc-no-space .essb-sc-btn:last-child,
.essb-sc-float-bottom_left_vertical .essb-sc-no-space .essb-sc-btn:last-child {
    border-bottom-left-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
}

/* Round style vertical */
.essb-sc-style-round.essb-sc-float-left_sidebar .essb-sc-no-space .essb-sc-btn:first-child,
.essb-sc-style-round.essb-sc-float-right_sidebar .essb-sc-no-space .essb-sc-btn:first-child,
.essb-sc-style-round.essb-sc-float-bottom_right_vertical .essb-sc-no-space .essb-sc-btn:first-child,
.essb-sc-style-round.essb-sc-float-bottom_left_vertical .essb-sc-no-space .essb-sc-btn:first-child {
    border-top-left-radius: 21px !important;
    border-top-right-radius: 21px !important;
}

.essb-sc-style-round.essb-sc-float-left_sidebar .essb-sc-no-space .essb-sc-btn:last-child,
.essb-sc-style-round.essb-sc-float-right_sidebar .essb-sc-no-space .essb-sc-btn:last-child,
.essb-sc-style-round.essb-sc-float-bottom_right_vertical .essb-sc-no-space .essb-sc-btn:last-child,
.essb-sc-style-round.essb-sc-float-bottom_left_vertical .essb-sc-no-space .essb-sc-btn:last-child {
    border-bottom-left-radius: 21px !important;
    border-bottom-right-radius: 21px !important;
}

/* Outline template: remove touching borders in no-space mode */
.essb-sc-template-outline.essb-sc-no-space .essb-sc-btn {
    border-right-width: 0;
}

.essb-sc-template-outline.essb-sc-no-space .essb-sc-btn:last-child {
    border-right-width: 2px;
}

/* Outline template vertical: remove bottom borders instead */
.essb-sc-float-left_sidebar .essb-sc-no-space.essb-sc-template-outline .essb-sc-btn,
.essb-sc-float-right_sidebar .essb-sc-no-space.essb-sc-template-outline .essb-sc-btn,
.essb-sc-float-bottom_right_vertical .essb-sc-no-space.essb-sc-template-outline .essb-sc-btn,
.essb-sc-float-bottom_left_vertical .essb-sc-no-space.essb-sc-template-outline .essb-sc-btn {
    border-right-width: 2px;
    border-bottom-width: 0;
}

.essb-sc-float-left_sidebar .essb-sc-no-space.essb-sc-template-outline .essb-sc-btn:last-child,
.essb-sc-float-right_sidebar .essb-sc-no-space.essb-sc-template-outline .essb-sc-btn:last-child,
.essb-sc-float-bottom_right_vertical .essb-sc-no-space.essb-sc-template-outline .essb-sc-btn:last-child,
.essb-sc-float-bottom_left_vertical .essb-sc-no-space.essb-sc-template-outline .essb-sc-btn:last-child {
    border-bottom-width: 2px;
}

/* ========== Type: Icon Only ========== */
.essb-sc-type-icon .essb-sc-btn {
    padding: 10px;
    width: 42px;
    height: 42px;
}

/* ========== Type: Button (Icon + Text) ========== */
.essb-sc-type-button .essb-sc-btn {
    padding: 10px 16px;
    border-radius: 8px;
    height: 42px;
}

.essb-sc-style-round.essb-sc-type-button .essb-sc-btn {
    border-radius: 21px;
    padding: 10px 20px;
}

/* ========== Template: Dark ========== */
.essb-sc-template-dark .essb-sc-btn {
    background-color: #1a1a2e;
}

/* ========== Template: Lite ========== */
.essb-sc-template-lite .essb-sc-btn {
    background-color: #f0f0f0;
    color: #333;
}

/* ========== Template: Outline ========== */
.essb-sc-template-outline .essb-sc-btn {
    background-color: transparent;
    border: 2px solid;
}

/* ========== Button Size: Extra Small ========== */
.essb-sc-size-xs .essb-sc-btn-icon svg {
    width: 14px;
    height: 14px;
}

.essb-sc-type-icon.essb-sc-size-xs .essb-sc-btn {
    padding: 7px;
    width: 30px;
    height: 30px;
}

.essb-sc-type-button.essb-sc-size-xs .essb-sc-btn {
    padding: 7px 12px;
    height: 30px;
}

.essb-sc-style-round.essb-sc-type-button.essb-sc-size-xs .essb-sc-btn {
    border-radius: 15px;
    padding: 7px 14px;
}

.essb-sc-size-xs .essb-sc-btn-text {
    font-size: 11px;
}

/* ========== Button Size: Small ========== */
.essb-sc-size-sm .essb-sc-btn-icon svg {
    width: 17px;
    height: 17px;
}

.essb-sc-type-icon.essb-sc-size-sm .essb-sc-btn {
    padding: 8px;
    width: 36px;
    height: 36px;
}

.essb-sc-type-button.essb-sc-size-sm .essb-sc-btn {
    padding: 8px 14px;
    height: 36px;
}

.essb-sc-style-round.essb-sc-type-button.essb-sc-size-sm .essb-sc-btn {
    border-radius: 18px;
    padding: 8px 16px;
}

.essb-sc-size-sm .essb-sc-btn-text {
    font-size: 12px;
}

/* ========== Button Size: Large ========== */
.essb-sc-size-lg .essb-sc-btn-icon svg {
    width: 24px;
    height: 24px;
}

.essb-sc-type-icon.essb-sc-size-lg .essb-sc-btn {
    padding: 12px;
    width: 50px;
    height: 50px;
}

.essb-sc-type-button.essb-sc-size-lg .essb-sc-btn {
    padding: 12px 20px;
    height: 50px;
}

.essb-sc-style-round.essb-sc-type-button.essb-sc-size-lg .essb-sc-btn {
    border-radius: 25px;
    padding: 12px 24px;
}

.essb-sc-size-lg .essb-sc-btn-text {
    font-size: 14px;
}

/* ========== Button Size: Extra Large ========== */
.essb-sc-size-xl .essb-sc-btn-icon svg {
    width: 28px;
    height: 28px;
}

.essb-sc-type-icon.essb-sc-size-xl .essb-sc-btn {
    padding: 14px;
    width: 60px;
    height: 60px;
}

.essb-sc-type-button.essb-sc-size-xl .essb-sc-btn {
    padding: 14px 24px;
    height: 60px;
}

.essb-sc-style-round.essb-sc-type-button.essb-sc-size-xl .essb-sc-btn {
    border-radius: 30px;
    padding: 14px 28px;
}

.essb-sc-size-xl .essb-sc-btn-text {
    font-size: 15px;
}

/* ========== Floating Containers ========== */
.essb-sc-float {
    position: fixed;
    z-index: 99990;
}

.essb-sc-float-bottom_right_horizontal,
.essb-sc-float-bottom_right_vertical {
    bottom: 24px;
    right: 24px;
}

.essb-sc-float-bottom_left_horizontal,
.essb-sc-float-bottom_left_vertical {
    bottom: 24px;
    left: 24px;
}

.essb-sc-float-left_sidebar {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.essb-sc-float-right_sidebar {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

/* ========== Floating Edge Offsets ========== */
/* Small (12px) */
.essb-sc-edge-small.essb-sc-float-bottom_right_horizontal,
.essb-sc-edge-small.essb-sc-float-bottom_right_vertical {
    bottom: 12px;
    right: 12px;
}

.essb-sc-edge-small.essb-sc-float-bottom_left_horizontal,
.essb-sc-edge-small.essb-sc-float-bottom_left_vertical {
    bottom: 12px;
    left: 12px;
}

/* None (0px) */
.essb-sc-edge-none.essb-sc-float-bottom_right_horizontal,
.essb-sc-edge-none.essb-sc-float-bottom_right_vertical {
    bottom: 0;
    right: 0;
}

.essb-sc-edge-none.essb-sc-float-bottom_left_horizontal,
.essb-sc-edge-none.essb-sc-float-bottom_left_vertical {
    bottom: 0;
    left: 0;
}

/* Large (36px) */
.essb-sc-edge-large.essb-sc-float-bottom_right_horizontal,
.essb-sc-edge-large.essb-sc-float-bottom_right_vertical {
    bottom: 36px;
    right: 36px;
}

.essb-sc-edge-large.essb-sc-float-bottom_left_horizontal,
.essb-sc-edge-large.essb-sc-float-bottom_left_vertical {
    bottom: 36px;
    left: 36px;
}

/* ========== Responsive ========== */
@media (max-width: 480px) {
    .essb-sc-float-bottom_right_horizontal,
    .essb-sc-float-bottom_left_horizontal {
        bottom: 16px;
    }

    .essb-sc-float-bottom_right_horizontal {
        right: 16px;
    }

    .essb-sc-float-bottom_left_horizontal {
        left: 16px;
    }

    .essb-sc-edge-small.essb-sc-float-bottom_right_horizontal,
    .essb-sc-edge-small.essb-sc-float-bottom_left_horizontal {
        bottom: 12px;
    }

    .essb-sc-edge-small.essb-sc-float-bottom_right_horizontal {
        right: 12px;
    }

    .essb-sc-edge-small.essb-sc-float-bottom_left_horizontal {
        left: 12px;
    }

    .essb-sc-edge-none.essb-sc-float-bottom_right_horizontal,
    .essb-sc-edge-none.essb-sc-float-bottom_left_horizontal {
        bottom: 0;
    }

    .essb-sc-edge-none.essb-sc-float-bottom_right_horizontal {
        right: 0;
    }

    .essb-sc-edge-none.essb-sc-float-bottom_left_horizontal {
        left: 0;
    }

    .essb-sc-edge-large.essb-sc-float-bottom_right_horizontal,
    .essb-sc-edge-large.essb-sc-float-bottom_left_horizontal {
        bottom: 24px;
    }

    .essb-sc-edge-large.essb-sc-float-bottom_right_horizontal {
        right: 24px;
    }

    .essb-sc-edge-large.essb-sc-float-bottom_left_horizontal {
        left: 24px;
    }

    .essb-sc-type-button .essb-sc-btn-text {
        display: none;
    }

    .essb-sc-type-button .essb-sc-btn {
        padding: 10px;
        width: 42px;
    }
}

/* Device visibility */
.essb-sc-device-desktop {
    display: flex;
}

.essb-sc-device-mobile {
    display: none;
}

@media (max-width: 768px) {
    .essb-sc-device-desktop {
        display: none !important;
    }

    .essb-sc-device-mobile {
        display: flex !important;
    }
}

/* Contact button mode */
.essb-sc-contact-wrap {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    z-index: 100;
}

.essb-sc-contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
    line-height: 1;
    text-decoration: none;
    position: relative;
    z-index: 10;
    padding: 0;
}

.essb-sc-contact-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
}

.essb-sc-contact-btn:active {
    transform: scale(0.96);
}

.essb-sc-contact-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.essb-sc-contact-btn-icon svg,
.essb-sc-contact-btn-icon img {
    width: 28px;
    height: 28px;
}

.essb-sc-contact-btn .essb-sc-btn-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 600;
    white-space: nowrap;
}

/* Contact button shapes */
.essb-sc-contact-btn.essb-sc-shape-round {
    border-radius: 50%;
    width: 60px;
    height: 60px;
}

.essb-sc-contact-btn.essb-sc-shape-rounded {
    border-radius: 16px;
    padding: 14px 18px;
}

.essb-sc-contact-btn.essb-sc-shape-square {
    border-radius: 0;
    width: 60px;
    height: 60px;
}

/* Contact button type button mode */
.essb-sc-contact-btn.essb-sc-type-button.essb-sc-shape-round {
    width: auto;
    height: auto;
    border-radius: 50px;
    padding: 14px 22px;
}

.essb-sc-contact-btn.essb-sc-type-button.essb-sc-shape-square {
    width: auto;
    height: auto;
    border-radius: 0;
    padding: 14px 18px;
}

/* Contact button sizes */
.essb-sc-contact-btn.essb-sc-size-xs {
    width: 36px;
    height: 36px;
}

.essb-sc-contact-btn.essb-sc-size-xs.essb-sc-btn-icon svg,
.essb-sc-contact-btn.essb-sc-size-xs.essb-sc-btn-icon img {
    width: 18px;
    height: 18px;
}

.essb-sc-contact-btn.essb-sc-size-sm {
    width: 44px;
    height: 44px;
}

.essb-sc-contact-btn.essb-sc-size-sm.essb-sc-btn-icon svg,
.essb-sc-contact-btn.essb-sc-size-sm.essb-sc-btn-icon img {
    width: 22px;
    height: 22px;
}

.essb-sc-contact-btn.essb-sc-size-md {
    width: 52px;
    height: 52px;
}

.essb-sc-contact-btn.essb-sc-size-lg {
    width: 60px;
    height: 60px;
}

.essb-sc-contact-btn.essb-sc-size-xl {
    width: 72px;
    height: 72px;
}

.essb-sc-contact-btn.essb-sc-size-xl.essb-sc-btn-icon svg,
.essb-sc-contact-btn.essb-sc-size-xl.essb-sc-btn-icon img {
    width: 32px;
    height: 32px;
}

/* Popup base */
.essb-sc-contact-popup {
    position: absolute;
    border-radius: 12px;
    padding: 12px;
    z-index: 9;
    min-width: 180px;
    max-height: 70vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    animation: essb-sc-popup-in .2s ease;
}

/* Direction: above (bottom_* positions) */
.essb-sc-popup-above {
    bottom: calc(100% + 12px);
    max-height: calc(100vh - 100px);
}

.essb-sc-popup-above.essb-sc-popup-flipped {
    bottom: auto;
    top: calc(100% + 12px);
}

.essb-sc-popup-above.essb-sc-popup-align-start {
    left: 0;
}

.essb-sc-popup-above.essb-sc-popup-align-center {
    left: 50%;
    transform: translateX(-50%);
}

.essb-sc-popup-above.essb-sc-popup-align-end {
    right: 0;
}

/* Direction: below (top_* positions) */
.essb-sc-popup-below {
    top: calc(100% + 12px);
}

.essb-sc-popup-below.essb-sc-popup-align-start {
    left: 0;
}

.essb-sc-popup-below.essb-sc-popup-align-center {
    left: 50%;
    transform: translateX(-50%);
}

.essb-sc-popup-below.essb-sc-popup-align-end {
    right: 0;
}

/* Direction: right (left_sidebar) */
.essb-sc-popup-right {
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
}

.essb-sc-popup-right.essb-sc-popup-align-start {
    top: 0;
    transform: none;
}

.essb-sc-popup-right.essb-sc-popup-align-end {
    bottom: 0;
    top: auto;
    transform: none;
}

/* Direction: left (right_sidebar) */
.essb-sc-popup-left {
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
}

.essb-sc-popup-left.essb-sc-popup-align-start {
    top: 0;
    transform: none;
}

.essb-sc-popup-left.essb-sc-popup-align-end {
    bottom: 0;
    top: auto;
    transform: none;
}

/* Popup themes */
.essb-sc-popup-theme-light {
    background: #fff;
    box-shadow: 0 8px 32px rgba(23, 33, 83, .18);
}

.essb-sc-popup-theme-dark {
    background: #1a1f36;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .35);
}

.essb-sc-popup-theme-dark .essb-sc-contact-popup-buttons .essb-sc-btn {
    color: #e2e8f0;
}

.essb-sc-popup-theme-dark .essb-sc-contact-popup-buttons .essb-sc-btn:hover {
    background: rgba(255, 255, 255, .08);
}

.essb-sc-popup-theme-transparent {
    background: transparent;
    box-shadow: none;
}

.essb-sc-popup-theme-transparent .essb-sc-contact-popup-buttons .essb-sc-btn {
    color: #fff;
}

.essb-sc-popup-theme-transparent .essb-sc-contact-popup-buttons .essb-sc-btn:hover {
    background: rgba(255, 255, 255, .12);
}

/* Popup buttons: vertical list (default for button type) */
.essb-sc-contact-popup-buttons .essb-sc-buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.essb-sc-contact-popup-buttons .essb-sc-btn {
    justify-content: flex-start;
    padding: 10px 14px;
    gap: 10px;
}

.essb-sc-contact-popup-buttons .essb-sc-btn-icon svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Button type (icon + text) full-width */
.essb-sc-contact-popup-buttons .essb-sc-buttons.essb-sc-type-button .essb-sc-btn {
    gap: 5px;
    flex: 1;
}

/* Icon grid: horizontal wrap when buttons are icon-only */
.essb-sc-popup-icon-grid .essb-sc-contact-popup-buttons .essb-sc-buttons {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-start;
}

.essb-sc-popup-icon-grid .essb-sc-contact-popup-buttons .essb-sc-btn {
    justify-content: center;
    padding: 10px;
    gap: 0;
}

.essb-sc-popup-icon-grid .essb-sc-contact-popup-buttons .essb-sc-btn-icon svg {
    width: 22px;
    height: 22px;
}

@keyframes essb-sc-popup-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Override transform for centered/translated popups */
.essb-sc-popup-above.essb-sc-popup-align-center,
.essb-sc-popup-below.essb-sc-popup-align-center {
    animation-name: essb-sc-popup-in-center;
}

.essb-sc-popup-right,
.essb-sc-popup-left {
    animation-name: essb-sc-popup-in-side;
}

@keyframes essb-sc-popup-in-center {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes essb-sc-popup-in-side {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(6px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

/* Header text (tooltip above buttons) */
.essb-sc-header-text {
    display: inline-block;
    padding: 6px 14px;
    margin-bottom: 8px;
    background: #172153;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    white-space: nowrap;
    position: relative;
}

.essb-sc-header-text::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #172153;
}

/* Header text inside popup */
.essb-sc-contact-popup .essb-sc-header-text {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

/* Popup dark theme header text */
.essb-sc-popup-theme-dark .essb-sc-header-text {
    background: #e2e8f0;
    color: #172153;
}

.essb-sc-popup-theme-dark .essb-sc-header-text::after {
    border-top-color: #e2e8f0;
}

/* Popup transparent theme header text */
.essb-sc-popup-theme-transparent .essb-sc-header-text {
    background: rgba(255, 255, 255, .15);
    color: #fff;
}

.essb-sc-popup-theme-transparent .essb-sc-header-text::after {
    border-top-color: rgba(255, 255, 255, .15);
}
