/* Site widgets: floating contact buttons, FAQ fallback, map, search form.
   Loaded once per page by resources/views/partials/widgets/*.blade.php. */

/* ---------- Floating contact buttons (Chaty replacement) ---------- */
.sw-chaty {
    --sw-chaty-size: 54px;
    position: fixed;
    bottom: calc(var(--sw-chaty-bottom, 25px) + env(safe-area-inset-bottom, 0px));
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    font-family: inherit;
    line-height: 1.2;
}
.sw-chaty--right { right: var(--sw-chaty-side, 25px); }
.sw-chaty--left { left: var(--sw-chaty-side, 25px); align-items: flex-start; }

.sw-chaty__channels {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.sw-chaty__item { margin: 0; padding: 0; list-style: none; }

/* With JavaScript the list is collapsed until the main button is pressed;
   without it the buttons simply stay visible. */
.sw-chaty.is-ready .sw-chaty__channels {
    visibility: hidden;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
}
.sw-chaty.is-ready.is-open .sw-chaty__channels {
    visibility: visible;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    transition: opacity .2s ease, transform .2s ease;
}

#top .sw-chaty__channel,
#top .sw-chaty__toggle,
.sw-chaty__channel,
.sw-chaty__toggle {
    position: relative;
    display: block;
    width: var(--sw-chaty-size);
    height: var(--sw-chaty-size);
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.sw-chaty__circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--sw-chaty-color, #03E78B);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
    transition: transform .15s ease, box-shadow .15s ease;
}
.sw-chaty__circle--main { background: var(--sw-chaty-main, #000); }
.sw-chaty__svg { width: 55%; height: 55%; display: block; }
.sw-chaty__dot { fill: var(--sw-chaty-main, #000); }

.sw-chaty__channel:hover .sw-chaty__circle,
.sw-chaty__toggle:hover .sw-chaty__circle { transform: scale(1.06); box-shadow: 0 4px 12px rgba(0, 0, 0, .3); }

.sw-chaty__channel:focus-visible,
.sw-chaty__toggle:focus-visible { outline: 3px solid #2177de; outline-offset: 3px; }

.sw-chaty__close-icon { display: none; }
.sw-chaty.is-open .sw-chaty__open-icon { display: none; }
.sw-chaty.is-open .sw-chaty__close-icon { display: contents; }
.sw-chaty__open-icon { display: contents; }

.sw-chaty__badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    box-sizing: border-box;
    border-radius: 10px;
    background: #dd0000;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}
.sw-chaty--left .sw-chaty__badge { right: auto; left: -3px; }
.sw-chaty.is-open .sw-chaty__badge,
.sw-chaty.is-seen .sw-chaty__badge { display: none; }

/* Tooltip label next to a button */
.sw-chaty__tip {
    position: absolute;
    top: 50%;
    right: calc(100% + 12px);
    transform: translateY(-50%);
    padding: 6px 10px;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 14px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .15s ease;
}
.sw-chaty--left .sw-chaty__tip { right: auto; left: calc(100% + 12px); }
.sw-chaty__channel:hover .sw-chaty__tip,
.sw-chaty__channel:focus-visible .sw-chaty__tip,
.sw-chaty__toggle:hover .sw-chaty__tip,
.sw-chaty__toggle:focus-visible .sw-chaty__tip { opacity: 1; visibility: visible; }

/* Touch screens have no hover: show channel labels while the list is open. */
@media (hover: none) {
    .sw-chaty.is-open .sw-chaty__channels .sw-chaty__tip { opacity: 1; visibility: visible; }
    .sw-chaty__toggle .sw-chaty__tip { display: none; }
}

/* Attention effect ("blink" in the original widget) */
.sw-chaty--attention:not(.is-open):not(.is-seen) .sw-chaty__toggle .sw-chaty__circle,
.sw-chaty--attention.sw-chaty--single .sw-chaty__circle { animation: sw-chaty-blink 1s ease-in-out 3; }
@keyframes sw-chaty-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: .35; }
}
@media (prefers-reduced-motion: reduce) {
    .sw-chaty *, .sw-chaty.is-ready .sw-chaty__channels { animation: none !important; transition: none !important; }
}

@media (max-width: 479px) {
    .sw-chaty { --sw-chaty-size: 50px; }
    .sw-chaty--right { right: min(var(--sw-chaty-side, 25px), 16px); }
    .sw-chaty--left { left: min(var(--sw-chaty-side, 25px), 16px); }
}

@media print { .sw-chaty { display: none !important; } }

/* ---------- FAQ (fallback when Enfold's toggle script is not loaded) ---------- */
.sw-faq-js .toggle_wrap {
    display: none;
    position: static;
    visibility: visible;
    left: 0;
    width: auto;
}
.sw-faq-js .toggle_wrap.active_tc { display: block; }
.sw-faq-js .toggler { cursor: pointer; }
.sw-faq-js .toggler:focus-visible { outline: 2px solid #2177de; outline-offset: 2px; }

/* ---------- Map ---------- */
.sw-map { width: 100%; max-width: 100%; overflow: hidden; }
.sw-map iframe { display: block; width: 100%; max-width: 100%; border: 0; }
.sw-map__frame { height: var(--sw-map-height, 450px); }

/* ---------- Search form (variant "page") ---------- */
.sw-search {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: stretch;
    max-width: 640px;
    margin: 0 0 30px;
}
.sw-search__label {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
#top .sw-search__input,
.sw-search__input {
    flex: 1 1 220px;
    min-width: 0;
    margin: 0;
    padding: 12px 14px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #fff;
    color: #333;
}
#top .sw-search__button,
.sw-search__button {
    flex: 0 0 auto;
    margin: 0;
    padding: 12px 24px;
    border: 0;
    border-radius: 3px;
    font-size: 15px;
    cursor: pointer;
}
