/* ============================================================
   main.css — Shared Design System for niche.com.mx
   Reset · Variables · Typography · Nav · Footer · Utilities
   ============================================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Colors */
  --color-bg:             #ffffff;
  --color-bg-subtle:      #f7f7f5;
  --color-text:           #111111;
  --color-text-secondary: #6b6b6b;
  --color-text-muted:     #9b9b9b;
  --color-border:         #e8e8e8;
  --color-accent:         #111111;
  --color-hover-bg:       #f2f2f0;

  /* Spacing (8px base) */
  --space-1:  8px;
  --space-2:  16px;
  --space-3:  24px;
  --space-4:  32px;
  --space-5:  40px;
  --space-6:  48px;
  --space-8:  64px;
  --space-10: 80px;
  --space-12: 96px;
  --space-15: 120px;

  /* Layout */
  --max-width: 1200px;
  --nav-height: 60px;

  /* Typography */
  --font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-weight: 400;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button, input, textarea {
  font: inherit;
}

/* ---------- Focus Visible ---------- */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ---------- Typography Utilities ---------- */
.label,
.section-label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.section-label {
  margin-bottom: var(--space-2);
}

/* ---------- Layout Utilities ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-3);
  padding-right: var(--space-3);
}

@media (min-width: 640px) {
  .container {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
}

@media (min-width: 1024px) {
  .container {
    padding-left: var(--space-3);
    padding-right: var(--space-3);
  }
}

/* ---------- Navigation ---------- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.site-nav.scrolled {
  border-bottom-color: var(--color-border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

@media (min-width: 640px) {
  .nav-inner {
    padding: 0 var(--space-6);
  }
}

@media (min-width: 1024px) {
  .nav-inner {
    padding: 0 var(--space-3);
  }
}

.nav-logo {
  display: flex;
  align-items: center;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--color-text);
  transition: opacity 0.2s ease;
}

.nav-logo:hover {
  opacity: 0.7;
}

/* Logo image — height constrained to nav, width auto-scales */
.nav-logo img {
  display: block;
  height: 22px;
  width: auto;
}

.nav-cta {
  font-size: 14px;
  color: var(--color-text-secondary);
  transition: color 0.2s ease;
}

.nav-cta:hover {
  color: var(--color-text);
}

/* Nav centre links */
.nav-links {
  display: none; /* hidden below 640px */
  align-items: center;
  gap: 2px;
}

@media (min-width: 640px) {
  .nav-links {
    display: flex;
  }
}

.nav-link {
  font-size: 14px;
  color: var(--color-text-secondary);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-family);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--color-text);
}

/* Chevron inside dropdown trigger */
.nav-chevron {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
  opacity: 0.5;
}

.nav-dropdown.open .nav-chevron,
.nav-dropdown:hover .nav-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

/* Dropdown container */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 6px;
  min-width: 220px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
  z-index: 200;
}

/* Invisible bridge fills the gap between the trigger and menu so
   hovering downward doesn't dismiss the dropdown */
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}

/* Show on hover OR when .open class is toggled via JS */
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown-item {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  border-radius: 7px;
  transition: background 0.15s ease;
  color: var(--color-text);
}

.nav-dropdown-item:hover {
  background: var(--color-hover-bg);
}

.nav-dropdown-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}

.nav-dropdown-tag {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-5) var(--space-3);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
}

.footer-left,
.footer-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.footer-logo {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.footer-location,
.footer-copy {
  font-size: 13px;
  color: var(--color-text-muted);
}

@media (min-width: 640px) {
  .site-footer {
    padding: var(--space-5) var(--space-6);
  }

  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }

  .footer-left,
  .footer-right {
    align-items: flex-start;
  }

  .footer-right {
    align-items: flex-end;
  }
}

@media (min-width: 1024px) {
  .site-footer {
    padding: var(--space-5) var(--space-3);
  }
}

/* ---------- Button Styles ---------- */
.btn-primary {
  display: inline-block;
  background: var(--color-accent);
  color: #ffffff;
  padding: 14px 28px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-primary:hover {
  background: #333333;
}

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

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

/* ---------- Scroll Animation Base ---------- */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Email Link (shared) ---------- */
.email-link {
  display: inline-block;
  font-size: 18px;
  font-weight: 500;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-text);
  margin-top: var(--space-3);
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.email-link:hover {
  color: var(--color-text-secondary);
  border-color: var(--color-text-secondary);
}
