/* =========================================
   site.css — MetalsCost.com
   Clean, public-facing stylesheet
   ========================================= */

/* ---- CSS Variables ---- */
:root {
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-bg: #ffffff;
  --color-bg-alt: #f8fafc;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  --color-up: #16a34a;
  --color-down: #dc2626;
  --color-gold: #d97706;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --container-max: 1200px;
  --nav-height: 64px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
p { text-align: left !important; margin-bottom: 0; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
h1,h2,h3,h4,h5,h6 { line-height: 1.3; }

/* ---- Container ---- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* =========================================
   NAVBAR
   ========================================= */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}
.site-header > nav {
  display: flex;
  align-items: center;
  height: var(--nav-height);
  gap: 8px;
}
.nav-logo { flex-shrink: 0; }
.nav-logo img {
  height: 75px;
  width: auto;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 20px;
}
.nav-links a,
.nav-dropdown > button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav-links a:hover,
.nav-dropdown > button:hover,
.nav-links a.active {
  background: var(--color-bg-alt);
  color: var(--color-primary);
  text-decoration: none;
}
.nav-links a.active { color: var(--color-primary); }

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown > button { font-size: 14px; font-weight: 500; }
.dropdown-arrow { font-size: 10px; transition: transform 0.2s; display: inline-block; }
.nav-dropdown.open .dropdown-arrow,
.nav-dropdown:hover .dropdown-arrow { transform: rotate(180deg); }
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  min-width: 280px;
  padding: 8px;
  z-index: 200;
  columns: 2;
  column-gap: 4px;
}
/* Invisible bridge fills the 6px gap so hover isn't lost moving to dropdown */
.nav-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 6px;
}
.nav-dropdown.open .dropdown-menu,
.nav-dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a {
  display: block;
  padding: 7px 12px;
  font-size: 13px;
  color: var(--color-text);
  border-radius: 6px;
  white-space: nowrap;
  break-inside: avoid;
}
.dropdown-menu a:hover {
  background: var(--color-bg-alt);
  color: var(--color-primary);
  text-decoration: none;
}

/* Search */
.nav-search {
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
}
.nav-search input {
  width: 210px;
  padding: 7px 14px 7px 34px;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  font-size: 13px;
  font-family: var(--font);
  background: var(--color-bg-alt);
  color: var(--color-text);
  outline: none;
  transition: border-color 0.2s, width 0.2s;
}
.nav-search input:focus {
  border-color: var(--color-primary);
  width: 250px;
  background: var(--color-bg);
}
.nav-search input::placeholder { color: var(--color-text-muted); }
.nav-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
  font-size: 13px;
  line-height: 1;
}
.search-results-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 300;
  max-height: 220px;
  overflow-y: auto;
}
.search-results-dropdown.has-results { display: block; }
.search-results-dropdown a {
  display: block;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}
.search-results-dropdown a:last-child { border-bottom: none; }
.search-results-dropdown a:hover {
  background: var(--color-bg-alt);
  color: var(--color-primary);
  text-decoration: none;
}

/* Mobile hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 6px;
  margin-left: auto;
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: all 0.25s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile drawer */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0; right: 0; bottom: 0;
  background: var(--color-bg);
  padding: 16px 20px;
  overflow-y: auto;
  z-index: 999;
  border-top: 1px solid var(--color-border);
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block;
  padding: 12px 4px;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}
.mobile-menu a:hover { color: var(--color-primary); text-decoration: none; }
.mobile-menu-section { margin-top: 20px; }
.mobile-menu-section h3 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}
.mobile-menu-section a { font-size: 14px; font-weight: 400; }

/* =========================================
   HERO SLIDER (HOMEPAGE)
   ========================================= */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #20466a 100%);
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px 0 64px;
}
.hero-slides { position: relative; width: 100%; }
.hero-slide { display: none; }
.hero-slide.active {
  display: block;
  animation: heroFadeIn 0.5s ease;
}
@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  opacity: 0.65;
  margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(26px, 5vw, 44px);
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}
.hero-subtitle {
  font-size: 16px;
  opacity: 0.85;
  max-width: 560px;
  margin: 0 auto 20px;
  line-height: 1.6;
}
.hero-date {
  font-size: 14px;
  opacity: 0.7;
  margin-top: 4px;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.18);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 24px;
  padding: 10px 26px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 6px;
  transition: background 0.2s;
}
.hero-cta:hover { background: rgba(255,255,255,0.3); color: #fff; text-decoration: none; }

/* Slider dots */
.hero-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
  position: relative;
  z-index: 2;
}
.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.25s, transform 0.25s;
}
.hero-dot.active { background: #fff; transform: scale(1.35); }

/* Slider arrows */
.hero-prev,
.hero-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 3;
}
.hero-prev { left: 20px; }
.hero-next { right: 20px; }
.hero-prev:hover,
.hero-next:hover { background: rgba(255,255,255,0.3); }

/* =========================================
   SECTION UTILITIES
   ========================================= */
.section { padding: 40px 0; }
.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

/* =========================================
   FEATURED METAL CARDS
   ========================================= */
.featured-metals {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 32px 0 8px;
}
.metal-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
  box-shadow: var(--shadow);
}
.metal-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.metal-card-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.metal-card-price {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
  min-height: 32px;
}
.metal-card-change {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  min-height: 22px;
}
.metal-card-change.up { color: var(--color-up); background: #dcfce7; }
.metal-card-change.down { color: var(--color-down); background: #fee2e2; }
.metal-card-unit {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 6px;
}

/* =========================================
   PRICES TABLE
   ========================================= */
.prices-section { background: var(--color-bg-alt); padding: 36px 0; }
.prices-table-wrap {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.prices-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.prices-table th {
  background: var(--color-bg-alt);
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}
.prices-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}
.prices-table tbody tr:last-child td { border-bottom: none; }
.prices-table tbody tr { cursor: pointer; transition: background 0.1s; }
.prices-table tbody tr:hover { background: var(--color-bg-alt); }
.prices-table .metal-name { font-weight: 600; }
.prices-table .price-val { font-variant-numeric: tabular-nums; font-weight: 600; }

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}
.badge.up { color: var(--color-up); background: #dcfce7; }
.badge.down { color: var(--color-down); background: #fee2e2; }

/* =========================================
   SEO / ABOUT SECTION (HOMEPAGE)
   ========================================= */
.seo-section { background: var(--color-bg); padding: 40px 0 48px; }
.seo-section h2 {
  font-size: 19px;
  font-weight: 700;
  margin: 28px 0 10px;
  color: var(--color-text);
}
.seo-section h2:first-child { margin-top: 0; }
.seo-section p { color: var(--color-text-muted); line-height: 1.75; }

/* =========================================
   BREADCRUMB
   ========================================= */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-muted);
  padding: 20px 0 0;
  margin-bottom: 20px;
}
.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb a:hover { color: var(--color-primary); text-decoration: none; }
.breadcrumb-sep { font-size: 14px; opacity: 0.5; }
.breadcrumb-current { color: var(--color-text); font-weight: 500; }

/* =========================================
   PRICE HERO (DETAIL PAGE)
   ========================================= */
.price-hero-section {
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
  padding: 0 0 32px;
}
.price-hero-section h1 {
  font-size: clamp(18px, 3vw, 26px);
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}
.price-stats {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.price-stat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}
.price-stat-value {
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.price-stat-value.price-current { color: var(--color-text); }
.text-up { color: var(--color-up); }
.text-down { color: var(--color-down); }
.price-divider {
  width: 1px;
  height: 48px;
  background: var(--color-border);
  flex-shrink: 0;
}
.share-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s;
  flex-shrink: 0;
}
.share-btn:hover { background: var(--color-primary-dark); color: #fff; text-decoration: none; }

/* =========================================
   CARAT CARDS (GOLD ONLY)
   ========================================= */
.carat-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 28px 0;
}
.carat-card {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}
.carat-card-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-gold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.carat-card-price {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}
.carat-card-sub {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* =========================================
   CHART SECTION
   ========================================= */
.chart-section {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 24px 0;
  box-shadow: var(--shadow);
}
.chart-section h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--color-text);
}
.chart-section canvas {
  height: 300px !important;
}

/* =========================================
   DATA TABLES (DETAIL PAGE)
   ========================================= */
.data-table-section {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 24px 0;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.data-table-section h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--color-text);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th {
  background: var(--color-bg-alt);
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}
.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--color-bg-alt); }

/* =========================================
   METAL INFO SECTION (DETAIL PAGE)
   ========================================= */
.metal-info-section {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 24px 0 40px;
  box-shadow: var(--shadow);
}
.metal-info-section h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--color-text);
}
.metal-info-section p { color: var(--color-text-muted); line-height: 1.7; }

/* =========================================
   ABOUT / CONTACT PAGES
   ========================================= */
.content-page { padding: 48px 0 64px; max-width: 740px; }
.content-page h1 {
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}
.content-page h2 {
  font-size: 19px;
  font-weight: 700;
  margin: 28px 0 10px;
  color: var(--color-text);
}
.content-page p {
  color: var(--color-text-muted);
  line-height: 1.75;
  margin-bottom: 12px;
}
.content-page a { color: var(--color-primary); }

/* =========================================
   FOOTER
   ========================================= */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 48px 0 0;
  margin-top: 48px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid #1e293b;
}
.footer-logo { margin-bottom: 14px; }
.footer-logo img { height: 30px; filter: brightness(0) invert(1); opacity: 0.85; }
.footer-tagline { font-size: 14px; line-height: 1.65; color: #94a3b8; }
.footer-col h3 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #f1f5f9;
  margin-bottom: 16px;
}
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a {
  font-size: 14px;
  color: #94a3b8;
  transition: color 0.15s;
}
.footer-col ul li a:hover { color: #f1f5f9; text-decoration: none; }
.footer-bottom {
  padding: 16px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #64748b;
}

/* =========================================
   SCROLL-TO-TOP
   ========================================= */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 900;
  border: none;
}
.scroll-top.visible { opacity: 1; transform: translateY(0); }
.scroll-top:hover { background: var(--color-primary-dark); }

/* =========================================
   TABLE SCROLL WRAPPER
   ========================================= */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* =========================================
   SKELETON LOADER
   ========================================= */
@keyframes skeleton-pulse { 0%,100%{opacity:1} 50%{opacity:.4} }
.skeleton {
  background: #e2e8f0;
  border-radius: 4px;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  color: transparent !important;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
  .featured-metals { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .nav-links,
  .nav-search { display: none; }
  .nav-hamburger { display: flex; }

  .featured-metals { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .metal-card-price { font-size: 18px; }
  .hero { padding: 44px 0 36px; min-height: 280px; }
  .hero-prev, .hero-next { display: none; }
  .hero-subtitle { font-size: 14px; }

  .price-stats { gap: 18px; }
  .price-divider { display: none; }
  .share-btn { margin-left: 0; }
  .price-stat-value { font-size: 22px; }

  .carat-cards { gap: 10px; }
  .carat-card-price { font-size: 18px; }
  .carat-card { padding: 16px 12px; }

  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 6px; text-align: center; }

  .dropdown-menu { columns: 1; }

  .data-table { font-size: 13px; }
  .data-table th, .data-table td { padding: 8px 10px; }

  .prices-table { font-size: 13px; }
  .prices-table th, .prices-table td { padding: 10px 12px; }

  .content-page { padding: 32px 0 48px; }
  .chart-section canvas { height: 260px !important; }
}

@media (max-width: 480px) {
  .featured-metals { grid-template-columns: 1fr 1fr; }
  .carat-cards { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .carat-card-price { font-size: 15px; }
  .carat-card { padding: 12px 8px; }
  .container { padding: 0 14px; }
  .price-stat-value { font-size: 20px; }
}
