/* ============================================================
   Aviv Accessibility widget — button + panel styling
   ============================================================ */
#aviv-a11y-root {
    --aviv-a11y-primary: #1e88e5;
    position: fixed;
    z-index: 2147483000; /* above sticky bars, chat widgets, elementor overlays */
    direction: rtl;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Assistant", Arial, sans-serif;
}

/* Positioning */
#aviv-a11y-root[data-position="bottom-right"] { bottom: 20px; right: 20px; }
#aviv-a11y-root[data-position="bottom-left"]  { bottom: 20px; left: 20px; }
#aviv-a11y-root[data-position="top-right"]    { top:    20px; right: 20px; }
#aviv-a11y-root[data-position="top-left"]     { top:    20px; left: 20px; }

/* Toggle button */
#aviv-a11y-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--aviv-a11y-primary);
    color: #fff;
    border: 3px solid #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.24);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s ease, box-shadow .2s ease;
    padding: 0;
}
#aviv-a11y-toggle:hover,
#aviv-a11y-toggle:focus-visible {
    transform: scale(1.08);
    box-shadow: 0 6px 22px rgba(0,0,0,0.32);
    outline: 3px solid #ffdd00;
    outline-offset: 2px;
}

/* Panel */
#aviv-a11y-panel {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: min(360px, calc(100vw - 40px));
    max-height: min(85vh, 720px);
    overflow-y: auto;
    background: #fff;
    color: #202020;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.28);
    padding: 0;
    animation: aviv-a11y-in 0.18s ease-out;
}
#aviv-a11y-root[data-position^="bottom-left"] #aviv-a11y-panel { right: auto; left: 0; }
#aviv-a11y-root[data-position^="top-"] #aviv-a11y-panel { bottom: auto; top: 72px; }

@keyframes aviv-a11y-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

#aviv-a11y-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--aviv-a11y-primary);
    color: #fff;
    border-radius: 14px 14px 0 0;
}
#aviv-a11y-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}
#aviv-a11y-close {
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}
#aviv-a11y-close:hover,
#aviv-a11y-close:focus-visible {
    background: rgba(255,255,255,0.2);
    outline: 2px solid #ffdd00;
    outline-offset: 1px;
}

#aviv-a11y-body { padding: 12px 16px 20px; }
#aviv-a11y-body section {
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
#aviv-a11y-body section:last-of-type { border-bottom: 0; }
#aviv-a11y-body h3 {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 8px;
    color: #666;
    text-transform: none;
}

/* Row layouts */
.aviv-a11y-btnrow {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
}
.aviv-a11y-btnrow-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

/* Buttons inside the panel */
#aviv-a11y-body button[data-action],
#aviv-a11y-body button[data-toggle] {
    background: #f4f6f8;
    border: 1px solid #d8dde3;
    color: #222;
    padding: 10px 8px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.05s ease;
    line-height: 1.2;
    min-height: 44px;
}
#aviv-a11y-body button:hover {
    background: #e8eef4;
}
#aviv-a11y-body button:focus-visible {
    outline: 3px solid #ffdd00;
    outline-offset: 2px;
}
#aviv-a11y-body button.is-active,
#aviv-a11y-body button[aria-pressed="true"] {
    background: var(--aviv-a11y-primary);
    color: #fff;
    border-color: var(--aviv-a11y-primary);
}

/* Reset + statement link */
#aviv-a11y-actions {
    padding-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
#aviv-a11y-reset {
    background: #fff5f5;
    color: #c92a2a;
    border: 1px solid #ffc9c9;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    min-height: 44px;
}
#aviv-a11y-reset:hover { background: #ffe3e3; }
#aviv-a11y-reset:focus-visible { outline: 3px solid #ffdd00; outline-offset: 2px; }

#aviv-a11y-statement-link {
    text-align: center;
    color: var(--aviv-a11y-primary);
    text-decoration: underline;
    font-size: 13px;
    padding: 6px;
}
#aviv-a11y-statement-link:focus-visible { outline: 3px solid #ffdd00; outline-offset: 2px; }

/* Mobile tuning */
@media (max-width: 480px) {
    #aviv-a11y-toggle { width: 52px; height: 52px; }
    #aviv-a11y-panel { width: calc(100vw - 24px); max-height: 80vh; }
}

/* Print — hide widget */
@media print {
    #aviv-a11y-root { display: none !important; }
}
