/*
 * RoverStore v4.3 — final dark-mode contrast layer.
 * Loaded after style.css, mobile.css and desktop.css on every public page.
 */

:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]){
  color-scheme:dark;
  --dark-bg:#06120e;
  --dark-surface:#0c2018;
  --dark-surface-2:#122c21;
  --dark-surface-3:#18382a;
  --dark-border:#2d5a46;
  --dark-text:#f3fbf7;
  --dark-muted:#b3c7bc;
  --dark-link:#8ce5bc;
  --dark-danger-bg:#35171a;
  --dark-danger:#ffb8be;
  --dark-warning-bg:#352b10;
  --dark-warning:#ffe08b;
  --dark-success-bg:#0d3323;
  --dark-success:#a0edc7;
}

:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) :is(body,.site-shell,.site-main){
  background-color:var(--dark-bg)!important;
  color:var(--dark-text)!important;
}

:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body :is(
  .mobile-header,.desktop-header,.bottom-app-nav,.site-footer,.desktop-footer,
  .side-menu,.sidebar-menu,.mobile-menu,.mobile-drawer
){
  background-color:#091b14!important;
  color:var(--dark-text)!important;
  border-color:var(--dark-border)!important;
}

/* All reusable public content surfaces, at both mobile and desktop widths. */
:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body .site-main :is(
  section,article,aside,
  .section,.page-section,.content-section,.content-box,.content-card,.content-wrapper,
  .page-card,.card,.box,.panel,.form-card,.form-section,.form-wrapper,
  .filter-card,.filter-panel,.search-card,.search-panel,.search-results-head,
  .profile-card,.profile-section,.dashboard-card,.dashboard-section,.auth-card,
  .listing-card,.listing-content,.product-card,.product-content,.product-info,
  .detail-card,.detail-section,.detail-content,.detail-request-card,.contact-card,
  .info-card,.action-card,.summary-card,.order-card,.vacancy-card,.blog-card,
  .wallet-card,.notification-card,.message-card,.empty-state,.search-not-found-card,
  .catalog-card,.catalog-filter-card,.catalog-results-head,.catalog-directory-block,
  .catalog-directory-card,.catalog-directory-empty,.catalog-hub-links,.category-card,
  .store-list-card,.store-list-body,.service-list-card,.service-list-body,
  .service-map-card,.business-video-card,.modal-content,.popup-content,.dropdown-menu,
  .accordion-item,.accordion-body,.tab-content,.table-responsive,.rvr-multi-menu,
  [class$="-card"],[class*="-card "],[class$="-panel"],[class*="-panel "],
  [class$="-box"],[class*="-box "],[class$="-modal"],[class*="-modal "]
){
  background-color:var(--dark-surface)!important;
  color:var(--dark-text)!important;
  border-color:var(--dark-border)!important;
}

/* White headings/paragraph backgrounds left by legacy inline page CSS. */
:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body .site-main :is(
  section,article,aside,.card,.panel,.page-card,.form-card,.detail-card,
  [class$="-card"],[class*="-card "],[class$="-panel"],[class*="-panel "]
) :is(h1,h2,h3,h4,h5,h6,p,legend,dt,dd){
  background-color:transparent!important;
  color:var(--dark-text)!important;
}

:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body .site-main :is(
  h1,h2,h3,h4,h5,h6,p,label,legend,li,dt,dd,th,td,
  .title,.subtitle,.page-title,.page-subtitle,.section-title,.card-title,
  .form-label,.detail-label,.listing-title,.product-title,.store-list-title,
  .service-list-title,.catalog-directory-title
){
  color:var(--dark-text)!important;
}

:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body .site-main :is(
  small,.muted,.text-muted,.help-text,.field-help,.meta,.date,.description,
  .page-description,.card-subtitle,.listing-meta,.product-meta
){
  color:var(--dark-muted)!important;
}

/* Tables: fixes white header cells with white text on listing and OEM tables. */
:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body .site-main :is(
  table,thead,tbody,tfoot,tr
){
  background-color:var(--dark-surface)!important;
  color:var(--dark-text)!important;
  border-color:var(--dark-border)!important;
}

:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body .site-main :is(
  table th,.ld-table-card th,.ld-compat-card th,.spec-table th,.detail-table th
){
  background:var(--dark-surface-2)!important;
  color:var(--dark-text)!important;
  border-color:var(--dark-border)!important;
  -webkit-text-fill-color:var(--dark-text)!important;
}

:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body .site-main :is(
  table td,.ld-table-card td,.ld-compat-card td,.spec-table td,.detail-table td
){
  background:var(--dark-surface)!important;
  color:var(--dark-text)!important;
  border-color:var(--dark-border)!important;
  -webkit-text-fill-color:var(--dark-text)!important;
}

:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body .site-main :is(
  .ld-table-card,.ld-compat-card,.ld-title-card,.ld-seller-card,.ld-description-card,
  .ld-video-card,.ld-promo-packages,.ld-feature-strip,.ld-share-panel,.ld-share-main,
  .listing-price-card,.listing-seller-card,.listing-video-card
){
  background:var(--dark-surface)!important;
  color:var(--dark-text)!important;
  border-color:var(--dark-border)!important;
}

/* Forms, search bars, selectable rows and browser autofill. */
:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select,textarea,.select2-selection,.select2-dropdown,.select2-search__field,
  .choices__inner,.choices__list,.rvr-multi-button,.rvr-multi-menu,
  .category-option-search,.edit-option-search
){
  background:var(--dark-surface-2)!important;
  color:var(--dark-text)!important;
  border-color:var(--dark-border)!important;
  -webkit-text-fill-color:var(--dark-text)!important;
}

:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body :is(input,textarea)::placeholder{
  color:#91aa9d!important;
  -webkit-text-fill-color:#91aa9d!important;
  opacity:1!important;
}

:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body input:-webkit-autofill,
:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body input:-webkit-autofill:hover,
:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body input:-webkit-autofill:focus{
  -webkit-box-shadow:0 0 0 1000px var(--dark-surface-2) inset!important;
  -webkit-text-fill-color:var(--dark-text)!important;
  caret-color:var(--dark-text)!important;
}

:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body :is(option,optgroup){
  background:#10271e!important;
  color:var(--dark-text)!important;
}

/* Neutral buttons must not stay white; primary/semantic buttons keep their colour. */
:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body :is(
  .secondary-btn,.outline-btn,.gray-btn,.ghost-btn,.light-btn,.white-btn,
  .ld-round-btn,.ld-slider-arrow,.ld-share-main,.reaction-btn,
  .ld-zoom-close,.ld-zoom-arrow,.ld-promo-group summary>span,
  .wallet-quick button,.auction-share-panel a,.auction-share-panel button,
  .desktop-section-more,.desktop-search button,.lang-switcher a,.theme-switcher button,
  .side-menu-close
){
  background:var(--dark-surface-2)!important;
  color:var(--dark-link)!important;
  border-color:#3f7b61!important;
  -webkit-text-fill-color:var(--dark-link)!important;
}

:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body .site-main :is(
  .ld-share-option,.ld-share-panel-head strong,.ld-share-note
){
  color:var(--dark-text)!important;
  -webkit-text-fill-color:var(--dark-text)!important;
}

:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body .site-main :is(
  .ld-share-close,.ld-share-option.copy span,.ld-share-option.instagram span
){
  background:var(--dark-surface-2)!important;
  color:var(--dark-link)!important;
  -webkit-text-fill-color:var(--dark-link)!important;
}

:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body :is(
  .primary-btn,.btn-primary,.submit-btn,.search-btn,.desktop-button,.whatsapp-btn,
  .add-listing-btn,.ld-contact-btn,.auction-call-btn
){
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}

/* Desktop header, search/filter and footer previously forced white with !important. */
@media(min-width:1200px){
  :is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body :is(
    .desktop-header,.desktop-nav,.desktop-tools,.desktop-home,.desktop-section,
    .desktop-filter,.desktop-main-filter,.desktop-main-filter .desktop-filter-form,
    .desktop-product,.desktop-suppliers a,.desktop-blogs a,.desktop-footer,
    .desktop-footer-main,.desktop-copy
  ){
    background-color:var(--dark-surface)!important;
    color:var(--dark-text)!important;
    border-color:var(--dark-border)!important;
  }

  :is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body :is(
    .desktop-nav a,.desktop-nav-actions a,.desktop-section h2,.desktop-section header a,
    .desktop-product a,.desktop-product h3,.desktop-business,.desktop-blogs a,
    .desktop-footer-main h3,.desktop-footer-main p,.desktop-footer-main a,.desktop-copy
  ){
    color:var(--dark-text)!important;
  }

  :is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body :is(
    .desktop-main-filter .desktop-filter-tabs button:not(.active),
    .desktop-filter>div button:not(.active),.desktop-brand:not(.active)
  ){
    background:var(--dark-surface-2)!important;
    color:var(--dark-text)!important;
    border-color:var(--dark-border)!important;
  }
}

/* Common page-specific surfaces that use embedded CSS. */
:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body .site-main :is(
  .checkout-form-card,.checkout-summary-card,.cart-page-item,.cart-summary-card,
  .order-info-card,.order-items-card,.order-status-card,.orders-filter-card,
  .wallet-topup-card,.wallet-history,.wallet-row,.balance-info-card,.balance-pay-card,
  .promote-listing-card,.promote-package-grid,.ad-package-card,.selected-listing-card,.epoint-card,.epoint-result-card,
  .auction-card-public,.auction-card-body,.auction-price-box,.auction-info-card,.auction-actions-card,.auction-share-panel,.auction-description,
  .store-detail-hero,.store-info-card,.store-social-card,.store-contact-panel,.store-map-card,
  .service-detail-hero,.service-info-card,.service-social-card,.service-contact-panel,.service-items-card,.service-master-card,
  .supplier-detail-hero,.supplier-info-card,.supplier-social-card,.supplier-products-card,.supplier-list-card,
  .chat-app,.chat-sidebar,.chat-view,.chat-top,.chat-room-head,.chat-compose,.chat-contact,.chat-empty-list,
  .bdp-pro-hero,.bdp-pro-content-card,.bdp-pro-side-card,.blog-detail-card,
  .add-form-card,.edit-form-card,.edit-profile-card,.change-password-card,
  .store-register-card,.service-register-card,.supplier-register-card,.edit-supplier-card,
  .my-listing-card,.my-store-card,.my-supplier-card,.profile-menu-card
){
  background-color:var(--dark-surface)!important;
  color:var(--dark-text)!important;
  border-color:var(--dark-border)!important;
  box-shadow:none!important;
}

:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body .site-main :is(
  .add-choice,.edit-choice,.checkout-choice,.locked-listing-type,.optional-i18n-fields,
  .option-check,.auction-check,.image-upload-box,.image-upload-status,
  .store-upload-box,.service-upload-box,.supplier-upload-box,.edit-supplier-upload-box,
  .whatsapp-checkbox-row,.my-listing-inventory-form,.listing-info-grid>div,
  .vd-quick-list>div,.profile-menu-list>span,.search-type-tabs label,
  .color-swatch,.av-kind-grid label>span,.av-upload,.chat-search,.chat-messages,
  .vacancy-kind-tabs a:not(.active),.supplier-meta-grid>span
){
  background-color:var(--dark-surface-2)!important;
  color:var(--dark-text)!important;
  border-color:var(--dark-border)!important;
}

/* Semantic messages retain recognisable state colours with readable contrast. */
:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body :is(.alert,.flash-message,.notice,.message){
  background:var(--dark-surface-2)!important;
  color:var(--dark-text)!important;
  border-color:var(--dark-border)!important;
}
:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body :is(.alert-success,.success-message){background:var(--dark-success-bg)!important;color:var(--dark-success)!important;border-color:#1c714c!important}
:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body :is(.alert-danger,.alert-error,.error-message){background:var(--dark-danger-bg)!important;color:var(--dark-danger)!important;border-color:#7d3138!important}
:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body :is(.alert-warning,.warning-message,.balance-warning){background:var(--dark-warning-bg)!important;color:var(--dark-warning)!important;border-color:#746122!important}

/* White canvases are intentional only behind logos/product media, never text. */
:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body .site-main :is(
  .business-logo,.store-detail-logo,.service-detail-logo,.supplier-detail-logo,
  .supplier-list-logo,.my-supplier-logo,.edit-supplier-logo-preview,
  .logo-preview,.image-preview,.ld-thumb,.order-detail-main-img,.order-detail-thumbs button
){
  background:#f4f8f6!important;
}

:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body .site-main a:not(.primary-btn):not(.btn-primary):not(.submit-btn):not(.desktop-button):not(.whatsapp-btn){
  text-decoration-color:currentColor;
}


/* V66: selected listing type / condition must stay visibly selected in dark mode. */
:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body .site-main :is(
  .add-choice.active,.edit-choice.active,.checkout-choice.active,
  .add-choice:has(input:checked),.edit-choice:has(input:checked),.checkout-choice:has(input:checked)
){
  background:#0b6b43!important;
  color:#fff!important;
  border-color:#2ba977!important;
  -webkit-text-fill-color:#fff!important;
  box-shadow:0 0 0 2px rgba(43,169,119,.20)!important;
}
:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body .site-main :is(
  .add-choice.active,.edit-choice.active,.checkout-choice.active,
  .add-choice:has(input:checked),.edit-choice:has(input:checked),.checkout-choice:has(input:checked)
) :is(span,strong,b,small){color:#fff!important;-webkit-text-fill-color:#fff!important}

/* Premium yellow badge: dark text on yellow gives WCAG-safe contrast in night mode. */
:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body .site-main :is(
  .promotion-premium,.promo-premium .promotion-mark,.badge-pill.premium
){
  background:#ffd84d!important;
  color:#332500!important;
  -webkit-text-fill-color:#332500!important;
  border-color:#f0bd19!important;
}

/* Promotion checkout: package/duration/payment + method choices remain readable. */
:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body .site-main .promote-package-grid>div,
:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body .site-main .payment-choice{
  background:var(--dark-surface-2)!important;color:var(--dark-text)!important;border-color:var(--dark-border)!important;
}
:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body .site-main .promote-package-grid :is(span,strong),
:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body .site-main .payment-choice :is(span,strong,small,b),
:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body .site-main .payment-method-title{
  color:var(--dark-text)!important;-webkit-text-fill-color:var(--dark-text)!important;
}
:is(html[data-theme="dark"],html[data-theme="auto"][data-auto-theme="dark"]) body .site-main .payment-choice-icon{
  background:#173d2d!important;color:#a8f0cf!important;-webkit-text-fill-color:#a8f0cf!important;
}
