/* ============================================================
   Titanium — Accessibility widget + a11y modes
   תקן ישראלי ת"י 5568 / WCAG 2.1 AA
   ============================================================ */

/* ---- כפתור צף ---- */
/* יושב מעל מחסנית כפתורי יצירת-הקשר הצפים (וואטסאפ/טלפון/וויז) שבפוטר — לכן bottom גבוה */
.a11y-toggle {
	position: fixed; bottom: 82px; left: 22px; right: auto; z-index: 9998;
	width: 44px; height: 44px; border-radius: 50%; border: 0;
	background: #16222e; color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.3);
	display: inline-flex; align-items: center; justify-content: center; transition: transform .2s, bottom .25s ease;
}
.a11y-toggle svg { width: 24px; height: 24px; }
.a11y-toggle:hover { transform: scale(1.08); }
.a11y-toggle:focus-visible { outline: 3px solid #ffd700; outline-offset: 3px; }
/* במובייל: כפתור נגישות קטן (לפי בקשת הלקוחה — לא לתפוס מקום על תמונת המוצר); כשהמחסנית מכווצת נצמד לפינה */
@media (max-width: 680px) {
	.a11y-toggle { bottom: 200px; left: 14px; width: 34px; height: 34px; }
	.a11y-toggle svg { width: 19px; height: 19px; }
	.ti-fc-collapsed .a11y-toggle { bottom: 60px; }
}

/* ---- פאנל ---- */
.a11y-panel {
	position: fixed; inset-block: 0; left: 0; right: auto; z-index: 9999;
	width: min(360px, 92vw); background: #fff; color: #1a1a1a;
	box-shadow: 0 0 40px rgba(0,0,0,.35); overflow-y: auto;
	transform: translateX(-105%); transition: transform .25s ease;
	font-family: 'Heebo', Arial, sans-serif; direction: rtl;
}
.a11y-panel:not([hidden]) { display: block; }
.a11y-widget.is-open .a11y-panel { transform: translateX(0); }

.a11y-panel__head {
	display: flex; align-items: center; justify-content: space-between;
	background: #1c5fb4; color: #fff; padding: 16px 20px;
}
.a11y-panel__title { margin: 0; color: #fff; font-size: 1.25rem; }
.a11y-close { background: none; border: 0; color: #fff; font-size: 1.4rem; line-height: 1; padding: 4px 8px; }
.a11y-close:hover { color: #ffd700; }

.a11y-panel__body { padding: 18px 20px 28px; }
.a11y-group { margin-bottom: 20px; }
.a11y-group__label { display: block; font-weight: 700; margin-bottom: 10px; color: #1a1a1a; }

.a11y-fontsize { display: flex; gap: 8px; }
.a11y-btn {
	flex: 1; padding: 12px; border: 2px solid #d0d0d0; border-radius: 8px; background: #f6f6f6;
	font-weight: 700; font-size: 1rem; color: #1a1a1a; transition: .15s;
}
.a11y-btn:hover { border-color: #1c5fb4; background: #eaf2fb; }

.a11y-toggles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.a11y-tile {
	display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
	padding: 14px 8px; border: 2px solid #d0d0d0; border-radius: 10px; background: #fff;
	font-size: .9rem; color: #1a1a1a; transition: .15s; min-height: 84px; justify-content: center;
}
.a11y-tile:hover { border-color: #1c5fb4; background: #eaf2fb; }
.a11y-tile[aria-pressed="true"] { border-color: #1c5fb4; background: #1c5fb4; color: #fff; }
.a11y-tile__icon { font-size: 1.4rem; line-height: 1; }
.a11y-tile__label { font-weight: 600; }

.a11y-panel__foot { margin-top: 8px; display: flex; flex-direction: column; gap: 12px; }
.a11y-reset {
	padding: 12px; border: 2px solid #b3261e; border-radius: 8px; background: #fff; color: #b3261e;
	font-weight: 700; font-size: 1rem;
}
.a11y-reset:hover { background: #b3261e; color: #fff; }
.a11y-statement { text-align: center; font-weight: 700; color: #1c5fb4; text-decoration: underline; }

/* ---- מדריך קריאה ---- */
.a11y-reading-guide {
	position: fixed; inset-inline: 0; height: 40px; z-index: 9997; pointer-events: none;
	background: rgba(28,95,180,.18); border-block: 2px solid #1c5fb4; display: none;
}
body.a11y--reading-guide .a11y-reading-guide { display: block; }

/* ============================================================
   מצבי נגישות (מוחלים על <body> ע"י JS)
   ============================================================ */

/* ניגודיות גבוהה */
body.a11y--contrast, body.a11y--contrast * {
	background-color: #000 !important; color: #fff !important; border-color: #fff !important;
}
body.a11y--contrast a, body.a11y--contrast a * { color: #ffff00 !important; }
body.a11y--contrast img { filter: grayscale(1) contrast(1.2); }

/* מצב כהה */
body.a11y--dark { background: #121212 !important; }
body.a11y--dark, body.a11y--dark p, body.a11y--dark li, body.a11y--dark span, body.a11y--dark h1,
body.a11y--dark h2, body.a11y--dark h3, body.a11y--dark h4 { color: #eaeaea !important; }
body.a11y--dark .site-header, body.a11y--dark .header-main,
body.a11y--dark .review-card, body.a11y--dark li.product { background: #1e1e1e !important; }

/* מצב בהיר (ביטול רקעים כהים) */
body.a11y--light .hero, body.a11y--light .why-card,
body.a11y--light .site-footer, body.a11y--light .topbar { background: #f2f2f2 !important; }
body.a11y--light .hero *, body.a11y--light .why-card *,
body.a11y--light .site-footer *, body.a11y--light .topbar * { color: #1a1a1a !important; }

/* גווני אפור */
body.a11y--grayscale { filter: grayscale(1); }

/* הדגשת קישורים */
body.a11y--links a { outline: 2px solid #1c5fb4 !important; text-decoration: underline !important; background: #fff3cd !important; color: #0033a0 !important; }

/* פונט קריא */
body.a11y--readable-font, body.a11y--readable-font * { font-family: Arial, "Times New Roman", sans-serif !important; letter-spacing: .02em !important; }

/* סמן גדול */
body.a11y--big-cursor, body.a11y--big-cursor * {
	cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path fill="black" stroke="white" stroke-width="2" d="M8 4l30 18-13 3 8 14-5 3-8-14-9 9z"/></svg>') 4 4, auto !important;
}

/* עצירת אנימציות */
body.a11y--stop-motion *, body.a11y--stop-motion *::before, body.a11y--stop-motion *::after {
	animation: none !important; transition: none !important; scroll-behavior: auto !important;
}

@media (max-width: 520px) {
	.a11y-toggle { width: 34px; height: 34px; bottom: 200px; left: 14px; }
	.a11y-toggle svg { width: 19px; height: 19px; }
	.ti-fc-collapsed .a11y-toggle { bottom: 60px; }
}
