/* ==========================================================================
   Surfaces (SRP & DIP: Semantic surface classes + dark mode overrides)
   ========================================================================== */

.tg-surface-base {
  background-color: var(--tg-surface-base) !important;
}

.tg-surface-tinted {
  background-color: var(--tg-surface-tinted) !important;
}

.tg-surface-muted {
  background-color: var(--tg-surface-muted) !important;
}

.tg-surface-elevated {
  background-color: var(--tg-surface-elevated) !important;
}

html.dark body {
  background-color: var(--tg-surface-base) !important;
  color: var(--tg-text-secondary) !important;
}

html.dark section.wrapper:not(.image-wrapper):not(.bg-image):not([data-image-src]):not([style*="background-image"]):not(.bg-dark):not([class*="bg-[#21262c]"]),
html.dark main > section:not(.image-wrapper):not(.bg-image):not([data-image-src]):not([style*="background-image"]):not(.bg-dark):not([class*="bg-[#21262c]"]),
html.dark main [class*="bg-white"],
html.dark .bg-light,
html.dark .\!bg-\[\#ffffff\],
html.dark .\!bg-white {
  background-color: var(--tg-surface-base) !important;
  color: var(--tg-text-secondary) !important;
}

html.dark main [class*="from-white"] {
  background-color: var(--tg-surface-base) !important;
  background-image: none !important;
  color: var(--tg-text-secondary) !important;
}

html.dark section.wrapper[class*="!bg-[#edf2fc]"],
html.dark section.wrapper[class*="bg-[rgba(246,247,249,1)]"],
html.dark section.wrapper.bg-light,
html.dark .\!bg-\[\#edf2fc\],
html.dark section.\!bg-\[\#f0f0f8\] {
  background-color: var(--tg-surface-tinted) !important;
}

html.dark main [class*="bg-slate-50"],
html.dark main [class*="bg-slate-100"],
html.dark main [class*="bg-gray-50"],
html.dark main [class*="bg-[#f8fafc]"],
html.dark main [class*="bg-[#f6f7f9]"],
html.dark .card,
html.dark .card.\!bg-\[\#f0f0f8\] {
  background-color: var(--tg-surface-elevated) !important;
  border-color: var(--tg-border-card) !important;
  color: var(--tg-text-secondary) !important;
}

html.dark .card-footer {
  background-color: var(--tg-surface-subtle) !important;
  border-top-color: var(--tg-border-subtle) !important;
  color: var(--tg-text-muted) !important;
}

html.dark .divider,
html.dark .divider svg,
html.dark .divider svg path,
html.dark .divider.\!text-\[\#fefefe\],
html.dark .divider.\!text-\[\#fefefe\] svg,
html.dark .divider.\!text-\[\#fefefe\] svg path {
  color: var(--tg-surface-base) !important;
  fill: var(--tg-surface-base) !important;
}

/* Homepage Flagship Products Showcase */
html.dark .tg-products-section {
  background: var(--tg-surface-base) !important;
}

html.dark .tg-product-card {
  background: var(--tg-surface-elevated) !important;
  border-color: var(--tg-border-card) !important;
}

html.dark .tg-product-card .tg-card-visual {
  background: linear-gradient(145deg, #162033 0%, #0f172a 100%) !important;
}

html.dark .tg-product-card .tg-card-body {
  background: var(--tg-surface-elevated) !important;
}

html.dark .tg-feature-list {
  background: var(--tg-surface-base) !important;
  border-color: var(--tg-border-subtle) !important;
}

html.dark .tg-products-bottom-bar {
  background: var(--tg-surface-elevated) !important;
  border-color: var(--tg-border-card) !important;
}

html.dark .nav-tabs.nav-tabs-bg .nav-link.active,
html.dark .nav-tabs.nav-tabs-bg .nav-link:hover {
  background-color: var(--tg-surface-elevated) !important;
  border-color: var(--tg-border-subtle) !important;
}

html.dark hr {
  border-color: var(--tg-border-subtle) !important;
}
