/*
 * AMS Contact FAB — speed-dial floating contact button.
 * Sits bottom-right above .ams-search-fab. Hides when mobile drawer is open
 * (body.ams-body--menu-open). Items animate up with stagger when expanded.
 */

.ams-cfab {
    position: fixed;
    left: 24px;
    bottom: 24px; /* bottom-left corner (was right) — a11y trigger removed, slot is free */
    z-index: 9998;
    font-family: var(--ams-font-sans, "Mulish", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
}

/* Hide when mobile menu drawer is open */
body.ams-body--menu-open .ams-cfab { display: none !important; }

/* ============================================================
   Trigger
   ============================================================ */

.ams-cfab__trigger,
button.ams-cfab__trigger {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 0;
    background: var(--ams-burgundy-500, #8B0030);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(26, 23, 21, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.18s ease, background 0.15s ease, box-shadow 0.18s ease;
    padding: 0;
    min-height: 0;
}
.ams-cfab__trigger:hover,
button.ams-cfab__trigger:hover {
    background: var(--ams-burgundy-700, #67000C);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(26, 23, 21, 0.3);
}
.ams-cfab__trigger:focus-visible,
button.ams-cfab__trigger:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.ams-cfab__icon-open,
.ams-cfab__icon-closed {
    position: absolute;
    inset: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.18s ease, transform 0.18s ease;
}
.ams-cfab__icon-open  { opacity: 0; transform: rotate(-90deg); }
.ams-cfab__icon-closed { opacity: 1; transform: rotate(0deg); }

.ams-cfab[data-state="open"] .ams-cfab__icon-closed { opacity: 0; transform: rotate(90deg); }
.ams-cfab[data-state="open"] .ams-cfab__icon-open   { opacity: 1; transform: rotate(0deg); }

/* ============================================================
   Menu
   ============================================================ */

.ams-cfab__menu {
    position: absolute;
    bottom: calc(100% + 22px); /* extra gap so "Pokliči" (closest item) is not adjacent to trigger */
    left: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column-reverse; /* topmost item = last channel */
    gap: 10px;
    min-width: 240px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}
.ams-cfab[data-state="open"] .ams-cfab__menu {
    opacity: 1;
    pointer-events: auto;
}

.ams-cfab__menu li {
    transform: translateY(8px);
    opacity: 0;
    transition: transform 0.22s ease, opacity 0.22s ease;
    transition-delay: 0ms;
}
.ams-cfab[data-state="open"] .ams-cfab__menu li {
    transform: translateY(0);
    opacity: 1;
    /* Stagger by index — set inline via --ams-cfab-i */
    transition-delay: calc(var(--ams-cfab-i, 0) * 35ms + 40ms);
}

/* Individual channel item */
.ams-cfab__item {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px 10px 12px;
    background: #fff;
    color: var(--ams-gray-900, #1A1715);
    border-radius: 999px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    box-shadow: 0 4px 12px rgba(26, 23, 21, 0.18);
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
    min-height: 44px;
    box-sizing: border-box;
}
.ams-cfab__item:hover,
.ams-cfab__item:focus-visible {
    background: var(--ams-burgundy-500, #8B0030);
    color: #fff;
    transform: translateX(4px); /* slide right (was -4 for right-anchored layout) */
    text-decoration: none;
}
.ams-cfab__item:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.ams-cfab__item-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ams-cream, #FAF7F2);
    color: var(--ams-burgundy-500, #8B0030);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}
.ams-cfab__item:hover .ams-cfab__item-icon,
.ams-cfab__item:focus-visible .ams-cfab__item-icon {
    background: #fff;
    color: var(--ams-burgundy-500, #8B0030);
}

.ams-cfab__item-text {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
}
.ams-cfab__item-label {
    font-weight: 700;
    letter-spacing: 0.02em;
}
.ams-cfab__item-sub {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.72;
}

/* ============================================================
   Mobile
   ============================================================ */
@media (max-width: 768px) {
    .ams-cfab { left: 16px; bottom: 16px; }
    .ams-cfab__menu { min-width: 220px; }
    .ams-cfab__item { font-size: 13px; padding: 8px 14px 8px 10px; }
    .ams-cfab__item-icon { flex-basis: 32px; width: 32px; height: 32px; }
    .ams-cfab__item-icon svg { width: 18px; height: 18px; }
}

/* Print: hide */
@media print { .ams-cfab { display: none !important; } }
