/* ===== SERVICE PAGES (/es/servicios/<slug>/) =====
   Builds on case-studies.css (cs-wrap, cs-detail, cs-block, cs-pillars, cs-table, cs-timeline).
   Generated pages: scripts/build_servicios_es.py */

/* Nav trigger styled before styles.min.css finishes its async load */
.nav-dd-trigger { font-size: 14px; font-weight: 500; color: var(--text-secondary); }

/* ---------- Hero ---------- */

.sv-hero { padding-top: 132px; }

.sv-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.sv-crumbs li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--text-muted);
}

.sv-crumbs a { color: var(--text-secondary); }
.sv-crumbs a:hover { color: var(--color-orange-text); }
.sv-crumbs [aria-current] { color: var(--text-primary); }

.sv-hero .page-title { max-width: 16ch; }
.sv-hero .cs-lead { max-width: 640px; }

.sv-hero-single { grid-template-columns: 1fr; }

.sv-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

/* ---------- Body ---------- */

.cs-block a {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: rgba(252, 80, 0, 0.55);
  text-underline-offset: 3px;
}

.cs-block a:hover { color: var(--color-orange-text); }

.sv-single { max-width: 860px; padding: 72px 0 40px; }

/* Neutral last column for comparison tables (cs-table colors it orange by default) */
.sv-table-plain td:last-child { color: var(--text-secondary); font-weight: 400; }
.sv-table th:first-child:empty { background: var(--bg-card); }

/* Integration flow: form → scoring → CRM → alert */
.sv-flow {
  list-style: none;
  counter-reset: flow;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 24px;
  padding: 0;
}

.sv-flow li {
  position: relative;
  counter-increment: flow;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-medium);
}

.sv-flow li::before {
  content: counter(flow, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-orange-text);
}

.sv-flow li + li::after {
  content: "→";
  position: absolute;
  left: -11px;
  top: 50%;
  transform: translate(-50%, -50%);
  color: var(--color-orange-text);
  font-size: 14px;
}

.sv-flow strong { font-size: 15px; color: var(--text-primary); }
.sv-flow span { font-size: 13px; line-height: 1.5; color: var(--text-secondary); }

/* FAQ */
.sv-faq { border-top: 1px solid var(--border-color); }

.sv-faq-item { border-bottom: 1px solid var(--border-color); }

.sv-faq-item summary {
  position: relative;
  list-style: none;
  cursor: pointer;
  padding: 20px 44px 20px 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
}

.sv-faq-item summary::-webkit-details-marker { display: none; }

.sv-faq-item summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  font-weight: 400;
  color: var(--color-orange-text);
  transition: transform .2s ease;
}

.sv-faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.sv-faq-item summary:hover { color: var(--color-orange-text); }
.sv-faq-answer { padding: 0 44px 22px 0; }
.sv-faq-answer p { margin: 0; max-width: 68ch; }

/* Related services */
.sv-related { padding: 8px 0 48px; }

.sv-related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.sv-related-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-medium);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  transition: border-color .25s ease, color .25s ease;
}

.sv-related-link:hover { border-color: rgba(252, 80, 0, 0.45); color: var(--color-orange-text); }
.sv-related-arrow { color: var(--color-orange-text); }

/* Unconfirmed business data: must read as a gap, never as a finished fact */
.sv-ph {
  display: inline-block;
  padding: 1px 8px;
  border: 1px dashed rgba(255, 196, 107, 0.7);
  border-radius: 6px;
  background: rgba(255, 196, 107, 0.1);
  color: #ffc46b;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .02em;
  line-height: 1.6;
  white-space: normal;
}

[data-theme="light"] .sv-ph {
  border-color: #c98a12;
  background: #fff3d6;
  color: #7a4d00;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .sv-hero { padding-top: 120px; }
  .sv-flow { grid-template-columns: 1fr 1fr; }
  .sv-flow li:nth-child(3)::after { display: none; }
  .sv-related-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .sv-flow { grid-template-columns: 1fr; }
  .sv-flow li + li::after { display: none; }
  .sv-hero-actions .btn { width: 100%; justify-content: center; }
}

/* ---------- Landing variant (paid media #2, CRO test) ---------- */

.lp-hero .cs-detail-hero-grid { align-items: start; }

.lp-micro {
  margin: 16px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.lp-micro-center { text-align: center; }

/* "What happens next" card: answers the post-click question above the fold */
.lp-next {
  justify-self: end;
  width: 100%;
  max-width: 360px;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-large);
}

.lp-next-title {
  margin: 0 0 18px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.lp-next ol {
  list-style: none;
  counter-reset: next;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}

.lp-next li {
  counter-increment: next;
  display: grid;
  grid-template-columns: 28px 1fr;
  column-gap: 12px;
}

.lp-next li::before {
  content: counter(next);
  grid-row: span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-action);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.lp-next strong { font-size: 15px; color: var(--text-primary); }
.lp-next span { font-size: 14px; line-height: 1.5; color: var(--text-secondary); }

.lp-proof { padding: 48px 0 8px; }
.lp-logos { margin: 20px 0 0; text-align: center; }

.lp-section { padding: 88px 0 0; }

.lp-head { max-width: 760px; margin-bottom: 32px; }

.lp-head h2 {
  font-size: clamp(30px, 3.6vw, 46px);
  line-height: 1;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.lp-intro {
  margin: 0;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.lp-section .cs-list li,
.lp-section .cs-timeline-what { max-width: 72ch; }
.lp-section .cs-timeline-what em { color: var(--text-primary); font-style: normal; font-weight: 600; }
.lp-section .cs-pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lp-section .cs-pillar p { font-size: 15px; }
.lp-section .cs-pillar h3 { margin: 0 0 8px; font-family: var(--font-body); font-size: 17px; font-weight: 700; text-transform: none; letter-spacing: -0.01em; line-height: 1.3; color: var(--text-primary); }
.lp-section .cs-pillar { padding: 24px; }
.lp-section a { color: var(--text-primary); text-decoration: underline; text-decoration-color: rgba(252, 80, 0, 0.55); text-underline-offset: 3px; }
.lp-section a:hover { color: var(--color-orange-text); }
.lp-faq-wrap { max-width: 860px; }
.lp-faq-wrap .sv-faq-answer p { color: var(--text-secondary); font-size: 16px; line-height: 1.7; }

.lp-section + .cs-cta { margin-top: 88px; }

@media (max-width: 860px) {
  .lp-next { justify-self: start; max-width: none; }
  .lp-section { padding-top: 64px; }
}

@media (max-width: 600px) {
  .lp-section .cs-pillars { grid-template-columns: 1fr; }
}

/* ==========================================================================
   COLOR DEPTH: service-only blocks (tokens live in case-studies.css)
   ========================================================================== */
/* ---------- FAQ: the open answer gets a tinted surface ---------- */
.sv-faq-item { transition: background-color .25s ease; }

.sv-faq-item[open] {
  border-radius: 12px;
  background: var(--indigo-soft);
  border-bottom-color: transparent;
}

.sv-faq-item summary { padding-left: 16px; }
.sv-faq-answer { padding-left: 16px; }
.sv-faq-item[open] summary { color: var(--color-orange-text); }

/* ---------- Related services ---------- */
.sv-related-link { border-color: var(--indigo-line); }

.sv-related-arrow {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--color-action);
  color: #fff;
  transition: transform .25s ease;
}

.sv-related-link:hover .sv-related-arrow { transform: translateX(3px); }

@media (prefers-reduced-motion: reduce) {
  .sv-related-link:hover .sv-related-arrow { transform: none; }
}

.sv-guides-head { margin-top: 32px; }

/* Comparison tables: stack each row as a card on phones so no column hides behind a sideways scroll */
@media (max-width: 600px) {
  .sv-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .sv-table, .sv-table tbody, .sv-table tr, .sv-table td { display: block; width: 100%; }
  .sv-table { min-width: 0; }
  .sv-table tr { padding: 14px 16px; border-bottom: 1px solid var(--border-color); }
  .sv-table tr:last-child { border-bottom: 0; }
  .sv-table td { padding: 4px 0; border: 0; }
  .sv-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
  }
  .sv-table td:first-child { font-weight: 600; color: var(--text-primary); }
  .sv-table td:first-child::before { display: none; }
}

/* Microcopy on the indigo closing band: grey text was unreadable on indigo */
.cs-cta .lp-micro { color: rgba(255, 255, 255, 0.82); }

/* Proof strip with three stats (v2 pages): three even columns instead of an empty fourth */
.cs-impact-grid.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 601px) and (max-width: 1024px) {
  .cs-impact-grid.is-3 .cs-impact-stat:nth-child(2) { border-right: 1px solid var(--border-color); }
  .cs-impact-grid.is-3 .cs-impact-stat:nth-child(-n+2) { border-bottom: none; }
}
@media (max-width: 600px) {
  .cs-impact-grid.is-3 { grid-template-columns: 1fr; }
}
