/*
  Kloss / AutoSales -- readability patch (light background only).
  Included AFTER the regular theme & appearance CSS, and only when the admin
  appearance settings use a light site background and a light header.
  This is scoped to links, labels, and light components to avoid breaking
  white-on-blue Buy Now buttons, dark footers and product photography.
*/

/* Main issue from the supplied screenshot: "Log Out" is pale on white. */
#mainNav a[href$="/logout"],
#mainNav a[href$="/logout.php"] {
    color: #153b65 !important;
    background: #eaf3ff !important;
    border: 1px solid #b9d2f0 !important;
    border-radius: 9px !important;
    font-weight: 750 !important;
    opacity: 1 !important;
    text-shadow: none !important;
    -webkit-text-fill-color: #153b65 !important;
}
#mainNav a[href$="/logout"]:hover,
#mainNav a[href$="/logout.php"]:hover {
    background: #d8eaff !important;
    color: #082b53 !important;
    -webkit-text-fill-color: #082b53 !important;
}
#mainNav a[href$="/logout"] :is(span,i,svg),
#mainNav a[href$="/logout.php"] :is(span,i,svg) {
    color: inherit !important;
    opacity: 1 !important;
}
/* Keep the sign-out option visually distinct inside the white account dropdown. */
#mainNav .nav-dd a[href$="/logout"],
#mainNav .nav-dd a[href$="/logout.php"] {
    color: #a51e23 !important;
    background: #fff4f4 !important;
    border: 1px solid #f0c6c8 !important;
    -webkit-text-fill-color: #a51e23 !important;
}

/* The original dark navigation has pale inline styles that were not updated
   when the header was switched to white. Fix the signed-in user's name and
   account controls while retaining white avatar letters on a blue tile. */
#mainNav .relative.group > button {
    background: #f3f7fc !important;
    border-color: #c9d9ea !important;
}
#mainNav .relative.group > button > span,
#mainNav .relative.group > button > i {
    color: #153858 !important;
    -webkit-text-fill-color: #153858 !important;
    opacity: 1 !important;
}
#mainNav .relative.group > button:hover { background:#e9f3ff !important; }
#mainNav a[href$="/dashboard"].lg\:hidden,
#mainNav a[href$="/login"].lg\:hidden {
    color: #153858 !important;
    background: #f3f7fc !important;
    border-color: #c9d9ea !important;
}
#mainNav a[href$="/dashboard"].lg\:hidden i,
#mainNav a[href$="/login"].lg\:hidden i { color:inherit!important; }
#mainNav button[aria-label="Open search"],
#mainNav button[aria-label="Open menu"] { color:#153858!important; }
#mainNav .nav-link:not(.nav-active) { color:#294260!important; }
#mainNav .nav-link:hover { color:#0562c5!important; }

/* Strengthen fine-print labels on white/light-background sections. */
.rb-home .rb-benefit-grid small,
.rb-home .kl-home-review-meta span,
.rb-home .rb-vehicle-info small,
.rb-home .rb-empty p,
.pg-header .pg-desc,
.pg-header .pg-subtitle,
.form-card p,
.card .text-muted {
    color: #485f79 !important;
    opacity: 1 !important;
}
/* Common Tailwind low-contrast utility text on LIGHT cards only. */
:is(.form-card,.rb-vehicle-info,.rb-empty,.kl-home-trust-card,.kl-home-review-card,.pg-header)
:is(.text-gray-300,.text-gray-400,.text-slate-300,.text-slate-400) {
    color: #485f79 !important;
}
/* Form control text and placeholders must remain legible. */
:is(.form-card,.rb-search,#mobileSearchBar) :is(input,select,textarea) {
    color: #163657 !important;
    -webkit-text-fill-color: #163657 !important;
}
:is(.form-card,.rb-search,#mobileSearchBar) :is(input,textarea)::placeholder {
    color:#526781 !important;
    -webkit-text-fill-color:#526781 !important;
    opacity:1 !important;
}
:is(.form-card,.rb-search) label { color:#334e6b !important; opacity:1!important; }
#mobileDrawer .bsm-row,
#mobileDrawer .bsm-card { color:#153858 !important; }
#mobileDrawer .bsm-row:hover,
#mobileDrawer .bsm-card:hover { color:#075bb3 !important; }
/* Preserve proper contrast in accessible keyboard navigation. */
#mainNav a:focus-visible,
#mainNav button:focus-visible,
#mobileDrawer a:focus-visible {
    outline: 3px solid #176bd0;
    outline-offset: 3px;
}

/* Buyer menu links: visible beside Log Out on light header */
#mainNav .customer-account-link {
    display: inline-flex;
    align-items: center;
    color: #153b65 !important;
    -webkit-text-fill-color: #153b65 !important;
    background: #eaf3ff !important;
    border: 1px solid #b9d2f0 !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    opacity: 1 !important;
    text-shadow: none !important;
}
#mainNav .customer-account-link:hover { background:#d8eaff !important; }
#mainNav .customer-account-link i { color:#175faa !important; opacity:1!important; }
#mainNav .customer-logout-link {
    color:#153b65!important; -webkit-text-fill-color:#153b65!important;
    background:#f1f5fa!important; border:1px solid #cfdae7!important;
    border-radius:9px!important; font-weight:800!important; opacity:1!important;
}
#mainNav .customer-logout-link:hover {background:#e0eaf5!important;}
@media(max-width:1023px){#mainNav .customer-account-link,#mainNav .customer-logout-link{display:none!important}}

/* Guest header auth actions: keep Sign In visible on the white header. */
#mainNav .customer-signin-link {
    color:#153b65 !important;
    -webkit-text-fill-color:#153b65 !important;
    background:#eaf3ff !important;
    border:1px solid #b9d2f0 !important;
    font-weight:800 !important;
    text-decoration:none !important;
    opacity:1 !important;
    text-shadow:none !important;
}
#mainNav .customer-signin-link i {color:#153b65 !important;}
#mainNav .customer-signin-link:hover {background:#d8eaff !important;}
#mainNav .customer-register-link {
    color:#fff !important;
    -webkit-text-fill-color:#fff !important;
    background:#1267d8 !important;
    border:1px solid #1267d8 !important;
    font-weight:800 !important;
    opacity:1 !important;
}
#mainNav .customer-register-link:hover {background:#0954b6 !important;}
@media(max-width:1023px) {
    #mainNav .customer-signin-link,
    #mainNav .customer-register-link {display:none!important;}
}
