/* ============================================================
   styles.css — Tunings.lv moderns dizains
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@300;400;600;700;900&family=Barlow:wght@300;400;500&display=swap');

:root {
  --red:    #E8231A;
  --red2:   #FF3D33;
  --dark:   #0A0A0A;
  --dark2:  #111111;
  --dark3:  #1A1A1A;
  --mid:    #242424;
  --border: #2A2A2A;
  --silver: #B0B0B0;
  --white:  #F2F2F2;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--dark);
  color: var(--white);
  font-family: 'Barlow', sans-serif;
  font-weight: 300;
  overflow-x: hidden;
}

/* ── TOPBAR ──────────────────────────────────────────────── */
.topbar {
  background: var(--red);
  height: 3px;
  width: 100%;
}

/* ── HEADER ──────────────────────────────────────────────── */
header {
  background: var(--dark2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 48px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}
.logo-mark {
  width: 28px; height: 28px;
  background: var(--red);
  clip-path: polygon(0 0, 100% 0, 82% 100%, 0% 100%);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 14px;
  color: white;
  padding-right: 3px;
}
.logo-text {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 3px;
  color: var(--white);
  text-transform: uppercase;
}
.logo-text span { color: var(--red); }

nav { display: flex; gap: 2px; align-items: center; }
nav a {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--silver);
  text-decoration: none;
  padding: 6px 14px;
  transition: color .2s, background .2s;
  border-radius: 2px;
}
nav a:hover { color: var(--white); background: var(--mid); }
nav a.active { color: var(--red); }

.header-contact {
  font-size: 12px;
  color: var(--silver);
  display: flex; align-items: center; gap: 7px;
}
.header-contact a { color: var(--white); text-decoration: none; }
.header-contact a:hover { color: var(--red); }
.header-contact::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--red);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232,35,26,.4); }
  50%       { box-shadow: 0 0 0 5px rgba(232,35,26,0); }
}

/* ── HERO ────────────────────────────────────────────────── */
.hero {
  position: relative;
  height: 300px;
  overflow: hidden;
  background: var(--dark2);
  display: flex;
  align-items: center;
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    linear-gradient(105deg, var(--dark) 38%, transparent 38%),
    linear-gradient(105deg, rgba(232,35,26,.08) 0%, transparent 60%);
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: linear-gradient(105deg, transparent 38%, black 38%);
  -webkit-mask-image: linear-gradient(105deg, transparent 38%, black 38%);
}
.hero-slash {
  position: absolute;
  top: 0; bottom: 0;
  left: calc(38% - 4px);
  width: 8px;
  background: var(--red);
  transform: skewX(-6deg);
  z-index: 1;
}
.hero-slash::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: 14px;
  width: 3px;
  background: rgba(232,35,26,.3);
}
.hero-content {
  position: relative;
  z-index: 2;
  padding-left: 52px;
  max-width: 400px;
}
.hero-tag {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 10px;
}
.hero-tag::before {
  content: '';
  display: block;
  width: 24px; height: 1px;
  background: var(--red);
}
.hero-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 54px;
  line-height: .92;
  text-transform: uppercase;
  letter-spacing: -1px;
  color: var(--white);
  margin-bottom: 14px;
}
.hero-title em {
  font-style: normal;
  color: var(--red);
  display: block;
}
.hero-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--silver);
  margin-bottom: 22px;
  max-width: 300px;
}
.hero-cta {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--red);
  color: white;
  text-decoration: none;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  padding: 10px 24px;
  clip-path: polygon(0 0, 100% 0, 94% 100%, 0% 100%);
  transition: background .2s, transform .2s;
}
.hero-cta:hover { background: var(--red2); transform: translateX(4px); }
.hero-cta svg { transition: transform .2s; }
.hero-cta:hover svg { transform: translateX(4px); }

.hero-image {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 64%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.hero-image img {
  max-height: 90%;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(-20px 0 60px rgba(232,35,26,.12));
}
.demo-car {
  width: 100%;
  max-width: 640px;
  opacity: .95;
  filter: drop-shadow(0 16px 48px rgba(0,0,0,.9)) drop-shadow(-8px 0 40px rgba(232,35,26,.06));
  animation: floatCar 7s ease-in-out infinite;
}
@keyframes floatCar {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

.hero-stats {
  position: absolute;
  bottom: 0; right: 0;
  display: flex;
  background: var(--dark);
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}
.hero-stat {
  padding: 12px 24px;
  border-right: 1px solid var(--border);
  text-align: center;
}
.hero-stat:last-child { border-right: none; }
.stat-num {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 24px;
  color: var(--red);
  line-height: 1;
}
.stat-label {
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--silver);
  margin-top: 3px;
}

/* Ielādes animācijas */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-content > * { animation: fadeInUp .5s ease both; }
.hero-tag   { animation-delay: .1s; }
.hero-title { animation-delay: .2s; }
.hero-desc  { animation-delay: .3s; }
.hero-cta   { animation-delay: .4s; }

/* ── LAYOUT ──────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 48px - 300px);
  align-items: start;
}

/* ── SIDEBAR ─────────────────────────────────────────────── */
aside {
  background: var(--dark2);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  position: sticky;
  top: 48px;
  height: calc(100vh - 48px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
aside::-webkit-scrollbar { width: 4px; }
aside::-webkit-scrollbar-track { background: transparent; }
aside::-webkit-scrollbar-thumb { background: var(--border); }

.sidebar-section { margin-bottom: 6px; }

.sidebar-heading {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(176,176,176,.35);
  padding: 12px 24px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 24px;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--silver);
  transition: color .15s, background .15s, padding-left .15s;
  border-left: 2px solid transparent;
}
.sidebar-link::before {
  content: '+';
  color: rgba(232,35,26,.4);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  transition: color .15s;
}
.sidebar-link:hover {
  color: var(--white);
  background: rgba(255,255,255,.03);
  padding-left: 30px;
  border-left-color: var(--red);
}
.sidebar-link:hover::before { color: var(--red); }
.sidebar-link.active {
  color: var(--red);
  background: rgba(232,35,26,.06);
  border-left-color: var(--red);
}
.sidebar-link.active::before { color: var(--red); }

/* Apakšizvēlne */
.sidebar-sub {
  padding-left: 38px;
  display: none;
}
.sidebar-link.open + .sidebar-sub { display: block; }
.sidebar-sub a {
  display: block;
  padding: 5px 0;
  font-size: 12px;
  color: rgba(176,176,176,.6);
  text-decoration: none;
  transition: color .15s;
}
.sidebar-sub a:hover { color: var(--white); }

/* ── GALVENAIS SATURS ────────────────────────────────────── */
main {
  padding: 40px 48px;
  background: var(--dark);
  min-width: 0; /* grid overflow fix */
}

/* Satura virsraksts */
.page-header {
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.page-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 10px;
}
.page-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.page-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 36px;
  text-transform: uppercase;
  letter-spacing: -.5px;
  line-height: 1;
}
.page-title span { color: var(--red); }

/* ── TEKSTU SATURS (text(), text_by_id()) ────────────────── */
.content-body {
  font-size: 14px;
  line-height: 1.8;
  color: var(--silver);
  max-width: 820px;
}
.content-body p { margin-bottom: 14px; }
.content-body h2, .content-body h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  color: var(--white);
  margin: 24px 0 10px;
  text-transform: uppercase;
}
.content-body h2 { font-size: 26px; }
.content-body h3 { font-size: 20px; }
.content-body strong { color: var(--white); font-weight: 500; }
.content-body a { color: var(--red); }
.content-body a:hover { color: var(--red2); }
.content-body ul, .content-body ol {
  padding-left: 20px;
  margin-bottom: 14px;
}
.content-body li { margin-bottom: 6px; }

/* Teksta bloks ar sarkanu kreiso malu */
.text-block {
  background: var(--dark2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  padding: 28px 36px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.text-block::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 120px; height: 120px;
  border: 30px solid rgba(232,35,26,.04);
  border-radius: 50%;
}

/* Admin rediģēšanas saites (redzamas tikai adminam) */
.admin-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  padding: 8px 0;
  margin-bottom: 4px;
}
.admin-actions a {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid var(--border);
  color: var(--silver);
  transition: all .15s;
}
.admin-actions a:hover { border-color: var(--red); color: var(--red); }
.admin-actions .state-active  { color: var(--red); }
.admin-actions .state-inactive { color: rgba(176,176,176,.4); }

/* ── PRODUKTU GRID (text_cars()) ─────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 14px;
  margin-bottom: 40px;
}

.product-card {
  background: var(--dark2);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  text-decoration: none;
  display: block;
}
.product-card:hover {
  border-color: var(--red);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}

.product-img {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--mid);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}
.product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s;
}
.product-card:hover .product-img img { transform: scale(1.05); }
.product-img-empty {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(255,255,255,.12);
  text-transform: uppercase;
}

.product-info {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}
.product-code {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--red);
  text-transform: uppercase;
  margin-bottom: 4px;
  opacity: .8;
}
.product-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 8px;
  line-height: 1.2;
}
.product-price {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--red);
}
.product-currency {
  font-size: 11px;
  font-weight: 400;
  color: var(--silver);
  margin-left: 2px;
}

/* Pilnā skata produkta lapa */
.product-full {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.product-full-img img {
  width: 100%;
  border: 1px solid var(--border);
}
.product-full-info h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 40px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.product-full-price {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--red);
  margin: 16px 0 24px;
}

/* "Under construction" bloks */
.under-construction {
  padding: 60px 0;
  text-align: center;
  color: rgba(176,176,176,.3);
}
.under-construction svg {
  margin-bottom: 16px;
  opacity: .2;
}
.under-construction p {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
}

/* Admin inline iframe */
.admin-iframe-wrap {
  border: 1px solid var(--border);
  margin: 24px 0;
}
.admin-iframe-wrap iframe {
  width: 100%;
  display: block;
  background: var(--dark2);
}

/* Insert / edit poga lapā */
.inline-action-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}
.inline-action-bar a {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--silver);
  border: 1px solid var(--border);
  padding: 6px 16px;
  transition: all .15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.inline-action-bar a::before { content: '+'; color: var(--red); font-size: 16px; }
.inline-action-bar a:hover { border-color: var(--red); color: var(--white); }

/* ── FOOTER ──────────────────────────────────────────────── */
footer {
  background: var(--dark2);
  border-top: 1px solid var(--border);
  padding: 40px 60px;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 48px;
}
.footer-brand p {
  font-size: 13px;
  color: var(--silver);
  line-height: 1.7;
  max-width: 240px;
  margin-top: 12px;
}
.footer-col h4 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 14px;
}
.footer-col p,
.footer-col a {
  font-size: 13px;
  color: var(--silver);
  line-height: 2;
  text-decoration: none;
  display: block;
  transition: color .15s;
}
.footer-col a:hover { color: var(--white); }

.footer-bottom {
  background: var(--dark);
  border-top: 1px solid var(--border);
  padding: 14px 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: rgba(176,176,176,.35);
}
.footer-bottom a {
  color: rgba(176,176,176,.35);
  text-decoration: none;
  transition: color .15s;
}
.footer-bottom a:hover { color: var(--silver); }

/* ── ADMIN STILI (admin panelim) ─────────────────────────── */
.adm-bar {
  background: var(--dark2);
  border-bottom: 1px solid var(--border);
  padding: 6px 32px;
  display: flex;
  gap: 16px;
  align-items: center;
}
.adm-bar a {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(176,176,176,.5);
  text-decoration: none;
  padding: 4px 8px;
  transition: color .15s;
}
.adm-bar a:hover { color: var(--red); }

/* ── MOBILAIS SKATS ──────────────────────────────────────── */
@media (max-width: 768px) {

  /* Header */
  header {
    padding: 0 16px;
    height: auto;
    min-height: 48px;
    flex-wrap: wrap;
    gap: 4px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  nav { gap: 0; flex-wrap: wrap; }
  nav a { font-size: 10px; padding: 4px 8px; letter-spacing: 1px; }
  .header-contact { font-size: 11px; }

  /* Hero */
  .hero { height: auto; min-height: 180px; flex-direction: column; align-items: flex-start; }
  .hero-content { padding: 24px 20px 16px; max-width: 100%; }
  .hero-title { font-size: 36px; }
  .hero-desc { display: none; }
  .hero-image { display: none; }
  .hero-stats { position: static; width: 100%; }
  .hero-stat { padding: 8px 16px; }
  .stat-num { font-size: 18px; }

  /* Layout — sānu josla pazūd, pāriet uz augšu */
  .layout {
    grid-template-columns: 1fr;
  }
  aside {
    position: static;
    height: auto;
    max-height: 220px;
    overflow-y: auto;
    padding: 12px 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-heading { padding: 8px 16px 6px; }
  .sidebar-link { padding: 6px 16px; font-size: 12px; }

  /* Galvenais saturs */
  main { padding: 24px 16px; }
  .page-title { font-size: 26px; }

  /* Produktu grid */
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  /* Produkta pilnā lapa */
  .product-full {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  /* Footer */
  footer {
    grid-template-columns: 1fr;
    padding: 24px 20px;
    gap: 24px;
  }
  .footer-bottom {
    padding: 12px 20px;
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }
}

@media (max-width: 420px) {
  .products-grid { grid-template-columns: 1fr; }
  nav a { font-size: 9px; padding: 3px 6px; }
}

/* ── LIELĀKI TEKSTI ──────────────────────────────────────── */
.content-body { font-size: 16px; line-height: 1.9; }
.content-body p { font-size: 16px; }
.content-body li { font-size: 16px; }

.page-title { font-size: 48px; }
.page-label { font-size: 12px; }

.sidebar-link { font-size: 14px; padding: 10px 24px; }
.sidebar-heading { font-size: 11px; }

.product-name { font-size: 16px; }
.product-code { font-size: 11px; }
.product-price { font-size: 22px; }

.hero-title { font-size: 64px; }
.hero-desc { font-size: 15px; }
.hero-tag { font-size: 11px; }

.stat-num { font-size: 28px; }
.stat-label { font-size: 10px; }

.section-title { font-size: 48px; }

nav a { font-size: 13px; }
.footer-col p, .footer-col a { font-size: 14px; }

/* ── FORCE LIELĀKI TEKSTI ────────────────────────────────── */
body { font-size: 17px !important; }
.content-body, .content-body p, .content-body li, .content-body td { font-size: 18px !important; line-height: 2 !important; }
.page-title { font-size: 56px !important; }
.sidebar-link { font-size: 15px !important; padding: 11px 24px !important; }
.product-name { font-size: 17px !important; }
.product-price { font-size: 24px !important; }
nav a { font-size: 14px !important; letter-spacing: 2px !important; }
.hero-title { font-size: 72px !important; }
.hero-desc { font-size: 16px !important; }

/* ── SECTION TITLE FORCE ─────────────────────────────────── */
.section-label {
  font-family: 'Barlow Condensed', sans-serif !important;
  font-size: 11px !important;
  letter-spacing: 4px !important;
  text-transform: uppercase !important;
  color: var(--red) !important;
  margin-bottom: 12px !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}
.section-label::after {
  content: '' !important;
  flex: 1 !important;
  height: 1px !important;
  background: var(--border) !important;
}
.section-title {
  font-family: 'Barlow Condensed', sans-serif !important;
  font-weight: 900 !important;
  font-size: 58px !important;
  text-transform: uppercase !important;
  letter-spacing: -1px !important;
  line-height: 1 !important;
  margin-bottom: 32px !important;
  color: var(--white) !important;
}
.section-title span { color: var(--red) !important; }
