/* ═══ FLOATING WIDGETS (chat + back to top) ═══ */
.ed-floating-widgets {
    position: fixed;
    right: 20px;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    /* Pod mini-košíkem a menu (dřív 9999 – tlačítka překrývala otevřený košík). */
    z-index: 950;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
}
.ed-floating-btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    transition: all 0.25s ease;
    position: relative;
    overflow: visible;
    padding: 0;
}
.ed-floating-btn svg {
    flex-shrink: 0;
}
.ed-floating-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22); }
.ed-chat-btn { background: linear-gradient(135deg, #3BC1F4, #2196f3); }
.ed-chat-btn::after {
    content: "";
    position: absolute;
    top: 6px; right: 6px;
    width: 10px; height: 10px;
    background: #10b981;
    border-radius: 50%;
    border: 2px solid #fff;
}
.ed-totop-btn {
    background: #fff;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    max-width: 44px;
    max-height: 44px;
    padding: 0;
    box-sizing: border-box;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
}
.ed-totop-btn.is-visible { opacity: 1; pointer-events: auto; }
.ed-totop-btn:hover { border-color: #3BC1F4; }

/* Chat panel */
.ed-chat-panel {
    position: fixed;
    right: 20px;
    bottom: 90px;
    width: 340px;
    max-width: calc(100vw - 40px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    z-index: 951;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease, visibility 0s linear 0.25s;
}
.ed-chat-panel.is-open {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.25s ease, opacity 0.25s ease, visibility 0s;
}
.ed-chat-header {
    background: linear-gradient(135deg, #3BC1F4, #2196f3);
    color: #fff;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ed-chat-header h3 { margin: 0; font-size: 16px; font-weight: 700; color: #fff; }
.ed-chat-header p { margin: 2px 0 0; font-size: 12px; color: rgba(255,255,255,0.85); }
.ed-chat-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    max-width: 32px;
    max-height: 32px;
    padding: 0;
    box-sizing: border-box;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}
.ed-chat-close:hover { background: rgba(255,255,255,0.35); }
.ed-chat-body { padding: 18px 20px 20px; }
.ed-chat-body label { display: block; font-size: 12px; font-weight: 600; color: #374151; margin-bottom: 5px; }
.ed-chat-body input[type=email],
.ed-chat-body textarea {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    margin-bottom: 12px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.ed-chat-body input[type=email]:focus,
.ed-chat-body textarea:focus { outline: none; border-color: #3BC1F4; }
.ed-chat-body textarea { resize: vertical; min-height: 90px; }
.ed-chat-submit {
    width: 100%;
    background: linear-gradient(135deg, #3BC1F4, #2196f3);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.ed-chat-submit:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(33,150,243,0.3); }
.ed-chat-submit:disabled { opacity: 0.6; cursor: wait; transform: none; }
.ed-chat-msg {
    margin-top: 10px;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
    display: none;
}
.ed-chat-msg.is-success { display: block; background: #d1fae5; color: #065f46; }
.ed-chat-msg.is-error   { display: block; background: #fee2e2; color: #991b1b; }

@media (max-width: 480px) {
    .ed-floating-widgets { right: 12px; bottom: 12px; }
    .ed-chat-panel { right: 12px; bottom: 80px; width: calc(100vw - 24px); }
}

/* Mobil: menší tlačítka blíž okraji, ať nezakrývají tlačítka v obsahu (V4). */
@media (max-width: 768px) {
    .ed-floating-widgets { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); gap: 10px; }
    .ed-chat-btn { width: 48px; height: 48px; }
    .ed-totop-btn { width: 40px; height: 40px; min-width: 40px; min-height: 40px; max-width: 40px; max-height: 40px; }
    .ed-chat-panel { right: 12px; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); max-width: calc(100vw - 24px); }
}

@media (prefers-reduced-motion: reduce) {
    .ed-floating-btn, .ed-chat-panel { transition: none; }
}
