/* =======================================
   ACCESSIBILITY TOOLS - COMPLETE STYLES
   ======================================= */

/* Toggle Button (Fixed Size) */
.accessibility-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 999998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background-color 0.2s;
    font-size: 16px !important;
}

.accessibility-toggle:hover {
    background: #333;
    transform: scale(1.1);
}

.accessibility-toggle:focus {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.accessibility-toggle svg {
    width: 28px !important;
    height: 28px !important;
    font-size: 16px !important;
}

/* Panel (Fixed Size) */
.accessibility-panel {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 320px;
    max-width: calc(100vw - 40px);
    background: #fff;
    border: 2px solid #000;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    z-index: 999999;
    font-size: 16px !important;
}

.accessibility-panel[hidden] {
    display: none;
}

/* Header */
.accessibility-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 2px solid #e0e0e0;
}

.accessibility-header h2 {
    margin: 0;
    font-size: 18px !important;
    font-weight: 600;
}

.accessibility-close {
    background: none;
    border: none;
    font-size: 24px !important;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.accessibility-close:hover {
    background: #f0f0f0;
}

.accessibility-close:focus {
    outline: 2px solid #000;
    outline-offset: 2px;
}

/* Content */
.accessibility-content {
    padding: 20px;
}

.accessibility-control {
    margin-bottom: 24px;
}

.accessibility-control:last-child {
    margin-bottom: 0;
}

.accessibility-control > label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 14px !important;
}

/* Buttons */
.accessibility-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.accessibility-btn {
    flex: 1;
    padding: 10px;
    background: #f5f5f5;
    border: 2px solid #000;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    min-height: 44px;
    font-size: 16px !important;
}

.accessibility-btn:hover {
    background: #e0e0e0;
}

.accessibility-btn:focus {
    outline: 3px solid #000;
    outline-offset: 2px;
}

.accessibility-value {
    font-weight: 600;
    min-width: 60px;
    text-align: center;
    font-size: 16px !important;
}

/* Toggle Button */
.accessibility-toggle-btn {
    width: 56px;
    height: 32px;
    background: #ddd;
    border: 2px solid #000;
    border-radius: 16px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 16px !important;
}

.accessibility-toggle-btn:focus {
    outline: 3px solid #000;
    outline-offset: 2px;
}

.accessibility-toggle-btn[aria-pressed="true"] {
    background: #000;
}

.toggle-indicator {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.accessibility-toggle-btn[aria-pressed="true"] .toggle-indicator {
    transform: translateX(24px);
}

/* Action Button (für Seitenstruktur) */
.accessibility-action-btn {
    width: 100%;
    padding: 12px;
    background: #f5f5f5;
    border: 2px solid #000;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    min-height: 44px;
    font-size: 16px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.accessibility-action-btn:hover {
    background: #e0e0e0;
}

.accessibility-action-btn:focus {
    outline: 3px solid #000;
    outline-offset: 2px;
}

.accessibility-action-btn svg {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0;
}

/* Reset Button */
.accessibility-reset {
    width: 100%;
    padding: 12px;
    background: #f5f5f5;
    border: 2px solid #000;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: background-color 0.2s;
    min-height: 44px;
    font-size: 16px !important;
}

.accessibility-reset:hover {
    background: #e0e0e0;
}

.accessibility-reset:focus {
    outline: 3px solid #000;
    outline-offset: 2px;
}

/* Footer with Link */
.accessibility-footer {
    padding: 16px 20px;
    border-top: 2px solid #e0e0e0;
    background: #f9f9f9;
}

.accessibility-info-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #000;
    text-decoration: none;
    font-size: 14px !important;
    font-weight: 500;
    transition: color 0.2s;
}

.accessibility-info-link:hover {
    color: #555;
    text-decoration: underline;
}

.accessibility-info-link:focus {
    outline: 2px solid #000;
    outline-offset: 2px;
    border-radius: 4px;
}

.accessibility-info-link svg {
    flex-shrink: 0;
    width: 16px !important;
    height: 16px !important;
    font-size: 16px !important;
}

.accessibility-info-link span {
    font-size: inherit !important;
}

/* =======================================
   SEITENSTRUKTUR MODAL
   ======================================= */

.page-structure-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-structure-modal[hidden] {
    display: none;
}

.page-structure-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1;
}

.page-structure-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    z-index: 2;
    display: flex;
    flex-direction: column;
    font-size: 16px !important;
}

.page-structure-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 2px solid #e0e0e0;
    flex-shrink: 0;
}

.page-structure-header h2 {
    margin: 0;
    font-size: 20px !important;
    font-weight: 600;
}

.page-structure-close {
    background: none;
    border: none;
    font-size: 28px !important;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.page-structure-close:hover {
    background: #f0f0f0;
}

.page-structure-close:focus {
    outline: 2px solid #000;
    outline-offset: 2px;
}

.page-structure-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.structure-section {
    margin-bottom: 32px;
}

.structure-section:last-child {
    margin-bottom: 0;
}

.structure-section h3 {
    margin: 0 0 16px 0;
    font-size: 18px !important;
    font-weight: 600;
    color: #000;
}

.structure-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.structure-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 16px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: #000;
    font-size: 15px !important;
}

.structure-item:hover {
    background: #e8e8e8;
    border-color: #000;
    transform: translateX(4px);
}

.structure-item:focus {
    outline: 3px solid #000;
    outline-offset: 2px;
}

.structure-item-level {
    font-weight: 700;
    min-width: 40px;
    color: #555;
    font-size: inherit !important;
}

.structure-item-text {
    flex: 1;
    font-size: inherit !important;
}

.structure-item-landmark {
    display: inline-block;
    padding: 2px 8px;
    background: #000;
    color: #fff;
    border-radius: 3px;
    font-size: 12px !important;
    font-weight: 600;
    margin-right: 8px;
}

.structure-empty {
    padding: 16px;
    text-align: center;
    color: #666;
    font-style: italic;
    font-size: 15px !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .accessibility-toggle {
        bottom: 80px;
        right: 15px;
    }

    .accessibility-panel {
        bottom: 150px;
        right: 15px;
        width: calc(100vw - 30px);
    }

    .accessibility-info-link {
        font-size: 13px !important;
    }

    .page-structure-content {
        width: 95%;
        max-height: 85vh;
    }

    .page-structure-header {
        padding: 16px 20px;
    }

    .page-structure-body {
        padding: 20px;
    }

    .structure-item {
        flex-direction: column;
        gap: 4px;
    }

    .structure-item-level {
        min-width: auto;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .accessibility-toggle,
    .accessibility-btn,
    .accessibility-toggle-btn,
    .toggle-indicator,
    .structure-item {
        transition: none !important;
    }
}

/* =======================================
   SCHRIFTGRÖSSE 100% - 300%
   Nuclear Option - Überschreibt ALLES
   ======================================= */

/* HTML Root-Size setzen */
html.accessibility-font-110 { font-size: 110% !important; }
html.accessibility-font-120 { font-size: 120% !important; }
html.accessibility-font-130 { font-size: 130% !important; }
html.accessibility-font-140 { font-size: 140% !important; }
html.accessibility-font-150 { font-size: 150% !important; }
html.accessibility-font-160 { font-size: 160% !important; }
html.accessibility-font-170 { font-size: 170% !important; }
html.accessibility-font-180 { font-size: 180% !important; }
html.accessibility-font-190 { font-size: 190% !important; }
html.accessibility-font-200 { font-size: 200% !important; }
html.accessibility-font-210 { font-size: 210% !important; }
html.accessibility-font-220 { font-size: 220% !important; }
html.accessibility-font-230 { font-size: 230% !important; }
html.accessibility-font-240 { font-size: 240% !important; }
html.accessibility-font-250 { font-size: 250% !important; }
html.accessibility-font-260 { font-size: 260% !important; }
html.accessibility-font-270 { font-size: 270% !important; }
html.accessibility-font-280 { font-size: 280% !important; }
html.accessibility-font-290 { font-size: 290% !important; }
html.accessibility-font-300 { font-size: 300% !important; }

/* ALLE Elemente außer Panel */
html[class*="accessibility-font-"] body,
html[class*="accessibility-font-"] body *:not(.accessibility-toggle):not(.accessibility-panel):not(.accessibility-panel *):not(.page-structure-modal):not(.page-structure-modal *) {
    font-size: inherit !important;
}

/* WordPress Navigation */
html[class*="accessibility-font-"] .wp-block-navigation-item__label,
html[class*="accessibility-font-"] .wp-block-navigation__container,
html[class*="accessibility-font-"] .wp-block-navigation-submenu,
html[class*="accessibility-font-"] .wp-block-navigation-item__content {
    font-size: inherit !important;
}

/* WooCommerce Produkte */
html[class*="accessibility-font-"] .wp-block-post-title,
html[class*="accessibility-font-"] .wp-block-post-title a,
html[class*="accessibility-font-"] .has-small-font-size,
html[class*="accessibility-font-"] .has-medium-font-size,
html[class*="accessibility-font-"] .has-large-font-size,
html[class*="accessibility-font-"] .has-x-large-font-size {
    font-size: inherit !important;
}

/* Formulare */
html[class*="accessibility-font-"] input,
html[class*="accessibility-font-"] input[type="text"],
html[class*="accessibility-font-"] input[type="email"],
html[class*="accessibility-font-"] input[type="tel"],
html[class*="accessibility-font-"] input[type="number"],
html[class*="accessibility-font-"] select,
html[class*="accessibility-font-"] option,
html[class*="accessibility-font-"] textarea,
html[class*="accessibility-font-"] label,
html[class*="accessibility-font-"] .form-row label,
html[class*="accessibility-font-"] fieldset legend,
html[class*="accessibility-font-"] .checkout-fields h2,
html[class*="accessibility-font-"] .checkout-fields label,
html[class*="accessibility-font-"] .checkout-fields input,
html[class*="accessibility-font-"] .checkout-fields select,
html[class*="accessibility-font-"] .checkout-fields textarea,
html[class*="accessibility-font-"] .error-message {
    font-size: inherit !important;
}

/* Buttons */
html[class*="accessibility-font-"] button:not(.accessibility-panel button):not(.page-structure-modal button),
html[class*="accessibility-font-"] .button,
html[class*="accessibility-font-"] .wp-block-button__link,
html[class*="accessibility-font-"] .button.alt,
html[class*="accessibility-font-"] .cancel-button,
html[class*="accessibility-font-"] .cart-portfolio-button,
html[class*="accessibility-font-"] .cart-checkout-button,
html[class*="accessibility-font-"] .qvc-submit-btn,
html[class*="accessibility-font-"] .qvc-btn-text {
    font-size: inherit !important;
    padding: 0.6em 1.2em !important;
    min-height: 2.75em !important;
}

/* Warenkorb */
html[class*="accessibility-font-"] .cart-checkout-button-container,
html[class*="accessibility-font-"] .cart-checkout-button-container a,
html[class*="accessibility-font-"] .cart-portfolio-button,
html[class*="accessibility-font-"] .qvc-attribute-label,
html[class*="accessibility-font-"] .qvc-quantity-label,
html[class*="accessibility-font-"] .qvc-sku-label,
html[class*="accessibility-font-"] .qvc-sku-value {
    font-size: inherit !important;
}

/* Überschriften */
html[class*="accessibility-font-"] h1,
html[class*="accessibility-font-"] h2,
html[class*="accessibility-font-"] h3,
html[class*="accessibility-font-"] h4,
html[class*="accessibility-font-"] h5,
html[class*="accessibility-font-"] h6 {
    font-size: inherit !important;
}

/* Text-Elemente */
html[class*="accessibility-font-"] a,
html[class*="accessibility-font-"] span,
html[class*="accessibility-font-"] p,
html[class*="accessibility-font-"] div,
html[class*="accessibility-font-"] li {
    font-size: inherit !important;
}

/* Inputs Proportionen */
html[class*="accessibility-font-"] input:not([type="checkbox"]):not([type="radio"]),
html[class*="accessibility-font-"] select,
html[class*="accessibility-font-"] textarea {
    padding: 0.5em 0.75em !important;
    min-height: 2.75em !important;
}

/* Icons NICHT vergrößern */
html[class*="accessibility-font-"] svg:not(.accessibility-panel svg):not(.page-structure-modal svg),
html[class*="accessibility-font-"] .wp-block-navigation__submenu-icon svg,
html[class*="accessibility-font-"] img.emoji {
    font-size: 1em !important;
    width: 1.2em !important;
    height: 1.2em !important;
}

/* =======================================
   ZEILENHÖHE 1.5 - 2.0
   ======================================= */

html.accessibility-line-16 body * { line-height: 1.6 !important; }
html.accessibility-line-17 body * { line-height: 1.7 !important; }
html.accessibility-line-18 body * { line-height: 1.8 !important; }
html.accessibility-line-19 body * { line-height: 1.9 !important; }
html.accessibility-line-20 body * { line-height: 2.0 !important; }

/* =======================================
   HOHER KONTRAST
   ======================================= */

body.accessibility-high-contrast {
    filter: contrast(200%) !important;
}

/* WICHTIG: Button & Panel vom Filter ausschließen! */
body.accessibility-high-contrast .accessibility-toggle,
body.accessibility-high-contrast .accessibility-panel,
body.accessibility-high-contrast .page-structure-modal {
    filter: contrast(0.5) !important; /* Kontrast zurücksetzen */
}

body.accessibility-high-contrast * {
    text-shadow: none !important;
}

/* Schatten nur auf Elemente außer Panel */
body.accessibility-high-contrast *:not(.accessibility-toggle):not(.accessibility-panel):not(.accessibility-panel *):not(.page-structure-modal):not(.page-structure-modal *) {
    box-shadow: 0 0 0 1px #000 !important;
}

/* =======================================
   SCHWARZ-WEISS
   ======================================= */

body.accessibility-grayscale {
    filter: grayscale(100%) !important;
}

body.accessibility-grayscale img,
body.accessibility-grayscale video {
    filter: grayscale(100%) !important;
}