/* =============================================
   Inbal — Accessibility Enhancements
   ============================================= */

/* ---- Skip Navigation Link ---- */
.skip-nav {
    position: absolute;
    top: -100%;
    right: 0;
    background: var(--dark-bg);
    color: var(--gold);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 0 10px;
    transition: top 0.2s ease;
}
.skip-nav:focus {
    top: 0;
    outline: 3px solid var(--gold);
    outline-offset: -3px;
}

/* ---- Focus Visible Outlines ----
   Replace outline:none with visible focus rings for keyboard users.
   :focus-visible fires only on keyboard focus, not mouse clicks. */

*:focus-visible {
    outline: 3px solid var(--gold, #D4AF37) !important;
    outline-offset: 2px !important;
}

/* Remove default outlines only when NOT keyboard-focused */
*:focus:not(:focus-visible) {
    outline: none;
}

/* Specific focus styles for form inputs */
.form-field input:focus-visible,
.form-field textarea:focus-visible,
.auth-field input:focus-visible,
.contact-form .form-field input:focus-visible,
.contact-form .form-field select:focus-visible,
.contact-form .form-field textarea:focus-visible,
#filterCategory:focus-visible,
.price-inputs input:focus-visible {
    outline: 3px solid var(--gold) !important;
    outline-offset: -1px !important;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

/* Focus styles for buttons */
button:focus-visible,
.btn-pay:focus-visible,
.btn-add-to-cart:focus-visible,
.btn-checkout:focus-visible,
.btn-continue:focus-visible,
.contact-submit-btn:focus-visible,
.cart-empty-link:focus-visible,
.element-pill:focus-visible,
.btn-reset-filters:focus-visible {
    outline: 3px solid var(--gold) !important;
    outline-offset: 2px !important;
}

/* Focus on clickable cards (made keyboard-accessible via JS) */
.product-card:focus-visible,
.carousel-card:focus-visible,
.similar-card:focus-visible,
.element-card:focus-visible {
    outline: 3px solid var(--gold) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.25);
}

/* Focus on nav links */
.main-nav a:focus-visible,
.footer-links a:focus-visible,
.footer-contact-item a:focus-visible {
    outline: 3px solid var(--gold) !important;
    outline-offset: 2px !important;
    border-radius: 4px;
}

/* Focus on cart button */
.cart-btn:focus-visible {
    outline: 3px solid var(--gold) !important;
    outline-offset: 2px !important;
}

/* Focus on thumbnail buttons */
.product-thumb:focus-visible {
    outline: 3px solid var(--gold) !important;
    outline-offset: 2px !important;
    border-color: var(--gold);
}

/* Focus for checkbox labels */
.cart-checkbox input[type="checkbox"]:focus-visible {
    outline: 3px solid var(--gold) !important;
    outline-offset: 2px !important;
}

/* ---- Prefers Reduced Motion ----
   Disable or reduce all animations/transitions for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    /* Global: disable all transitions and animations */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* Carousel: stop infinite scroll */
    .carousel-track {
        animation: none !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
    }
    .carousel-card {
        scroll-snap-align: start;
    }

    /* Parallax: disable */
    .hero-section {
        transform: none !important;
        opacity: 1 !important;
    }

    /* Scroll reveal: make everything visible immediately */
    .element-card,
    .seal-card,
    .section-title {
        opacity: 1 !important;
        transform: none !important;
    }

    /* Hover zoom effects: disable */
    .element-card:hover img,
    .seal-card:hover img,
    .product-card:hover .product-card-img-wrap img,
    .similar-card:hover .similar-card-img-wrap img,
    .carousel-card:hover .carousel-card-img-wrap img,
    .video-container:hover .featured-video {
        transform: none !important;
    }

    /* Card hover transforms: disable */
    .element-card:hover,
    .seal-card:hover,
    .product-card:hover,
    .similar-card:hover,
    .carousel-card:hover {
        transform: none !important;
    }

    /* Overlay slide: show instantly instead of slide-up */
    .product-card-overlay {
        transform: translateY(0) !important;
    }

    /* Button hover transforms: disable */
    .btn-pay:hover,
    .btn-add-to-cart:hover,
    .btn-checkout:hover,
    .cart-empty-link:hover,
    .contact-submit-btn:hover {
        transform: none !important;
    }
}

/* ---- Screen Reader Only (visually hidden but accessible) ---- */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* =============================================
   Accessibility Widget — Floating Button & Panel
   ============================================= */

/* ---- Widget Container ---- */
.a11y-widget {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    direction: rtl;
    font-family: 'Assistant', 'Heebo', sans-serif;
}

/* ---- Floating Trigger Button ---- */
.a11y-widget-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--dark-bg, #2C2416);
    color: #fff;
    border: 2px solid rgba(212, 175, 55, 0.4);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}
.a11y-widget-btn:hover,
.a11y-widget-btn:focus-visible {
    border-color: var(--gold, #D4AF37);
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.35);
    transform: scale(1.08);
}

/* ---- Widget Panel ---- */
.a11y-widget-panel {
    position: absolute;
    bottom: 62px;
    left: 0;
    width: 280px;
    background: var(--dark-bg, #2C2416);
    color: var(--text-light, #F5F5F0);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(212, 175, 55, 0.25);
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    pointer-events: none;
}
.a11y-widget-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Panel title */
.a11y-widget-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--gold, #D4AF37);
    text-align: center;
}

/* ---- Widget Rows ---- */
.a11y-widget-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    gap: 0.5rem;
}
.a11y-widget-row + .a11y-widget-row {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.a11y-widget-row > span {
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Font size controls group */
.a11y-font-controls {
    display: flex;
    gap: 4px;
}

/* ---- Control Buttons ---- */
.a11y-ctrl {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light, #F5F5F0);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    min-width: 36px;
    text-align: center;
}
.a11y-ctrl:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.35);
}
.a11y-ctrl.active {
    background: var(--gold, #D4AF37);
    color: var(--dark-bg, #2C2416);
    border-color: var(--gold, #D4AF37);
    font-weight: 600;
}

/* ---- Toggle Buttons ---- */
.a11y-toggle {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light, #F5F5F0);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 0.3rem 0.75rem;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    min-width: 50px;
    text-align: center;
}
.a11y-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.35);
}
.a11y-toggle[aria-pressed="true"] {
    background: var(--gold, #D4AF37);
    color: var(--dark-bg, #2C2416);
    border-color: var(--gold, #D4AF37);
    font-weight: 600;
}

/* ---- Reset All Button ---- */
.a11y-widget-reset-row {
    justify-content: center;
    padding-top: 0.75rem;
}
.a11y-reset-all {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 0.35rem 1rem;
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.a11y-reset-all:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}

/* ---- Font size indicator ---- */
.a11y-font-level {
    font-size: 0.75rem;
    opacity: 0.7;
    min-width: 20px;
    text-align: center;
}

/* =============================================
   Accessibility Mode Classes (applied to <html>)
   ============================================= */

/* ---- Font Size Levels ---- */
html.a11y-font-1 {
    font-size: 115% !important;
}
html.a11y-font-2 {
    font-size: 130% !important;
}

/* ---- Grayscale Mode ---- */
html.a11y-grayscale {
    filter: grayscale(1);
    -webkit-filter: grayscale(1);
}

/* ---- High Contrast Mode ---- */
html.a11y-high-contrast body {
    background-color: #1a1a1a !important;
    color: #ffffff !important;
}
html.a11y-high-contrast .site-header,
html.a11y-high-contrast .site-header--compact {
    background-color: #000 !important;
    background-image: none !important;
}
html.a11y-high-contrast .banner {
    background: #000 !important;
    backdrop-filter: none !important;
}
html.a11y-high-contrast .info-page-hero,
html.a11y-high-contrast .cart-page-hero {
    background: #111 !important;
    color: #fff !important;
}
html.a11y-high-contrast .info-content,
html.a11y-high-contrast .cart-main,
html.a11y-high-contrast .product-detail-main {
    background: #1a1a1a !important;
    color: #fff !important;
}
html.a11y-high-contrast a {
    color: #FFD700 !important;
}
html.a11y-high-contrast a:visited {
    color: #FFA500 !important;
}
html.a11y-high-contrast .main-nav a,
html.a11y-high-contrast .footer-links a,
html.a11y-high-contrast .footer-contact-item a {
    color: #FFD700 !important;
}
html.a11y-high-contrast .product-card,
html.a11y-high-contrast .carousel-card,
html.a11y-high-contrast .similar-card {
    background: #222 !important;
    border: 2px solid #fff !important;
    color: #fff !important;
}
html.a11y-high-contrast .product-card-name,
html.a11y-high-contrast .product-card-price,
html.a11y-high-contrast .carousel-card-name,
html.a11y-high-contrast .carousel-card-price {
    color: #fff !important;
}
html.a11y-high-contrast .element-card {
    border: 2px solid #fff !important;
}
html.a11y-high-contrast .element-card-overlay {
    background: rgba(0, 0, 0, 0.85) !important;
    color: #fff !important;
}
html.a11y-high-contrast .site-footer-new {
    background: #000 !important;
    color: #fff !important;
}
html.a11y-high-contrast .footer-tagline,
html.a11y-high-contrast .footer-desc,
html.a11y-high-contrast .footer-col-title {
    color: #fff !important;
}
html.a11y-high-contrast .footer-bottom {
    border-top-color: #555 !important;
    color: #ccc !important;
}
html.a11y-high-contrast .form-field input,
html.a11y-high-contrast .form-field textarea,
html.a11y-high-contrast .form-field select {
    background: #222 !important;
    color: #fff !important;
    border-color: #888 !important;
}
html.a11y-high-contrast .form-field label {
    color: #fff !important;
}
html.a11y-high-contrast .btn-pay,
html.a11y-high-contrast .btn-add-to-cart,
html.a11y-high-contrast .contact-submit-btn,
html.a11y-high-contrast .cart-empty-link {
    background: #FFD700 !important;
    color: #000 !important;
    border: 2px solid #FFD700 !important;
}
html.a11y-high-contrast .element-pill {
    background: #333 !important;
    color: #fff !important;
    border: 1px solid #888 !important;
}
html.a11y-high-contrast .element-pill.active {
    background: #FFD700 !important;
    color: #000 !important;
    border-color: #FFD700 !important;
}
html.a11y-high-contrast .product-price,
html.a11y-high-contrast .product-detail-main .product-price {
    color: #FFD700 !important;
}
html.a11y-high-contrast .cart-total-price {
    color: #FFD700 !important;
}
html.a11y-high-contrast .cart-items-section,
html.a11y-high-contrast .cart-details-section,
html.a11y-high-contrast .cart-checkout-section {
    background: #222 !important;
    border-color: #555 !important;
    color: #fff !important;
}
html.a11y-high-contrast .cart-item {
    border-color: #555 !important;
}
html.a11y-high-contrast .cart-confirm-box {
    background: #222 !important;
    color: #fff !important;
    border: 2px solid #FFD700 !important;
}
html.a11y-high-contrast .about-feature {
    background: #222 !important;
    color: #fff !important;
    border: 1px solid #555 !important;
}
html.a11y-high-contrast h1,
html.a11y-high-contrast h2,
html.a11y-high-contrast h3,
html.a11y-high-contrast h4 {
    color: #fff !important;
}
html.a11y-high-contrast p {
    color: #eee !important;
}
/* High contrast: keep widget readable */
html.a11y-high-contrast .a11y-widget-panel {
    background: #111 !important;
    border-color: #FFD700 !important;
}
html.a11y-high-contrast .a11y-widget-btn {
    background: #111 !important;
    border-color: #FFD700 !important;
}
/* High contrast: contact info box */
html.a11y-high-contrast .contact-info-box {
    background: #222 !important;
    color: #fff !important;
    border-color: #555 !important;
}
/* High contrast: product loading & not found */
html.a11y-high-contrast .product-page-loading,
html.a11y-high-contrast .product-not-found {
    color: #fff !important;
}
/* High contrast: section titles */
html.a11y-high-contrast .section-title {
    color: #FFD700 !important;
}
/* High contrast: seal section */
html.a11y-high-contrast .seal-card {
    background: #222 !important;
    border: 2px solid #fff !important;
    color: #fff !important;
}
/* High contrast: hero section */
html.a11y-high-contrast .hero-section {
    background-color: #111 !important;
}
html.a11y-high-contrast .hero-content {
    color: #fff !important;
}
/* High contrast: footer elements column */
html.a11y-high-contrast .footer-element-link {
    background: #222 !important;
    border: 1px solid #555 !important;
}
html.a11y-high-contrast .footer-element-name {
    color: #fff !important;
}
html.a11y-high-contrast .footer-element-link:hover .footer-element-name {
    color: #FFD700 !important;
}

/* ---- Stop Animations Mode (class-based) ----
   Duplicates prefers-reduced-motion rules as a toggleable class */
html.a11y-no-animations *,
html.a11y-no-animations *::before,
html.a11y-no-animations *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}
html.a11y-no-animations .carousel-track {
    animation: none !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
}
html.a11y-no-animations .carousel-card {
    scroll-snap-align: start;
}
html.a11y-no-animations .hero-section {
    transform: none !important;
    opacity: 1 !important;
}
html.a11y-no-animations .element-card,
html.a11y-no-animations .seal-card,
html.a11y-no-animations .section-title {
    opacity: 1 !important;
    transform: none !important;
}
html.a11y-no-animations .element-card:hover img,
html.a11y-no-animations .seal-card:hover img,
html.a11y-no-animations .product-card:hover .product-card-img-wrap img,
html.a11y-no-animations .similar-card:hover .similar-card-img-wrap img,
html.a11y-no-animations .carousel-card:hover .carousel-card-img-wrap img,
html.a11y-no-animations .video-container:hover .featured-video {
    transform: none !important;
}
html.a11y-no-animations .element-card:hover,
html.a11y-no-animations .seal-card:hover,
html.a11y-no-animations .product-card:hover,
html.a11y-no-animations .similar-card:hover,
html.a11y-no-animations .carousel-card:hover {
    transform: none !important;
}
html.a11y-no-animations .product-card-overlay {
    transform: translateY(0) !important;
}
html.a11y-no-animations .btn-pay:hover,
html.a11y-no-animations .btn-add-to-cart:hover,
html.a11y-no-animations .btn-checkout:hover,
html.a11y-no-animations .cart-empty-link:hover,
html.a11y-no-animations .contact-submit-btn:hover {
    transform: none !important;
}
/* Keep widget panel transition working even in no-animations mode */
html.a11y-no-animations .a11y-widget-panel {
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease !important;
}

/* ---- Responsive: Widget ---- */
@media (max-width: 400px) {
    .a11y-widget-panel {
        width: calc(100vw - 40px);
        left: 0;
    }
}
