/* ============================================================
   XAB-STORE: theme toggle, buy bar, DARK THEME
   ============================================================ */

/* ---------- theme toggle button (both themes) */
.theme-toggle { flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; cursor: pointer;
  background: #f1f3f8; border: 1px solid var(--border-color); color: #4b5563; transition: background .2s, color .2s, transform .2s; }
.theme-toggle:hover { color: var(--primary-color); transform: translateY(-1px); }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .ic-sun { display: none; }
html[data-theme="dark"] .theme-toggle .ic-sun { display: block; }
html[data-theme="dark"] .theme-toggle .ic-moon { display: none; }
@media (max-width: 768px) {
  .theme-toggle { grid-area: cur; justify-self: end; width: 38px; height: 38px; border-radius: 11px; }
}

/* ---------- buy bar in product modal (no email) */
#mOrder.modal-footer { gap: 8px; }
.buy-bar { display: flex; align-items: center; gap: 14px; width: 100%; }
.buy-bar .qty { flex: 0 0 auto; height: 48px; }
.buy-bar .total-price-block { flex: 1 1 auto; min-width: 0; text-align: left; padding: 0; background: none; }
.buy-bar .checkout-btn { flex: 0 0 auto; min-width: 220px; max-width: none; }
#mOrder .order-err:empty { display: none; }
#mOrder p.consent { margin: 0; font-size: .74rem; color: var(--text-muted); }
#mOrder.no-price .buy-bar .checkout-btn { flex: 1 1 auto; }
@media (max-width: 600px) {
  .buy-bar { gap: 10px; }
  .buy-bar .qty { height: 44px; }
  .buy-bar .checkout-btn { min-width: 0; flex: 1 1 auto; padding: 13px 14px; }
}
@media (max-width: 380px) {
  .buy-bar { flex-wrap: wrap; }
  .buy-bar .checkout-btn { flex-basis: 100%; }
}

/* ---------- smooth switch */
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color .3s ease, border-color .3s ease, color .3s ease, box-shadow .3s ease !important;
}

/* ============================================================ DARK */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg-color: #0b1020;
  --card-bg: #121a2e;
  --text-color: #e6e9f2;
  --text-muted: #97a1b8;
  --border-color: #232e4a;
  --d-surface: #121a2e;
  --d-surface2: #18213a;
  --d-hover: #1c2747;
}
html[data-theme="dark"] body { background: #0b1020; color: #e6e9f2; }

/* header */
html[data-theme="dark"] .site-header { background: rgba(11, 16, 32, .82); border-bottom-color: #1c2540; }
html[data-theme="dark"] .header-logo { color: #e6e9f2; }
html[data-theme="dark"] .search-bar input { background: #141c32; border-color: #232e4a; color: #e6e9f2; box-shadow: none; }
html[data-theme="dark"] .search-bar input::placeholder { color: #6f7a94; }
html[data-theme="dark"] .search-bar input:focus { background: #18213a; border-color: var(--primary-color); }
html[data-theme="dark"] .clear-search { color: #8a93ab; }
html[data-theme="dark"] .btn-gray { background: #26314d; }
html[data-theme="dark"] .theme-toggle { background: #18213a; border-color: #2a3555; color: #ffd166; }
html[data-theme="dark"] .sub-header { background: #0f1528; border-bottom-color: #1c2540; }
html[data-theme="dark"] .crumbs, html[data-theme="dark"] .crumbs a { color: #8a93ab; }
html[data-theme="dark"] .crumbs b { color: #e6e9f2; }

/* sections & categories */
html[data-theme="dark"] .section-head h2, html[data-theme="dark"] .page-title { color: #f1f3fa; }
html[data-theme="dark"] .section-head h2 small, html[data-theme="dark"] .cat-count { background: #1c2540; color: #97a1b8; }
html[data-theme="dark"] .cat-desc { color: #97a1b8; }
html[data-theme="dark"] .cat-nav-item { background: #121a2e; color: #d4d9e6; border-color: #26314d; box-shadow: none; }
html[data-theme="dark"] .cat-nav-item:hover { background: #1c2747; color: #fff; border-color: var(--primary-color); }
html[data-theme="dark"] .cat-nav-item.active { background: var(--primary-color); color: #fff; }
html[data-theme="dark"] .cat-nav-item.active .cat-count { background: rgba(255, 255, 255, .2); color: #fff; }
html[data-theme="dark"] .empty-state { background: #121a2e; border-color: #26314d; color: #97a1b8; }
html[data-theme="dark"] .search-fix { background: #2a2212; border-color: #4a3a14; color: #f5d58a; }

/* product cards */
html[data-theme="dark"] .product-card { background: #121a2e; border-color: #1f2a45; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
html[data-theme="dark"] .product-card:hover { box-shadow: 0 16px 34px rgba(0, 0, 0, .45); border-color: color-mix(in srgb, var(--primary-color) 45%, transparent); }
html[data-theme="dark"] .pc-title { color: #dfe3ee; }
html[data-theme="dark"] .pc-media { background: #0b1020; }

/* modal */
html[data-theme="dark"] .modal { background: rgba(2, 5, 15, .72); }
html[data-theme="dark"] .modal-content { background: #121a2e; box-shadow: 0 30px 70px -12px rgba(0, 0, 0, .7); }
html[data-theme="dark"] .modal-content::before { background: #2f3a58; }
html[data-theme="dark"] .modal-header { border-bottom-color: #1f2a45; }
html[data-theme="dark"] .modal-header h2 { color: #f1f3fa; }
html[data-theme="dark"] .modal-ico { background: #1c2747; }
html[data-theme="dark"] .icon-btn { background: #18213a; border-color: #2a3555; color: #c7cddd; }
html[data-theme="dark"] .icon-btn:hover { color: #fff; border-color: var(--primary-color); }
html[data-theme="dark"] .modal-desc { color: #cdd3e1; }
html[data-theme="dark"] .modal-gallery img { border-color: #26314d; }
html[data-theme="dark"] #mOrder.modal-footer { background: #0f1629; border-top-color: #1f2a45; }
html[data-theme="dark"] .qty { background: #18213a; border-color: #2a3555; }
html[data-theme="dark"] .qty input { background: transparent; color: #f1f3fa; }
html[data-theme="dark"] .qty button { color: #c7cddd; }
html[data-theme="dark"] .qty button:hover { background: #1f2a48; color: #fff; }
html[data-theme="dark"] .total-price-block b { color: #fff; }

/* typography */
html[data-theme="dark"] .content-typo { color: #cdd3e1; }
html[data-theme="dark"] .content-typo h2, html[data-theme="dark"] .content-typo h3 { color: #f1f3fa; }
html[data-theme="dark"] .content-typo blockquote { background: #16213f; }
html[data-theme="dark"] .content-typo code { background: #1c2540; color: #e6e9f2; }
html[data-theme="dark"] .content-typo th, html[data-theme="dark"] .content-typo td, html[data-theme="dark"] .content-typo hr { border-color: #26314d; }
html[data-theme="dark"] .content-typo a { color: #8fa8ff; }

/* search dropdown */
html[data-theme="dark"] .search-suggest { background: #121a2e; border-color: #26314d; box-shadow: 0 24px 50px rgba(0, 0, 0, .55); }
html[data-theme="dark"] .sug-item { color: #e6e9f2; }
html[data-theme="dark"] .sug-item:hover, html[data-theme="dark"] .sug-item.is-active, html[data-theme="dark"] .sug-all:hover, html[data-theme="dark"] .sug-all.is-active { background: #1c2747; }
html[data-theme="dark"] .sug-thumb { background: #1c2747; }
html[data-theme="dark"] .sug-cat { background: #18213a; border-color: #2a3555; color: #e6e9f2; }
html[data-theme="dark"] .sug-all { border-top-color: #1f2a45; }
html[data-theme="dark"] .sug-name mark, html[data-theme="dark"] .sug-cat mark { background: rgba(255, 184, 0, .3); }
html[data-theme="dark"] .sug-fix { background: #2a2212; color: #f5d58a; }

/* pages, news, garant, reviews, advertise */
html[data-theme="dark"] .page-article, html[data-theme="dark"] .post, html[data-theme="dark"] .news-card,
html[data-theme="dark"] .g-block, html[data-theme="dark"] .g-feature { background: #121a2e; border-color: #1f2a45; }
html[data-theme="dark"] .g-grid { background: none; }
html[data-theme="dark"] .news-poster { background: linear-gradient(135deg, #18213a, #1d1a3a); }
html[data-theme="dark"] .news-body p, html[data-theme="dark"] .post-lead { color: #a9b2c7; }
html[data-theme="dark"] .g-steps li { background: #18213a; }
html[data-theme="dark"] .g-steps p, html[data-theme="dark"] .g-feature p, html[data-theme="dark"] .rk-place-head p,
html[data-theme="dark"] .rk-note, html[data-theme="dark"] .g-faq p, html[data-theme="dark"] .g-tpl dd { color: #a9b2c7; }
html[data-theme="dark"] .g-tpl { border-color: #26314d; }
html[data-theme="dark"] .g-tpl > div { border-bottom-color: #1f2a45; }
html[data-theme="dark"] .g-tpl > div:nth-child(odd) { background: #151e35; }
html[data-theme="dark"] .btn-copy { background: #18213a; border-color: #2a3555; color: #8fa8ff; }
html[data-theme="dark"] .g-faq details { background: #18213a; border-color: #26314d; }
html[data-theme="dark"] .g-fee { background: linear-gradient(135deg, #3a2c0a, #4a3608); border-color: #6b4f10; }
html[data-theme="dark"] .g-fee-val { color: #ffd166; }
html[data-theme="dark"] .g-fee p { color: #e9d8a6; }
html[data-theme="dark"] .g-cta { background: #070b18; box-shadow: inset 0 0 0 1px #1f2a45; }
html[data-theme="dark"] .rk-place { background: #18213a; border-color: #26314d; }
html[data-theme="dark"] .rv-top { border-bottom-color: #1f2a45; }
html[data-theme="dark"] .rv-bar { color: #a9b2c7; }
html[data-theme="dark"] .rv-bar i { background: #1f2a45; }
html[data-theme="dark"] .rv-form { background: #18213a; border-color: #26314d; }
html[data-theme="dark"] .rv-form input[type=text], html[data-theme="dark"] .rv-form textarea { background: #121a2e; border-color: #2a3555; color: #e6e9f2; }
html[data-theme="dark"] .rv-item { background: #121a2e; border-color: #1f2a45; }
html[data-theme="dark"] .rv-body p { color: #cdd3e1; }
html[data-theme="dark"] .rv-reply { background: #16213f; }
html[data-theme="dark"] .stars { color: #3a4566; }
html[data-theme="dark"] .stars .on { color: #f59e0b; }
html[data-theme="dark"] .rv-rate label { color: #3a4566; }
html[data-theme="dark"] .rv-rate input:checked ~ label, html[data-theme="dark"] .rv-rate label:hover, html[data-theme="dark"] .rv-rate label:hover ~ label { color: #f59e0b; }

/* ads in dark */
html[data-theme="dark"] .hb-light { background: #121a2e; color: #e6e9f2; }
html[data-theme="dark"] .hb-image.is-empty { background: #121a2e; border-color: #2a3555; }
html[data-theme="dark"] .hb-dots button { background: #2f3a58; }
html[data-theme="dark"] .hb-dots button.is-active { background: var(--primary-color); }

/* footer & misc */
html[data-theme="dark"] .site-footer { background: #0f1528; border-top-color: #1c2540; color: #8a93ab; }
html[data-theme="dark"] .footer-logo { color: #e6e9f2; }
html[data-theme="dark"] .footer-links a { color: #8a93ab; }
html[data-theme="dark"] .footer-links a:hover { color: #fff; }
html[data-theme="dark"] .pager a { background: #121a2e; border-color: #26314d; color: #e6e9f2; }
html[data-theme="dark"] .pager a.active { background: var(--primary-color); border-color: var(--primary-color); }
html[data-theme="dark"] .link-back { color: #8fa8ff; }
html[data-theme="dark"] .hx { box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .7), inset 0 0 0 1px rgba(255, 255, 255, .06); }
html[data-theme="dark"] ::selection { background: color-mix(in srgb, var(--primary-color) 55%, transparent); color: #fff; }
