/* =========================================
   ForexMexico.mx — main.css
   Layout, design tokens, typography, base
   ========================================= */

:root {
  --color-primary:       #0057B8;
  --color-primary-dark:  #003d82;
  --color-accent:        #F5A623;
  --color-success:       #27ae60;
  --color-danger:        #e74c3c;
  --color-warning:       #f39c12;
  --color-bg:            #f7f9fc;
  --color-surface:       #ffffff;
  --color-border:        #e1e7f0;
  --color-text:          #1a2332;
  --color-muted:         #637082;
  --color-light:         #5c7080;
  --color-hero-bg:       #0a1628;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);

  --transition: 180ms ease-out;
  --container-max: 1200px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

*:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  font-size: 0.97rem;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

ul, ol { padding-left: 1.4em; }

/* ---- Typography ---- */
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; line-height: 1.15; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; line-height: 1.2; }
h3 { font-size: 1.15rem; font-weight: 600; line-height: 1.3; }
h4 { font-size: 1rem; font-weight: 600; }
h5, h6 { font-size: 0.95rem; font-weight: 600; }

p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

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

/* ---- Section ---- */
section { padding: 64px 0; }

/* ---- Skip Link ---- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 9999;
  padding: 8px 16px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  transition: top var(--transition);
  text-decoration: none;
}
.skip-link:focus { top: 0; color: #fff; text-decoration: none; }

/* ---- Header / Nav ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
}
.site-logo:hover { text-decoration: none; }
.logo-icon {
  color: var(--color-primary);
  font-size: 1.3rem;
  line-height: 1;
}
.logo-mx { color: var(--color-primary); }

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-muted);
  font-size: 0.92rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.main-nav a:hover, .main-nav a.active {
  background: var(--color-bg);
  color: var(--color-primary);
  text-decoration: none;
}

.nav-cta {
  background: var(--color-primary);
  color: #fff !important;
  padding: 8px 16px !important;
  border-radius: var(--radius-md) !important;
  font-weight: 600 !important;
  white-space: nowrap;
}
.nav-cta:hover { background: var(--color-primary-dark) !important; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--color-text);
  font-size: 1.4rem;
  line-height: 1;
}

/* ---- Hero ---- */
.hero {
  background: var(--color-hero-bg);
  color: #fff;
  padding: 80px 0 72px;
  position: relative;
  overflow: hidden;
}
.hero-bg-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.18;
}
.hero-content { position: relative; z-index: 1; }
.hero h1 { color: #fff; margin-bottom: 16px; }
.hero-subtitle {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.82);
  margin-bottom: 32px;
  max-width: 600px;
}
.hero-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  color: rgba(255,255,255,0.65);
  font-size: 0.88rem;
  margin-top: 24px;
}
.hero-stats span::before { content: '·'; margin-right: 24px; }
.hero-stats span:first-child::before { content: ''; margin-right: 0; }

/* ---- Filter Cards ---- */
.filter-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 36px;
}
.filter-card {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
}
.filter-card:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
  text-decoration: none;
}
.filter-card-icon { font-size: 1.2rem; }

/* ---- Section titles ---- */
.section-header { text-align: center; margin-bottom: 40px; }
.section-header h2 { margin-bottom: 12px; }
.section-header p { color: var(--color-muted); font-size: 1rem; max-width: 560px; margin: 0 auto; }

/* ---- Sidebar layout ---- */
.content-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
}
.sidebar { position: sticky; top: 80px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--color-primary-dark); color: #fff; text-decoration: none; }

.btn-accent {
  background: var(--color-accent);
  color: #fff;
}
.btn-accent:hover { background: #d4891e; color: #fff; text-decoration: none; }

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline:hover { background: var(--color-primary); color: #fff; text-decoration: none; }

.btn-ghost {
  background: transparent;
  color: var(--color-muted);
  border-color: var(--color-border);
}
.btn-ghost:hover { border-color: var(--color-primary); color: var(--color-primary); text-decoration: none; }

.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-block { display: flex; width: 100%; }

/* ---- Breadcrumbs ---- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--color-muted);
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.breadcrumb a { color: var(--color-muted); }
.breadcrumb a:hover { color: var(--color-primary); }
.breadcrumb-sep { color: var(--color-light); }
.breadcrumb-current { color: var(--color-text); }

/* ---- Footer ---- */
.site-footer {
  background: var(--color-text);
  color: rgba(255,255,255,0.7);
  padding: 48px 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  padding-bottom: 40px;
}
.footer-col h4 {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a {
  color: rgba(255,255,255,0.65);
  font-size: 0.9rem;
}
.footer-col a:hover { color: #fff; text-decoration: none; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 20px 0;
  font-size: 0.83rem;
  color: rgba(255,255,255,0.4);
  text-align: center;
}

/* ---- Score / Stars ---- */
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
}
.score-badge.score-high { background: var(--color-success); }
.score-badge.score-mid  { background: var(--color-warning); color: var(--color-text); }

.stars { color: var(--color-accent); letter-spacing: 2px; font-size: 0.9rem; }

/* ---- Tag / Badge ---- */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--color-bg);
  color: var(--color-muted);
  border: 1px solid var(--color-border);
}
.tag-reg-top { background: #e8f5e9; color: #1b7a3e; border-color: #a5d6a7; }
.tag-reg-mid { background: #fff3e0; color: #b35c00; border-color: #ffcc80; }
.tag-featured { background: #e3f0ff; color: #0057B8; border-color: #90b8f0; }

/* ---- Info / Alert boxes ---- */
.box-info {
  background: #e3f0ff;
  border-left: 4px solid var(--color-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px 20px;
  margin: 20px 0;
  color: var(--color-text);
  font-size: 0.94rem;
}
.box-alert {
  background: #fff3cd;
  border-left: 4px solid var(--color-warning);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px 20px;
  margin: 20px 0;
  color: #7a5400;
  font-size: 0.94rem;
}
.box-success {
  background: #e8f5e9;
  border-left: 4px solid var(--color-success);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 0.94rem;
}
.box-danger {
  background: #fdecea;
  border-left: 4px solid var(--color-danger);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px 20px;
  margin: 20px 0;
  color: #8b1a1a;
  font-size: 0.94rem;
}

/* ---- Divider ---- */
.divider { border: none; border-top: 1px solid var(--color-border); margin: 32px 0; }

/* ---- Table ---- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.data-table th {
  background: var(--color-bg);
  font-weight: 600;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid var(--color-border);
  color: var(--color-text);
}
.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--color-bg); }
.data-table .best { color: var(--color-success); font-weight: 700; }
.data-table .worst { color: var(--color-danger); }

/* ---- Page hero (inner pages) ---- */
.page-hero {
  background: var(--color-hero-bg);
  color: #fff;
  padding: 56px 0 48px;
}
.page-hero h1 { color: #fff; font-size: clamp(1.6rem, 3.5vw, 2.4rem); margin-bottom: 12px; }
.page-hero p { color: rgba(255,255,255,0.78); max-width: 640px; }

/* ---- Utility ---- */
.text-center { text-align: center; }
.text-muted { color: var(--color-muted); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-primary { color: var(--color-primary); }
.text-accent { color: var(--color-accent); }
.fw-bold { font-weight: 700; }
.fw-600 { font-weight: 600; }
.mt-8  { margin-top:  8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8  { margin-bottom:  8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-0  { margin-bottom: 0; }
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .content-with-sidebar { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .filter-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  section { padding: 48px 0; }
  .filter-cards { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }

  .main-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--color-surface);
    flex-direction: column;
    align-items: stretch;
    border-bottom: 1px solid var(--color-border);
    padding: 8px 16px 16px;
    box-shadow: var(--shadow-md);
    z-index: 99;
  }
  .main-nav.show { display: flex; }
  .main-nav a { padding: 10px 12px; font-size: 1rem; }
  .nav-cta { text-align: center; margin-top: 8px; }
  .nav-toggle { display: block; }
}

@media (max-width: 480px) {
  .filter-cards { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 8px; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
