/* ==========================================================================
   dezShop.ro — WCAG 2.1 AA / EAA Accessibility & Contrast Layer
   Loaded after per-view compiled CSS so every route inherits consistent
   contrast (>= 4.5:1), visible keyboard focus, skip link, and valid list styling.
   ========================================================================== */

/* 1. Skip to main content link (WCAG 2.4.1) */
.dz-skip-link {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.dz-skip-link:focus,
.dz-skip-link:focus-visible {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 100000;
    width: auto;
    height: auto;
    margin: 0;
    padding: 10px 18px;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background-color: #2a3541;
    color: #ffffff;
    font-family: "Roboto", sans-serif;
    font-size: 15px;
    font-weight: 500;
    border-radius: 6px;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
    outline: 3px solid #7ec848 !important;
    outline-offset: 2px !important;
}

main#main-content:focus {
    outline: none;
}

/* 2. Keyboard Focus Visibility (WCAG 2.4.7) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[role="button"]:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
    outline: 2px solid #0a58ca !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 3px rgba(10, 88, 202, 0.25);
}

.dz-navbar a:focus-visible,
.dz-navbar button:focus-visible,
footer a:focus-visible,
footer button:focus-visible,
.cookies-banner a:focus-visible,
.cookies-banner button:focus-visible {
    outline: 2px solid #ffffff !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 3px rgba(126, 200, 72, 0.45);
}

/* Mobile menu drawer has a white background — keep dark-blue focus ring there */
#dz_mobileMenuSidebar a:focus-visible,
#dz_mobileMenuSidebar button:focus-visible,
.dz-navbar-mobile-holder a:focus-visible,
.dz-navbar-mobile-holder button:focus-visible {
    outline: 2px solid #0a58ca !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 3px rgba(10, 88, 202, 0.25);
}

/* 3. Valid Preheader List Semantics (WCAG 1.3.1)
   Preserve layout when <dz-header-customers>/<dz-header-cart> sit inside <li>
   and render <div class="dz-preheader-item"> internally instead of nested <li>. */
.preheader .info-items-preheader > li {
    list-style: none;
}

.preheader .info-items-preheader dz-header-customers > .dz-preheader-item,
.preheader .info-items-preheader dz-header-cart > .dz-preheader-item {
    display: block;
    padding: 12px 0;
}

@media screen and (max-width: 991px) {
    .preheader .info-items-preheader > li.dz-preheader-li {
        margin-right: 12px;
    }
    .preheader .info-items-preheader > li.dz-preheader-li:last-of-type {
        margin-right: 0;
    }
}

.preheader .info-items-preheader dz-header-customers > .dz-preheader-item > a,
.preheader .info-items-preheader dz-header-cart > .dz-preheader-item > a,
.preheader .info-items-preheader dz-header-cart > .dz-preheader-item > .dz-btn-cart-mobile {
    display: flex;
    flex-direction: row;
    align-items: center;
    font-family: "Roboto", sans-serif;
    font-weight: 500;
    color: #36404b;
    cursor: pointer;
}

button.dz-btn-cart-mobile {
    background: transparent;
    border: 0;
    padding: 0;
    appearance: none;
}

.preheader .info-items-preheader dz-header-customers > .dz-preheader-item > a .preheader-icon,
.preheader .info-items-preheader dz-header-cart > .dz-preheader-item > a .preheader-icon,
.preheader .info-items-preheader dz-header-cart > .dz-preheader-item > .dz-btn-cart-mobile .preheader-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Cart badge contrast >= 5.5:1 (#ffffff on #b81d2c..#c92229) */
.preheader .info-items-preheader dz-header-cart .preheader-icon .badge-custom,
.preheader-icon .badge-custom {
    position: absolute;
    top: -7px;
    right: -7px;
    display: flex;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-image: linear-gradient(90deg, #b81d2c 0%, #c92229 100%) !important;
    justify-content: center;
    align-items: center;
}

.preheader .info-items-preheader dz-header-cart .preheader-icon .badge-custom span,
.preheader-icon .badge-custom span {
    font-family: "Roboto", sans-serif;
    font-size: 13px;
    color: #ffffff;
}

dz-header-customers .dz-preheader-item a {
    flex-flow: wrap;
}

dz-header-customers .dz-preheader-item a span {
    width: 102px;
    display: -webkit-box;
    text-overflow: ellipsis;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: nowrap;
}

/* Open desktop account & cart dropdowns on keyboard focus-within too */
dz-header-customers:focus-within .dz-header-customers-dropdown,
dz-header-cart:focus-within .dz-header-cart-dropdown {
    display: block !important;
}

/* Prevent inherited `dz-header-customers li { padding: 12px 0 }` from stacking inside dropdown */
.dz-header-customers-dropdown ul li {
    padding: 0 !important;
}

.dz-header-customers-dropdown ul li a {
    display: block;
    padding: 6px 16px;
    color: #36404b;
    text-decoration: none;
}

.dz-header-customers-dropdown ul li a.text-second-color {
    color: #2a3541 !important;
}

/* Valid <ul><li><a> / <ul><li><button> semantics in dz-customers-sidebar */
.dz-customers-sidebar-nav > li {
    padding: 0 !important;
    display: block !important;
    border-bottom: 1px solid #e5e5e5;
}

.dz-customers-sidebar-nav > li:last-child {
    border-bottom: 0;
}

.dz-customers-sidebar-nav > li > a,
.dz-customers-sidebar-nav > li > button.dz-sidebar-logout-btn {
    width: 100%;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 0;
    background: transparent;
    color: #4e5a67;
    font-family: "Roboto", sans-serif;
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.dz-customers-sidebar-nav > li > a:hover,
.dz-customers-sidebar-nav > li > a:focus,
.dz-customers-sidebar-nav > li > button.dz-sidebar-logout-btn:hover,
.dz-customers-sidebar-nav > li > button.dz-sidebar-logout-btn:focus {
    background-color: #ebebeb;
}

.dz-customers-sidebar-nav > li > a.active {
    color: #2a3541 !important;
    font-weight: 500;
}

.dz-customers-sidebar-nav > li > a.active svg path {
    fill: #2a3541;
}

.dz-customers-sidebar-nav > li > a svg,
.dz-customers-sidebar-nav > li > button.dz-sidebar-logout-btn svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

.dz-header-customers-dropdown .dz-customers-sidebar-nav > li {
    border-bottom: 0;
}

.dz-header-customers-dropdown .dz-customers-sidebar-nav > li > a,
.dz-header-customers-dropdown .dz-customers-sidebar-nav > li > button.dz-sidebar-logout-btn {
    padding: 6px 14px;
    font-weight: 400;
}

/* 4. Color Contrast Fixes (WCAG 1.4.3 — minimum 4.5:1) */

/* 4a. Brand green (#7ec848) CTA buttons -> dark ink (#1b242c) = ~8.4:1 contrast */
#dz_home_search_btn,
#dz_home_search_btn p,
.search-btn-home,
.search-btn-home p,
.dz-regular-btn-second,
.dz-regular-btn-second span,
.dz-show-all-cars-btn,
.dz-show-all-cars-btn span,
.dz-btn-buy-announce,
.dz-btn-buy-announce span,
.dz-add-to-cart,
.dz-add-to-cart span,
.dz-cart-order-btn,
.dz-cart-order-btn span {
    color: #1b242c !important;
    font-weight: 500;
}

#dz_home_search_btn:hover,
#dz_home_search_btn:hover p,
.search-btn-home:hover,
.search-btn-home:hover p,
.dz-regular-btn-second:hover,
.dz-show-all-cars-btn:hover,
.dz-show-all-cars-btn:hover span,
.dz-btn-buy-announce:hover,
.dz-btn-buy-announce:hover span,
.dz-add-to-cart:hover,
.dz-add-to-cart:hover span,
.dz-cart-order-btn:hover,
.dz-cart-order-btn:focus {
    color: #1b242c !important;
}

#dz_home_search_btn svg .home-search-svg,
.search-btn-home svg .home-search-svg,
.dz-btn-buy-announce svg,
.dz-btn-buy-announce svg path,
.dz-add-to-cart svg,
.dz-add-to-cart svg path,
.dz-show-all-cars-btn svg,
.dz-show-all-cars-btn svg path {
    fill: #1b242c !important;
}

/* Semantic <button> resets for converted ATC & Cookie Banner buttons */
button.dz-add-to-cart,
button.dz-btn-buy-announce {
    border: 0;
    cursor: pointer;
    font-family: "Roboto", sans-serif;
}

button.dz-regular-btn-second {
    border: 0;
    cursor: pointer;
    text-align: center;
}

/* Preserve white text on dark navy buttons (e.g. Cookie Banner Reject button) */
.dz-regular-btn-second.bg-base-color,
.dz-regular-btn-second.bg-base-color:hover,
#dz_footerRejectCookies,
#dz_footerRejectCookies:hover {
    color: #ffffff !important;
    background-color: #36404b !important;
}

#dz_footerRejectCookies:hover {
    background-color: #2a3541 !important;
}

/* 4b. Blue CTA buttons (#0062c4 + #ffffff = 6.0:1) */
.banner-get .dz-regular-btn-second,
.banner-get .dz-regular-btn-second:hover,
.dz-back-to-shop-btn.bg-contrast-color,
.dz-back-to-shop-btn.bg-contrast-color:hover {
    background-color: #0062c4 !important;
    color: #ffffff !important;
}

.banner-get .dz-regular-btn-second:hover,
.dz-back-to-shop-btn.bg-contrast-color:hover {
    background-color: #004e9e !important;
}

/* 4c. Prices & section accent spans -> brand $base-color-darker (#2a3541 = 12.5:1 on white, 11.2:1 on #f2f3f5) */
.dz-price,
.dz-price sup,
.dz-title-section h2 > span,
.dz-recommanded-wrapper h2 > span,
.dz-google-reviews-title h2 > span {
    color: #2a3541 !important;
}

/* Keep "RON" suffix subtle in brand $base-color-focus (#4e5a67 = 6.9:1 on white) */
.dz-price > span {
    color: #4e5a67 !important;
}

/* 4d. Muted labels: "preț cu TVA", "Vezi mai mult", "Cod SKU", specs, warning */
.dz-tva {
    color: #59616a !important;
}

.dz-title-section .dz-title-section-link,
.dz-title-section .dz-title-section-link span {
    opacity: 1 !important;
    color: #4a545f !important;
}

.dz-title-section .dz-title-section-link:hover,
.dz-title-section .dz-title-section-link:hover span {
    color: #2a3541 !important;
}

.dz-title-and-sku-wrapper > span,
.dz-cart-item-sku {
    color: #545d66 !important;
}

.dz-gallery-number-images {
    background-color: rgba(38, 46, 54, 0.88) !important;
    color: #ffffff !important;
}

.dz-sp-wr-body,
.dz-sp-wr-body ul li {
    color: #4a545f !important;
}

.warning-color,
.dz-announce-quantity-holder.warning-color {
    color: #b84a00 !important;
}

/* 4e. Cookie banner link on dark #4a535d background (#9dd0ff = 6.2:1) */
.cookies-banner p a,
.cookies-banner p a:visited {
    color: #9dd0ff !important;
    text-decoration: underline !important;
}

.cookies-banner p a:hover {
    color: #ffffff !important;
}

/* 5. Links inside prose blocks (WCAG 1.4.1 — distinguishable without color alone) */
.dz-about-zone a,
.dz-simple-page-content a:not(.dz-regular-btn-second),
.dz-empty-cart-description a,
.dz-footer-checkout .dz-checkout-contact-info a,
.dz-cookie-disabled a {
    color: #0a58ca !important;
    text-decoration: underline !important;
    text-underline-offset: 2px;
}

.dz-about-zone a:hover,
.dz-simple-page-content a:not(.dz-regular-btn-second):hover,
.dz-empty-cart-description a:hover,
.dz-footer-checkout .dz-checkout-contact-info a:hover,
.dz-cookie-disabled a:hover {
    color: #084298 !important;
}
