/* TVN Global v3 - Flatsome-Inspired Industrial Minimalist Theme */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --dark: #0f172a;
  --dark-2: #1e293b;
  --text: #334155;
  --muted: #64748b;
  --accent: #d97706;
  --accent-hover: #b45309;
  --border: #e2e8f0;
  --radius: 8px;
  --container-w: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 20px;
}

/* Topbar */
.topbar {
  background: var(--dark);
  color: #cbd5e1;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.topbar a { color: #fbbf24; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* Language Switcher */
.lang-switch {
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}
.lang-switch a {
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.4px;
  transition: background 0.15s, color 0.15s;
}
.lang-switch a.active {
  background: var(--accent);
  color: #ffffff;
}
.lang-switch-light {
  background: #f1f5f9;
  border-color: var(--border);
}
.lang-switch-light a { color: var(--dark-2); }
.lang-switch-light a.active { background: var(--accent); color: #ffffff; }

/* Header */
header.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 50;
  transition: box-shadow 0.2s;
}
header.site-header.is-sticky {
  position: sticky;
  top: 0;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  gap: 18px;
  padding: 8px 0;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--dark);
}
.logo-mark { width: 36px; height: 36px; border-radius: 6px; object-fit: contain; }
.logo-img { max-height: 44px; width: auto; }
.logo-accent { color: var(--accent); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
.main-nav a {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--dark-2);
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.main-nav a:hover, .main-nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mobile-toggle {
  display: none;
  background: #f1f5f9;
  border: 1px solid var(--border);
  color: var(--dark);
  border-radius: 6px;
  padding: 7px 11px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* UX Sections */
.ux-section {
  position: relative;
}
.ux-hero {
  background-color: var(--dark);
  background-size: cover;
  background-position: center;
  color: #ffffff;
  position: relative;
}
.ux-hero-overlay {
  position: relative;
  z-index: 2;
}
.ux-hero.has-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(95deg, rgba(15,23,42,0.92) 0%, rgba(15,23,42,0.70) 60%, rgba(15,23,42,0.45) 100%);
  z-index: 1;
}
.hero-kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #fbbf24;
  margin-bottom: 12px;
}
.ux-hero h1 {
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.18;
  margin-bottom: 16px;
  max-width: 820px;
}
.ux-hero p {
  color: #cbd5e1;
  max-width: 680px;
  margin-bottom: 28px;
  font-size: 16px;
}

/* Buttons */
.btn-group { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-primary { background: var(--accent); color: #ffffff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline-light { background: transparent; color: #ffffff; border-color: rgba(255,255,255,0.45); }
.btn-outline-light:hover { border-color: #ffffff; background: rgba(255,255,255,0.08); }
.btn-secondary { background: #ffffff; color: var(--dark); border-color: #cbd5e1; }
.btn-secondary:hover { border-color: var(--dark); }
.btn-sm { padding: 8px 14px; font-size: 13px; }

/* Section headers */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 26px;
}
.section-title {
  font-size: 24px;
  color: var(--dark);
  padding-left: 12px;
  border-left: 4px solid var(--accent);
  line-height: 1.25;
}
.section-sub {
  color: var(--muted);
  font-size: 14px;
  margin-top: 6px;
  padding-left: 16px;
}

/* Grids */
.grid { display: grid; gap: 22px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Flatsome Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
}
.card-pad { padding: 22px; }
.card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #f1f5f9;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.card:hover .card-media img { transform: scale(1.04); }
.placeholder-media {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #94a3b8;
  padding: 16px;
  text-align: center;
}
.placeholder-code {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ffffff;
  border: 1px solid rgba(251,191,36,0.45);
  padding: 5px 12px;
  border-radius: 6px;
  margin-bottom: 6px;
}
.placeholder-sub { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: #fbbf24; }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; justify-content: space-between; }
.card-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  margin-bottom: 6px;
}
.card h3 { font-size: 17px; color: var(--dark); margin-bottom: 8px; line-height: 1.35; }
.card p { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.card-link { font-size: 13px; font-weight: 700; color: var(--dark); display: inline-flex; align-items: center; gap: 4px; }
.card-link:hover { color: var(--accent); }
.badge-featured {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
  text-transform: uppercase;
}

/* Flatsome Blog Date Badge */
.blog-date-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #ffffff;
  color: var(--dark);
  width: 48px;
  height: 48px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(15,23,42,0.18);
  line-height: 1.05;
  border-top: 3px solid var(--accent);
}
.blog-date-badge strong { font-size: 16px; font-weight: 800; }
.blog-date-badge span { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--muted); }

/* CTA Strip */
.ux-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  color: #ffffff;
}
.ux-cta-inner h2 { font-size: 24px; margin-bottom: 6px; }
.ux-cta-inner p { color: #cbd5e1; max-width: 680px; font-size: 15px; }

/* Inner Pages & Flatsome Shop/Blog Two-Column Layout */
.page-main { padding: 36px 0 64px; min-height: 62vh; }
.breadcrumb {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.breadcrumb a:hover { color: var(--accent); }

.shop-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.blog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 30px;
  align-items: start;
}
.sidebar-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.sidebar-title {
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--dark);
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--border);
}
.cat-tree { list-style: none; }
.cat-tree > li { margin-bottom: 10px; }
.cat-tree > li > a {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
  padding: 5px 0;
}
.cat-tree > li > a.active, .cat-tree > li > a:hover { color: var(--accent); }
.sub-tree { list-style: none; padding-left: 12px; margin-top: 4px; border-left: 2px solid #f1f5f9; }
.sub-tree li a {
  display: block;
  font-size: 13px;
  color: var(--muted);
  padding: 3px 0;
}
.sub-tree li a.active, .sub-tree li a:hover { color: var(--accent); font-weight: 600; }

/* Single Product (Flatsome Style) */
.product-single-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 34px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 28px;
}
.gallery-main {
  aspect-ratio: 4 / 3;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.gallery-thumb {
  width: 72px;
  height: 54px;
  border: 2px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: #ffffff;
  padding: 0;
}
.gallery-thumb.active, .gallery-thumb:hover { border-color: var(--accent); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-title { font-size: 28px; color: var(--dark); line-height: 1.25; margin-bottom: 10px; }
.product-sku { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.product-summary { font-size: 15px; color: var(--text); margin-bottom: 20px; }
.quick-specs {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 22px;
}
.quick-specs-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
}
.quick-specs-row:last-child { border-bottom: none; }
.quick-specs-row span { color: var(--muted); }
.quick-specs-row strong { color: var(--dark); text-align: right; }

/* Flatsome Product Tabs */
.tabs-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 36px;
}
.tabs-nav {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
  flex-wrap: wrap;
}
.tab-btn {
  background: none;
  border: none;
  border-top: 3px solid transparent;
  padding: 14px 22px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  cursor: pointer;
}
.tab-btn.active {
  background: #ffffff;
  color: var(--dark);
  border-top-color: var(--accent);
}
.tab-pane { display: none; padding: 26px; }
.tab-pane.active { display: block; }

/* Rich Content Typography */
.rich-content p { margin-bottom: 14px; }
.rich-content h2, .rich-content h3, .rich-content h4 { color: var(--dark); margin: 18px 0 10px; }
.rich-content ul, .rich-content ol { padding-left: 22px; margin-bottom: 14px; }
.rich-content li { margin-bottom: 6px; }

/* Panels, Tables, Forms */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table th, .spec-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}
.spec-table th { width: 34%; color: var(--dark); background: #f8fafc; font-weight: 600; }

.form-grid { display: grid; gap: 14px; max-width: 620px; margin-top: 18px; }
.form-grid label { font-size: 14px; font-weight: 600; color: var(--dark); display: block; margin-bottom: 5px; }
.form-grid input, .form-grid textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  color: var(--dark);
}
.form-grid input:focus, .form-grid textarea:focus { outline: none; border-color: var(--accent); }
.alert-ok {
  background: #ecfdf5; border: 1px solid #10b981; color: #065f46;
  padding: 14px 16px; border-radius: 6px; margin-bottom: 18px;
}
.alert-err {
  background: #fef2f2; border: 1px solid #ef4444; color: #991b1b;
  padding: 14px 16px; border-radius: 6px; margin-bottom: 18px;
}
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.gone-box { text-align: center; padding: 52px 20px; }
.gone-box h1 { font-size: 28px; color: var(--dark); margin-bottom: 10px; }
.gone-box p { margin-bottom: 22px; color: var(--muted); }

/* Footer */
footer.site-footer {
  background: var(--dark);
  color: #94a3b8;
  padding: 48px 0 28px;
  font-size: 14px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
  margin-bottom: 28px;
}
footer.site-footer h4 { color: #ffffff; margin-bottom: 12px; font-size: 15px; }
footer.site-footer ul { list-style: none; display: grid; gap: 8px; }
footer.site-footer a:hover { color: #fbbf24; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* UX Builder Live Preview Hover Overlay (only active when body.ux-preview-mode) */
body.ux-preview-mode .ux-section {
  cursor: pointer;
  outline: 2px dashed transparent;
  outline-offset: -2px;
  transition: outline-color 0.15s;
}
body.ux-preview-mode .ux-section:hover {
  outline-color: #2563eb;
}
body.ux-preview-mode .ux-section.is-selected {
  outline: 2px solid #2563eb;
}
body.ux-preview-mode .ux-section::after {
  content: attr(data-ux-label);
  position: absolute;
  top: 8px;
  right: 12px;
  background: #2563eb;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  z-index: 30;
  transition: opacity 0.15s;
}
body.ux-preview-mode .ux-section:hover::after,
body.ux-preview-mode .ux-section.is-selected::after {
  opacity: 1;
}

@media (max-width: 960px) {
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shop-layout, .blog-layout, .product-single-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .mobile-toggle { display: inline-flex; }
  .main-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 0;
    border-top: 1px solid var(--border);
    gap: 8px;
  }
  .main-nav.open { display: flex; }
  .cols-4, .cols-3, .cols-2 { grid-template-columns: 1fr; }
}
