/* ===========================================
   MIGAS — Header / Nav / Ticker / Footer
   =========================================== */

/* Topbar */
.site-header { position: relative; z-index: 50; }
.topbar {
  background: var(--c-primary-900);
  color: rgba(255,255,255,.85);
  font-size: 12px;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
}
.topbar-left { display: flex; gap: 22px; align-items: center; }
.topbar-right { display: flex; gap: 14px; align-items: center; }
.topbar-contact {
  display: inline-flex; gap: 7px; align-items: center;
}
.topbar-right a {
  color: rgba(255,255,255,.85);
  transition: color .15s;
}
.topbar-right a:hover { color: var(--c-accent-500); }
.topbar-sep {
  width: 1px; height: 14px; background: rgba(255,255,255,.18);
}
.lang-switch {
  background: transparent;
  color: rgba(255,255,255,.6);
  border: 1px solid rgba(255,255,255,.18);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 3px;
  letter-spacing: 0.05em;
  transition: all .15s;
}
.lang-switch.active, .lang-switch:hover {
  background: var(--c-accent-500);
  color: var(--c-primary-900);
  border-color: var(--c-accent-500);
}

/* Header main */
.header-main {
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 92px;
}
[data-density="compact"] .header-inner { height: 76px; }

.brand {
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.brand-mark { display: block; line-height: 0; }
.brand-text { line-height: 1.15; }
.brand-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--c-ink-500);
  text-transform: uppercase;
}
.brand-name {
  font-family: var(--ff-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--c-primary-900);
  letter-spacing: -0.01em;
}
[data-theme="dark"] .brand-name { color: var(--c-accent-500); }
.brand-tag-line {
  font-size: 11px;
  color: var(--c-ink-500);
  font-style: italic;
}

/* Primary nav */
.primary-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  justify-content: center;
}
.nav-item { position: relative; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--c-ink-700);
  border-radius: 4px;
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--c-primary-800); }
.nav-item.active > .nav-link { color: var(--c-primary-900); }
.nav-item.active > .nav-link::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: -1px;
  height: 3px;
  background: var(--c-accent-500);
}
[data-theme="dark"] .nav-link { color: var(--c-ink-700); }
[data-theme="dark"] .nav-link:hover, [data-theme="dark"] .nav-item.active > .nav-link { color: #fff; }

.nav-caret { opacity: .6; transition: transform .15s; }
.nav-item.has-child:hover .nav-caret { transform: rotate(180deg); }

.nav-dropdown {
  position: absolute;
  top: calc(100% - 1px);
  left: 0;
  min-width: 240px;
  background: var(--c-bg);
  border: 1px solid var(--c-line);
  border-top: 3px solid var(--c-accent-500);
  box-shadow: var(--shadow-2);
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .18s, transform .18s, visibility .18s;
  z-index: 60;
}
.nav-item.has-child:hover .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-dropdown a {
  display: block;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-ink-700);
  border-left: 2px solid transparent;
  transition: all .12s;
}
.nav-dropdown a:hover {
  background: var(--c-bg-soft);
  color: var(--c-primary-800);
  border-left-color: var(--c-accent-500);
}

/* Header actions */
.header-actions {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.icon-btn {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px;
  color: var(--c-ink-700);
  transition: all .15s;
}
.icon-btn-bordered {
  border: 1px solid var(--c-line-strong);
}
.icon-btn:hover {
  background: var(--c-primary-900);
  color: var(--c-accent-500);
  border-color: var(--c-primary-900);
}

.btn-yellow {
  background: var(--c-accent-500);
  color: var(--c-primary-900);
  font-weight: 700;
  font-size: 13px;
  padding: 10px 18px;
  letter-spacing: 0.01em;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .15s;
  position: relative;
}
.btn-yellow::after {
  content: "›";
  font-weight: 400;
  font-size: 16px;
  margin-left: 2px;
  transition: transform .15s;
}
.btn-yellow:hover {
  background: #e8b75c;
  transform: translateY(-1px);
}
.btn-yellow:hover::after { transform: translateX(2px); }
.header-cta { white-space: nowrap; }

/* Ticker */
.ticker {
  background: var(--c-primary-800);
  color: #fff;
  border-bottom: 2px solid var(--c-accent-500);
  overflow: hidden;
}
.ticker-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 38px;
}
.ticker-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ff-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--c-accent-500);
  flex-shrink: 0;
  padding-right: 16px;
  border-right: 1px solid rgba(255,255,255,.12);
}
.ticker-pulse {
  width: 7px; height: 7px;
  background: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(74,222,128,.7);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74,222,128,.7); }
  70% { box-shadow: 0 0 0 8px rgba(74,222,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}
.ticker-track-wrap {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.ticker-track-wrap::before, .ticker-track-wrap::after {
  content: "";
  position: absolute; top: 0; bottom: 0; width: 30px;
  z-index: 2;
  pointer-events: none;
}
.ticker-track-wrap::before { left: 0; background: linear-gradient(90deg, var(--c-primary-800), transparent); }
.ticker-track-wrap::after { right: 0; background: linear-gradient(-90deg, var(--c-primary-800), transparent); }

.ticker-track {
  display: inline-flex;
  gap: 36px;
  white-space: nowrap;
  animation: ticker-scroll 60s linear infinite;
  padding-right: 36px;
}
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.ticker-item {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  flex-shrink: 0;
}
.ticker-name { font-weight: 700; color: rgba(255,255,255,.9); letter-spacing: 0.02em; }
.ticker-value { font-family: var(--ff-mono); font-weight: 700; color: #fff; font-size: 14px; }
.ticker-unit { font-size: 11px; color: rgba(255,255,255,.55); letter-spacing: 0.05em; }
.ticker-delta { font-family: var(--ff-mono); font-size: 11.5px; font-weight: 600; }
.ticker-delta.up { color: #6ee7b7; }
.ticker-delta.down { color: #fca5a5; }

/* ============================================
   Footer
   ============================================ */
.site-footer {
  background: var(--c-primary-900);
  color: rgba(255,255,255,.78);
  margin-top: 80px;
  position: relative;
}
.site-footer::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: linear-gradient(90deg, var(--c-accent-600), var(--c-accent-500), var(--c-accent-600));
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr;
  gap: 48px;
  padding: 64px 24px 48px;
}
.footer-brand .brand { margin-bottom: 18px; }
.footer-addr {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255,255,255,.7);
  margin: 0 0 18px;
}
.footer-socials { display: flex; gap: 8px; }
.social-dot {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
  transition: all .15s;
}
.social-dot:hover { background: var(--c-accent-500); border-color: var(--c-accent-500); color: var(--c-primary-900); }

.footer-col h4 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-accent-500);
  margin: 0 0 16px;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col a {
  font-size: 13.5px;
  color: rgba(255,255,255,.7);
  transition: color .15s;
}
.footer-col a:hover { color: var(--c-accent-500); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 18px 0;
  font-size: 12px;
  color: rgba(255,255,255,.5);
}
.footer-bottom-inner {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.footer-bottom-links { display: flex; gap: 22px; }
.footer-bottom-links a { color: rgba(255,255,255,.5); transition: color .15s; }
.footer-bottom-links a:hover { color: var(--c-accent-500); }

@media (max-width: 1100px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: span 3; }
}
