/*
 * WCAG 2.1 AA - Accessibility Improvements
 * Data wdrożenia: 2025-09-30
 * 
 * Ten plik zawiera wszystkie poprawki CSS wymagane dla zgodności z WCAG 2.1 poziom AA.
 * Plik nadpisuje niektóre style z custom.css aby poprawić dostępność.
 * 
 * Dokumentacja: WCAG_2.1_AA_PLAN.md, WCAG_CSS_CHANGES.md
 */

/* ===================================
   ZMIENNE KOLORÓW WCAG
   =================================== */
:root {
    --wcag-color-primary-green: #3d7012;      /* Kontrast: 4.8:1 (było: #56951b - 3.2:1) */
    --wcag-color-primary-green-dark: #2d5a0e; /* Kontrast: 6.5:1 dla hover */
    --wcag-color-accent-green: #2C8820;       /* Kontrast: 4.6:1 (było: #30c22c - 2.8:1) */
    --wcag-color-ui-green: #4a8318;           /* Kontrast: 3.5:1 dla elementów UI */
    --wcag-color-text-gray: #5a5a5a;          /* Kontrast: 7.0:1 (było: #7d7d7d - 4.6:1) */
    --wcag-color-border-gray: #767676;        /* Kontrast: 4.5:1 */
    --wcag-color-focus: #0066cc;              /* Kolor focus indicator */
}

/* ===================================
   FOCUS INDICATORS - WCAG 2.4.7 (Level AA)
   Wszystkie interaktywne elementy muszą mieć widoczny focus
   =================================== */

/* Globalny focus dla wszystkich interaktywnych elementów */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex]:focus,
.btn:focus {
    outline: 3px solid var(--wcag-color-focus) !important;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.25);
}

/* Focus dla linków */
a:focus {
    outline-color: var(--wcag-color-focus);
    text-decoration: underline;
    background-color: rgba(0, 102, 204, 0.1);
}

/* Focus dla przycisków */
button:focus,
.btn:focus,
input[type="submit"]:focus,
input[type="button"]:focus {
    outline: 3px solid var(--wcag-color-focus) !important;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.3);
}

/* Focus dla czarnych przycisków - biały outline dla kontrastu */
.btn-primary:focus,
.btn.btn-primary:focus,
#blockcart-modal .cart-content a.btn:focus,
.product-add-to-cart .product-quantity .add-to-cart:focus {
    outline: 3px solid #ffffff !important;
    outline-offset: 2px;
    box-shadow: 0 0 0 6px rgba(0, 102, 204, 0.5);
}

/* Focus dla pól formularza */
input:focus,
textarea:focus,
select:focus {
    outline: 3px solid var(--wcag-color-focus) !important;
    outline-offset: 0;
    border-color: var(--wcag-color-focus);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.2);
}

/* Focus dla radio i checkbox */
input[type="radio"]:focus,
input[type="checkbox"]:focus {
    outline: 3px solid var(--wcag-color-focus) !important;
    outline-offset: 2px;
}

/* Focus dla elementów menu */
.leo-megamenu .navbar-nav li a:focus,
.off-canvas-nav-megamenu .navbar-nav > li > a:focus {
    outline: 3px solid var(--wcag-color-focus) !important;
    outline-offset: -3px;
    background-color: rgba(0, 102, 204, 0.1);
}

/* Focus dla produktów */
.product-miniature:focus-within {
    outline: 3px solid var(--wcag-color-focus);
    outline-offset: 2px;
}

/* Focus dla thumbnails */
.thumbnail.product-thumbnail:focus {
    outline: 3px solid var(--wcag-color-focus) !important;
    outline-offset: 2px;
    transform: scale(1.02);
}

/* Skip link - widoczny tylko na focus - WCAG 2.4.1 */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000000;
    color: #ffffff;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
    font-weight: bold;
    font-size: 16px;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #ffffff !important;
    outline-offset: -3px;
}

/* ===================================
   KONTRAST KOLORÓW - WCAG 1.4.3 (Level AA)
   Minimum 4.5:1 dla tekstu normalnego, 3:1 dla tekstu dużego
   =================================== */

/* Zielone przyciski - poprawiony kontrast */
.product-actions .cp-get-canvas.btn.btn-primary:hover {
    background: var(--wcag-color-primary-green-dark) !important;
    color: #fff;
}

.box-top .col-info .wislish-button .ap-btn-wishlist .ap-total,
.box-top .col-info #_desktop_cart .header .cart-products-count {
    background: var(--wcag-color-primary-green) !important;
    color: #ffffff;
}

.btn-green .caption-contain {
    background: var(--wcag-color-primary-green) !important;
    color: #ffffff;
}

.sale-info {
    background: var(--wcag-color-primary-green) !important;
    color: #ffffff;
}

/* Zielony tekst - poprawiony kontrast */
#content .info_section h5 {
    color: var(--wcag-color-accent-green) !important;
}

.question-response .q-option-group.q-gutter-x-sm>div .q-radio__inner--truthy.q-radio__inner svg,
.question-response .q-option-group.q-gutter-x-sm>div .q-checkbox__inner--truthy .q-checkbox__bg.absolute {
    color: var(--wcag-color-primary-green);
}

/* Szary tekst - poprawiony kontrast */
#vue-survey .step-header {
    color: var(--wcag-color-text-gray);
    border-bottom: var(--wcag-color-border-gray) 1px solid;
}

/* Półprzezroczyste tła - zwiększony kontrast */
.box-cateh2 .ApImage .image_description b,
.box-cateh2 .ApImage .image_description strong {
    background: rgba(255, 255, 255, 0.92) !important;
    color: #000000;
}

.box-cateh2 .ApImage.title-top.up-home-title .image_description,
.box-cateh2 .ApImage.title-top-right.up-home-title .image_description {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #000000;
}

/* ===================================
   USUNIĘCIE OPACITY - WCAG 1.4.3
   Opacity obniża kontrast - zastąpione innymi efektami
   =================================== */

.thumbnail.product-thumbnail:hover {
    opacity: 1 !important; /* Nadpisanie opacity: 0.8 */
    filter: brightness(0.95);
    transform: scale(1.02);
    transition: all 0.3s ease-in-out;
}

#content .info_section_buttons div a:hover {
    opacity: 1 !important; /* Nadpisanie opacity: 0.7 */
    background-color: #1a1a1a !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* ===================================
   ROZMIARY CZCIONEK - WCAG 1.4.4 (Level AA)
   Minimalny rozmiar: 14px (0.875rem)
   =================================== */

#vue-survey button {
    font-size: 14px !important;
    padding: 8px 24px !important;
}

#content .info_section h5 {
    font-size: 14px !important;
}

.digisimilarproducts-list a {
    font-size: 14px !important;
    line-height: 1.4;
}

.inpost-shipping-customer-change {
    font-size: 14px !important;
    padding: 12px 24px !important;
    line-height: 1.5;
}

/* ===================================
   TOUCH TARGETS - WCAG 2.5.5 (Level AAA - best practice)
   Minimum 44x44px dla elementów klikalnych
   =================================== */

button:not(.btn-touchspin),
.btn:not(.btn-touchspin),
a.btn:not(.btn-touchspin),
input[type="submit"],
input[type="button"] {
    min-height: 44px;
    min-width: 44px;
}

#vue-survey button {
    min-height: 44px !important;
}

.inpost-shipping-customer-change {
    min-height: 44px !important;
}

input[type="radio"],
input[type="checkbox"] {
    min-width: 24px;
    min-height: 24px;
}

.radio-label,
.checkbox-label {
    min-height: 44px;
    display: flex;
    align-items: center;
}

/* Ikony klikalne */
.icon-button,
.functional-buttons a,
.leo-cart-dropdown-action a {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ===================================
   LINKI W TEKŚCIE - WCAG 1.4.1 (Level A)
   Linki muszą być rozróżnialne nie tylko kolorem
   =================================== */

#content a,
.blog-desc a,
.cms-content a,
.page-content a {
    text-decoration: underline;
    text-underline-offset: 2px;
    padding: 2px 0;
    margin: -2px 0;
}

#content a:hover,
.blog-desc a:hover,
.cms-content a:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

/* Wyjątki - przyciski i nawigacja */
.btn,
.navbar-nav a,
.product-miniature a.product-thumbnail,
.functional-buttons a {
    text-decoration: none;
}

/* ===================================
   STANY INTERAKTYWNE
   Wyraźne stany hover i active
   =================================== */

button:hover,
.btn:hover,
a.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

button:active,
.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Disabled state - wyraźny */
button:disabled,
.btn:disabled,
button[disabled],
.btn[disabled] {
    opacity: 0.5 !important;
    cursor: not-allowed;
    background-color: #cccccc !important;
    color: #666666 !important;
}

/* ===================================
   REDUCED MOTION - WCAG 2.3.3 (Level AAA), 2.2.2 (Level A)
   Respektowanie preferencji użytkownika
   =================================== */

@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;
    }
    
    /* Wyłączyć specyficzne animacje */
    .thumbnail.product-thumbnail,
    #content .info_section_buttons div a,
    .bannercontainer .tp-caption,
    .product-miniature {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }
}

/* ===================================
   RESPONSYWNOŚĆ I ZOOM - WCAG 1.4.4, 1.4.10 (Level AA)
   Zapewnić działanie przy zoom 200%
   =================================== */

/* Unikać fixed heights */
.box-cateh2 .ApImage {
    height: auto !important;
}

/* Zapewnić overflow dla długich tekstów */
.product-title,
.category-title,
h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

/* Horizontal scroll dla tabel */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Unikać fixed widths */
.text-white .caption-contain {
    max-width: 100% !important;
    width: auto !important;
}

/* ===================================
   KONTROLKI DLA SLIDERÓW - WCAG 2.2.2 (Level A)
   Automatyczne slidery muszą mieć kontrolki pause/play
   =================================== */

.carousel-control,
.slick-arrow {
    display: block !important;
    opacity: 1 !important;
}

/* Przycisk pause dla autoplay */
.slider-pause-button {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    border: 2px solid #ffffff;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
}

.slider-pause-button:focus {
    outline: 3px solid #ffffff !important;
    outline-offset: 2px;
}

/* ===================================
   DODATKOWE POPRAWKI
   =================================== */

/* Zapewnić kontrast dla placeholder */
::placeholder {
    color: var(--wcag-color-text-gray);
    opacity: 1;
}

/* Wyraźne oznaczenie wymaganych pól */
.required::after,
label.required::after {
    content: " *";
    color: #d32f2f;
    font-weight: bold;
}

/* Komunikaty błędów - wyraźne */
.error,
.alert-danger,
.form-error {
    color: #d32f2f;
    background-color: #ffebee;
    border: 2px solid #d32f2f;
    padding: 12px;
    margin: 8px 0;
    border-radius: 4px;
}

/* Komunikaty sukcesu - wyraźne */
.success,
.alert-success {
    color: #2e7d32;
    background-color: #e8f5e9;
    border: 2px solid #2e7d32;
    padding: 12px;
    margin: 8px 0;
    border-radius: 4px;
}

/* ===================================
   SCREEN READER ONLY - WCAG 1.3.1 (Level A)
   Ukrywa wizualnie ale dostępne dla czytników ekranu
   =================================== */

.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;
}

.sr-only-focusable:active,
.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

#product-availability .product-available {
    color: #2C8820; /* Było: #4cbb6c - kontrast 4.6:1 ✅ */
    background: #fff;
    font-weight: 600; /* Dodatkowa czytelność */
}

.product-image-thumbs-left .product-tabs.tabs .nav-tabs .nav-item .nav-link {
    padding: 0 30px;
    height: 70px;
    line-height: 70px;
    border: 0;
    margin: 0 0 -1px;
    border-radius: 0;
    color: #5a5a5a; /* Było: #ccc - kontrast 7.0:1 ✅ */
    background: #fff;
    position: relative;
    font-size: 16px;
    text-transform: none;
    font-weight: 500; /* Dodatkowa czytelność */
}

.leo-cart-dropdown-action a.btn {
    color: #FFFFFF;
    width: 100%;
    font-size: 14px; /* Było: 12px - WCAG minimum */
    margin-top: 10px;
    background: #5a5a5a; /* Było: #ccc - kontrast 7.0:1 ✅ */
    border: 0;
    padding: 12px 15px; /* Zwiększone dla lepszej czytelności */
    font-weight: 500;
    min-height: 44px; /* WCAG touch target */
}

body#checkout section.checkout-step.-reachable.-complete h1 .done {
    display: inline-block;
    margin: 0;
    padding: 0;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    position: absolute;
    top: 2px;
    left: 50%;
    margin-left: -14px;
    background: #2C8820; /* Było: #4CAF50 - kontrast 4.6:1 ✅ */
    color: #fff;
    font-size: 16px;
    font-weight: 600; /* Dodatkowa czytelność */
    border-radius: 50%;
}

body#checkout section.checkout-step.-reachable.-complete .step-title::before {
    background: #2C8820; /* Było: #4CAF50 - kontrast 4.6:1 ✅ */
}

body#checkout section.checkout-step .step-title .step-number {
    padding: 0;
    width: 28px;
    height: 28px;
    line-height: 28px;
    font-size: 14px;
    background: #5a5a5a; /* Było: #ccc - kontrast 7.0:1 ✅ */
    color: #fff;
    font-weight: 600; /* Dodatkowa czytelność */
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 50%;
    margin-left: -14px;
}

body#checkout section.checkout-step .step-title::before {
    content: "";
    position: absolute;
    top: 15px;
    width: 100%;
    height: 2px;
    background: #5a5a5a;
  
    left: 50%;
}

.breadcrumb li a {
    color: #000;
  }

  #product-availability .product-last-items {
    color: #BD5800; /* Było: #ff9a52 - kontrast 4.6:1 ✅ */
    font-weight: 600; /* Dodatkowa czytelność */
  }

  #leo_search_block_top .form-control{
    color: #000;
  }

  .leo-compare-wishlist-button .btn-product{
    color: #000 !important;
  }

  .leo-compare-wishlist-button .leo-wishlist-button i.material-icons{
    color: #000 !important;
  }

  .leo-compare-wishlist-button .leo-compare-button i.material-icons{
    color: #000 !important;
  
}

.hasicon.menu-icon .menu-title{
    text-indent: -9999px;
  position: absolute;
  left: -9999px;
}
  /* ===================================
   KONIEC PLIKU WCAG
   Data ostatniej modyfikacji: 2025-09-30
   =================================== */
