/* =============================================
   Maize Accessibility Plugin — Styles
   ============================================= */

/* ----- Floating Action Button (FAB) ----- */
.maize-a11y-fab {
    position: fixed;
    bottom: 24px;
    left: 24px; /* Moved to left to avoid overlapping with scroll-to-top */
    z-index: 99990;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: #0B3B60;
    color: #fff;
    border: 1px solid #F59E0B;
    border-radius: 50px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, bottom 0.35s ease;
}
.maize-a11y-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(0,0,0,0.35);
    background: #1E5688;
}
.maize-a11y-fab:active {
    transform: translateY(0);
}
.maize-a11y-fab__label {
    white-space: nowrap;
}

/* ----- Header Button ----- */
.maize-a11y-header-btn {
    display: inline-flex;
    flex-direction: column; /* Text under icon */
    align-items: center;
    gap: 2px;
    background: none;
    border: none;
    cursor: pointer;
    color: #e5e7eb;
    padding: 0;
    font-size: 10px; /* Reduced font size to look neat under the icon */
    font-weight: 600;
    font-family: inherit;
    transition: color 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.maize-a11y-header-btn:hover {
    color: #fff;
}
.maize-a11y-header-btn__label {
    white-space: nowrap;
}

/* ----- Panel (slide-in from right) ----- */
.maize-a11y-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 360px;
    max-width: 90vw;
    height: 100vh;
    z-index: 99999;
    background: #fff;
    box-shadow: -8px 0 40px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    overflow-y: auto;
}
.maize-a11y-panel.is-open {
    right: 0;
}

.maize-a11y-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 24px 16px;
    border-bottom: 1px solid #eee;
}
.maize-a11y-panel__header h4 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #0B3B60;
}
.maize-a11y-panel__close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #999;
    padding: 0;
    transition: color 0.2s;
}
.maize-a11y-panel__close:hover {
    color: #333;
}

.maize-a11y-panel__body {
    flex: 1;
    padding: 20px 24px;
    overflow-y: auto;
}

.maize-a11y-panel__footer {
    padding: 16px 24px 22px;
    border-top: 1px solid #eee;
}

/* ----- Settings groups ----- */
.maize-a11y-group {
    margin-bottom: 22px;
}
.maize-a11y-group__label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.maize-a11y-btn-row {
    display: flex;
    gap: 8px;
}

.maize-a11y-btn {
    flex: 1;
    background: #F1F5F9;
    border: 2px solid transparent;
    padding: 10px 8px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    color: #0B3B60;
    transition: all 0.2s ease;
    text-align: center;
    font-size: 14px;
    font-family: inherit;
}
.maize-a11y-btn:hover {
    background: #E2E8F0;
}
.maize-a11y-btn.active {
    border-color: #0B3B60;
    background: rgba(11, 59, 96, 0.12);
    color: #0B3B60;
    font-weight: 800;
}

.maize-a11y-color-btn {
    font-size: 18px;
    font-weight: 800;
    min-width: 48px;
}
.maize-a11y-color-btn.active {
    outline: 3px solid #F59E0B;
    outline-offset: 2px;
    border-color: transparent !important;
}

/* Reset button */
.maize-a11y-reset-btn {
    width: 100%;
    padding: 12px;
    border: 2px solid #0B3B60;
    background: transparent;
    border-radius: 10px;
    color: #0B3B60;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}
.maize-a11y-reset-btn:hover {
    background: #0B3B60;
    color: #fff;
}

/* ----- Notification bar ----- */
.maize-a11y-notice {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99989;
    background: #0B3B60;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    transform: translateY(100%);
    transition: transform 0.35s ease;
}
.maize-a11y-notice.is-visible {
    transform: translateY(0);
}
.maize-a11y-notice__btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    padding: 5px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    transition: background 0.2s;
}
.maize-a11y-notice__btn:hover {
    background: rgba(255,255,255,0.25);
}

/* ----- Panel overlay (mobile) ----- */
.maize-a11y-overlay {
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.maize-a11y-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}


/* =============================================
   GLOBAL MODIFIERS (applied to <html> or <body>)
   ============================================= */

/* ----- Font sizes ----- */
body.a11y-font-large,
html.a11y-font-large {
    font-size: 110% !important;
}
html.a11y-font-large h1 { font-size: 56px !important; }
html.a11y-font-large h2 { font-size: 40px !important; }
html.a11y-font-large h3 { font-size: 30px !important; }
html.a11y-font-large h4 { font-size: 24px !important; }
html.a11y-font-large .gradient-text { font-size: 40px !important; }

body.a11y-font-xlarge,
html.a11y-font-xlarge {
    font-size: 125% !important;
}
html.a11y-font-xlarge h1 { font-size: 64px !important; }
html.a11y-font-xlarge h2 { font-size: 48px !important; }
html.a11y-font-xlarge h3 { font-size: 36px !important; }
html.a11y-font-xlarge h4 { font-size: 28px !important; }
html.a11y-font-xlarge .gradient-text { font-size: 48px !important; }

/* ----- Letter spacing ----- */
html.a11y-spacing-medium,
html.a11y-spacing-medium body {
    letter-spacing: 1px !important;
}
html.a11y-spacing-large,
html.a11y-spacing-large body {
    letter-spacing: 2.5px !important;
}

/* ----- Line height ----- */
html.a11y-lh-medium,
html.a11y-lh-medium body {
    line-height: 1.8 !important;
}
html.a11y-lh-medium p,
html.a11y-lh-medium li,
html.a11y-lh-medium td {
    line-height: 1.8 !important;
}
html.a11y-lh-large,
html.a11y-lh-large body {
    line-height: 2.2 !important;
}
html.a11y-lh-large p,
html.a11y-lh-large li,
html.a11y-lh-large td {
    line-height: 2.2 !important;
}

/* ----- Sans-serif font ----- */
html.a11y-sans-serif,
html.a11y-sans-serif body,
html.a11y-sans-serif * {
    font-family: Arial, Helvetica, sans-serif !important;
}

/* ----- Images off ----- */
html.a11y-images-off img,
body.a11y-images-off img,
html.a11y-images-off .gibrid-card__thumb,
html.a11y-images-off .gibrid-hero-block__gallery,
html.a11y-images-off .corn-img-wrapper {
    display: none !important;
}
html.a11y-images-off .site-header__logo img,
body.a11y-images-off .site-header__logo img {
    display: block !important;
    filter: grayscale(100%);
}


/* =============================================
   COLOR SCHEME: Black on White (bw)
   ============================================= */

html.a11y-color-bw,
html.a11y-color-bw body,
body.a11y-color-bw,
html.a11y-color-bw *:not(img):not(svg):not(path) {
    background: #fff !important;
    color: #000 !important;
    border-color: #000 !important;
    text-shadow: none !important;
    box-shadow: none !important;
}
html.a11y-color-bw img,
html.a11y-color-bw svg {
    background: transparent !important;
}
html.a11y-color-bw .site-header {
    border-bottom: 2px solid #000 !important;
}
html.a11y-color-bw .site-footer {
    border-top: 2px solid #000 !important;
}
html.a11y-color-bw .site-header__logo img,
html.a11y-color-bw .site-footer__logo img {
    filter: invert(1) !important;
}
html.a11y-color-bw button:hover,
html.a11y-color-bw .btn-primary:hover,
html.a11y-color-bw .btn-secondary:hover,
html.a11y-color-bw a:hover {
    background: #000 !important;
    color: #fff !important;
}
html.a11y-color-bw button:hover *,
html.a11y-color-bw a:hover * {
    background: transparent !important;
    color: #fff !important;
}
html.a11y-color-bw .site-header__accessibility svg,
html.a11y-color-bw .search-icon,
html.a11y-color-bw .cart-toggle svg {
    stroke: #000 !important;
}
/* Keep the a11y panel itself readable in bw mode */
html.a11y-color-bw .maize-a11y-panel * {
    background: initial !important;
    color: initial !important;
    border-color: initial !important;
}
html.a11y-color-bw .maize-a11y-panel {
    background: #fff !important;
    border-left: 2px solid #000 !important;
}
html.a11y-color-bw .maize-a11y-btn.active {
    border: 2px solid #000 !important;
}


/* =============================================
   COLOR SCHEME: White on Black (wb) + legacy a11y-mode
   ============================================= */

html.a11y-color-wb,
html.a11y-color-wb body,
body.a11y-color-wb,
body.a11y-mode,
html.a11y-color-wb *:not(img):not(svg):not(path) {
    background: #000 !important;
    color: #fff !important;
    border-color: #fff !important;
    text-shadow: none !important;
    box-shadow: none !important;
}
html.a11y-color-wb img,
html.a11y-color-wb svg {
    background: transparent !important;
}
html.a11y-color-wb .site-header {
    border-bottom: 2px solid #fff !important;
}
html.a11y-color-wb .site-footer {
    border-top: 2px solid #fff !important;
}
html.a11y-color-wb .site-header__accessibility svg,
html.a11y-color-wb .search-icon,
html.a11y-color-wb .cart-toggle svg {
    stroke: #fff !important;
}
/* Keep the a11y panel readable in wb mode */
html.a11y-color-wb .maize-a11y-panel {
    background: #000 !important;
    border-left: 2px solid #fff !important;
}
html.a11y-color-wb .maize-a11y-btn {
    border: 1px solid #fff !important;
}
html.a11y-color-wb .maize-a11y-btn.active {
    background: #fff !important;
    color: #000 !important;
    border: 2px solid #fff !important;
}

/* Legacy a11y-mode overrides (backward compatibility with theme) */
body.a11y-mode {
    --color-primary: #000;
    --color-secondary: #000;
    --color-accent: #ff0;
    --color-black: #000;
    --glass-bg-light: #fff;
    --glass-blur: 0px;
}
body.a11y-mode * {
    font-family: Arial, sans-serif !important;
    text-shadow: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}

/* Header & footer in a11y-mode */
body.a11y-mode .site-header {
    background: #fff !important;
    border-bottom: 2px solid #000;
}
body.a11y-mode .site-header__logo img,
body.a11y-mode .site-footer__logo img {
    filter: invert(1) !important;
}
body.a11y-mode #live-search-input {
    background: #fff !important;
    color: #000 !important;
    border: 2px solid #000 !important;
}
body.a11y-mode #live-search-input::placeholder {
    color: #555 !important;
}
body.a11y-mode .search-icon {
    color: #000 !important;
}
body.a11y-mode .hamburger-inner,
body.a11y-mode .hamburger-inner::before,
body.a11y-mode .hamburger-inner::after {
    background-color: #000 !important;
}
body.a11y-mode .site-header__accessibility {
    color: #000 !important;
    opacity: 1 !important;
}
body.a11y-mode .header-menu-list a,
body.a11y-mode .site-header__phone,
body.a11y-mode .cart-toggle {
    color: #000 !important;
    font-weight: bold;
}
body.a11y-mode .announcement-bar {
    background: #000 !important;
    color: #ff0 !important;
}
body.a11y-mode .site-footer {
    background: #fff !important;
    color: #000 !important;
    border-top: 2px solid #000;
}
body.a11y-mode .footer-cta {
    background: #fff !important;
    border: 2px solid #000 !important;
}
body.a11y-mode .footer-cta__text h2 {
    background: none;
    -webkit-text-fill-color: #000;
    color: #000;
}
body.a11y-mode .site-footer__col h4,
body.a11y-mode .site-footer__col p,
body.a11y-mode .site-footer__col a {
    color: #000 !important;
}

/* Buttons */
body.a11y-mode .btn-primary,
body.a11y-mode .btn-secondary {
    background: #000 !important;
    color: #ff0 !important;
    border: 2px solid #000 !important;
}
body.a11y-mode .btn-primary:focus,
body.a11y-mode a:focus,
body.a11y-mode button:focus {
    outline: 4px solid #ff0 !important;
    outline-offset: 2px;
}

/* Hybrid page modules */
body.a11y-mode .gibrid-module,
body.a11y-mode .gibrid-hero-block,
body.a11y-mode .gibrid-hero-block__gallery,
body.a11y-mode .gibrid-price-box {
    background: #fff !important;
    border: 2px solid #000 !important;
    color: #000 !important;
    box-shadow: none !important;
    transform: none !important;
}
body.a11y-mode .gibrid-hero-block__info h1,
body.a11y-mode .gibrid-price-box .price-val,
body.a11y-mode .gibrid-price-box .price-val small,
body.a11y-mode .gibrid-module h3,
body.a11y-mode .gibrid-morphology h3,
body.a11y-mode .gibrid-morphology__content,
body.a11y-mode .marker-value,
body.a11y-mode .marker-label,
body.a11y-mode .trait-label,
body.a11y-mode .trait-score,
body.a11y-mode .chem-val,
body.a11y-mode .chem-unit,
body.a11y-mode .chem-label,
body.a11y-mode .tag,
body.a11y-mode .region-tag {
    color: #000 !important;
    background: #fff !important;
}
body.a11y-mode .tag,
body.a11y-mode .region-tag {
    border: 2px solid #000 !important;
}
body.a11y-mode .trait-bar-track,
body.a11y-mode .chem-circle {
    border: 2px solid #000 !important;
    background: #fff !important;
}
body.a11y-mode .trait-bar-fill {
    background: #000 !important;
}
body.a11y-mode .marker-value {
    background: #000 !important;
    color: #fff !important;
    border: 2px solid #000 !important;
    font-size: 24px !important;
}
body.a11y-mode .map-svg-wrapper {
    background: #fff !important;
    border: 3px solid #000 !important;
}
body.a11y-mode .map-region path {
    fill: #eee !important;
    stroke: #000 !important;
}
body.a11y-mode .map-region.active path {
    fill: #000 !important;
}
body.a11y-mode .region-tag {
    background: #fff !important;
    border: 2px solid #000 !important;
    color: #000 !important;
}
body.a11y-mode .region-tag.highlight {
    background: #000 !important;
    color: #fff !important;
}
body.a11y-mode .map-svg-wrapper svg path {
    fill: #fff !important;
    stroke: #000 !important;
    stroke-width: 3px !important;
}

/* Price bar */
.a11y-mode .gibrid-price-bar {
    background: #000 !important;
    border: 3px solid #fff;
    box-shadow: none;
}
.a11y-mode .gibrid-price-bar .price-val,
.a11y-mode .gibrid-price-bar .price-unit,
.a11y-mode .gibrid-price-bar .sticky-cta__title {
    color: #fff !important;
}
.a11y-mode .gibrid-price-bar::before {
    display: none;
}
.a11y-mode .price-actions .btn-primary {
    background: #ffff00 !important;
    color: #000 !important;
    border: 2px solid #000;
    font-size: 16px;
}
.a11y-mode .btn-action-icon {
    background: #000 !important;
    border: 2px solid #fff !important;
    color: #fff !important;
}
.a11y-mode .trait-segment.filled {
    background: #ffff00 !important;
    border: 1px solid #000;
}
.a11y-mode .trait-segment {
    background: #f0f0f0 !important;
    border: 1px solid #000;
}
.a11y-mode .trait-label,
.a11y-mode .trait-score {
    color: #000 !important;
    font-size: 16px !important;
    font-weight: 800;
}
.a11y-mode .trait-score {
    background: #ffff00 !important;
    border: 2px solid #000;
}
.a11y-mode .marker-value {
    background: #000 !important;
    border: 2px solid #fff;
}
.a11y-mode .donut-center-value {
    color: #000 !important;
    font-size: 26px !important;
}

/* Footer contact card */
body.a11y-mode .site-footer__legal-text,
body.a11y-mode .site-footer__copyright {
    color: #000 !important;
    opacity: 1 !important;
    font-weight: 700;
}
body.a11y-mode .site-footer__mission,
body.a11y-mode .footer-docs-list a,
body.a11y-mode .site-footer__nav a {
    color: #000 !important;
    font-weight: 800;
}
body.a11y-mode .footer-contact-card {
    background: #000 !important;
    border: 2px solid #fff !important;
}
body.a11y-mode .site-footer__col .footer-contact-card,
body.a11y-mode .site-footer__col .footer-contact-card h4,
body.a11y-mode .site-footer__col .footer-contact-card a,
body.a11y-mode .site-footer__col .footer-contact-card span,
body.a11y-mode .site-footer__col .footer-contact-card p,
body.a11y-mode .site-footer__col .footer-contact-card svg {
    color: #fff !important;
}

/* Chem chart */
.a11y-mode .donut-svg {
    filter: grayscale(100%) contrast(150%);
}
.a11y-mode .chem-item,
.a11y-mode .chem-badge,
.a11y-mode .chem-legend-item {
    background: #fff !important;
    border: 2px solid #000 !important;
    box-shadow: none !important;
}
.a11y-mode .chem-val,
.a11y-mode .chem-label,
.a11y-mode .chem-unit,
.a11y-mode .chem-legend-val,
.a11y-mode .chem-legend-name {
    color: #000 !important;
    font-weight: 900 !important;
}
.a11y-mode .chem-legend-dot {
    filter: grayscale(100%) contrast(200%);
    border: 1px solid #000;
}

/* ----- Adapt the FAB in color modes ----- */
html.a11y-color-bw .maize-a11y-fab {
    background: #000 !important;
    color: #fff !important;
}
html.a11y-color-wb .maize-a11y-fab {
    background: #fff !important;
    color: #000 !important;
}
html.a11y-color-bw .maize-a11y-notice,
html.a11y-color-wb .maize-a11y-notice {
    background: #333 !important;
    color: #fff !important;
}

/* ----- Mobile responsive ----- */
@media (max-width: 480px) {
    .maize-a11y-fab {
        bottom: 16px;
        right: 16px;
        padding: 10px 14px;
        font-size: 12px;
    }
    .maize-a11y-panel {
        width: 100vw;
        max-width: 100vw;
        right: -100vw;
    }
}
