/* =====================================================================
   ACCESSIBILITY TOOLBAR – AlfaKatsifa
   Μεταφορά από Domotexniki.gr. Οι ρυθμίσεις εφαρμόζονται ως classes στο <html>:
     .acc-contrast  .acc-grayscale  .acc-fontsize  .acc-dyslexic
   Χρώματα brand: navy #222a35, beige #ffeed7, red #ea1d25
   ===================================================================== */

@font-face {
    font-family: "OpenDyslexic";
    src: url("../fonts/OpenDyslexic-Regular.otf") format("opentype");
    font-display: swap;
}

/* ================================
   WIDGET
================================ */

.acc-widget {
    position: fixed;
    right: 0;
    bottom: 10vh;
    z-index: 9999;
}

.acc-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background-color: #222a35;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    transition: background-color .2s ease-in;
}

    .acc-toggle:hover {
        background-color: #ea1d25;
    }

.acc-panel {
    position: absolute;
    right: 100%;
    bottom: 0;
    display: flex;
    flex-direction: column;
    width: max-content;
    max-width: calc(100vw - 54px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
}

    .acc-panel[hidden] {
        display: none !important;
    }

.acc-panel__title {
    margin: 0;
    padding: 10px 15px;
    background: #222a35;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.acc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin: 0;
    padding: 10px 15px;
    background: #ffeed7;
    color: #222a35;
    font-size: 15px;
    line-height: 1.3;
}

.acc-row__label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.acc-row--reset {
    justify-content: center;
}

.acc-switch {
    display: inline-flex;
    flex-shrink: 0;
    padding: 3px;
    border: 0;
    border-radius: 4px;
    background-color: rgba(34, 42, 53, .6);
    cursor: pointer;
}

    .acc-switch > span {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 26px;
        border-radius: 3px;
        color: #fff;
    }

    .acc-switch[aria-checked="true"] .acc-switch__on,
    .acc-switch[aria-checked="false"] .acc-switch__off {
        background-color: #fff;
        color: #222a35;
    }

.acc-reset {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border: 1px solid #222a35;
    border-radius: 4px;
    background: #fff;
    color: #222a35;
    font-size: 15px;
    cursor: pointer;
}

    .acc-reset:hover {
        background: #222a35;
        color: #fff;
    }

.acc-widget button:focus-visible {
    outline: 3px solid #ea1d25;
    outline-offset: 2px;
}

/* ================================
   GRAYSCALE
   Στο <html>: το filter στο root element ΔΕΝ χαλάει τα position:fixed
   (header, cookie bar, το ίδιο το widget).
================================ */

html.acc-grayscale {
    filter: grayscale(100%);
}

/* ================================
   DYSLEXIC FONT
   Εξαιρούνται τα Font Awesome icons.
================================ */

html.acc-dyslexic body,
html.acc-dyslexic body *:not(.fa, .fas, .far, .fab, .fa-solid, .fa-regular, .fa-brands, .svg-inline--fa, .svg-inline--fa *) {
    font-family: "OpenDyslexic", sans-serif !important;
}

/* ================================
   LARGER TEXT
   - Τα μεγέθη του site είναι σε px (font_XX classes), οπότε δεν αρκεί να
     μεγαλώσει το root font-size.
   - Κείμενο χωρίς font_ class -> 1.25rem (rem = χωρίς σωρευτική μεγέθυνση).
   - Μικρά font_ classes (13–25) -> σταθερά μεγαλύτερα px.
     Τα μεγάλα (28+) είναι ήδη τίτλοι και μένουν ως έχουν.
   - Εξαιρείται το fixed header (έχει hard-coded ύψη/offsets).
================================ */

html.acc-fontsize :is(p, li, label, dt, dd, td, th, input, select, textarea):not([class*="font_"], [class*="font_"] *, h1 *, h2 *, h3 *, h4 *, h5 *, h6 *, .main-nav-bar *, .secondary-nav-bar *, .acc-widget *) {
    font-size: 1.25rem !important;
    line-height: 1.5 !important;
}

html.acc-fontsize .font_13:not(.main-nav-bar *, .secondary-nav-bar *) { font-size: 15px !important; }
html.acc-fontsize .font_16:not(.main-nav-bar *, .secondary-nav-bar *) { font-size: 20px !important; }
html.acc-fontsize .font_18:not(.main-nav-bar *, .secondary-nav-bar *) { font-size: 22px !important; }
html.acc-fontsize .font_20:not(.main-nav-bar *, .secondary-nav-bar *) { font-size: 24px !important; }
html.acc-fontsize .font_23:not(.main-nav-bar *, .secondary-nav-bar *) { font-size: 27px !important; }
html.acc-fontsize .font_25:not(.main-nav-bar *, .secondary-nav-bar *) { font-size: 29px !important; }

/* ================================
   HIGH CONTRAST
   1) Βάση: μαύρο φόντο / λευκό κείμενο σε όλα (με :where -> χαμηλό specificity,
      ώστε οι κανόνες για links/κουμπιά παρακάτω να υπερισχύουν).
      Τα background-image (banners, slider) διατηρούνται.
================================ */

html.acc-contrast :where(body, body *:not(img, svg, svg *, video, iframe, canvas, picture)) {
    background-color: #000 !important;
    color: #fff !important;
    border-color: #fff !important;
    text-shadow: none !important;
    box-shadow: none !important;
}

/* 2) Links */

html.acc-contrast a,
html.acc-contrast a * {
    color: orange !important;
    text-decoration: underline !important;
}

    html.acc-contrast a:hover,
    html.acc-contrast a:focus,
    html.acc-contrast a:hover *,
    html.acc-contrast a:focus * {
        color: #fff !important;
    }

/* 3) Κουμπιά / CTA */

html.acc-contrast :is(button, .btn, input[type="submit"], input[type="button"], .add_to_cart, .discount_add_to_cart, .btn-send-form, .popupnewsletter_btn, .popupnewsletter_btn2, .weight-btn, .item_count, .social-icons, .menu-social-icons, .cb-enable, .cb-disable) {
    background-color: orange !important;
    color: #000 !important;
    border: 2px solid orange !important;
    text-decoration: none !important;
}

    html.acc-contrast :is(button, .btn, input[type="submit"], input[type="button"], .add_to_cart, .discount_add_to_cart, .btn-send-form, .popupnewsletter_btn, .popupnewsletter_btn2, .weight-btn, .item_count, .social-icons, .menu-social-icons, .cb-enable, .cb-disable) * {
        background-color: transparent !important;
        color: #000 !important;
    }

    html.acc-contrast :is(button, .btn, .add_to_cart, .discount_add_to_cart, .btn-send-form, .popupnewsletter_btn, .popupnewsletter_btn2, .social-icons, .menu-social-icons):is(:hover, :focus) {
        background-color: #fff !important;
        border-color: #fff !important;
    }

/* 4) Φόρμες */

html.acc-contrast :is(input:not([type="submit"], [type="button"], [type="checkbox"], [type="radio"]), select, textarea) {
    background-color: #000 !important;
    color: #fff !important;
    border: 2px solid #fff !important;
}

    html.acc-contrast :is(input, textarea)::placeholder {
        color: #ddd !important;
        opacity: 1 !important;
    }

/* 5) Τιμές προϊόντων */

html.acc-contrast :is(.old, .strikethrough) {
    color: #ddd !important;
    text-decoration: line-through !important;
}

/* 6) Εικόνες
   - Σκούρα εικονίδια (svg ως <img>) -> αναστροφή για να φαίνονται σε μαύρο φόντο.
   - Logo & φωτογραφίες προϊόντων -> λευκό φόντο. */

html.acc-contrast img:is([src*="menu_lines"], [src*="black-arrow"], [src*="close"], [src*="button_send"]) {
    filter: invert(1) !important;
}

html.acc-contrast img:is([src*="logo_alfakatsifa"], .bank_logo) {
    background-color: #fff !important;
    padding: 4px !important;
}

html.acc-contrast :is(.product, .product2, .related-products) img {
    background-color: #fff !important;
}

/* 7) Focus */

html.acc-contrast :focus-visible {
    outline: 3px solid orange !important;
    outline-offset: 2px !important;
}

/* 8) Το ίδιο το widget σε high contrast */

html.acc-contrast #acc-widget .acc-toggle,
html.acc-contrast #acc-widget .acc-panel__title {
    background-color: #000 !important;
    color: #fff !important;
    border: 2px solid #fff !important;
}

html.acc-contrast #acc-widget .acc-row {
    background-color: #111 !important;
    color: #fff !important;
}

html.acc-contrast #acc-widget .acc-switch {
    background-color: #000 !important;
    border: 2px solid #fff !important;
}

    html.acc-contrast #acc-widget .acc-switch > span {
        background-color: transparent !important;
        color: #fff !important;
    }

    html.acc-contrast #acc-widget .acc-switch[aria-checked="true"] .acc-switch__on,
    html.acc-contrast #acc-widget .acc-switch[aria-checked="false"] .acc-switch__off {
        background-color: orange !important;
        color: #000 !important;
    }

        html.acc-contrast #acc-widget .acc-switch > span * {
            color: inherit !important;
        }

html.acc-contrast #acc-widget .acc-reset {
    background-color: orange !important;
    color: #000 !important;
    border: 2px solid orange !important;
}
