/**
 * Site-wide dark canvas for WooCommerce, search, archives, and default templates.
 * Scoped to the active dark theme so light mode still works.
 */

html[data-autx-theme="dark"],
html.dark-mode,
html[data-theme="dark"] {
  background-color: #0b1118 !important;
  color-scheme: dark;
}

html[data-autx-theme="dark"] body,
html.dark-mode body,
html[data-theme="dark"] body,
body.dark-mode {
  background-color: #0b1118 !important;
  color: #e2e8f0 !important;
}

html[data-autx-theme="dark"] :is(
  .site,
  #page,
  #wrapper-container,
  #tbay-main-content,
  #main-wrapper,
  #main-container,
  #main-content,
  #content,
  .site-content,
  #primary,
  #main,
  .site-main,
  .main-page,
  .elementor,
  .entry-content,
  .post-content,
  .content-area
),
html.dark-mode :is(
  .site,
  #page,
  #wrapper-container,
  #tbay-main-content,
  #main-wrapper,
  #main-container,
  #main-content,
  #content,
  .site-content,
  #primary,
  #main,
  .site-main,
  .main-page,
  .elementor,
  .entry-content,
  .content-area
),
body.dark-mode :is(
  .site,
  #page,
  #wrapper-container,
  #tbay-main-content,
  #main-container,
  #content,
  .site-content,
  #primary,
  #main,
  .site-main,
  .entry-content
) {
  background-color: #0b1118 !important;
  color: #e2e8f0 !important;
}

/* 1. Page headers, Fana breadcrumbs, title bars */
html[data-autx-theme="dark"] :is(
  #tbay-breadcrumb,
  .tbay-breadcrumb,
  .breadcrumbs-color,
  .breadcrumb-page,
  .breadcrumbs-page,
  .breadscrumb-inner,
  .page-header,
  .entry-header,
  .ast-breadcrumbs-wrapper,
  .woocommerce-breadcrumb,
  .tbay-woocommerce-breadcrumb,
  .breadcrumb,
  .breadcrumbs,
  .page-title-bar,
  .top-archive-shop,
  .archive-header
),
html.dark-mode :is(
  #tbay-breadcrumb,
  .tbay-breadcrumb,
  .breadcrumbs-color,
  .breadcrumb-page,
  .page-header,
  .entry-header,
  .woocommerce-breadcrumb,
  .tbay-woocommerce-breadcrumb,
  .breadcrumb,
  .breadcrumbs,
  .page-title-bar,
  .top-archive-shop
),
body.dark-mode :is(
  #tbay-breadcrumb,
  .tbay-breadcrumb,
  .breadcrumbs-color,
  .page-header,
  .woocommerce-breadcrumb,
  .breadcrumb
) {
  background-color: #0b1118 !important;
  background: #0b1118 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #94a3b8 !important;
}

html[data-autx-theme="dark"] :is(.woocommerce-breadcrumb a, .breadcrumb a, .tbay-woocommerce-breadcrumb a, .tbay-breadcrumb a),
html.dark-mode :is(.woocommerce-breadcrumb a, .breadcrumb a, .tbay-woocommerce-breadcrumb a, .tbay-breadcrumb a) {
  color: #38bdf8 !important;
}

html[data-autx-theme="dark"] .tbay-breadcrumb li,
html[data-autx-theme="dark"] .tbay-woocommerce-breadcrumb li,
html.dark-mode .tbay-breadcrumb li {
  color: #94a3b8 !important;
}

/* 2. WooCommerce single product & shop archive wrappers */
html[data-autx-theme="dark"] :is(
  .woocommerce,
  .woocommerce-page,
  .woocommerce-shop,
  .archive.woocommerce,
  .post-type-archive-product,
  .tax-product_cat,
  .tax-product_tag,
  .single-product,
  .woocommerce div.product,
  .woocommerce #content div.product,
  .product-type-simple,
  .product-type-variable,
  .product,
  .single-product .site-main,
  .woocommerce-tabs,
  .woocommerce-Tabs-panel,
  .woocommerce-tabs .panel,
  .woocommerce-product-gallery,
  .woocommerce-product-gallery__wrapper,
  .woocommerce-product-gallery__image,
  .flex-viewport,
  .flex-control-thumbs,
  .flex-control-nav,
  .summary.entry-summary,
  .single-main-content,
  .information,
  .detail-gallery,
  .product-images,
  .image.psnav,
  .wc-tabs-wrapper,
  .woocommerce-tabs-wrapper,
  .related.products,
  .upsells.products,
  .woocommerce-Reviews,
  #reviews,
  #comments,
  .comment-respond,
  .archive-shop,
  .top-archive,
  .tbay-filter,
  #sticky-menu-bar,
  .sticky-menu-bar
),
html.dark-mode :is(
  .woocommerce,
  .woocommerce-page,
  .woocommerce div.product,
  .single-product .site-main,
  .woocommerce-tabs,
  .woocommerce-Tabs-panel,
  .woocommerce-product-gallery,
  .summary.entry-summary,
  .single-main-content,
  .related.products,
  .archive-shop,
  #sticky-menu-bar
) {
  background-color: #0b1118 !important;
  background: #0b1118 !important;
  color: #e2e8f0 !important;
}

/* 3. Titles & prices */
html[data-autx-theme="dark"] :is(
  .woocommerce div.product .product_title,
  .entry-title,
  .product-title,
  .woocommerce-loop-product__title
),
html.dark-mode :is(.woocommerce div.product .product_title, .entry-title, .product-title) {
  color: #ffffff !important;
}

html[data-autx-theme="dark"] :is(
  .woocommerce div.product p.price,
  .woocommerce div.product span.price,
  .woocommerce div.product .price .amount,
  .woocommerce div.product .price bdi,
  .single-product .price
),
html.dark-mode .woocommerce div.product .price,
html.dark-mode .woocommerce div.product .price .amount {
  color: #22c55e !important;
}

html[data-autx-theme="dark"] :is(
  .woocommerce-product-details__short-description,
  .woocommerce-Tabs-panel p,
  .product_meta,
  .posted_in,
  .tagged_as,
  .sku_wrapper
),
html.dark-mode :is(.woocommerce-product-details__short-description, .product_meta, .posted_in) {
  color: #94a3b8 !important;
}

/* 4. Tabs, quantity, forms */
html[data-autx-theme="dark"] .woocommerce div.product .woocommerce-tabs ul.tabs,
html.dark-mode .woocommerce div.product .woocommerce-tabs ul.tabs {
  background-color: #0f172a !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

html[data-autx-theme="dark"] .woocommerce div.product .woocommerce-tabs ul.tabs li,
html.dark-mode .woocommerce div.product .woocommerce-tabs ul.tabs li {
  background-color: #1e293b !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

html[data-autx-theme="dark"] .woocommerce div.product .woocommerce-tabs ul.tabs li.active,
html.dark-mode .woocommerce div.product .woocommerce-tabs ul.tabs li.active {
  background-color: #0b1118 !important;
  border-bottom-color: #0b1118 !important;
}

html[data-autx-theme="dark"] .woocommerce div.product .woocommerce-tabs ul.tabs li a,
html.dark-mode .woocommerce div.product .woocommerce-tabs ul.tabs li a {
  color: #e2e8f0 !important;
}

html[data-autx-theme="dark"] :is(.quantity input.qty, .woocommerce .quantity .qty),
html.dark-mode .quantity input.qty {
  background-color: #1e293b !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

html[data-autx-theme="dark"] :is(
  .woocommerce input.input-text,
  .woocommerce textarea,
  .woocommerce select,
  .woocommerce-ordering select,
  .comment-form input,
  .comment-form textarea,
  select.orderby
),
html.dark-mode :is(.woocommerce input.input-text, .woocommerce textarea, .woocommerce select, select.orderby) {
  background-color: #1e293b !important;
  color: #e2e8f0 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
}

/* 5. Search results, product grids, cards, shop sidebar */
html[data-autx-theme="dark"] :is(
  .search-results,
  .search-no-results,
  .archive.woocommerce,
  ul.products li.product,
  .products .product,
  .product-inner,
  .product-thumbnail,
  .product-block,
  .product-wrapper,
  .product-content,
  .caption,
  #sidebar-shop,
  .sidebar,
  .widget-area,
  .widget,
  .tbay-offcanvas-content,
  .woocommerce-pagination,
  .woocommerce-info,
  .woocommerce-message,
  .woocommerce-error
),
html.dark-mode :is(
  .search-results,
  .archive.woocommerce,
  ul.products li.product,
  .product-inner,
  .product-thumbnail,
  .product-block,
  #sidebar-shop,
  .sidebar,
  .widget
) {
  background-color: #0f172a !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}

html[data-autx-theme="dark"] :is(.widget title, .widget .widget-title, .widget h4, .widget a),
html.dark-mode .widget a,
html.dark-mode .widget .widget-title {
  color: #e2e8f0 !important;
}

html[data-autx-theme="dark"] .widget a:hover,
html.dark-mode .widget a:hover {
  color: #38bdf8 !important;
}

html[data-autx-theme="dark"] :is(.error404 #main, .error404 .page-content, .not-found),
html.dark-mode .error404 #main {
  background-color: #0b1118 !important;
  color: #e2e8f0 !important;
}

html[data-autx-theme="dark"] .error404 h1,
html.dark-mode .error404 h1 {
  color: #ffffff !important;
}

/* Cart / checkout tables on Woo templates */
html[data-autx-theme="dark"] :is(
  .woocommerce table.shop_table,
  .woocommerce-cart-form,
  .cart-collaterals,
  .woocommerce-checkout,
  .woocommerce-checkout-review-order,
  .woocommerce-account .woocommerce
),
html.dark-mode :is(.woocommerce table.shop_table, .cart-collaterals, .woocommerce-checkout) {
  background-color: #0b1118 !important;
  color: #e2e8f0 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-autx-theme="dark"] .woocommerce table.shop_table th,
html[data-autx-theme="dark"] .woocommerce table.shop_table td,
html.dark-mode .woocommerce table.shop_table th,
html.dark-mode .woocommerce table.shop_table td {
  background-color: #0f172a !important;
  color: #e2e8f0 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Fana single-product shells that still paint white */
html[data-autx-theme="dark"] :is(
  .single-main-content,
  #sticky-menu-bar,
  .sticky-menu-bar,
  .image.psnav,
  .single-product .image,
  .flex-control-thumbs li,
  .woocommerce-product-gallery__image,
  .quantity .box,
  .quantity .qty-box,
  .group-button,
  .group-buttons,
  .meta-info-wrapper,
  .social-share-box,
  .product-share,
  .tbay-social,
  .woocommerce-variation,
  .single-product .related,
  .tbay-element-product,
  .woocommerce-tabs .panel,
  .wc-tabs-wrapper,
  header#tbay-header .sub-menu,
  .dropdown-menu,
  .tbay-dropdown
),
html.dark-mode :is(
  .single-main-content,
  #sticky-menu-bar,
  .image.psnav,
  .single-product .image,
  .quantity .box,
  header#tbay-header .sub-menu
) {
  background-color: #0b1118 !important;
  background: #0b1118 !important;
  color: #e2e8f0 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-autx-theme="dark"] .single-main-content .product_title,
html[data-autx-theme="dark"] .single-main-content h1,
html.dark-mode .single-main-content .product_title {
  color: #ffffff !important;
}

html[data-autx-theme="dark"] .single-main-content,
html.dark-mode .single-main-content {
  box-shadow: none !important;
}
