/* ─── Froppy Accessibility CSS ─────────────────────────────────────────────── */

/* Ekraanilugeritele nähtav, visuaalselt peidetud */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ─── Skip link ─────────────────────────────────────────────────────────────── */
.froppy-skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 99999;
    padding: 0.75rem 1.5rem;
    background: #0071a1;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 0 0 6px 6px;
    text-decoration: none;
    transition: top 0.15s ease;
}
.froppy-skip-link:focus {
    top: 0;
    outline: 3px solid #fff;
    outline-offset: 2px;
}

/* ─── Ujuv vidin ────────────────────────────────────────────────────────────── */
#froppy-a11y-bar {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    font-family: inherit;
}

#froppy-a11y-toggle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: #1a56db;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    transition: background 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
#froppy-a11y-toggle:hover,
#froppy-a11y-toggle:focus {
    background: #1440a8;
    transform: scale(1.08);
    outline: 3px solid #93c5fd;
    outline-offset: 2px;
}
#froppy-a11y-toggle[aria-expanded="true"] {
    background: #1440a8;
}

#froppy-a11y-tools {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 0.75rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    min-width: 160px;
}
#froppy-a11y-tools[hidden] {
    display: none !important;
}

#froppy-a11y-tools button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    font-size: 0.9rem;
    color: #111827;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, border-color 0.15s;
    width: 100%;
}
#froppy-a11y-tools button:hover,
#froppy-a11y-tools button:focus {
    background: #eff6ff;
    border-color: #93c5fd;
    outline: none;
}
#froppy-a11y-tools button[aria-pressed="true"] {
    background: #dbeafe;
    border-color: #1a56db;
    color: #1a56db;
    font-weight: 600;
}

/* TTS aktiivsuse animatsioon */
#froppy-tts-read.tts-active {
    background: #fee2e2;
    border-color: #ef4444;
    color: #dc2626;
    animation: froppy-pulse 1.5s ease-in-out infinite;
}
@keyframes froppy-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.7; }
}

/* ─── Kõrge kontrastsus ─────────────────────────────────────────────────────── */
body.froppy-high-contrast {
    background: #000 !important;
    color: #fff !important;
}
body.froppy-high-contrast a {
    color: #ffff00 !important;
}
body.froppy-high-contrast button,
body.froppy-high-contrast .button,
body.froppy-high-contrast .btn,
body.froppy-high-contrast input[type="submit"] {
    background: #ffff00 !important;
    color: #000 !important;
    border: 2px solid #fff !important;
}
body.froppy-high-contrast input,
body.froppy-high-contrast select,
body.froppy-high-contrast textarea {
    background: #000 !important;
    color: #fff !important;
    border: 2px solid #fff !important;
}
body.froppy-high-contrast img {
    filter: grayscale(30%) contrast(1.2);
}
body.froppy-high-contrast .woocommerce-Price-amount,
body.froppy-high-contrast .price {
    color: #00ff88 !important;
}

/* ─── Klaviatuuri fookus – globaalne parandus ───────────────────────────────── */
body:not(.froppy-high-contrast) *:focus-visible {
    outline: 3px solid #1a56db;
    outline-offset: 2px;
    border-radius: 3px;
}

/* WooCommerce spetsiifilised ARIA täiustused */
.woocommerce .quantity input[type="number"] {
    /* Tagame et number-input on klaviatuuriga hästi kasutatav */
    min-width: 60px;
}

/* Laoseis - visuaalne indikaator ekraanilugeritele */
.woocommerce .stock.in-stock {
    color: #15803d;
}
.woocommerce .stock.out-of-stock {
    color: #dc2626;
}
