/* Product Tour – rediseño SaaS con laptop mockup */

.tour-section {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 55% at 12% 18%, rgba(0, 152, 240, 0.14), transparent 60%),
    radial-gradient(ellipse 55% 50% at 88% 12%, rgba(0, 119, 200, 0.1), transparent 58%),
    radial-gradient(ellipse 60% 45% at 70% 90%, rgba(255, 255, 255, 0.75), transparent 55%),
    linear-gradient(180deg, #eef7fd 0%, #f7fbff 48%, #eaf4fb 100%);
}

.tour-section::before,
.tour-section::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.tour-section::before {
  width: 28rem;
  height: 28rem;
  top: -8rem;
  right: -6rem;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.65), transparent 70%);
}

.tour-section::after {
  width: 22rem;
  height: 22rem;
  left: -8rem;
  bottom: 8%;
  background: radial-gradient(circle, rgba(0, 152, 240, 0.08), transparent 70%);
}

.tour-section > .wrap {
  position: relative;
  z-index: 1;
}

.tour-header {
  max-width: 44rem;
}

.tour-header .kicker {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tour-header h2 {
  position: relative;
  display: inline-block;
  padding-right: 1.1em;
}

.tour-title-spark {
  position: absolute;
  top: 0.18em;
  right: 0;
  width: 0.9em;
  height: 0.9em;
  background:
    linear-gradient(135deg, transparent 40%, var(--accent) 40% 48%, transparent 48%),
    linear-gradient(135deg, transparent 52%, var(--accent) 52% 58%, transparent 58%),
    linear-gradient(135deg, transparent 62%, var(--accent-strong) 62% 68%, transparent 68%);
  opacity: 0.9;
}

.tour-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 1.35rem 0 1.4rem;
}

.tour-tab {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid rgba(0, 119, 200, 0.18);
  background: #fff;
  color: var(--accent-strong);
  border-radius: 999px;
  padding: 0.72rem 1.15rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(14, 42, 71, 0.05);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.tour-tab-icon {
  display: inline-flex;
  width: 1.15rem;
  height: 1.15rem;
  color: currentColor;
}

.tour-tab-icon svg {
  width: 100%;
  height: 100%;
}

.tour-tab:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.tour-tab.is-active,
.tour-tab[aria-selected="true"] {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 119, 200, 0.22);
}

.tour-panel[hidden] {
  display: none !important;
}

.software-viewer-layout {
  display: grid;
  grid-template-columns: minmax(15rem, 0.78fr) minmax(0, 1.45fr);
  gap: 1.35rem;
  align-items: center;
}

.tour-copy {
  position: relative;
  margin: 0;
  padding: 1.35rem 1.3rem 1.2rem;
  background: #fff;
  border: 1px solid rgba(201, 220, 235, 0.9);
  border-radius: 22px;
  box-shadow: 0 14px 36px rgba(14, 42, 71, 0.08);
}

.tour-step {
  display: inline-flex;
  align-items: center;
  margin: 0 0 1rem;
  padding: 0.28rem 0.72rem;
  border: 1px solid rgba(0, 152, 240, 0.35);
  border-radius: 999px;
  color: var(--accent-strong);
  background: rgba(0, 152, 240, 0.06);
  font-size: 0.86rem;
  font-weight: 700;
}

.tour-feature-icon {
  display: grid;
  place-items: center;
  width: 3.1rem;
  height: 3.1rem;
  margin-bottom: 0.9rem;
  border-radius: 50%;
  background: rgba(0, 152, 240, 0.1);
  color: var(--accent-strong);
}

.tour-icon-slot {
  display: none;
  width: 1.45rem;
  height: 1.45rem;
}

.tour-feature-icon[data-tour-icon="home"] [data-icon-name="home"],
.tour-feature-icon[data-tour-icon="calendar"] [data-icon-name="calendar"],
.tour-feature-icon[data-tour-icon="clock"] [data-icon-name="clock"],
.tour-feature-icon[data-tour-icon="users"] [data-icon-name="users"],
.tour-feature-icon[data-tour-icon="fingerprint"] [data-icon-name="fingerprint"],
.tour-feature-icon[data-tour-icon="phone"] [data-icon-name="phone"],
.tour-feature-icon[data-tour-icon="settings"] [data-icon-name="settings"],
.tour-feature-icon[data-tour-icon="laptop"] [data-icon-name="laptop"] {
  display: block;
}

.tour-icon-slot svg {
  width: 100%;
  height: 100%;
}

.tour-copy h3 {
  margin: 0 0 0.55rem;
  font-family: "Nunito", "Nunito Sans", sans-serif;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  color: var(--navy);
}

.tour-copy p:not(.tour-step) {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.tour-card-nav {
  display: flex;
  gap: 0.55rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
}

.tour-card-nav-btn {
  appearance: none;
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid rgba(0, 119, 200, 0.22);
  border-radius: 50%;
  background: #fff;
  color: var(--accent-strong);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tour-card-nav-btn:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
}

.tour-card-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.laptop-mock {
  position: relative;
  min-width: 0;
  padding-top: 2.4rem;
}

.tour-controls {
  position: absolute;
  top: 0;
  right: 0.6rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid rgba(201, 220, 235, 0.95);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(14, 42, 71, 0.1);
  backdrop-filter: blur(8px);
}

.tour-controls-sep {
  width: 1px;
  height: 1.1rem;
  margin: 0 0.25rem;
  background: rgba(201, 220, 235, 0.95);
}

.tour-control {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-width: 1.9rem;
  min-height: 1.9rem;
  padding: 0.2rem 0.45rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--navy);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tour-control:hover {
  background: rgba(0, 152, 240, 0.1);
  color: var(--accent-deep);
}

.tour-control:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.tour-control-full span {
  font-size: 0.8rem;
}

.laptop-frame {
  position: relative;
  width: 100%;
  max-width: 40rem;
  margin-inline: auto;
  filter: drop-shadow(0 22px 40px rgba(14, 42, 71, 0.18));
}

.laptop-chassis {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* Medición real del PNG 1024x682: pantalla blanca 125,67 → 897,476 */
.laptop-screen {
  position: absolute;
  top: 9.824%;
  left: 12.207%;
  width: 75.4883%;
  height: 60.1173%;
  overflow: auto;
  border-radius: 0.55% / 1%;
  background: #0b2238;
  cursor: grab;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.laptop-screen.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.laptop-screen:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 2px;
}

.desktop-pan {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-width: 100%;
  min-height: 100%;
  transform-origin: center top;
}

.reforma40 .laptop-screen img[data-tour-image],
.laptop-screen img[data-tour-image] {
  display: block;
  width: auto;
  max-width: none;
  height: auto;
  margin: 0 auto;
  background: #fff;
  user-select: none;
  -webkit-user-drag: none;
}

.tour-thumbs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(9.4rem, 1fr);
  gap: 0.85rem;
  margin: 1.35rem 0 0;
  padding-bottom: 0.25rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.tour-thumb {
  appearance: none;
  display: grid;
  gap: 0.55rem;
  min-width: 9.4rem;
  padding: 0.55rem;
  border: 1.5px solid transparent;
  border-radius: 16px;
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(14, 42, 71, 0.07);
  scroll-snap-align: start;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.tour-thumb-media {
  display: block;
  overflow: hidden;
  border-radius: 10px;
  background: var(--surface);
}

.tour-thumb img {
  display: block;
  width: 100%;
  height: 4.4rem;
  object-fit: cover;
  object-position: top center;
}

.tour-thumb-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem;
  align-items: start;
}

.tour-thumb-icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  margin-top: 0.1rem;
  color: var(--accent-strong);
}

.tour-thumb-icon svg {
  width: 100%;
  height: 100%;
}

.tour-thumb-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.3;
}

.tour-thumb:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(14, 42, 71, 0.1);
}

.tour-thumb.is-active,
.tour-thumb[aria-selected="true"] {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 2px rgba(0, 119, 200, 0.12), 0 12px 26px rgba(14, 42, 71, 0.1);
}

.tour-thumb.is-active .tour-thumb-label,
.tour-thumb[aria-selected="true"] .tour-thumb-label {
  color: var(--navy);
}

.tour-cta {
  margin-top: 2rem;
  padding: 1.35rem 1.4rem;
  border: 1px solid rgba(201, 220, 235, 0.95);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(14, 42, 71, 0.06);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.tour-cta h3 {
  margin: 0;
  font-family: "Nunito", "Nunito Sans", sans-serif;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
}

.tour-empty {
  display: grid;
  gap: 0.9rem;
  justify-items: start;
  padding: 1.5rem;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
}

.tour-empty p {
  margin: 0;
  max-width: 40rem;
  color: var(--muted);
}

.laptop-mock:fullscreen,
.laptop-mock:-webkit-full-screen {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 3.4rem 1rem 1rem;
  background: #0b2238;
  display: grid;
  align-content: center;
  justify-items: center;
}

.laptop-mock:fullscreen .tour-controls,
.laptop-mock:-webkit-full-screen .tour-controls {
  position: fixed;
  top: 0.85rem;
  right: 1rem;
  left: auto;
  transform: none;
  z-index: 5;
}

.laptop-mock:fullscreen .laptop-frame,
.laptop-mock:-webkit-full-screen .laptop-frame {
  /* Escala por viewport: prioriza ocupar casi toda la altura útil */
  width: min(96vw, calc((100vh - 4.5rem) * 1024 / 682));
  max-width: none;
  margin: 0;
  filter: drop-shadow(0 28px 48px rgba(0, 0, 0, 0.45));
}

.laptop-mock:fullscreen .laptop-chassis,
.laptop-mock:-webkit-full-screen .laptop-chassis {
  width: 100%;
  height: auto;
}

@media (min-width: 1100px) {
  .tour-thumbs {
    grid-auto-columns: minmax(0, 1fr);
    overflow: visible;
  }
}

@media (max-width: 959px) {
  .software-viewer-layout {
    grid-template-columns: 1fr;
  }

  .laptop-mock {
    order: -1;
    padding-top: 2.7rem;
  }

  .tour-controls {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  .laptop-screen {
    cursor: default;
  }

  .tour-control-full span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .tour-control-full {
    position: relative;
  }
}

@media (max-width: 599px) {
  .tour-tab {
    width: 100%;
    justify-content: center;
  }

  .tour-cta {
    align-items: stretch;
  }

  .tour-cta .btn {
    width: 100%;
    justify-content: center;
  }

  .laptop-frame {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tour-tab,
  .tour-thumb,
  .tour-control,
  .tour-card-nav-btn {
    transition: none;
  }
}
