/* --------------------------------------------------
   1. SCREEN READER ONLY CLASS
   -------------------------------------------------- */
/* Hides content visually but keeps it accessible to screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Allow screen reader only text to be focusable when navigated to via keyboard */
.sr-only-focusable:focus,
.sr-only-focusable:active {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
}


/* --------------------------------------------------
   2. SKIP LINK
   -------------------------------------------------- */
.skip-link {
    position: fixed;
    left: 20px;
    top: -100px;

    background-color: #f4a925;
    color: #fff !important;
    padding: 12px 35px;

    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    white-space: nowrap;

    border-radius: 0 0 35px 35px;

    border: none;
    outline: none;

    z-index: 9999;
    transition: top 0.3s ease, transform 0.3s ease;
}

.skip-link:focus {
    top: 0;

    transform: scale(1.02);

    outline: none;
    border: none;
}

.skip-link:hover {
    background-color: #e09820;
    transform: scale(1.02);
}

.skip-link:active {
    transform: scale(0.98);
}


/* --------------------------------------------------
   3. FOCUS INDICATORS
   -------------------------------------------------- */
*:focus {
    outline: 2px solid transparent;
}

*:focus-visible {
    outline: 3px solid #3498db;
    outline-offset: 2px;
}

/* Enhanced focus for specific interactive elements */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #3498db;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

/* Special focus for buttons */
button:focus-visible {
    position: relative;
}

/* Focus for custom checkbox/radio buttons */
input[type="checkbox"]:focus-visible + label,
input[type="radio"]:focus-visible + label {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}


/* --------------------------------------------------
   4. BUTTON ACCESSIBILITY
   -------------------------------------------------- */
/* Ensure buttons look clickable */
button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* For buttons that look like links */
button.link-style {
    background: none;
    border: none;
    color: inherit;
    text-decoration: underline;
    padding: 0;
}

/* Subscore toggle button accessibility */
.subscore-toggle-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    width: auto;
}

.subscore_expander {
    cursor: pointer;
    padding: 4px 8px;
    min-width: 30px;
    min-height: 30px; /* Ensure minimum touch target size */
}


/* --------------------------------------------------
   5. TOUCH TARGET SIZES
   -------------------------------------------------- */
/* WCAG 2.1 requires minimum 44x44px touch targets */
button,
a,
.btn-zum-merkzettel {
    min-width: 44px;
    min-height: 44px;
}

button.filter-delete-btn {
    min-width: 24px;
    min-height: 24px;
}

.therapist-and-license-buttons a {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* For checkboxes and radios, ensure the LABEL provides adequate touch target */
input[type="checkbox"],
input[type="radio"] {
    /* Keep native size or use reasonable custom size */
    width: 18px;
    height: 18px;
    margin: 0;
    flex-shrink: 0;
}

/* Ensure labels have adequate padding for touch targets - ONLY in forms and filter areas */
form input[type="checkbox"] + label,
form input[type="radio"] + label,
.input_filter_container input[type="checkbox"] + label,
.input_filter_container input[type="radio"] + label,
fieldset input[type="checkbox"] + label,
fieldset input[type="radio"] + label {
    display: inline-block;
    padding: 4px 8px;
    line-height: 20px;
    cursor: pointer;
    vertical-align: middle;
}

/* Exception for inline text links */
a:not([class]) {
    min-width: auto;
    min-height: auto;
}

/* --------------------------------------------------
   6. REDUCED MOTION SUPPORT
   -------------------------------------------------- */
/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}


/* --------------------------------------------------
   7. HIGH CONTRAST MODE SUPPORT
   -------------------------------------------------- */
/* Ensure borders are visible in high contrast mode */
@media (prefers-contrast: more) {
    button,
    input,
    select,
    textarea {
        border: 2px solid currentColor !important;
    }

    * {
        outline-color: currentColor !important;
    }
}


/* --------------------------------------------------
   8. FORCED COLORS MODE (Windows High Contrast)
   -------------------------------------------------- */
@media (forced-colors: active) {
    .skip-link:focus {
        forced-color-adjust: none;
        background: ButtonText;
        color: ButtonFace;
    }
}


/* --------------------------------------------------
   9. FORM LABELS & FIELDSETS
   -------------------------------------------------- */
/* Ensure labels are properly styled */
label {
    cursor: pointer;
    display: inline-block;
}

/* Fieldset styling */
fieldset {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

legend {
    padding: 0 10px;
    font-weight: bold;
}

/* Make fieldsets accessible without visual borders when needed */
fieldset.no-border {
    border: none;
    padding: 0;
    margin: 0;
}

fieldset.no-border legend {
    padding: 0;
}


/* --------------------------------------------------
   10. ARIA LIVE REGIONS
   -------------------------------------------------- */
/* Ensure live regions don't cause visual jumps */
[aria-live="polite"],
[aria-live="assertive"],
[role="status"],
[role="alert"] {
    position: relative;
}


/* --------------------------------------------------
   11. TABLE ACCESSIBILITY
   -------------------------------------------------- */
/* Better table caption visibility */
caption {
    padding: 10px;
    font-weight: bold;
    text-align: left;
}

/* Ensure table headers stand out */
th {
    font-weight: bold;
    text-align: left;
}


/* --------------------------------------------------
   12. IMAGE ACCESSIBILITY
   -------------------------------------------------- */
/* Ensure decorative images are properly hidden */
img[alt=""],
img[alt=" "],
img[role="presentation"] {
    /* Decorative images should have empty alt */
}

/* --------------------------------------------------
   13. NAVIGATION IMPROVEMENTS
   -------------------------------------------------- */
/* Pagination accessibility */
nav[aria-label="Seitennummerierung"] a[aria-current="page"] {
    font-weight: bold;
    text-decoration: underline;
}

/* Filter navigation */
nav[aria-label="Produktfilter"] {
    /* Ensure filter navigation is clearly defined */
}


/* --------------------------------------------------
   14. MODAL/DIALOG ACCESSIBILITY
   -------------------------------------------------- */
/* When modals are open, prevent background scrolling */
body.modal-open {
    overflow: hidden;
}

/* Focus trap for modals */
.modal-content:focus {
    outline: none;
}


/* --------------------------------------------------
   15. LINK STYLING
   -------------------------------------------------- */
/* Ensure links are distinguishable from text */
a {
    text-decoration: underline;
}

a:hover,
a:focus {
    text-decoration: none;
}

/* External links indicator (optional but helpful) */
a[target="_blank"]::after {
    content: " ↗";
    font-size: 0.8em;
    vertical-align: super;
}

/* Exception for buttons styled as links */
.button-link::after {
    content: none;
}


/* --------------------------------------------------
   16. COLOR CONTRAST
   -------------------------------------------------- */
/* Ensure minimum contrast ratios (4.5:1 for normal text) */
/* Check your specific colors with a contrast checker */
/* Example: */
.text-muted {
    color: #666; /* Ensure this meets 4.5:1 against background */
}


/* --------------------------------------------------
   17. ERROR MESSAGES & VALIDATION
   -------------------------------------------------- */
/* Make error messages clearly visible */
.error-message,
[aria-invalid="true"] {
    border-color: #d32f2f;
}

.error-text {
    color: #d32f2f;
    font-weight: bold;
}


/* --------------------------------------------------
   18. LOADING STATES
   -------------------------------------------------- */
/* Loading indicators */
[aria-busy="true"] {
    cursor: wait;
    opacity: 0.6;
}

.loading-spinner {
    /* Add spinner animation if needed */
}


/* --------------------------------------------------
   19. RESPONSIVE FONT SIZES
   -------------------------------------------------- */
/* Ensure text can be resized up to 200% */
html {
    font-size: 100%; /* Use relative units */
}

@media (max-width: 768px) {
    html {
        font-size: 100%; /* Don't make it smaller on mobile */
    }
}


/* --------------------------------------------------
   20. PRINT STYLES
   -------------------------------------------------- */
@media print {
    .skip-link,
    .btn-zum-merkzettel,
    button,
    nav {
        display: none;
    }

    a[href]::after {
        content: " (" attr(href) ")";
    }
}


/* --------------------------------------------------
   21. SPECIFIC COMPONENT FIXES
   -------------------------------------------------- */

/* Filter mobile button */
#filterlink_mobil {
    width: 100%;
    text-align: center;
    padding: 12px;
    background: var(--main-color2, #3498db);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
}

#filterlink_mobil:hover,
#filterlink_mobil:focus-visible {
    background: #2980b9;
}

/* Product buttons */
.product-btn {
    min-height: 44px;
    padding: 8px 16px;
}

/* Merkzettel button */
.btn-zum-merkzettel {
    background: transparent;
    border: 2px solid transparent;
    border-radius: 4px;
    padding: 8px;
}

.btn-zum-merkzettel:hover,
.btn-zum-merkzettel:focus-visible {
    background: rgba(244, 169, 37, 0.1);
    border-color: #f4a925;
}


/* --------------------------------------------------
   22. UTILITY CLASSES
   -------------------------------------------------- */

/* Visually hidden but available to screen readers */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus within container */
.focus-within:focus-within {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* --------------------------------------------------
   23. SLICK SLIDER ACCESSIBILITY (NEW)
   -------------------------------------------------- */
.slick-slider .slick-dots li button:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.slick-arrow:focus {
    outline: 3px solid #3498db;
    outline-offset: 2px;
    z-index: 100;
}

/* --------------------------------------------------
   24. HIGHLIGHT CIRCLES (NEW - for homepage)
   -------------------------------------------------- */
.highlight-circle {
    /* Ensure animations respect motion preferences */
}

@media (prefers-reduced-motion: reduce) {
    .highlight-circle.in-view .circle-svg circle {
        animation: none;
        stroke-dasharray: 596.9 596.9;
    }
}

/* --------------------------------------------------
   25. PRODUCT PREVIEW TILES (NEW)
   -------------------------------------------------- */
.product-preview-tile:focus-within {
    box-shadow: 0 0 0 3px #3498db;
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* --------------------------------------------------
   26. BLOG PREVIEW CARDS (NEW)
   -------------------------------------------------- */
.blog-preview-item:focus-within {
    outline: 2px solid #3498db;
    outline-offset: 2px;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

/* --------------------------------------------------
   27. INFO DIALOG IMPROVEMENTS (NEW)
   -------------------------------------------------- */
#info_dialog[aria-hidden="true"] {
    display: none;
}

#info_dialog[aria-hidden="false"] {
    display: block;
}

.info-icon:focus {
    outline: 3px solid #fff;
    outline-offset: 2px;
}
