/* Pauta medida por ventas, integración con CRM, piloto de 30 días y contacto directo */

/* 1. Laboratorio de pauta dentro de #pauta (fondo claro --paper) */
.campaign-lab {
  margin-top: clamp(24px, 4vw, 48px);
  padding: clamp(18px, 3vw, 38px);
  border: 1px solid #c4c9b8;
  border-radius: 14px;
  background: #fbfbf5;
  color: var(--ink);
}
.lab-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: clamp(18px, 2.6vw, 30px);
}
.lab-head > div:first-child { max-width: 58ch; }
.lab-head .kicker { color: #4c573c; margin-bottom: 10px; }
.lab-head .kicker i { background: #6c7b45; box-shadow: none; }
.lab-head h3 {
  font-size: clamp(1.65rem, 3.1vw, 2.7rem);
  font-weight: 520;
  line-height: 1.04;
  letter-spacing: -.045em;
  margin-bottom: 10px;
}
.lab-head h3 em { font-family: Instrument, Georgia, serif; font-weight: 400; color: #5f6f3e; }
.lab-head p { color: #4c5344; font-size: .96rem; }

.lab-steps {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: #e6eadc;
  border: 1px solid #c3cab6;
  border-radius: 999px;
  flex-wrap: wrap;
}
.lab-steps button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 9px 15px;
  background: transparent;
  color: #3b4634;
  font-size: .85rem;
  font-weight: 620;
  transition: background .2s, color .2s;
}
.lab-steps button span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #d2dac4;
  color: #25331e;
  font: 700 .74rem ui-monospace, Consolas, monospace;
}
.lab-steps button[aria-pressed="true"] {
  background: #24341e;
  color: #f4f7ec;
}
.lab-steps button[aria-pressed="true"] span {
  background: var(--accent);
  color: #182000;
}

.lab-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.lab-piece {
  display: flex;
  flex-direction: column;
  background: #f3f4eb;
  border: 1px solid #ccd2bf;
  border-radius: 12px;
  overflow: hidden;
  transition: border-color .3s, box-shadow .3s, transform .3s;
}
.lab-piece.is-winner {
  border-color: #3b582c;
  box-shadow: 0 10px 28px #2031191a;
  background: #ffffff;
}
.lab-thumb {
  position: relative;
  height: 132px;
  overflow: hidden;
  background: #c89a7a;
}
.lab-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.lab-thumb span {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #161b14d9;
  color: #f4f6ec;
  font: 600 .68rem ui-monospace, Consolas, monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.lab-piece header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 18px 8px;
}
.lab-piece h4 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 640;
  letter-spacing: -.025em;
}
.lab-badge {
  padding: 3px 9px;
  border-radius: 999px;
  background: #e3ebd2;
  color: #2f4824;
  font: 600 .72rem ui-monospace, Consolas, monospace;
}
.lab-badge:empty { display: none; }
.lab-piece.is-winner .lab-badge {
  background: #24341e;
  color: var(--accent);
}

.lab-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 6px 18px 14px;
}
.lab-metrics div {
  padding: 10px 11px;
  border-radius: 8px;
  background: #f5f6ee;
  border: 1px solid #dfe4d4;
  transition: opacity .35s, background .35s, border-color .35s;
}
.lab-metrics dt {
  font-size: .72rem;
  color: #535c49;
  line-height: 1.25;
}
.lab-metrics dd {
  margin: 4px 0 0;
  font-size: clamp(1rem, 1.6vw, 1.28rem);
  font-weight: 660;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.campaign-lab[data-stage="platform"] .crm-only {
  opacity: .52;
  border-style: dashed;
}
.campaign-lab[data-stage="platform"] .crm-only dd {
  font-size: .84rem;
  font-weight: 500;
  color: #6b7361;
}
.campaign-lab[data-stage="crm"] .crm-only {
  background: #edf4e1;
  border-color: #b7cca0;
}

.lab-funnel {
  display: grid;
  gap: 5px;
  padding: 0 18px 16px;
  margin-top: auto;
}
.lab-funnel i {
  display: block;
  height: 7px;
  width: var(--w, 0%);
  border-radius: 999px;
  background: #aeb89f;
  transition: width .65s cubic-bezier(.2, .7, .2, 1);
}
.lab-funnel i[data-f="qualified"] { background: #6b8b44; }
.lab-funnel i[data-f="sales"] { background: #263d21; }

.lab-optimizer {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 18px 28px;
  align-items: center;
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 12px;
  background: #eef1e5;
  border: 1px solid #cbd2be;
  transition: opacity .3s;
}
.campaign-lab[data-stage="platform"] .lab-optimizer { opacity: .68; }
.campaign-lab[data-stage="platform"] .lab-summary strong { font-size: .96rem; font-weight: 560; color: #616957; }
.lab-slider { display: grid; gap: 6px; }
.lab-slider label { font-size: .8rem; font-weight: 650; color: #424b39; }
.lab-slider output {
  font: 650 1.05rem ui-monospace, Consolas, monospace;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.lab-slider input[type="range"] {
  width: 100%;
  accent-color: #2b4523;
  cursor: pointer;
}
.lab-slider input[type="range"]:disabled { cursor: not-allowed; }
.lab-scale {
  display: flex;
  justify-content: space-between;
  font: 500 .72rem ui-monospace, Consolas, monospace;
  color: #5a6350;
}
.lab-summary {
  display: flex;
  align-items: center;
  gap: 16px 22px;
  flex-wrap: wrap;
}
.lab-summary p { display: grid; gap: 2px; }
.lab-summary small { font-size: .72rem; color: #545d4a; }
.lab-summary strong {
  font-size: clamp(1.35rem, 2.2vw, 1.8rem);
  line-height: 1.05;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
}
.lab-summary em {
  font-style: normal;
  font-size: .74rem;
  font-weight: 600;
  color: #3c6525;
}
.lab-summary .route-play {
  background: #24341e;
  border-color: #24341e;
  color: #f4f7ec;
  font-weight: 620;
}
.lab-summary .route-play:hover:not(:disabled) { background: #334a2b; }
.lab-summary .route-play:disabled { opacity: .5; cursor: not-allowed; }

.lab-insight {
  margin-top: 14px;
  padding: 12px 15px;
  border-left: 3px solid #5e7c2b;
  background: #f1f5e8;
  border-radius: 0 8px 8px 0;
  font-size: .92rem;
  color: #253020;
}
.lab-note {
  display: block;
  margin-top: 10px;
  font: 400 .74rem ui-monospace, Consolas, monospace;
  color: #5b6351;
}

/* 2. Integración con CRM (#integraciones, fondo oscuro --bg) */
#integraciones {
  background: radial-gradient(ellipse at 90% 10%, #27321c, transparent 58%), var(--bg);
}
.int-demo {
  padding: clamp(16px, 2.6vw, 32px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.int-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.int-seg {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  background: #131711;
  border: 1px solid var(--border);
  border-radius: 999px;
  flex-wrap: wrap;
}
.int-seg button {
  border: 0;
  border-radius: 999px;
  padding: 7px 13px;
  background: transparent;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
  transition: background .2s, color .2s;
}
.int-seg button:hover { color: var(--text); }
.int-seg button[aria-pressed="true"] {
  background: var(--accent);
  color: #182000;
}

.int-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr) 44px minmax(0, 1.1fr);
  align-items: stretch;
  gap: 0;
}
.int-card {
  display: flex;
  flex-direction: column;
  padding: 18px;
  background: #141812;
  border: 1px solid #32392d;
  border-radius: 12px;
  min-width: 0;
  transition: border-color .3s, box-shadow .3s, background .3s;
}
.int-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #dcfa7526;
}
.int-card.is-done { border-color: #6f8a42; }
.int-card header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid #2b3227;
}
.int-card header small {
  font: 600 .68rem ui-monospace, Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
}
.int-card header b { font-size: .9rem; color: var(--text); }

.int-card dl {
  display: grid;
  gap: 9px;
  margin: 0;
}
.int-card dl div {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.int-card dt {
  font: 600 .68rem ui-monospace, Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #9ba490;
}
.int-card dd {
  margin: 0;
  font-size: .88rem;
  color: var(--text);
  min-height: 1.3em;
  overflow-wrap: anywhere;
}

.int-score {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 10px;
}
.int-score strong {
  font-size: clamp(2.1rem, 3.2vw, 2.8rem);
  line-height: 1;
  letter-spacing: -.05em;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.int-score small { color: var(--muted); font-size: .85rem; }
.int-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
  margin-bottom: 12px;
}
.int-chips span {
  padding: 4px 9px;
  border-radius: 999px;
  background: #273021;
  border: 1px solid #445338;
  color: #e4f2c3;
  font-size: .74rem;
}
.int-decision {
  margin-top: auto;
  padding: 9px 12px;
  border-radius: 8px;
  background: #1f251b;
  border: 1px solid #353e2f;
  font-size: .84rem;
  font-weight: 620;
  color: var(--muted);
}
.int-demo[data-route="assigned"] .int-decision {
  background: #2b3c1c;
  border-color: #7ea33b;
  color: var(--accent);
}
.int-demo[data-route="recycle"] .int-decision {
  background: #332e1c;
  border-color: #a68c3e;
  color: #f3dc8a;
}
.int-demo[data-route="blocked"] .int-decision {
  background: #35211e;
  border-color: #9e564a;
  color: #f4b7ac;
}
.int-demo[data-route="blocked"] .int-dest.is-done {
  border-color: #8f4e43;
  background: #1b1514;
}

.int-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.int-link::before {
  content: "";
  width: 100%;
  height: 2px;
  background: #3a4234;
  transition: background .3s;
}
.int-link.is-done::before { background: #7f9f3b; }
.int-link i {
  position: absolute;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  opacity: 0;
}
.int-status {
  margin-top: 16px;
  font-size: .9rem;
  color: #d6e4b6;
  min-height: 1.5em;
}

.int-points {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin: 28px 0 0;
  padding: 0;
}
.int-points li {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: .92rem;
  color: var(--muted);
}
.int-points b { display: block; color: var(--text); margin-bottom: 4px; font-weight: 620; }

/* 3. Piloto medido en 30 días (#piloto, fondo claro --paper) */
#piloto {
  background: var(--paper);
  color: var(--ink);
  --border: #cdd0c3;
  --muted: #505749;
}
#piloto .eyebrow { color: #55633f; }
#piloto .section-head h2 em { color: #617044; }
#piloto .section-head p { color: #4c5444; }

.pilot-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: #e4e8da;
  border: 1px solid #c3c9b7;
  border-radius: 999px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.pilot-tabs button {
  border: 0;
  border-radius: 999px;
  padding: 9px 16px;
  background: transparent;
  color: #3d4736;
  font-size: .86rem;
  font-weight: 620;
  transition: background .2s, color .2s;
}
.pilot-tabs button[aria-pressed="true"] {
  background: #24341e;
  color: #f4f7ec;
}

.pilot-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(18px, 3vw, 34px);
  align-items: start;
}
.pilot-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.pilot-timeline li {
  position: relative;
  padding: 16px 18px 16px 22px;
  background: #fbfbf5;
  border: 1px solid #cbd1bf;
  border-left: 3px solid #6b8340;
  border-radius: 0 11px 11px 0;
}
.pilot-timeline span {
  display: inline-block;
  font: 700 .72rem ui-monospace, Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: #4f6331;
  margin-bottom: 5px;
}
.pilot-timeline p { font-size: .93rem; color: #31392b; line-height: 1.5; }

.pilot-board {
  padding: clamp(18px, 2.8vw, 30px);
  background: #fbfbf5;
  border: 1px solid #c4cab8;
  border-radius: 14px;
  box-shadow: 0 14px 36px #1c281712;
}
.pilot-board h3 {
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  font-weight: 580;
  letter-spacing: -.035em;
  margin: 2px 0 18px;
  color: var(--ink);
}
.pilot-board table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.pilot-board th,
.pilot-board td {
  padding: 11px 8px;
  border-bottom: 1px solid #dde2d2;
  text-align: left;
}
.pilot-board thead th {
  font: 600 .7rem ui-monospace, Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #55604a;
}
.pilot-board tbody th { font-weight: 560; color: var(--ink); }
.pilot-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: #e7ecdc;
  color: #3f4b34;
  font: 600 .72rem ui-monospace, Consolas, monospace;
  white-space: nowrap;
}
.pilot-pill.is-next {
  background: #24341e;
  color: var(--accent);
}
.pilot-note {
  margin: 16px 0 18px;
  font-size: .82rem;
  color: #525b49;
}
.pilot-board .btn-primary {
  background: #26351e;
  color: #f5f7ed;
}
.pilot-board .btn-primary:hover { background: #344a29; }

/* 4. Contacto con contexto y botón flotante de WhatsApp */
.context-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid #596c35;
  font-size: .84rem;
  color: #dce9be;
}
.context-chip b { color: var(--accent); font-weight: 650; }
.contact-phone {
  margin-top: 14px;
  font: 500 .82rem ui-monospace, Consolas, monospace;
  color: var(--muted);
}
.contact-phone a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.brief-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.brief-actions .btn-primary { flex: 1 1 200px; }

.wa-float {
  position: fixed;
  right: clamp(14px, 2.5vw, 26px);
  bottom: clamp(14px, 2.5vw, 24px);
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #182000;
  font-size: .88rem;
  font-weight: 700;
  border: 1px solid #9bbb4b;
  box-shadow: 0 10px 28px #00000059;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity .25s, transform .25s, background .2s;
}
.wa-float svg { width: 20px; height: 20px; flex-shrink: 0; }
.wa-float.is-shown {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.wa-float:hover { background: #eaffaa; transform: translateY(-2px); }

/* Animaciones respetando prefers-reduced-motion */
@media (prefers-reduced-motion: no-preference) {
  .int-link.is-active i {
    animation: int-pulse .55s ease-in-out forwards;
  }
  .int-chips span,
  .int-dest dl div {
    animation: grow-fade .3s ease-out both;
  }
  .pilot.is-playing .pilot-timeline li,
  .pilot.is-playing .pilot-board tbody tr {
    animation: grow-fade .42s cubic-bezier(.2, .7, .2, 1) both;
    animation-delay: calc(var(--i) * 85ms);
  }
}
@keyframes int-pulse {
  0% { left: 0; opacity: 0; transform: scale(.7); }
  20% { opacity: 1; transform: scale(1); }
  85% { opacity: 1; }
  100% { left: calc(100% - 10px); opacity: 0; transform: scale(.8); }
}
@keyframes int-pulse-y {
  0% { top: 0; opacity: 0; transform: scale(.7); }
  20% { opacity: 1; transform: scale(1); }
  85% { opacity: 1; }
  100% { top: calc(100% - 10px); opacity: 0; transform: scale(.8); }
}
@keyframes grow-fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Responsive */
@media (max-width: 900px) {
  .int-stage {
    grid-template-columns: 1fr;
  }
  .int-link {
    height: 28px;
  }
  .int-link::before {
    width: 2px;
    height: 100%;
  }
  .int-link i {
    left: auto;
    top: 0;
  }
  @media (prefers-reduced-motion: no-preference) {
    .int-link.is-active i {
      animation-name: int-pulse-y;
    }
  }
  .int-points,
  .pilot-body {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 780px) {
  .lab-grid,
  .lab-optimizer {
    grid-template-columns: 1fr;
  }
  .lab-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pilot-board table {
    font-size: .82rem;
  }
}
@media (max-width: 540px) {
  .wa-float {
    padding: 12px;
  }
  .wa-float span {
    display: none;
  }
}
