/* Ghekko Contact Hub. Settings arrive as custom properties on the hub element:
   --gch-primary, --gch-whatsapp, --gch-header, --gch-x, --gch-y, --gch-size, --gch-width, --gch-z */

.ghekko-contact-hub {
    --gch-primary: #ed174b;
    --gch-whatsapp: #25d366;
    --gch-header: #292929;
    --gch-x: 18px;
    --gch-y: 18px;
    --gch-size: 58px;
    --gch-width: 340px;
    --gch-z: 9999;
    --gch-button-size: var(--gch-size);

    position: fixed;
    right: var(--gch-x);
    bottom: calc(var(--gch-y) + env(safe-area-inset-bottom, 0px));
    z-index: var(--gch-z);
    font-family: inherit;
    line-height: 1.5;
}

.ghekko-contact-hub.gch-side-left {
    right: auto;
    left: var(--gch-x);
}

.ghekko-contact-hub * {
    box-sizing: border-box;
}

/* Floating contact button */

.ghekko-contact-hub .gch-toggle {
    width: var(--gch-button-size);
    height: var(--gch-button-size);
    margin-left: auto;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(
        circle at 35% 25%,
        color-mix(in srgb, var(--gch-primary), #fff 18%) 0%,
        var(--gch-primary) 50%,
        color-mix(in srgb, var(--gch-primary), #000 21%) 100%
    );
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow:
        0 6px 18px rgba(0, 0, 0, .2),
        0 3px 10px color-mix(in srgb, var(--gch-primary) 15%, transparent);
    transition: transform .25s ease, box-shadow .25s ease;
}

.ghekko-contact-hub.gch-side-left .gch-toggle {
    margin-left: 0;
}

.ghekko-contact-hub .gch-toggle:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow:
        0 10px 24px rgba(0, 0, 0, .25),
        0 5px 15px color-mix(in srgb, var(--gch-primary) 25%, transparent);
}

.ghekko-contact-hub .gch-toggle:active {
    transform: scale(.95);
}

.ghekko-contact-hub .gch-toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ghekko-contact-hub .gch-icon-close,
.ghekko-contact-hub.gch-open .gch-icon-chat {
    display: none;
}

.ghekko-contact-hub.gch-open .gch-icon-close {
    display: flex;
}

/* Contact panel */

.ghekko-contact-hub .gch-panel {
    position: absolute;
    right: 0;
    bottom: calc(var(--gch-button-size) + 15px);
    width: var(--gch-width);
    max-width: calc(100vw - 36px);
    max-height: calc(100dvh - 120px);
    overflow: auto;
    overscroll-behavior: contain;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .06);
    border-radius: 18px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, .18), 0 4px 12px rgba(0, 0, 0, .06);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(15px) scale(.96);
    transform-origin: bottom right;
    transition: opacity .25s ease, transform .25s ease, visibility .25s ease;
}

.ghekko-contact-hub.gch-side-left .gch-panel {
    right: auto;
    left: 0;
    transform-origin: bottom left;
}

.ghekko-contact-hub.gch-open .gch-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    /* Visible at once, so the close button can take focus when the panel opens. */
    transition: opacity .25s ease, transform .25s ease, visibility 0s;
}

/* Header */

.ghekko-contact-hub .gch-header {
    padding: 22px 24px;
    background: radial-gradient(
        ellipse at center,
        color-mix(in srgb, var(--gch-header), #fff 7%) 0%,
        var(--gch-header) 55%,
        color-mix(in srgb, var(--gch-header), #000 42%) 100%
    );
    color: #fff;
}

.ghekko-contact-hub .gch-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.ghekko-contact-hub .gch-brand {
    font-size: 23px;
    font-weight: 800;
    letter-spacing: .5px;
    color: #fff;
}

.ghekko-contact-hub .gch-close {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 5px;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    opacity: .8;
    transition: opacity .2s ease;
}

.ghekko-contact-hub .gch-close:hover {
    opacity: 1;
}

.ghekko-contact-hub .gch-header-title {
    margin: 0 0 8px;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
}

.ghekko-contact-hub .gch-header-text {
    margin: 0;
    color: rgba(255, 255, 255, .8);
    font-size: 14px;
}

/* Contact items */

.ghekko-contact-hub .gch-items {
    padding: 0 15px;
    background: #fff;
}

.ghekko-contact-hub .gch-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 8px;
    color: #202020;
    text-decoration: none !important;
    transition: background .2s ease, transform .2s ease;
}

.ghekko-contact-hub .gch-item + .gch-item {
    border-top: 1px solid #e8e8e8;
}

.ghekko-contact-hub .gch-item:hover {
    background: #fafafa;
    color: #202020;
    transform: translateX(3px);
}

.ghekko-contact-hub .gch-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    min-width: 30px;
    color: var(--gch-primary);
}

.ghekko-contact-hub .gch-item-whatsapp .gch-item-icon {
    color: var(--gch-whatsapp);
}

.ghekko-contact-hub .gch-item-content {
    flex: 1;
    min-width: 0;
}

.ghekko-contact-hub .gch-item-title {
    display: block;
    margin-bottom: 3px;
    font-size: 16px;
    font-weight: 600;
    color: #202020;
}

.ghekko-contact-hub .gch-item-description {
    display: block;
    font-size: 13px;
    color: #666;
    overflow-wrap: anywhere;
}

.ghekko-contact-hub .gch-item-arrow {
    display: flex;
    color: #888;
    transition: color .2s ease, transform .2s ease;
}

.ghekko-contact-hub .gch-item:hover .gch-item-arrow {
    color: var(--gch-primary);
    transform: translateX(3px);
}

/* Footer */

.ghekko-contact-hub .gch-footer {
    padding: 14px 20px;
    background: #f5f5f5;
    border-top: 1px solid #eee;
    color: #666;
    font-size: 12px;
    text-align: center;
}

/* Keyboard accessibility */

.ghekko-contact-hub button:focus-visible,
.ghekko-contact-hub a:focus-visible {
    outline: 2px solid var(--gch-primary);
    outline-offset: 3px;
}

/* Mobile */

@media (max-width: 640px) {
    .ghekko-contact-hub {
        --gch-button-size: calc(var(--gch-size) * .9);

        right: min(var(--gch-x), 14px);
        bottom: calc(min(var(--gch-y), 14px) + env(safe-area-inset-bottom, 0px));
    }

    .ghekko-contact-hub.gch-side-left {
        right: auto;
        left: min(var(--gch-x), 14px);
    }

    .ghekko-contact-hub .gch-panel {
        width: min(var(--gch-width), 320px);
        max-width: calc(100vw - 28px);
        max-height: calc(100dvh - 110px);
        border-radius: 15px;
    }

    .ghekko-contact-hub .gch-header {
        padding: 18px 20px;
    }

    .ghekko-contact-hub .gch-item {
        padding: 16px 5px;
    }
}

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
    .ghekko-contact-hub *,
    .ghekko-contact-hub *::before,
    .ghekko-contact-hub *::after {
        transition: none !important;
        animation: none !important;
    }
}
