/* ============================================================
   Protinex Diabetes Care — Dark Theme
   Uses [data-theme="dark"] to override all :root CSS variables
   GitHub Dark palette — VS Code Dark+ inspired, eye-friendly
   ============================================================ */

/* ── CSS Variable Overrides ────────────────────────────────── */
[data-theme="dark"] {
  --primary:        #3fb950;
  --primary-dark:   #2ea043;
  --primary-light:  rgba(63,185,80,0.10);
  --secondary:      #f0883e;
  --secondary-dark: #e07730;
  --accent:         #58a6ff;
  --accent-dark:    #388bfd;
  --bg:             #0d1117;
  --white:          #e6edf3;
  --text-dark:      #e6edf3;
  --text-muted:     #8b949e;
  --border:         #30363d;
  --success:        #3fb950;
  --error:          #f85149;
  --warning:        #d29922;
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.40);
  --shadow-md:      0 4px 16px rgba(0,0,0,0.50);
  --shadow-lg:      0 8px 32px rgba(0,0,0,0.60);
}

/* ── Color scheme & scrollbar ──────────────────────────────── */
[data-theme="dark"] { color-scheme: dark; }
[data-theme="dark"] ::-webkit-scrollbar { width: 8px; height: 8px; }
[data-theme="dark"] ::-webkit-scrollbar-track { background: #010409; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #30363d; border-radius: 4px; }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #3fb950; }
[data-theme="dark"] ::selection { background: rgba(63,185,80,0.25); color: #e6edf3; }

/* ── Base ──────────────────────────────────────────────────── */
[data-theme="dark"] body {
  background: #0d1117;
  color: #e6edf3;
}
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 { color: #e6edf3; }
[data-theme="dark"] p { color: #8b949e; }
[data-theme="dark"] a { color: #3fb950; }
[data-theme="dark"] a:hover { color: #2ea043; }

/* ── Announcement Bar ──────────────────────────────────────── */
[data-theme="dark"] .announcement-bar {
  background: #1a2f1a;
  border-bottom: 1px solid #2ea043;
  color: #e6edf3;
}
[data-theme="dark"] .announcement-bar a { color: #fde68a; }

/* ── Header ────────────────────────────────────────────────── */
[data-theme="dark"] .site-header {
  background: #161b22;
  border-bottom: 1px solid #30363d;
}
[data-theme="dark"] .site-header.scrolled {
  box-shadow: 0 4px 16px rgba(0,0,0,0.50);
}
[data-theme="dark"] .logo-text { color: #e6edf3; }
[data-theme="dark"] .logo-brand { color: #e6edf3; }
[data-theme="dark"] .logo-sub { color: #8b949e; }
[data-theme="dark"] .main-nav ul li a { color: #e6edf3; }
[data-theme="dark"] .main-nav ul li a:hover,
[data-theme="dark"] .main-nav ul li a.active {
  color: #3fb950;
  background: rgba(63,185,80,0.10);
}
[data-theme="dark"] .hamburger span { background: #e6edf3; }
[data-theme="dark"] .btn-icon {
  background: rgba(63,185,80,0.10);
  color: #3fb950;
}
[data-theme="dark"] .btn-icon:hover { background: #3fb950; color: #0d1117; }
[data-theme="dark"] .btn-outline-sm {
  color: #3fb950;
  border-color: #3fb950;
}
[data-theme="dark"] .btn-outline-sm:hover { background: #3fb950; color: #0d1117; }
[data-theme="dark"] .btn-primary-sm { background: #3fb950; color: #0d1117; }
[data-theme="dark"] .btn-primary-sm:hover { background: #2ea043; color: #0d1117; }

/* ── Mobile Nav ────────────────────────────────────────────── */
[data-theme="dark"] .mobile-nav {
  background: #161b22;
  box-shadow: 0 8px 32px rgba(0,0,0,0.60);
}
[data-theme="dark"] .mobile-nav ul li a {
  color: #e6edf3;
  border-bottom-color: #30363d;
}
[data-theme="dark"] .mobile-nav ul li a:hover { color: #3fb950; }
[data-theme="dark"] .close-nav {
  background: #21262d;
  color: #e6edf3;
}
[data-theme="dark"] .close-nav:hover { background: #f85149; color: #e6edf3; }

/* ── Hero Section ──────────────────────────────────────────── */
[data-theme="dark"] .hero-section {
  background: linear-gradient(135deg, #0d1117 0%, #161b22 60%, #0d1117 100%);
}
[data-theme="dark"] .hero-section::before {
  background: radial-gradient(circle, rgba(63,185,80,0.08) 0%, transparent 70%);
}
[data-theme="dark"] .hero-badge {
  background: rgba(63,185,80,0.10);
  color: #3fb950;
  border-color: rgba(63,185,80,0.25);
}
[data-theme="dark"] .hero-stats { border-top-color: #30363d; }
[data-theme="dark"] .hero-tag {
  background: #161b22;
  color: #e6edf3;
  box-shadow: 0 4px 16px rgba(0,0,0,0.50);
  border: 1px solid #30363d;
}

/* ── Trust Bar ─────────────────────────────────────────────── */
[data-theme="dark"] .trust-bar {
  background: #161b22;
  border-top-color: #30363d;
  border-bottom-color: #30363d;
}
[data-theme="dark"] .trust-item { color: #e6edf3; }
[data-theme="dark"] .trust-item .trust-icon {
  background: rgba(63,185,80,0.10);
  color: #3fb950;
}
[data-theme="dark"] .trust-divider { background: #30363d; }

/* ── Benefits Section ──────────────────────────────────────── */
[data-theme="dark"] .benefits-section { background: #0d1117; }
[data-theme="dark"] .benefit-card {
  background: #161b22;
  border-color: #30363d;
}
[data-theme="dark"] .benefit-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.60);
  border-color: #3fb950;
}
[data-theme="dark"] .benefit-card::before { background: #3fb950; }
[data-theme="dark"] .benefit-icon {
  background: rgba(63,185,80,0.10);
  color: #3fb950;
}
[data-theme="dark"] .benefit-card:hover .benefit-icon {
  background: #3fb950;
  color: #0d1117;
}
[data-theme="dark"] .benefit-card h3 { color: #e6edf3; }

/* ── Product Section ───────────────────────────────────────── */
[data-theme="dark"] .product-section { background: #0d1117; }
[data-theme="dark"] .product-main-img {
  background: #161b22;
  border-color: #30363d;
}
[data-theme="dark"] .product-thumb {
  background: #21262d;
  border-color: #30363d;
}
[data-theme="dark"] .product-thumb:hover,
[data-theme="dark"] .product-thumb.active { border-color: #3fb950; }
[data-theme="dark"] .product-info .product-badge {
  background: rgba(210,153,34,0.15);
  color: #d29922;
}
[data-theme="dark"] .price-save {
  background: rgba(63,185,80,0.15);
  color: #3fb950;
}
[data-theme="dark"] .pack-option {
  background: #161b22;
  border-color: #30363d;
  color: #e6edf3;
}
[data-theme="dark"] .pack-option:hover,
[data-theme="dark"] .pack-option.active {
  border-color: #3fb950;
  background: rgba(63,185,80,0.10);
  color: #3fb950;
}
[data-theme="dark"] .qty-control { border-color: #30363d; }
[data-theme="dark"] .qty-btn {
  background: #21262d;
  color: #e6edf3;
}
[data-theme="dark"] .qty-btn:hover { background: #3fb950; color: #0d1117; }
[data-theme="dark"] .qty-input {
  background: #161b22;
  color: #e6edf3;
  border-left-color: #30363d;
  border-right-color: #30363d;
}
[data-theme="dark"] .product-feature { color: #8b949e; }
[data-theme="dark"] .product-feature .feat-icon { color: #3fb950; }
[data-theme="dark"] .product-tagline { color: #8b949e; }
[data-theme="dark"] .rating-count { color: #8b949e; }

/* ── How To Use / Steps ────────────────────────────────────── */
[data-theme="dark"] .how-to-use { background: #161b22; }
[data-theme="dark"] .step-card {
  background: #21262d;
  border-color: #30363d;
}
[data-theme="dark"] .step-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.50);
  border-color: #3fb950;
}
[data-theme="dark"] .step-number {
  background: #3fb950;
  color: #0d1117;
  border-color: #21262d;
  box-shadow: 0 0 0 2px #3fb950;
}
[data-theme="dark"] .step-card h4 { color: #e6edf3; }
[data-theme="dark"] .steps-grid::before {
  background: linear-gradient(90deg, #3fb950 0%, rgba(63,185,80,0.20) 100%);
}

/* ── Nutrition Table ───────────────────────────────────────── */
[data-theme="dark"] .nutrition-section { background: #0d1117; }
[data-theme="dark"] .nutrition-table { border-color: #30363d; }
[data-theme="dark"] .nutrition-table thead tr { background: #161b22; }
[data-theme="dark"] .nutrition-table th { color: #3fb950; border-bottom: 2px solid #3fb950; }
[data-theme="dark"] .nutrition-table td {
  color: #e6edf3;
  border-bottom-color: #30363d;
}
[data-theme="dark"] .nutrition-table tbody tr:nth-child(even) { background: #161b22; }
[data-theme="dark"] .nutrition-table tbody tr:nth-child(odd)  { background: #0d1117; }
[data-theme="dark"] .nutrition-table tbody tr:hover { background: rgba(63,185,80,0.08); }
[data-theme="dark"] .nutrition-table tfoot td {
  background: #161b22;
  color: #8b949e;
}

/* ── Testimonials ──────────────────────────────────────────── */
[data-theme="dark"] .testimonials-section { background: #161b22; }
[data-theme="dark"] .testimonial-card {
  background: #21262d;
  border-color: #30363d;
}
[data-theme="dark"] .testimonial-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.60);
  border-color: #3fb950;
}
[data-theme="dark"] .testimonial-card::before { color: rgba(63,185,80,0.20); }
[data-theme="dark"] .testimonial-text { color: #e6edf3; }
[data-theme="dark"] .author-avatar {
  background: rgba(63,185,80,0.15);
  color: #3fb950;
}
[data-theme="dark"] .author-name { color: #e6edf3; }
[data-theme="dark"] .author-meta { color: #8b949e; }
[data-theme="dark"] .verified-badge { color: #3fb950; }

/* ── FAQ ───────────────────────────────────────────────────── */
[data-theme="dark"] .faq-section { background: #0d1117; }
[data-theme="dark"] .faq-item { border-color: #30363d; }
[data-theme="dark"] .faq-item.open { box-shadow: 0 1px 3px rgba(0,0,0,0.40); }
[data-theme="dark"] .faq-question {
  background: #161b22;
  color: #e6edf3;
}
[data-theme="dark"] .faq-question:hover { background: #21262d; }
[data-theme="dark"] .faq-item.open .faq-question {
  background: rgba(63,185,80,0.10);
  color: #3fb950;
}
[data-theme="dark"] .faq-icon { background: #30363d; color: #8b949e; }
[data-theme="dark"] .faq-item.open .faq-icon { background: #3fb950; color: #0d1117; }
[data-theme="dark"] .faq-answer-inner { color: #8b949e; }

/* ── CTA Banner ────────────────────────────────────────────── */
[data-theme="dark"] .cta-banner {
  background: linear-gradient(135deg, #1a2f1a 0%, #0d2818 100%);
  border-top: 1px solid #2ea043;
  border-bottom: 1px solid #2ea043;
}
[data-theme="dark"] .cta-banner h2 { color: #e6edf3; }
[data-theme="dark"] .cta-banner p  { color: rgba(230,237,243,0.75); }

/* ── Forms ─────────────────────────────────────────────────── */
[data-theme="dark"] .form-label { color: #e6edf3; }
[data-theme="dark"] .form-control {
  background: #161b22;
  border-color: #30363d;
  color: #e6edf3;
}
[data-theme="dark"] .form-control:focus {
  border-color: #3fb950;
  box-shadow: 0 0 0 3px rgba(63,185,80,0.15);
}
[data-theme="dark"] .form-control::placeholder { color: #6e7681; }
[data-theme="dark"] .form-control.error { border-color: #f85149; }
[data-theme="dark"] .form-control.error:focus { box-shadow: 0 0 0 3px rgba(248,81,73,0.15); }
[data-theme="dark"] .form-error { color: #f85149; }
[data-theme="dark"] .form-hint  { color: #8b949e; }
[data-theme="dark"] select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b949e' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}
[data-theme="dark"] .form-check label { color: #8b949e; }

/* ── Auth Pages ────────────────────────────────────────────── */
[data-theme="dark"] .auth-page {
  background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
}
[data-theme="dark"] .auth-card {
  background: #161b22;
  border-color: #30363d;
  box-shadow: 0 8px 32px rgba(0,0,0,0.60);
}
[data-theme="dark"] .auth-title { color: #e6edf3; }
[data-theme="dark"] .auth-subtitle { color: #8b949e; }
[data-theme="dark"] .auth-divider { color: #8b949e; }
[data-theme="dark"] .auth-divider::before,
[data-theme="dark"] .auth-divider::after { background: #30363d; }
[data-theme="dark"] .auth-footer { color: #8b949e; }
[data-theme="dark"] .auth-footer a { color: #3fb950; }

/* ── Checkout ──────────────────────────────────────────────── */
[data-theme="dark"] .checkout-page { background: #0d1117; }
[data-theme="dark"] .checkout-form-wrap {
  background: #161b22;
  border-color: #30363d;
}
[data-theme="dark"] .checkout-section-title {
  color: #e6edf3;
  border-bottom-color: #30363d;
}
[data-theme="dark"] .order-summary {
  background: #161b22;
  border-color: #30363d;
}
[data-theme="dark"] .order-summary h3 {
  color: #e6edf3;
  border-bottom-color: #30363d;
}
[data-theme="dark"] .order-item-img {
  background: #21262d;
  border-color: #30363d;
}
[data-theme="dark"] .order-item-name { color: #e6edf3; }
[data-theme="dark"] .order-item-qty  { color: #8b949e; }
[data-theme="dark"] .order-totals { border-top-color: #30363d; }
[data-theme="dark"] .order-total-row { color: #8b949e; }
[data-theme="dark"] .order-total-row.grand {
  color: #e6edf3;
  border-top-color: #30363d;
}
[data-theme="dark"] .payment-option {
  border-color: #30363d;
  background: #161b22;
  color: #e6edf3;
}
[data-theme="dark"] .payment-option:hover,
[data-theme="dark"] .payment-option.active {
  border-color: #3fb950;
  background: rgba(63,185,80,0.10);
}
[data-theme="dark"] .payment-option label { color: #e6edf3; }

/* ── Account Page ──────────────────────────────────────────── */
[data-theme="dark"] .account-page { background: #0d1117; }
[data-theme="dark"] .account-sidebar {
  background: #161b22;
  border-color: #30363d;
}
[data-theme="dark"] .account-user {
  background: rgba(63,185,80,0.08);
  border-bottom-color: #30363d;
}
[data-theme="dark"] .account-name { color: #e6edf3; }
[data-theme="dark"] .account-email { color: #8b949e; }
[data-theme="dark"] .account-nav a {
  color: #e6edf3;
  border-bottom-color: #30363d;
}
[data-theme="dark"] .account-nav a:hover,
[data-theme="dark"] .account-nav a.active {
  background: rgba(63,185,80,0.10);
  color: #3fb950;
}
[data-theme="dark"] .account-content {
  background: #161b22;
  border-color: #30363d;
}
[data-theme="dark"] .account-content-title {
  color: #e6edf3;
  border-bottom-color: #30363d;
}
[data-theme="dark"] .orders-table th {
  background: #21262d;
  color: #8b949e;
  border-bottom-color: #30363d;
}
[data-theme="dark"] .orders-table td {
  color: #e6edf3;
  border-bottom-color: #30363d;
}
[data-theme="dark"] .orders-table tbody tr:hover { background: rgba(63,185,80,0.05); }

/* ── Footer ────────────────────────────────────────────────── */
[data-theme="dark"] .site-footer {
  background: #010409;
  color: rgba(230,237,243,0.75);
}
[data-theme="dark"] .footer-grid { border-bottom-color: rgba(48,54,61,0.8); }
[data-theme="dark"] .footer-brand .logo-brand { color: #e6edf3; }
[data-theme="dark"] .footer-brand .logo-text span,
[data-theme="dark"] .footer-brand .logo-text .text-primary { color: #3fb950; }
[data-theme="dark"] .footer-brand p { color: rgba(230,237,243,0.55); }
[data-theme="dark"] .footer-links h4,
[data-theme="dark"] .footer-contact h4 { color: #e6edf3; }
[data-theme="dark"] .footer-links ul li a { color: rgba(230,237,243,0.55); }
[data-theme="dark"] .footer-links ul li a:hover { color: #e6edf3; }
[data-theme="dark"] .footer-contact ul li { color: rgba(230,237,243,0.55); }
[data-theme="dark"] .footer-contact ul li i { color: #3fb950; }
[data-theme="dark"] .footer-contact ul li a { color: rgba(230,237,243,0.55); }
[data-theme="dark"] .footer-contact ul li a:hover { color: #e6edf3; }
[data-theme="dark"] .social-links a,
[data-theme="dark"] .social-link {
  background: rgba(255,255,255,0.06);
  color: rgba(230,237,243,0.65);
}
[data-theme="dark"] .social-links a:hover,
[data-theme="dark"] .social-link:hover { background: #3fb950; color: #0d1117; }
[data-theme="dark"] .footer-bottom { border-top-color: rgba(48,54,61,0.8); }
[data-theme="dark"] .footer-bottom p { color: rgba(230,237,243,0.40); }
[data-theme="dark"] .trust-badges span {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.08);
  color: rgba(230,237,243,0.65);
}
[data-theme="dark"] .trust-badges span i { color: #3fb950; }
[data-theme="dark"] .disclaimer { color: rgba(230,237,243,0.30); }

/* ── Alerts ────────────────────────────────────────────────── */
[data-theme="dark"] .alert-success {
  background: rgba(63,185,80,0.10);
  color: #3fb950;
  border-color: rgba(63,185,80,0.30);
}
[data-theme="dark"] .alert-error {
  background: rgba(248,81,73,0.10);
  color: #f85149;
  border-color: rgba(248,81,73,0.30);
}
[data-theme="dark"] .alert-info {
  background: rgba(88,166,255,0.10);
  color: #58a6ff;
  border-color: rgba(88,166,255,0.30);
}
[data-theme="dark"] .alert-warning {
  background: rgba(210,153,34,0.10);
  color: #d29922;
  border-color: rgba(210,153,34,0.30);
}

/* ── Badges ────────────────────────────────────────────────── */
[data-theme="dark"] .badge-green  { background: rgba(63,185,80,0.15);  color: #3fb950; }
[data-theme="dark"] .badge-orange { background: rgba(240,136,62,0.15); color: #f0883e; }
[data-theme="dark"] .badge-blue   { background: rgba(88,166,255,0.15); color: #58a6ff; }
[data-theme="dark"] .badge-purple { background: rgba(188,140,255,0.15);color: #bc8cff; }
[data-theme="dark"] .badge-red    { background: rgba(248,81,73,0.15);  color: #f85149; }
[data-theme="dark"] .badge-gray   { background: rgba(139,148,158,0.15);color: #8b949e; }

/* ── Spinner / Loading ─────────────────────────────────────── */
[data-theme="dark"] .spinner { border-color: #30363d; border-top-color: #3fb950; }
[data-theme="dark"] .loading-overlay { background: rgba(13,17,23,0.85); }

/* ── Back-to-top button ────────────────────────────────────── */
[data-theme="dark"] .back-to-top,
[data-theme="dark"] #backToTop {
  background: #3fb950;
  color: #0d1117;
  box-shadow: 0 4px 14px rgba(63,185,80,0.35);
}
[data-theme="dark"] .back-to-top:hover,
[data-theme="dark"] #backToTop:hover {
  background: #2ea043;
  box-shadow: 0 6px 20px rgba(63,185,80,0.45);
}

/* ── Product Preview (index.php) ───────────────────────────── */
[data-theme="dark"] .preview-inner { background: transparent; }

/* ── Order Success ─────────────────────────────────────────── */
[data-theme="dark"] .order-success-grid .benefit-card,
[data-theme="dark"] .order-success-grid > div {
  background: #161b22;
  border-color: #30363d;
}

/* ── Dividers & misc ───────────────────────────────────────── */
[data-theme="dark"] .divider { background: #30363d; }
[data-theme="dark"] .section-title { color: #e6edf3; }
[data-theme="dark"] .section-subtitle { color: #8b949e; }
[data-theme="dark"] .text-muted { color: #8b949e; }

/* ── Admin Panel Tweaks ────────────────────────────────────── */
[data-theme="dark"] .admin-sidebar {
  background: #010409;
  border-right-color: #21262d;
}
[data-theme="dark"] .admin-sidebar-header { border-bottom-color: #21262d; }
[data-theme="dark"] .admin-nav-section { color: #6e7681; }
[data-theme="dark"] .admin-nav a { color: #8b949e; }
[data-theme="dark"] .admin-nav a:hover,
[data-theme="dark"] .admin-nav a.active {
  background: rgba(63,185,80,0.10);
  color: #3fb950;
}
[data-theme="dark"] .admin-sidebar-footer { border-top-color: #21262d; }
[data-theme="dark"] .admin-sidebar-footer a { color: #8b949e; }
[data-theme="dark"] .admin-sidebar-footer a:hover { color: #3fb950; }

/* ── Theme Toggle Button ───────────────────────────────────── */
[data-theme="dark"] .theme-toggle-btn {
  background: rgba(63,185,80,0.10);
  color: #3fb950;
  border-color: #30363d;
}
[data-theme="dark"] .theme-toggle-btn:hover {
  background: #3fb950;
  color: #0d1117;
  border-color: #3fb950;
}

/* ── btn-primary text fix — always white on dark green bg ──── */
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .btn-primary-sm,
[data-theme="dark"] .btn-primary-sm:hover,
[data-theme="dark"] .header-order-btn,
[data-theme="dark"] .header-order-btn:hover {
  color: #ffffff !important;
}

/* ── btn-secondary (orange) — dark text for contrast ────────── */
[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .btn-secondary:hover {
  color: #0d1117 !important;
  font-weight: 700;
}

/* ── btn-outline — visible border + text in dark mode ───────── */
[data-theme="dark"] .btn-outline {
  color: #3fb950;
  border-color: #3fb950;
  background: transparent;
}
[data-theme="dark"] .btn-outline:hover {
  background: #3fb950;
  color: #0d1117 !important;
}

/* ============================================================
   Global inline-style color overrides for dark mode
   These target hardcoded color:#xxx inline styles that can't
   be overridden by class selectors alone.
   ============================================================ */

/* ── Dark text (#1e293b) → light text ──────────────────────── */
[data-theme="dark"] [style*="color:#1e293b"],
[data-theme="dark"] [style*="color: #1e293b"] {
  color: #e6edf3 !important;
}

/* ── Muted text (#64748b) → dark muted ─────────────────────── */
[data-theme="dark"] [style*="color:#64748b"],
[data-theme="dark"] [style*="color: #64748b"] {
  color: #8b949e !important;
}

/* ── Primary green (#1a6b3c) → bright green ────────────────── */
[data-theme="dark"] [style*="color:#1a6b3c"],
[data-theme="dark"] [style*="color: #1a6b3c"] {
  color: #3fb950 !important;
}

/* ── Dark green text (#166534) → bright green ──────────────── */
[data-theme="dark"] [style*="color:#166534"],
[data-theme="dark"] [style*="color: #166534"] {
  color: #3fb950 !important;
}

/* ── Success green (#16a34a) → bright green ────────────────── */
[data-theme="dark"] [style*="color:#16a34a"],
[data-theme="dark"] [style*="color: #16a34a"] {
  color: #3fb950 !important;
}

/* ── Blue (#2563eb, #1d4ed8) → accent blue ─────────────────── */
[data-theme="dark"] [style*="color:#2563eb"],
[data-theme="dark"] [style*="color: #2563eb"],
[data-theme="dark"] [style*="color:#1d4ed8"],
[data-theme="dark"] [style*="color: #1d4ed8"] {
  color: #58a6ff !important;
}

/* ── Orange (#ea580c) → soft orange ────────────────────────── */
[data-theme="dark"] [style*="color:#ea580c"],
[data-theme="dark"] [style*="color: #ea580c"] {
  color: #f0883e !important;
}

/* ── Red (#dc2626) → soft red ──────────────────────────────── */
[data-theme="dark"] [style*="color:#dc2626"],
[data-theme="dark"] [style*="color: #dc2626"] {
  color: #f85149 !important;
}

/* ── Dark amber (#92400e) → amber ──────────────────────────── */
[data-theme="dark"] [style*="color:#92400e"],
[data-theme="dark"] [style*="color: #92400e"] {
  color: #d29922 !important;
}

/* ── Inline background overrides ───────────────────────────── */
/* White/light backgrounds on inline elements */
[data-theme="dark"] [style*="background:#fff"],
[data-theme="dark"] [style*="background: #fff"],
[data-theme="dark"] [style*="background:#ffffff"],
[data-theme="dark"] [style*="background-color:#fff"],
[data-theme="dark"] [style*="background-color: #fff"] {
  background: #161b22 !important;
}

[data-theme="dark"] [style*="background:#f8fafc"],
[data-theme="dark"] [style*="background: #f8fafc"],
[data-theme="dark"] [style*="background:#f1f5f9"] {
  background: #21262d !important;
}

/* Green tinted boxes */
[data-theme="dark"] [style*="background:#f0fdf4"],
[data-theme="dark"] [style*="background: #f0fdf4"] {
  background: rgba(63,185,80,.08) !important;
  border-color: rgba(63,185,80,.2) !important;
}

/* Blue tinted boxes */
[data-theme="dark"] [style*="background:#eff6ff"],
[data-theme="dark"] [style*="background: #eff6ff"],
[data-theme="dark"] [style*="background:#dbeafe"],
[data-theme="dark"] [style*="background: #dbeafe"] {
  background: rgba(88,166,255,.08) !important;
  border-color: rgba(88,166,255,.2) !important;
}

/* Orange tinted boxes */
[data-theme="dark"] [style*="background:#fff7ed"],
[data-theme="dark"] [style*="background: #fff7ed"],
[data-theme="dark"] [style*="background:#ffedd5"],
[data-theme="dark"] [style*="background: #ffedd5"] {
  background: rgba(240,136,62,.08) !important;
  border-color: rgba(240,136,62,.2) !important;
}

/* Green success boxes */
[data-theme="dark"] [style*="background:#dcfce7"],
[data-theme="dark"] [style*="background: #dcfce7"] {
  background: rgba(63,185,80,.12) !important;
  border-color: rgba(63,185,80,.25) !important;
}

/* Yellow/amber boxes */
[data-theme="dark"] [style*="background:#fef3c7"],
[data-theme="dark"] [style*="background: #fef3c7"] {
  background: rgba(210,153,34,.12) !important;
  border-color: rgba(210,153,34,.25) !important;
}

/* ── Inline border colors ───────────────────────────────────── */
[data-theme="dark"] [style*="border:1px solid #e2e8f0"],
[data-theme="dark"] [style*="border: 1px solid #e2e8f0"],
[data-theme="dark"] [style*="border-bottom:1px solid #e2e8f0"],
[data-theme="dark"] [style*="border-top:1px solid #e2e8f0"] {
  border-color: #30363d !important;
}

[data-theme="dark"] [style*="border:1px solid #bbf7d0"],
[data-theme="dark"] [style*="border: 1px solid #bbf7d0"] {
  border-color: rgba(63,185,80,.25) !important;
}

/* ── Step number circles (order-success.php) ────────────────── */
[data-theme="dark"] [style*="background:#dbeafe"][style*="color:#2563eb"] {
  background: rgba(88,166,255,.12) !important;
  color: #58a6ff !important;
}
[data-theme="dark"] [style*="background:#dcfce7"][style*="color:#16a34a"] {
  background: rgba(63,185,80,.12) !important;
  color: #3fb950 !important;
}
[data-theme="dark"] [style*="background:#ede9fe"] {
  background: rgba(188,140,255,.12) !important;
  color: #bc8cff !important;
}

/* ── Cards with inline white bg (order-success, checkout) ───── */
[data-theme="dark"] [style*="background:#fff;border-radius"],
[data-theme="dark"] [style*="background:#fff; border-radius"],
[data-theme="dark"] [style*="background:white"] {
  background: #161b22 !important;
}

/* ── Select dropdown — fix broken arrow in dark mode ────────── */
[data-theme="dark"] select.form-control {
  background-color: #161b22;
  color: #e6edf3;
  border-color: #30363d;
  /* Override the light SVG arrow with a dark-friendly white arrow */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b949e' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 12px 8px;
  padding-right: 2.5rem;
  appearance: none;
  -webkit-appearance: none;
}
[data-theme="dark"] select.form-control:focus {
  border-color: #3fb950;
  box-shadow: 0 0 0 3px rgba(63,185,80,.15);
  outline: none;
}
/* Fix select option colors in dark mode */
[data-theme="dark"] select.form-control option {
  background-color: #161b22;
  color: #e6edf3;
}

/* ============================================================
   COMPREHENSIVE DARK MODE — All white background fixes
   ============================================================ */

/* ── Admin panel — white cards & header ─────────────────────── */
[data-theme="dark"] .admin-body { background: #0d1117; }
[data-theme="dark"] .admin-header {
  background: #161b22 !important;
  border-bottom-color: #30363d !important;
}
[data-theme="dark"] .admin-page-title { color: #e6edf3 !important; }
[data-theme="dark"] .admin-breadcrumb { color: #8b949e !important; }
[data-theme="dark"] .admin-header-btn {
  background: #21262d !important;
  border-color: #30363d !important;
  color: #8b949e !important;
}
[data-theme="dark"] .admin-header-btn:hover {
  background: rgba(63,185,80,.12) !important;
  color: #3fb950 !important;
}
[data-theme="dark"] .admin-user-name { color: #e6edf3 !important; }

/* Admin cards — the white boxes */
[data-theme="dark"] .admin-card {
  background: #161b22 !important;
  border-color: #30363d !important;
}
[data-theme="dark"] .admin-card-header {
  background: #161b22 !important;
  border-bottom-color: #30363d !important;
}
[data-theme="dark"] .admin-card-title { color: #e6edf3 !important; }
[data-theme="dark"] .admin-card-body  { background: #161b22 !important; }

/* Admin table */
[data-theme="dark"] .admin-table thead tr { background: #21262d !important; }
[data-theme="dark"] .admin-table th {
  color: #8b949e !important;
  border-bottom-color: #30363d !important;
  background: #21262d !important;
}
[data-theme="dark"] .admin-table td {
  color: #e6edf3 !important;
  border-bottom-color: #30363d !important;
  background: #161b22 !important;
}
[data-theme="dark"] .admin-table tbody tr:hover { background: #21262d !important; }
[data-theme="dark"] .admin-table-wrap { background: #161b22 !important; }

/* Admin form controls */
[data-theme="dark"] .admin-form-control {
  background: #21262d !important;
  border-color: #30363d !important;
  color: #e6edf3 !important;
}
[data-theme="dark"] .admin-form-control:focus {
  border-color: #3fb950 !important;
  box-shadow: 0 0 0 3px rgba(63,185,80,.12) !important;
}
[data-theme="dark"] .admin-form-label { color: #e6edf3 !important; }

/* Admin pagination */
[data-theme="dark"] .admin-pagination {
  background: #161b22 !important;
  border-top-color: #30363d !important;
  color: #8b949e !important;
}
[data-theme="dark"] .page-btn {
  background: #21262d !important;
  border-color: #30363d !important;
  color: #e6edf3 !important;
}
[data-theme="dark"] .page-btn:hover,
[data-theme="dark"] .page-btn.active {
  background: #3fb950 !important;
  border-color: #3fb950 !important;
  color: #0d1117 !important;
}

/* Admin stats cards */
[data-theme="dark"] .stat-card {
  background: #161b22 !important;
  border-color: #30363d !important;
}
[data-theme="dark"] .stat-card-value { color: #e6edf3 !important; }
[data-theme="dark"] .stat-card-label { color: #8b949e !important; }

/* Admin content area */
[data-theme="dark"] .admin-content { background: #0d1117 !important; }
[data-theme="dark"] .admin-main     { background: #0d1117 !important; }

/* ── Checkout page white boxes ──────────────────────────────── */
[data-theme="dark"] .checkout-page { background: #0d1117 !important; }
[data-theme="dark"] .checkout-form-wrap {
  background: #161b22 !important;
  border-color: #30363d !important;
}
[data-theme="dark"] .checkout-section-title {
  color: #e6edf3 !important;
  border-bottom-color: #30363d !important;
}
[data-theme="dark"] .order-summary {
  background: #161b22 !important;
  border-color: #30363d !important;
}

/* ── Login / Register white card ────────────────────────────── */
[data-theme="dark"] .auth-card {
  background: #161b22 !important;
  border-color: #30363d !important;
}

/* ── Account page ───────────────────────────────────────────── */
[data-theme="dark"] .account-page { background: #0d1117 !important; }
[data-theme="dark"] .account-sidebar {
  background: #161b22 !important;
  border-color: #30363d !important;
}
[data-theme="dark"] .account-content {
  background: #161b22 !important;
  border-color: #30363d !important;
}
[data-theme="dark"] .account-user {
  background: rgba(63,185,80,.08) !important;
  border-bottom-color: #30363d !important;
}

/* ── Order success page ─────────────────────────────────────── */
[data-theme="dark"] .order-success-page { background: #0d1117 !important; }

/* ── Product section ────────────────────────────────────────── */
[data-theme="dark"] .product-section { background: #0d1117 !important; }
[data-theme="dark"] .product-main-img {
  background: #161b22 !important;
  border-color: #30363d !important;
}
[data-theme="dark"] #totalPreview {
  background: #21262d !important;
  border-color: #30363d !important;
}
[data-theme="dark"] #totalPreview span { color: #e6edf3 !important; }

/* ── Breadcrumb nav ─────────────────────────────────────────── */
[data-theme="dark"] .breadcrumb-nav,
[data-theme="dark"] nav[aria-label="Breadcrumb"] {
  background: #161b22 !important;
  border-bottom-color: #30363d !important;
}
[data-theme="dark"] .breadcrumb-nav ol,
[data-theme="dark"] nav[aria-label="Breadcrumb"] ol { color: #8b949e !important; }

/* ── Delivery info box on product page ──────────────────────── */
[data-theme="dark"] [style*="background:#f0fdf4"][style*="border:1px solid #bbf7d0"] {
  background: rgba(63,185,80,.08) !important;
  border-color: rgba(63,185,80,.2) !important;
}

/* ── Payment option boxes ───────────────────────────────────── */
[data-theme="dark"] .payment-option {
  background: #21262d !important;
  border-color: #30363d !important;
}
[data-theme="dark"] .payment-option.active,
[data-theme="dark"] .payment-option:hover {
  background: rgba(63,185,80,.10) !important;
  border-color: #3fb950 !important;
}

/* ── Free shipping nudge box ────────────────────────────────── */
[data-theme="dark"] #freeShipNudge {
  background: rgba(210,153,34,.10) !important;
  border-color: rgba(210,153,34,.25) !important;
}

/* ── Savings box in checkout ────────────────────────────────── */
[data-theme="dark"] [style*="background:#f0fdf4"][style*="border:1px solid #bbf7d0"] {
  background: rgba(63,185,80,.08) !important;
  border-color: rgba(63,185,80,.2) !important;
}

/* ── What's next steps (order success) ──────────────────────── */
[data-theme="dark"] [style*="background:#fff;border-radius:16px"],
[data-theme="dark"] [style*="background: #fff; border-radius: 16px"],
[data-theme="dark"] [style*="background:#fff;border-radius:12px"] {
  background: #161b22 !important;
  border-color: #30363d !important;
}

/* ── Logged-in email box in checkout ────────────────────────── */
[data-theme="dark"] [style*="background:#f0fdf4;border-radius:8px;border:1px solid #bbf7d0"] {
  background: rgba(63,185,80,.08) !important;
  border-color: rgba(63,185,80,.2) !important;
  color: #3fb950 !important;
}

/* ── Admin login page ───────────────────────────────────────── */
[data-theme="dark"] .admin-login-card {
  background: #161b22 !important;
  border: 1px solid #30363d !important;
}
[data-theme="dark"] .admin-login-logo h1 { color: #e6edf3 !important; }
[data-theme="dark"] .admin-login-logo p  { color: #8b949e !important; }

/* ── Table action buttons ───────────────────────────────────── */
[data-theme="dark"] .table-action-btn {
  background: #21262d !important;
  border-color: #30363d !important;
  color: #8b949e !important;
}
[data-theme="dark"] .table-action-btn:hover {
  background: rgba(63,185,80,.12) !important;
  color: #3fb950 !important;
  border-color: #3fb950 !important;
}

/* ── Admin buttons ──────────────────────────────────────────── */
[data-theme="dark"] .admin-btn-secondary {
  background: #21262d !important;
  border-color: #30363d !important;
  color: #e6edf3 !important;
}
[data-theme="dark"] .admin-btn-secondary:hover {
  background: #30363d !important;
}

/* ── Nutrition section white bg ─────────────────────────────── */
[data-theme="dark"] .nutrition-section { background: #0d1117 !important; }

/* ── Product preview section ────────────────────────────────── */
[data-theme="dark"] .product-preview-section { background: #161b22 !important; }

/* ── How to use section ─────────────────────────────────────── */
[data-theme="dark"] .how-to-use { background: #161b22 !important; }

/* ── Testimonials section ───────────────────────────────────── */
[data-theme="dark"] .testimonials-section { background: #161b22 !important; }

/* ── FAQ section ────────────────────────────────────────────── */
[data-theme="dark"] .faq-section { background: #0d1117 !important; }

/* ── Benefits section ───────────────────────────────────────── */
[data-theme="dark"] .benefits-section { background: #0d1117 !important; }

/* ── Hero section ───────────────────────────────────────────── */
[data-theme="dark"] .hero-section {
  background: linear-gradient(135deg, #0d1117 0%, #161b22 60%, #0d1117 100%) !important;
}

/* ── Trust bar ──────────────────────────────────────────────── */
[data-theme="dark"] .trust-bar {
  background: #161b22 !important;
  border-color: #30363d !important;
}

/* ── Announcement bar ───────────────────────────────────────── */
[data-theme="dark"] .announcement-bar {
  background: #1a2f1a !important;
  border-bottom-color: #2ea043 !important;
}

/* ── Site header ────────────────────────────────────────────── */
[data-theme="dark"] .site-header {
  background: #161b22 !important;
  border-bottom-color: #30363d !important;
}

/* ── Mobile nav ─────────────────────────────────────────────── */
[data-theme="dark"] .mobile-nav {
  background: #161b22 !important;
}
[data-theme="dark"] .mobile-nav ul li a {
  border-bottom-color: #30363d !important;
  color: #e6edf3 !important;
}

/* ── Footer ─────────────────────────────────────────────────── */
[data-theme="dark"] .site-footer { background: #010409 !important; }
[data-theme="dark"] .footer-grid { border-bottom-color: rgba(48,54,61,.8) !important; }
[data-theme="dark"] .footer-bottom p { color: rgba(230,237,243,.4) !important; }
[data-theme="dark"] .disclaimer { color: rgba(230,237,243,.3) !important; }

/* ── Catch-all: any remaining white/light backgrounds ───────── */
[data-theme="dark"] section[style*="background:#fff"],
[data-theme="dark"] section[style*="background: #fff"],
[data-theme="dark"] section[style*="background:white"],
[data-theme="dark"] div[style*="background:#fff;"],
[data-theme="dark"] div[style*="background: #fff;"] {
  background: #161b22 !important;
}
[data-theme="dark"] section[style*="background:#f8fafc"],
[data-theme="dark"] section[style*="background: #f8fafc"],
[data-theme="dark"] div[style*="background:#f8fafc"] {
  background: #21262d !important;
}
[data-theme="dark"] section[style*="padding:3rem 0;background:#f8fafc"],
[data-theme="dark"] section[style*="padding:5rem 0;background:#fff"] {
  background: #161b22 !important;
}
