/* =============================================================
   ACCESSIBILITY FIXES - Toyota Financial Services
   Generato per conformità WCAG 2.1 / EN 301 549
   ============================================================= */

/* ---------------------------------------------------------------
   ID 4, 37: Focus indicator visibile su sfondi scuri (#111111, #282830)
   WCAG 2.4.7 - Focus visible
--------------------------------------------------------------- */
*:focus-visible {
  outline: 3px solid #0057b8 !important;
  outline-offset: 2px !important;
}

/* Focus su elementi bianchi su sfondo scuro */
.site-header *:focus-visible,
.sticky-container *:focus-visible,
.mobile-menu *:focus-visible {
  outline: 3px solid #ffffff !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 5px #111111 !important;
}

/* ---------------------------------------------------------------
   ID 36: Focus indicator contrast minimo 3:1 su bottoni app scarica
   WCAG 1.4.11
--------------------------------------------------------------- */
.wp-block-button a:focus-visible,
.wp-block-button button:focus-visible,
a.wp-block-button__link:focus-visible {
  outline: 3px solid #0057b8 !important;
  outline-offset: 3px !important;
}

/* ---------------------------------------------------------------
   ID 2: Overlay su immagine hero - aumenta opacità per contrasto testo
   WCAG 1.4.3 - contrasto minimo 4.5:1
--------------------------------------------------------------- */
.wp-block-cover__background,
.hero-overlay,
.banner-overlay {
  opacity: 0.6 !important;
}

/* ---------------------------------------------------------------
   ID 9: Carousel slide pickers - contrasto 3:1 su elementi interattivi
   WCAG 1.4.11
--------------------------------------------------------------- */
.swiper-pagination-bullet {
  background: #767676 !important;
  opacity: 1 !important;
}

.swiper-pagination-bullet-active {
  background: #111111 !important;
}

/* ---------------------------------------------------------------
   ID 18, 38: Bordo input con contrasto sufficiente (#ECECEC → #767676)
   WCAG 1.4.11 - contrasto minimo 3:1 (rapporto attuale 1.2:1)
--------------------------------------------------------------- */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="date"],
textarea,
select,
.wpforms-field input,
.wpforms-field textarea,
.wpforms-field select {
  border-color: #767676 !important;
}

/* ---------------------------------------------------------------
   ID 19, 43: Colore errori #FE0123 → #c0001a (contrasto 5.1:1 su bianco)
   WCAG 1.4.3 - rapporto attuale 4:1, necessario 4.5:1
--------------------------------------------------------------- */
.wpforms-error,
.wpforms-field-error,
.wpforms-error-container p,
[class*="error"],
.error-message,
.field-error {
  color: #c0001a !important;
}

/* ---------------------------------------------------------------
   ID 35: Colore testo #E73736 → #c0001a su sfondo bianco
   WCAG 1.4.3 - rapporto attuale 4.2:1
--------------------------------------------------------------- */
.step-number,
.highlight-red,
[style*="color: #E73736"],
[style*="color:#E73736"],
[style*="color: #e73736"],
[style*="color:#e73736"] {
  color: #c0001a !important;
}

/* ---------------------------------------------------------------
   ID 39: #FE0123 su sfondo #ECECEC → contrasto attuale 3.4:1
   Necessario 4.5:1 → uso #c0001a (5.1:1 su #ECECEC)
--------------------------------------------------------------- */
.wpforms-field.wpforms-has-error input,
.wpforms-field.wpforms-has-error textarea,
.wpforms-field.wpforms-has-error select {
  border-color: #c0001a !important;
}

/* ---------------------------------------------------------------
   ID 28: Placeholder testo #A9A9A9 → #767676 (contrasto 4.5:1 su bianco)
   WCAG 1.4.3 - rapporto attuale 2.4:1
--------------------------------------------------------------- */
::placeholder {
  color: #767676 !important;
  opacity: 1 !important;
}

input::placeholder,
textarea::placeholder {
  color: #767676 !important;
  opacity: 1 !important;
}

/* ---------------------------------------------------------------
   ID 57: Chat link #FE0123 → #c0001a
   WCAG 1.4.3
--------------------------------------------------------------- */
.chat-widget a,
.chat-link,
[class*="chat"] a {
  color: #c0001a !important;
}

/* ---------------------------------------------------------------
   ID 58, 61: Hamburger menu e pulsante Cerca visibili al 200% zoom
   WCAG 1.4.4 - Resize text
--------------------------------------------------------------- */
@media (max-width: 768px), (min-width: 769px) and (max-width: 1280px) {

  .sticky-container .top-bar-right .search-icon,
  #search-icon {
    display: flex !important;
    align-items: center;
    flex-shrink: 0;
  }
}

/* Garantisce che il menu hamburger non tagli il testo al 200% */
.mobile-menu {
  overflow-y: auto !important;
  max-height: 100vh !important;
}

.mobile-menu-list li a,
.mobile-menu-list li button {
  white-space: normal !important;
  word-break: break-word !important;
  padding: 0.5em 1em !important;
  min-height: 44px !important;
}

/* ---------------------------------------------------------------
   ID 60: Carosello responsive a 320px viewport (400% zoom)
   WCAG 1.4.10 - Reflow
--------------------------------------------------------------- */
@media (max-width: 320px) {

  .swiper,
  .swiper-container,
  [class*="carousel"],
  [class*="swiper"] {
    width: 100% !important;
    overflow: hidden !important;
  }

  .swiper-slide,
  .swiper-wrapper {
    width: 100% !important;
    flex-wrap: wrap !important;
  }
}

/* ---------------------------------------------------------------
   Dimensioni minime tocco/click per elementi interattivi (44x44px)
   WCAG 2.5.5
--------------------------------------------------------------- */
.menu-link,
.menu-icon,
#search-icon,
.close-overlay,
#close-overlay,
#close-menu {
  min-height: 44px !important;
  min-width: 44px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
}

/* ---------------------------------------------------------------
   Fix button reset styles (menu-link ora è <button>)
--------------------------------------------------------------- */
button.menu-link,
button.menu-item {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  font: inherit !important;
  color: inherit !important;
  cursor: pointer !important;
  text-align: left !important;
}

/* ---------------------------------------------------------------
   Search clear button base styles
--------------------------------------------------------------- */
.search-clear-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  color: #333;
  font-size: 1rem;
}

/* ---------------------------------------------------------------
   ID 3: Carousel pause/play button (WCAG 2.2.2)
--------------------------------------------------------------- */
.carousel-pause-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 1rem;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.carousel-pause-btn:focus-visible {
  outline: 3px solid #0057b8 !important;
  outline-offset: 2px !important;
}

/* ---------------------------------------------------------------
   ID 50: Visually-hidden H1 for pages without visible page title
   Standard screen-reader-text technique
--------------------------------------------------------------- */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  clip: auto !important;
  clip-path: none;
  display: block;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}