/**
 * Rizon Theme Mode - Dark Theme CSS
 * Preserves the existing dark navy/blue appearance.
 * Maps existing site colours to design tokens.
 */

/* ================================
   CSS CUSTOM PROPERTIES — DARK THEME
   ================================ */

html[data-rizon-theme="dark"] {
  /* Backgrounds */
  --rizon-bg:              #01091c;
  --rizon-bg-secondary:    #03102f;
  --rizon-bg-tertiary:     #03153b;
  --rizon-surface:         #031339;
  --rizon-surface-raised:  #062050;
  --rizon-surface-hover:   #072864;
  --rizon-card:            rgba(6, 25, 67, 0.96);
  --rizon-card-hover:      rgba(7, 26, 70, 0.98);

  /* Text */
  --rizon-text:            #ffffff;
  --rizon-text-secondary:  rgba(255, 255, 255, 0.72);
  --rizon-text-muted:     rgba(255, 255, 255, 0.50);
  --rizon-heading:        rgba(255, 255, 255, 0.93);
  --rizon-link:           #76b5ff;
  --rizon-link-hover:     #8ac6ff;

  /* Borders */
  --rizon-border:          rgba(113, 169, 255, 0.18);
  --rizon-border-strong:  rgba(113, 169, 255, 0.35);
  --rizon-border-input:   rgba(113, 169, 255, 0.28);

  /* Accent */
  --rizon-accent:         #2e89ff;
  --rizon-accent-hover:   #4a9fff;
  --rizon-accent-soft:    rgba(46, 137, 255, 0.14);
  --rizon-accent-glow:    rgba(46, 137, 255, 0.15);

  /* Status */
  --rizon-success:        #3dd68c;
  --rizon-warning:        #f5a623;
  --rizon-error:          #ff5a5a;
  --rizon-info:           #76b5ff;

  /* Form inputs */
  --rizon-input-bg:       rgba(255, 255, 255, 0.04);
  --rizon-input-text:     #ffffff;
  --rizon-input-placeholder: rgba(255, 255, 255, 0.40);
  --rizon-input-border:   rgba(113, 169, 255, 0.20);
  --rizon-focus-ring:     rgba(46, 137, 255, 0.60);

  /* Shadows */
  --rizon-shadow-sm:      0 8px 24px rgba(1, 10, 30, 0.20);
  --rizon-shadow-md:      0 24px 70px rgba(1, 10, 30, 0.28);
  --rizon-shadow-lg:      0 40px 100px rgba(1, 10, 30, 0.40);
  --rizon-overlay:        rgba(1, 9, 28, 0.85);

  /* Header / Footer */
  --rizon-header-bg:      transparent;
  --rizon-footer-bg:      rgba(2, 16, 48, 0.78);

  /* Buttons */
  --rizon-button-primary-bg:    linear-gradient(90deg, #2d8cff, #1d53f1);
  --rizon-button-primary-text:  #ffffff;
  --rizon-button-secondary-bg:  rgba(255, 255, 255, 0.04);
  --rizon-button-secondary-text:#ffffff;
  --rizon-button-primary-shadow: 0 18px 34px rgba(29, 83, 241, 0.24);
  --rizon-button-primary-shadow-hover: 0 22px 44px rgba(29, 83, 241, 0.38), 0 0 30px rgba(46, 137, 255, 0.22);

  /* WooCommerce */
  --rizon-price:          #ffffff;
  --rizon-price-del:      rgba(255, 255, 255, 0.55);
  --rizon-sale:           #ff6b6b;
  --rizon-badge-bg:       #2e89ff;

  /* Toggle icon colours */
  --rizon-toggle-icon:    rgba(255, 255, 255, 0.75);
  --rizon-toggle-bg:      rgba(255, 255, 255, 0.06);
  --rizon-toggle-hover-bg: rgba(255, 255, 255, 0.10);
}

/* ================================
   APPLY DARK THEME VARIABLES
   ================================ */

html[data-rizon-theme="dark"] {
  color-scheme: dark;
}

/* Apply variables to key elements */
html[data-rizon-theme="dark"] body {
  background-color: var(--rizon-bg);
  color: var(--rizon-text);
}

html[data-rizon-theme="dark"] a {
  color: var(--rizon-link);
  transition: color 0.3s ease;
}

html[data-rizon-theme="dark"] a:hover {
  color: var(--rizon-link-hover);
}

html[data-rizon-theme="dark"] h1,
html[data-rizon-theme="dark"] h2,
html[data-rizon-theme="dark"] h3,
html[data-rizon-theme="dark"] h4,
html[data-rizon-theme="dark"] h5,
html[data-rizon-theme="dark"] h6 {
  color: var(--rizon-heading);
}

/* Toggle button dark mode styles */
html[data-rizon-theme="dark"] .rizon-theme-toggle {
  background: var(--rizon-toggle-bg);
  color: var(--rizon-toggle-icon);
  border: 1px solid var(--rizon-border);
}

html[data-rizon-theme="dark"] .rizon-theme-toggle:hover {
  background: var(--rizon-toggle-hover-bg);
  border-color: var(--rizon-border-strong);
}

/* ================================
   WOOCOMMERCE DARK THEME OVERRIDES
   ================================ */

/* Shop / product archive */
html[data-rizon-theme="dark"] .woocommerce ul.products,
html[data-rizon-theme="dark"] .woocommerce-page ul.products {
  background: transparent;
}

html[data-rizon-theme="dark"] .woocommerce ul.products li.product,
html[data-rizon-theme="dark"] .woocommerce-page ul.products li.product {
  background: var(--rizon-card);
  border: 1px solid var(--rizon-border);
  box-shadow: var(--rizon-shadow-md);
}

html[data-rizon-theme="dark"] .woocommerce ul.products li.product:hover,
html[data-rizon-theme="dark"] .woocommerce-page ul.products li.product:hover {
  border-color: var(--rizon-border-strong);
  box-shadow: var(--rizon-shadow-lg), var(--rizon-accent-glow);
  transform: translateY(-4px);
}

html[data-rizon-theme="dark"] .woocommerce ul.products li.product .woocommerce-loop-category__title,
html[data-rizon-theme="dark"] .woocommerce ul.products li.product .woocommerce-loop-product__title,
html[data-rizon-theme="dark"] .woocommerce ul.products li.product h2,
html[data-rizon-theme="dark"] .woocommerce ul.products li.product h3 {
  color: var(--rizon-heading);
}

html[data-rizon-theme="dark"] .woocommerce ul.products li.product .price,
html[data-rizon-theme="dark"] .woocommerce span.amount {
  color: var(--rizon-price);
}

html[data-rizon-theme="dark"] .woocommerce del .amount {
  color: var(--rizon-price-del);
}

html[data-rizon-theme="dark"] .woocommerce span.onsale,
html[data-rizon-theme="dark"] .woocommerce ul.products li.product span.onsale {
  background: var(--rizon-badge-bg);
  color: #fff;
}

html[data-rizon-theme="dark"] .woocommerce .star-rating span::before {
  color: #ffd166;
}

html[data-rizon-theme="dark"] .woocommerce .star-rating::before {
  color: rgba(255, 255, 255, 0.20);
}

/* Add to cart button */
html[data-rizon-theme="dark"] .woocommerce a.button,
html[data-rizon-theme="dark"] .woocommerce button.button,
html[data-rizon-theme="dark"] ul.products li.product .button {
  background: var(--rizon-button-primary-bg);
  color: var(--rizon-button-primary-text);
  box-shadow: var(--rizon-button-primary-shadow);
}

html[data-rizon-theme="dark"] .woocommerce a.button:hover,
html[data-rizon-theme="dark"] .woocommerce button.button:hover,
html[data-rizon-theme="dark"] ul.products li.product .button:hover {
  box-shadow: var(--rizon-button-primary-shadow-hover);
  transform: translateY(-2px);
}

/* Cart page */
html[data-rizon-theme="dark"] .woocommerce-cart-form,
html[data-rizon-theme="dark"] .woocommerce table.shop_table {
  background: var(--rizon-card);
  border: 1px solid var(--rizon-border);
}

html[data-rizon-theme="dark"] .woocommerce table.shop_table th,
html[data-rizon-theme="dark"] .woocommerce table.shop_table td {
  border-color: var(--rizon-border);
  color: var(--rizon-text);
}

html[data-rizon-theme="dark"] .woocommerce table.shop_table th {
  background: var(--rizon-surface);
  color: var(--rizon-heading);
}

html[data-rizon-theme="dark"] .woocommerce .cart-collaterals .cart_totals,
html[data-rizon-theme="dark"] .woocommerce .cart-collaterals .cross-sells {
  background: var(--rizon-card);
  border: 1px solid var(--rizon-border);
}

/* Quantity inputs */
html[data-rizon-theme="dark"] .woocommerce .quantity input.qty,
html[data-rizon-theme="dark"] .woocommerce #content .quantity input.qty {
  background: var(--rizon-input-bg);
  border: 1px solid var(--rizon-input-border);
  color: var(--rizon-input-text);
}

html[data-rizon-theme="dark"] .woocommerce .quantity input.minus,
html[data-rizon-theme="dark"] .woocommerce .quantity input.plus {
  background: var(--rizon-surface);
  border: 1px solid var(--rizon-border);
  color: var(--rizon-text);
}

/* Coupon field */
html[data-rizon-theme="dark"] .woocommerce .coupon {
  background: var(--rizon-surface);
  border: 1px solid var(--rizon-border);
}

html[data-rizon-theme="dark"] .woocommerce .coupon input.input-text {
  background: var(--rizon-input-bg);
  border: 1px solid var(--rizon-input-border);
  color: var(--rizon-input-text);
}

html[data-rizon-theme="dark"] .woocommerce .coupon input.input-text::placeholder {
  color: var(--rizon-input-placeholder);
}

/* Checkout page */
html[data-rizon-theme="dark"] .woocommerce-checkout #payment,
html[data-rizon-theme="dark"] .woocommerce-checkout #payment ul.payment_methods {
  background: var(--rizon-card);
  border: 1px solid var(--rizon-border);
}

html[data-rizon-theme="dark"] .woocommerce form.checkout_coupon,
html[data-rizon-theme="dark"] .woocommerce form.login,
html[data-rizon-theme="dark"] .woocommerce form.register {
  background: var(--rizon-card);
  border: 1px solid var(--rizon-border);
}

/* Checkout form fields */
html[data-rizon-theme="dark"] .woocommerce form .form-row input.input-text,
html[data-rizon-theme="dark"] .woocommerce form .form-row textarea,
html[data-rizon-theme="dark"] .woocommerce form .form-row select {
  background: var(--rizon-input-bg);
  border: 1px solid var(--rizon-input-border);
  color: var(--rizon-input-text);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

html[data-rizon-theme="dark"] .woocommerce form .form-row input.input-text::placeholder {
  color: var(--rizon-input-placeholder);
}

html[data-rizon-theme="dark"] .woocommerce form .form-row input.input-text:focus,
html[data-rizon-theme="dark"] .woocommerce form .form-row textarea:focus {
  border-color: var(--rizon-accent);
  box-shadow: 0 0 0 3px rgba(46, 137, 255, 0.15);
  outline: none;
}

html[data-rizon-theme="dark"] .woocommerce form .form-row label {
  color: var(--rizon-text-secondary);
}

/* Select2 */
html[data-rizon-theme="dark"] .select2-container .select2-choice,
html[data-rizon-theme="dark"] .select2-container .select2-choices {
  background: var(--rizon-input-bg) !important;
  border: 1px solid var(--rizon-input-border) !important;
  color: var(--rizon-input-text) !important;
}

html[data-rizon-theme="dark"] .select2-drop,
html[data-rizon-theme="dark"] .select2-dropdown {
  background: var(--rizon-card) !important;
  border: 1px solid var(--rizon-border) !important;
  color: var(--rizon-text) !important;
}

html[data-rizon-theme="dark"] .select2-results__option {
  color: var(--rizon-text) !important;
}

html[data-rizon-theme="dark"] .select2-results__option--highlighted[aria-selected] {
  background: var(--rizon-accent-soft) !important;
  color: var(--rizon-accent) !important;
}

/* WooCommerce notices */
html[data-rizon-theme="dark"] .woocommerce-message,
html[data-rizon-theme="dark"] .woocommerce-error,
html[data-rizon-theme="dark"] .woocommerce-info,
html[data-rizon-theme="dark"] .woocommerce-notices-wrapper .woocommerce-message {
  background: var(--rizon-card);
  border: 1px solid var(--rizon-border);
  color: var(--rizon-text);
}

html[data-rizon-theme="dark"] .woocommerce-error {
  border-color: var(--rizon-error);
}

html[data-rizon-theme="dark"] .woocommerce-info {
  border-color: var(--rizon-accent);
}

html[data-rizon-theme="dark"] .woocommerce-message {
  border-color: var(--rizon-success);
}

/* Place order button */
html[data-rizon-theme="dark"] #place_order {
  background: var(--rizon-button-primary-bg) !important;
  box-shadow: var(--rizon-button-primary-shadow) !important;
  color: var(--rizon-button-primary-text) !important;
}

/* Cart totals */
html[data-rizon-theme="dark"] .woocommerce .cart-collaterals .cart_totals .order-total th,
html[data-rizon-theme="dark"] .woocommerce .cart-collaterals .cart_totals .order-total td {
  color: var(--rizon-heading);
}

/* My Account */
html[data-rizon-theme="dark"] .woocommerce-account .woocommerce-MyAccount-navigation,
html[data-rizon-theme="dark"] .woocommerce-account .woocommerce-MyAccount-content {
  background: var(--rizon-card);
  border: 1px solid var(--rizon-border);
}

html[data-rizon-theme="dark"] .woocommerce-account .woocommerce-MyAccount-navigation ul li a {
  color: var(--rizon-text-secondary);
}

html[data-rizon-theme="dark"] .woocommerce-account .woocommerce-MyAccount-navigation ul li a:hover,
html[data-rizon-theme="dark"] .woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a {
  color: var(--rizon-accent);
  background: var(--rizon-accent-soft);
}

/* Order details */
html[data-rizon-theme="dark"] .woocommerce table.order_details tfoot th,
html[data-rizon-theme="dark"] .woocommerce table.order_details tfoot td {
  border-color: var(--rizon-border);
}

/* Remove button */
html[data-rizon-theme="dark"] .woocommerce a.remove {
  color: var(--rizon-text-muted) !important;
}

html[data-rizon-theme="dark"] .woocommerce a.remove:hover {
  color: var(--rizon-error) !important;
  background: transparent;
}

/* Pagination */
html[data-rizon-theme="dark"] .woocommerce nav.woocommerce-pagination ul {
  border: 1px solid var(--rizon-border);
  background: var(--rizon-card);
}

html[data-rizon-theme="dark"] .woocommerce nav.woocommerce-pagination ul li a,
html[data-rizon-theme="dark"] .woocommerce nav.woocommerce-pagination ul li span {
  color: var(--rizon-text);
  border-color: var(--rizon-border);
}

html[data-rizon-theme="dark"] .woocommerce nav.woocommerce-pagination ul li a:hover,
html[data-rizon-theme="dark"] .woocommerce nav.woocommerce-pagination ul li span.current {
  background: var(--rizon-accent-soft);
  color: var(--rizon-accent);
}

/* Sorting dropdown */
html[data-rizon-theme="dark"] .woocommerce .woocommerce-ordering select,
html[data-rizon-theme="dark"] .woocommerce select {
  background: var(--rizon-input-bg);
  border: 1px solid var(--rizon-input-border);
  color: var(--rizon-input-text);
}

/* Product tabs */
html[data-rizon-theme="dark"] .woocommerce div.product .woocommerce-tabs ul.tabs {
  background: var(--rizon-surface);
  border-bottom: 1px solid var(--rizon-border);
}

html[data-rizon-theme="dark"] .woocommerce div.product .woocommerce-tabs ul.tabs li a {
  color: var(--rizon-text-secondary);
}

html[data-rizon-theme="dark"] .woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
  color: var(--rizon-accent);
  border-bottom-color: var(--rizon-accent);
}

/* Related / upsells */
html[data-rizon-theme="dark"] .woocommerce div.product .related h2,
html[data-rizon-theme="dark"] .woocommerce div.product .upsells h2 {
  color: var(--rizon-heading);
}

/* ================================
   BRIZY DARK THEME OVERRIDES
   ================================ */

/* Brizy wraps content in these classes */
html[data-rizon-theme="dark"] .brz-woo-single-product,
html[data-rizon-theme="dark"] .brz-wc-single-product,
html[data-rizon-theme="dark"] .brz-woocommerce-page {
  background: var(--rizon-bg) !important;
}

/* Product page dark surfaces */
html[data-rizon-theme="dark"] .brz-woo-product-summary,
html[data-rizon-theme="dark"] .brz-wc-product-summary,
html[data-rizon-theme="dark"] .woocommerce #primary div.product .summary {
  background: var(--rizon-card) !important;
  border: 1px solid var(--rizon-border) !important;
}

/* Product title in dark mode */
html[data-rizon-theme="dark"] .brz-woo-product-title,
html[data-rizon-theme="dark"] .brz h1.brz-woo-product-title,
html[data-rizon-theme="dark"] .woocommerce div.product .product_title {
  color: var(--rizon-heading) !important;
}

/* Price in dark mode */
html[data-rizon-theme="dark"] .brz-woo-price,
html[data-rizon-theme="dark"] .woocommerce div.product p.price,
html[data-rizon-theme="dark"] .woocommerce div.product span.price {
  color: var(--rizon-price) !important;
}

html[data-rizon-theme="dark"] .woocommerce div.product p.price del,
html[data-rizon-theme="dark"] .woocommerce div.product span.price del {
  color: var(--rizon-price-del) !important;
}

/* Short description */
html[data-rizon-theme="dark"] .brz-woo-short-description,
html[data-rizon-theme="dark"] .woocommerce div.product .woocommerce-product-details__short-description,
html[data-rizon-theme="dark"] .woocommerce div.product .short_description {
  color: var(--rizon-text) !important;
}

/* Add to cart button */
html[data-rizon-theme="dark"] .brz-woo-add-to-cart button,
html[data-rizon-theme="dark"] .brz-wc-add-to-cart button,
html[data-rizon-theme="dark"] .woocommerce div.product form.cart .button {
  background: var(--rizon-button-primary-bg) !important;
  box-shadow: var(--rizon-button-primary-shadow) !important;
  color: var(--rizon-button-primary-text) !important;
}

/* Quantity selector */
html[data-rizon-theme="dark"] .woocommerce .quantity input.qty,
html[data-rizon-theme="dark"] .brz input[name="quantity"] {
  background: var(--rizon-input-bg) !important;
  border: 1px solid var(--rizon-input-border) !important;
  color: var(--rizon-input-text) !important;
}

/* Variation labels */
html[data-rizon-theme="dark"] .woocommerce div.product form.cart .variations label,
html[data-rizon-theme="dark"] .woocommerce div.product .product_meta .posted_in,
html[data-rizon-theme="dark"] .woocommerce div.product .product_meta .tagged_as {
  color: var(--rizon-text-secondary) !important;
}

/* SKU */
html[data-rizon-theme="dark"] .woocommerce div.product .product_meta span.sku_wrapper .sku {
  color: var(--rizon-text) !important;
}

/* Stock status */
html[data-rizon-theme="dark"] .woocommerce div.product p.stock {
  color: var(--rizon-success) !important;
}

html[data-rizon-theme="dark"] .woocommerce div.product p.stock.out-of-stock {
  color: var(--rizon-error) !important;
}

/* Product tabs in Brizy */
html[data-rizon-theme="dark"] .brz-woo-tabs,
html[data-rizon-theme="dark"] .woocommerce div.product .woocommerce-tabs {
  background: var(--rizon-card) !important;
  border: 1px solid var(--rizon-border) !important;
}

/* Brizy text blocks */
html[data-rizon-theme="dark"] .brz-rich-text,
html[data-rizon-theme="dark"] .brz-tp-html p {
  color: var(--rizon-text) !important;
}

/* Brizy buttons */
html[data-rizon-theme="dark"] .brz-btn {
  background: var(--rizon-button-primary-bg) !important;
  box-shadow: var(--rizon-button-primary-shadow) !important;
}

/* Brizy columns/cards with dark backgrounds */
html[data-rizon-theme="dark"] .brz-section,
html[data-rizon-theme="dark"] .brz-columns,
html[data-rizon-theme="dark"] .brz-wp-content {
  transition: background-color 0.3s ease;
}

/* Reviews */
html[data-rizon-theme="dark"] .woocommerce #reviews #comments ol.commentlist li {
  background: var(--rizon-card);
  border: 1px solid var(--rizon-border);
}

html[data-rizon-theme="dark"] .woocommerce #reviews #comments ol.commentlist li .comment-text {
  border-color: var(--rizon-border);
}

html[data-rizon-theme="dark"] .woocommerce #review_form #respond textarea {
  background: var(--rizon-input-bg);
  border: 1px solid var(--rizon-input-border);
  color: var(--rizon-input-text);
}