/*
Theme Name: MTO Automotion Editable
Theme URI: https://mto-automotion.example/
Author: MTO Automotion
Description: Theme WordPress responsive creado desde el prototipo HTML Fieldline. Todas las páginas se editan con el editor de bloques de WordPress.
Version: 10.0.0
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: mto-automotion-editable
*/

:root {
  --mto-bg: #f4f5f5;
  --mto-surface: #ffffff;
  --mto-ink: #17191b;
  --mto-body: #555b61;
  --mto-muted: #858b91;
  --mto-line: #dfe2e4;
  --mto-accent: #bd1e36;
  --mto-dark: #17191b;
  --mto-dark-surface: #202326;
  --mto-dark-line: rgba(255, 255, 255, 0.14);
  --mto-dark-body: #aeb3b7;
  --mto-font-sans: Arial, Helvetica, sans-serif;
  --mto-font-mono: "Courier New", Courier, monospace;
  --mto-container: 1180px;
  --mto-gutter: clamp(1.25rem, 4vw, 3.75rem);
  --mto-section: clamp(4rem, 8vw, 7.5rem);
  --mto-header-height: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--mto-header-height) + 1rem); }
body {
  margin: 0;
  background: var(--mto-bg);
  color: var(--mto-ink);
  font-family: var(--mto-font-sans);
  font-size: 16px;
  font-stretch: normal;
  font-synthesis: none;
  font-variation-settings: normal;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body.menu-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
figure { margin: 0; }

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  color: var(--mto-ink);
  font-family: var(--mto-font-sans);
  font-stretch: normal;
  font-style: normal;
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.1;
  overflow-wrap: normal;
  text-wrap: balance;
  word-break: normal;
}
h1 { font-size: clamp(2.45rem, 5.4vw, 4.45rem); max-width: 15ch; }
h2 { font-size: clamp(1.9rem, 3.7vw, 3rem); max-width: 22ch; }
h3 { font-size: clamp(1.15rem, 1.6vw, 1.35rem); letter-spacing: -0.012em; }
p { margin: 0; color: var(--mto-body); }
ul, ol { color: var(--mto-body); }

.mto-container,
.wrap,
.entry-content > .alignwide,
.entry-content > .wp-block-group.alignwide {
  width: min(100% - (2 * var(--mto-gutter)), var(--mto-container));
  margin-inline: auto;
}
.entry-content > *:not(.alignfull):not(.alignwide):not(.mto-full) {
  width: min(100% - (2 * var(--mto-gutter)), var(--mto-container));
  margin-inline: auto;
}
.alignfull, .mto-full { width: 100%; margin-inline: 0; }
.alignwide { max-width: var(--mto-container); }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.screen-reader-text:focus {
  position: fixed !important;
  z-index: 99999;
  top: 1rem; left: 1rem;
  width: auto; height: auto;
  padding: 0.75rem 1rem;
  clip: auto;
  background: var(--mto-surface);
  border: 1px solid var(--mto-ink);
}
:focus-visible { outline: 2px solid var(--mto-accent); outline-offset: 3px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--mto-header-height);
  background: rgba(244, 245, 245, 0.96);
  border-bottom: 1px solid var(--mto-line);
  backdrop-filter: blur(12px);
}
.site-header__inner {
  min-height: var(--mto-header-height);
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 2.25rem);
}
.site-branding { flex: 0 0 auto; }
.custom-logo-link { display: block; }
.custom-logo { width: auto; max-height: 42px; }
.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.72rem;
  color: var(--mto-ink);
  font-family: var(--mto-font-mono);
  font-size: 0.91rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.site-logo__mark {
  position: relative;
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  background: var(--mto-accent);
}
.site-logo__mark::after {
  content: "";
  position: absolute;
  inset: 6px;
  background: var(--mto-bg);
}
.primary-navigation { margin-left: auto; }
.primary-navigation ul {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.1vw, 1.85rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.primary-navigation a {
  display: block;
  padding: 0.35rem 0;
  color: var(--mto-body);
  border-bottom: 1px solid transparent;
  font-size: 0.875rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}
.primary-navigation a:hover,
.primary-navigation .current-menu-item > a,
.primary-navigation .current_page_item > a { color: var(--mto-ink); border-color: var(--mto-accent); }
.header-cta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.65rem 1rem;
  background: var(--mto-ink);
  border: 1px solid var(--mto-ink);
  color: #fff;
  font-family: var(--mto-font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}
.header-cta:hover { background: var(--mto-accent); border-color: var(--mto-accent); }
.menu-toggle {
  display: none;
  width: 44px;
  height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--mto-line);
  color: var(--mto-ink);
  cursor: pointer;
}
.menu-toggle__lines,
.menu-toggle__lines::before,
.menu-toggle__lines::after {
  display: block;
  width: 18px;
  height: 1px;
  background: currentColor;
  transition: transform 180ms ease, opacity 180ms ease;
}
.menu-toggle__lines { position: relative; }
.menu-toggle__lines::before,
.menu-toggle__lines::after { content: ""; position: absolute; left: 0; }
.menu-toggle__lines::before { top: -6px; }
.menu-toggle__lines::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .menu-toggle__lines { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle__lines::before { top: 0; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__lines::after { top: 0; transform: rotate(-45deg); }

/* Editable content blocks */
.entry-content { overflow: hidden; }
.entry-content > :first-child { margin-top: 0; }
.entry-content .wp-block-group,
.entry-content .wp-block-columns { margin-top: 0; margin-bottom: 0; }
.entry-content .wp-block-column { min-width: 0; }

.mto-section { padding-block: var(--mto-section); }
.mto-section--compact { padding-block: clamp(3rem, 6vw, 5.25rem); }
.mto-section--white { background: var(--mto-surface); }
.mto-section--dark { background: var(--mto-dark); color: #f3f4f4; }
.mto-section--dark h1,
.mto-section--dark h2,
.mto-section--dark h3 { color: #f3f4f4; }
.mto-section--dark p,
.mto-section--dark li { color: var(--mto-dark-body); }

.mto-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
  color: var(--mto-accent);
  font-family: var(--mto-font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  line-height: 1.35;
  text-transform: uppercase;
}
.mto-eyebrow::before { content: ""; width: 18px; height: 1px; flex: 0 0 18px; background: currentColor; }
.mto-lead { max-width: 51ch; font-size: clamp(1.02rem, 1.4vw, 1.16rem); line-height: 1.65; }
.mto-section-heading { margin-bottom: clamp(2.25rem, 5vw, 4.25rem); }
.mto-section-heading h2 { margin-bottom: 1rem; }
.mto-section-heading p { max-width: 60ch; }

.mto-hero { padding-block: clamp(4rem, 9vw, 8rem) clamp(3.5rem, 7vw, 6rem); }
.mto-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(300px, 5fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.mto-hero-copy h1 { margin-bottom: 1.35rem; }
.mto-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.mto-button,
.wp-block-button__link,
button.mto-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.8rem 1.25rem;
  border: 1px solid var(--mto-ink);
  border-radius: 0;
  background: var(--mto-ink);
  color: #fff;
  font-family: var(--mto-font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.mto-button:hover,
.wp-block-button__link:hover { background: var(--mto-accent); border-color: var(--mto-accent); color: #fff; }
.mto-button--ghost,
.mto-button--ghost .wp-block-button__link,
.wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent;
  color: var(--mto-ink);
}
.mto-button--ghost:hover,
.mto-button--ghost .wp-block-button__link:hover,
.wp-block-button.is-style-outline .wp-block-button__link:hover { border-color: var(--mto-accent); color: var(--mto-accent); background: transparent; }
.mto-hero-art {
  min-height: 340px;
  display: flex;
  align-items: center;
  padding: clamp(1rem, 2.5vw, 1.75rem);
  background: var(--mto-surface);
  border: 1px solid var(--mto-line);
}
.mto-trace { width: 100%; height: auto; }
.mto-trace path { fill: none; stroke: var(--mto-line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.mto-trace .live { stroke: var(--mto-accent); stroke-dasharray: 7 11; animation: mto-trace-flow 7s linear infinite; }
.mto-trace .node { fill: var(--mto-accent); }
@keyframes mto-trace-flow { to { stroke-dashoffset: -180; } }

.mto-stats { padding: 0; background: var(--mto-surface); border-block: 1px solid var(--mto-line); }
.mto-stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mto-stat { min-height: 132px; padding: 1.6rem; border-right: 1px solid var(--mto-line); }
.mto-stat:last-child { border-right: 0; }
.mto-stat strong { display: block; color: var(--mto-ink); font-family: var(--mto-font-mono); font-size: clamp(1.55rem, 2.6vw, 2.25rem); line-height: 1; letter-spacing: -0.03em; }
.mto-stat span { display: block; margin-top: 0.7rem; color: var(--mto-body); font-size: 0.82rem; line-height: 1.45; }

.mto-line-list { border-top: 1px solid var(--mto-line); }
.mto-line-row {
  display: grid;
  grid-template-columns: 78px minmax(190px, 0.8fr) minmax(0, 1.25fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  padding-block: clamp(1.6rem, 3.5vw, 2.4rem);
  border-bottom: 1px solid var(--mto-line);
  align-items: start;
}
.mto-code { color: var(--mto-accent); font-family: var(--mto-font-mono); font-size: 0.78rem; font-weight: 700; line-height: 1.4; }
.mto-line-row h3 { padding-top: 0; }
.mto-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.95rem; }
.mto-tag { padding: 0.28rem 0.55rem; border: 1px solid var(--mto-line); color: var(--mto-body); font-family: var(--mto-font-mono); font-size: 0.7rem; line-height: 1.2; }

.mto-architecture-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--mto-dark-line); }
.mto-architecture-item { min-height: 230px; padding: clamp(1.5rem, 3vw, 2.2rem); border-right: 1px solid var(--mto-dark-line); }
.mto-architecture-item:last-child { border-right: 0; }
.mto-architecture-item h3 { margin: 0.7rem 0 0.65rem; }

.mto-principles-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(1.5rem, 3vw, 2.5rem); }
.mto-principle h3 { margin: 0.65rem 0 0.55rem; }
.mto-principle p { font-size: 0.92rem; }

.mto-product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--mto-line); border-left: 1px solid var(--mto-line); }
.mto-product-card { min-width: 0; padding: clamp(1.25rem, 2.5vw, 1.8rem); background: var(--mto-surface); border-right: 1px solid var(--mto-line); border-bottom: 1px solid var(--mto-line); }
.mto-product-media { display: grid; place-items: center; min-height: 190px; margin: 0.8rem 0 1.2rem; background: var(--mto-bg); border: 1px solid var(--mto-line); overflow: hidden; }
.mto-product-media img { width: 100%; height: 100%; object-fit: cover; }
.mto-product-media p { max-width: 16ch; color: var(--mto-muted); font-family: var(--mto-font-mono); font-size: 0.72rem; text-align: center; }
.mto-product-card h3 { margin-bottom: 0.65rem; }

.mto-process-list { border-top: 1px solid var(--mto-line); }
.mto-process-step { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 1.25rem; padding-block: clamp(1.6rem, 3vw, 2.25rem); border-bottom: 1px solid var(--mto-line); }
.mto-process-step h3 { margin-bottom: 0.55rem; }

.mto-cta { padding-block: clamp(3.25rem, 7vw, 5.5rem); background: var(--mto-dark); }
.mto-cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.mto-cta h2 { color: #fff; }
.mto-cta .wp-block-button__link,
.mto-cta .mto-button { background: var(--mto-accent); border-color: var(--mto-accent); }
.mto-cta .wp-block-button__link:hover,
.mto-cta .mto-button:hover { background: #fff; border-color: #fff; color: var(--mto-ink); }

.mto-contact-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(270px, 0.85fr); gap: clamp(2.5rem, 6vw, 5rem); align-items: start; }
.mto-contact-card { padding: clamp(1.5rem, 3vw, 2.25rem); background: var(--mto-surface); border: 1px solid var(--mto-line); }
.mto-contact-card h3 { margin-bottom: 1rem; }
.mto-contact-card p + p { margin-top: 0.55rem; }

.mto-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.15rem; }
.mto-form-field--full { grid-column: 1 / -1; }
.mto-form label { display: block; margin-bottom: 0.45rem; color: var(--mto-body); font-family: var(--mto-font-mono); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; line-height: 1.3; text-transform: uppercase; }
.mto-form input,
.mto-form select,
.mto-form textarea {
  width: 100%;
  min-height: 46px;
  padding: 0.75rem 0.85rem;
  background: var(--mto-surface);
  border: 1px solid var(--mto-line);
  border-radius: 0;
  color: var(--mto-ink);
  font-family: var(--mto-font-sans);
  font-size: 0.95rem;
}
.mto-form textarea { min-height: 150px; resize: vertical; }
.mto-form input:focus,
.mto-form select:focus,
.mto-form textarea:focus { border-color: var(--mto-accent); outline: 2px solid rgba(189, 30, 54, 0.14); outline-offset: 0; }
.mto-form-consent { display: flex; align-items: flex-start; gap: 0.65rem; }
.mto-form-consent input { width: 18px; min-height: 18px; margin-top: 0.1rem; }
.mto-form-consent label { margin: 0; font-family: var(--mto-font-sans); font-size: 0.82rem; font-weight: 400; letter-spacing: 0; line-height: 1.5; text-transform: none; }
.mto-form-status { grid-column: 1 / -1; padding: 0.9rem 1rem; border: 1px solid var(--mto-line); background: var(--mto-surface); }
.mto-form-status--success { border-color: #2f7a4b; }
.mto-form-status--error { border-color: var(--mto-accent); }
.mto-honeypot { position: absolute !important; left: -9999px !important; }

.mto-legal { max-width: 780px !important; }
.mto-legal h2 { margin-top: 2.5rem; margin-bottom: 0.8rem; font-size: clamp(1.25rem, 2vw, 1.55rem); }
.mto-legal h2:first-child { margin-top: 0; }
.mto-legal p + p { margin-top: 1rem; }
.mto-legal li + li { margin-top: 0.45rem; }
.mto-notice { margin-top: 2rem; padding: 1rem; border-left: 3px solid var(--mto-accent); background: var(--mto-surface); font-size: 0.86rem; }

/* Generic WordPress content */
.page-header { padding-block: clamp(3.5rem, 7vw, 6rem) clamp(2.5rem, 5vw, 4rem); }
.page-header h1 { margin-top: 0.8rem; }
.page-content { padding-bottom: var(--mto-section); }
.entry-content > p + p { margin-top: 1rem; }
.entry-content .wp-block-image { margin-block: 1.5rem; }
.entry-content .wp-block-separator { border-color: var(--mto-line); }

/* Footer */
.site-footer { padding-block: clamp(3rem, 6vw, 4.5rem) 2rem; background: var(--mto-surface); border-top: 1px solid var(--mto-line); }
.footer-grid { display: grid; grid-template-columns: 1.35fr repeat(3, 1fr); gap: clamp(2rem, 4vw, 4rem); }
.footer-column h2,
.footer-column .widget-title { margin-bottom: 1rem; font-size: 0.78rem; font-family: var(--mto-font-mono); letter-spacing: 0.05em; text-transform: uppercase; }
.footer-column p,
.footer-column li,
.footer-column a { color: var(--mto-body); font-size: 0.84rem; }
.footer-column ul { margin: 0; padding: 0; list-style: none; }
.footer-column li + li { margin-top: 0.55rem; }
.footer-column a { text-decoration: none; }
.footer-column a:hover { color: var(--mto-accent); }
.footer-brand { margin-bottom: 1rem; }
.footer-meta { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--mto-line); display: flex; justify-content: space-between; gap: 1rem; color: var(--mto-muted); font-family: var(--mto-font-mono); font-size: 0.7rem; }

/* Responsive */
@media (max-width: 980px) {
  .header-cta { display: none; }
  .menu-toggle { display: inline-flex; }
  .primary-navigation {
    position: fixed;
    inset: var(--mto-header-height) 0 auto 0;
    display: none;
    margin: 0;
    padding: 1.25rem var(--mto-gutter) 1.5rem;
    background: var(--mto-bg);
    border-bottom: 1px solid var(--mto-line);
    max-height: calc(100vh - var(--mto-header-height));
    overflow-y: auto;
  }
  .primary-navigation.is-open { display: block; }
  .primary-navigation ul { align-items: stretch; flex-direction: column; gap: 0; }
  .primary-navigation li { border-bottom: 1px solid var(--mto-line); }
  .primary-navigation a { padding: 0.95rem 0; font-size: 1rem; border-bottom: 0; }
  .mto-hero-grid { grid-template-columns: 1fr; }
  .mto-hero-copy { max-width: 760px; }
  .mto-hero-art { min-height: 280px; }
  .mto-principles-grid { grid-template-columns: repeat(2, 1fr); }
  .mto-product-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  :root { --mto-header-height: 64px; }
  .site-header__inner { min-height: var(--mto-header-height); }
  .site-logo { font-size: 0.82rem; }
  h1 { font-size: clamp(2.25rem, 12vw, 3.35rem); max-width: 100%; }
  h2 { max-width: 100%; }
  .mto-hero { padding-block: 3.5rem 3rem; }
  .mto-hero-art { min-height: 230px; }
  .mto-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mto-stat { border-bottom: 1px solid var(--mto-line); }
  .mto-stat:nth-child(2n) { border-right: 0; }
  .mto-stat:nth-last-child(-n+2) { border-bottom: 0; }
  .mto-line-row { grid-template-columns: 52px 1fr; gap: 0.75rem 1rem; }
  .mto-line-row > :last-child { grid-column: 2; }
  .mto-architecture-grid { grid-template-columns: 1fr; }
  .mto-architecture-item { min-height: auto; border-right: 0; border-bottom: 1px solid var(--mto-dark-line); }
  .mto-architecture-item:last-child { border-bottom: 0; }
  .mto-contact-grid { grid-template-columns: 1fr; }
  .mto-cta-inner { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 540px) {
  .mto-actions { align-items: stretch; flex-direction: column; }
  .mto-actions .wp-block-button,
  .mto-actions .wp-block-button__link,
  .mto-actions .mto-button { width: 100%; }
  .mto-principles-grid,
  .mto-product-grid,
  .footer-grid { grid-template-columns: 1fr; }
  .mto-product-grid { border-top: 1px solid var(--mto-line); }
  .mto-form { grid-template-columns: 1fr; }
  .mto-form-field--full { grid-column: 1; }
  .footer-meta { align-items: flex-start; flex-direction: column; }
}

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