/**
 * Checkit · búsqueda inteligente header (Civitatis / OTA B2B)
 * Prefijo .ck- · tokens design system
 * Mobile <768px: logo + acciones arriba · cápsula en 2ª fila · sticky blur
 */
.ck-search-container {
  --ck-search-ink: var(--ck-ink, #0f172a);
  --ck-search-muted: var(--ck-muted, #64748b);
  --ck-search-line: var(--ck-line, #e2e8f0);
  --ck-search-accent: var(--ck-accent, #f26422);
  --ck-search-accent-2: var(--ck-accent-2, #ff7836);
  --ck-search-navy: var(--ck-navy, #0f2744);
  position: relative;
  flex: 0 1 320px;
  max-width: 340px;
  width: min(340px, 42vw);
  min-width: 0;
  margin: 0 8px;
  font-family: var(--ck-font, "Plus Jakarta Sans", Inter, sans-serif);
  z-index: 2;
}

.ck-search-container:has(.ck-search-dropdown.is-open),
.ck-search-container:focus-within {
  z-index: 60;
}

.ck-search-bar {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid var(--ck-search-line);
  border-radius: 999px;
  padding: 3px 5px 3px 14px;
  min-height: 36px;
  height: 36px;
  box-shadow: 0 6px 16px -4px rgba(15, 39, 68, 0.1);
  transition: all 0.25s ease;
}

.ck-search-bar:focus-within {
  border-color: var(--ck-search-accent);
  box-shadow: 0 8px 20px -4px rgba(242, 100, 34, 0.2);
}

.ck-search-icon {
  width: 15px;
  height: 15px;
  color: var(--ck-search-muted);
  margin-right: 10px;
  flex-shrink: 0;
}

.ck-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ck-search-ink);
  background: transparent;
  min-width: 0;
  font-family: inherit;
  line-height: 1.2;
}

.ck-search-input::placeholder {
  color: #94a3b8;
  font-weight: 500;
  font-size: 0.8125rem;
}

.ck-search-btn {
  background: linear-gradient(135deg, var(--ck-search-accent), var(--ck-search-accent-2));
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  height: 28px;
  transition: all 0.25s ease;
  font-family: inherit;
  white-space: nowrap;
}

.ck-search-btn:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 4px 14px rgba(242, 100, 34, 0.35);
}

.ck-search-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: min(680px, 94vw);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--ck-search-line);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 20px 40px -10px rgba(15, 39, 68, 0.15), 0 8px 16px -6px rgba(15, 39, 68, 0.08);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
}

.ck-search-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.ck-dropdown-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--ck-search-accent);
  text-align: center;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}

.ck-recent-block {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}

.ck-recent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ck-search-muted);
  margin-bottom: 10px;
}

.ck-recent-header button {
  border: none;
  background: none;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.ck-recent-header button:hover {
  color: var(--ck-search-accent);
}

.ck-recent-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ck-recent-chip {
  background: #f8fafc;
  border: 1px solid var(--ck-search-line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ck-search-navy);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.ck-recent-chip:hover {
  border-color: var(--ck-search-accent);
  color: var(--ck-search-accent);
  transform: translateY(-1px);
}

.ck-destinations-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 8px;
  margin-bottom: 18px;
}

.ck-dest-item {
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  text-align: left;
  background: transparent;
  font-family: inherit;
}

.ck-dest-item:hover,
.ck-dest-item:focus-visible {
  background: #fff7ed;
  border-color: rgba(242, 100, 34, 0.22);
  transform: translateX(4px);
  outline: none;
}

.ck-dest-item.is-hidden {
  display: none;
}

.ck-dest-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--ck-search-ink);
  line-height: 1.25;
  display: block;
}

.ck-dest-item:hover .ck-dest-name {
  color: var(--ck-search-accent);
}

.ck-dest-country {
  font-size: 0.75rem;
  color: var(--ck-search-muted);
  font-weight: 500;
}

.ck-see-all-wrap {
  text-align: center;
}

.ck-btn-outline {
  background: transparent;
  border: 1.5px solid var(--ck-search-accent);
  color: var(--ck-search-accent);
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
  min-height: 40px;
}

.ck-btn-outline:hover {
  background: var(--ck-search-accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(242, 100, 34, 0.25);
}

.ck-search-empty {
  display: none;
  text-align: center;
  color: var(--ck-search-muted);
  font-size: 0.85rem;
  padding: 8px 0 16px;
}

.ck-search-empty.is-visible {
  display: block;
}

/* === Resultados globales predictivos === */
.ck-global-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 8px 18px;
  color: var(--ck-search-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.ck-global-status[hidden] {
  display: none !important;
}

.ck-global-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #e2e8f0;
  border-top-color: var(--ck-search-accent);
  border-radius: 50%;
  animation: ck-spin 0.7s linear infinite;
}

@keyframes ck-spin {
  to { transform: rotate(360deg); }
}

@keyframes ck-result-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ck-global-results {
  max-height: 22rem;
  overflow-y: auto;
  margin: 0 0 8px;
  padding-right: 4px;
  scrollbar-width: thin;
}

.ck-global-results[hidden] {
  display: none !important;
}

.ck-result-group + .ck-result-group {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.ck-result-group__label {
  margin-bottom: 10px;
}

.ck-result-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.ck-result-chip i {
  font-size: 0.7rem;
  color: #ff7836;
}

.ck-result-chip--cupo { background: linear-gradient(135deg, #0f2744, #1a446c); }
.ck-result-chip--grupal { background: linear-gradient(135deg, #7c2d12, #c2410c); }
.ck-result-chip--circuito { background: linear-gradient(135deg, #1e3a5f, #0f2744); }
.ck-result-chip--destino,
.ck-result-chip--pais { background: linear-gradient(135deg, #0f172a, #334155); }
.ck-result-chip--transfer,
.ck-result-chip--servicio { background: linear-gradient(135deg, #134e4a, #0f766e); }

.ck-result-item {
  --ck-stagger: 0ms;
  width: 100%;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  border: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 16px;
  padding: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 8px 20px -10px rgba(15, 39, 68, 0.12);
  transition: all 0.25s ease;
  animation: ck-result-in 0.35s ease both;
  animation-delay: var(--ck-stagger);
  position: relative;
  overflow: hidden;
}

.ck-result-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.45) 45%, transparent 70%);
  transform: translateX(-120%);
  pointer-events: none;
}

.ck-result-item:hover::after,
.ck-result-item:focus-visible::after {
  transition: transform 0.55s ease;
  transform: translateX(120%);
}

.ck-result-item:hover,
.ck-result-item:focus-visible {
  background: #fff7ed;
  border-color: rgba(242, 100, 34, 0.35);
  transform: translateY(-3px);
  box-shadow: 0 14px 28px -12px rgba(15, 39, 68, 0.22), 0 0 0 1px rgba(242, 100, 34, 0.12);
  outline: none;
}

.ck-result-item__media {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(145deg, #e2e8f0, #f8fafc);
  box-shadow: inset 0 0 0 1px rgba(15, 39, 68, 0.06);
}

.ck-result-item__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.ck-result-item:hover .ck-result-item__media img {
  transform: scale(1.08);
}

.ck-result-item__icon {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.88);
  color: #ff7836;
  font-size: 0.62rem;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.25);
}

.ck-result-item__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ck-result-item__chip,
.ck-result-item__chip-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.ck-result-item__chip-inline i {
  font-size: 0.62rem;
}

.ck-result-item__title {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ck-search-ink);
  line-height: 1.3;
}

.ck-result-item__title .ck-hit-mark,
.ck-hit-mark {
  color: var(--ck-search-accent);
  font-weight: 800;
}

.ck-result-item__sub {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--ck-search-muted);
  font-weight: 500;
  line-height: 1.35;
}

.ck-result-item__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  padding-left: 4px;
}

.ck-result-item__meta {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ck-search-accent);
  white-space: nowrap;
  text-align: right;
}

.ck-result-item__cta {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f26422, #ff7836);
  color: #fff;
  font-size: 0.72rem;
  transition: all 0.25s ease;
  box-shadow: 0 6px 14px rgba(242, 100, 34, 0.28);
}

.ck-result-item:hover .ck-result-item__cta {
  transform: translateX(3px);
}

.ck-search-empty strong {
  color: var(--ck-search-ink);
}

@media (max-width: 480px) {
  .ck-result-item {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 10px;
  }

  .ck-result-item__media {
    width: 56px;
    height: 56px;
    border-radius: 12px;
  }

  .ck-result-item__aside {
    grid-column: 2;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding-left: 0;
  }
}

/* Toggle lupa (solo mobile) */
.ck-search-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
  transition: all 0.25s ease;
  flex-shrink: 0;
  box-sizing: border-box;
}

.ck-search-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
}

.ck-search-toggle:hover,
.ck-search-toggle:focus-visible,
.ck-search-toggle[aria-expanded="true"] {
  background: rgba(242, 100, 34, 0.22);
  border-color: rgba(242, 100, 34, 0.65);
  color: #ff7836;
  outline: none;
  transform: translateY(-1px);
}

/* Desktop: el cluster no genera caja (hijos siguen en el grid del header) */
.ck-header-mobile-actions {
  display: contents;
}

/* === Sticky header + blur al scroll === */
.c-header-collective.has-ck-header-search,
.c-header-collective:has(.ck-search-container) {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #000000;
  border-bottom: 1px solid transparent;
  transition: background 0.25s ease, backdrop-filter 0.25s ease, -webkit-backdrop-filter 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.c-header-collective.has-ck-header-search .c-header-collective__bar,
.c-header-collective:has(.ck-search-container) .c-header-collective__bar {
  background: transparent;
}

.c-header-collective.has-ck-header-search.is-ck-scrolled,
.c-header-collective:has(.ck-search-container).is-ck-scrolled {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: rgba(64, 64, 64, 0.6);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

/* === Desktop ≥768: logo | búsqueda | menú (una fila) === */
.c-header-collective__bar-inner.has-ck-header-search,
.c-header-collective__bar-inner:has(.ck-search-container) {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  overflow: visible;
}

.c-header-collective__bar-inner.has-ck-header-search .c-collective-brand--bar,
.c-header-collective__bar-inner:has(.ck-search-container) .c-collective-brand--bar {
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
  max-width: min(168px, 28vw);
  min-width: 0;
  overflow: hidden;
  align-self: center;
}

.c-header-collective__bar-inner.has-ck-header-search .c-collective-brand--bar > a,
.c-header-collective__bar-inner:has(.ck-search-container) .c-collective-brand--bar > a {
  display: block;
  max-width: 100%;
  line-height: 0;
}

.c-header-collective__bar-inner.has-ck-header-search .c-collective-brand__img--bar,
.c-header-collective__bar-inner:has(.ck-search-container) .c-collective-brand__img--bar {
  display: block;
  max-height: 40px;
  max-width: 100% !important;
  width: auto !important;
  height: auto;
  object-fit: contain;
  object-position: left center;
}

.c-header-collective__bar-inner.has-ck-header-search .c-collective-brand__legal,
.c-header-collective__bar-inner:has(.ck-search-container) .c-collective-brand__legal {
  display: none !important;
}

.c-header-collective__bar-inner.has-ck-header-search .ck-search-container,
.c-header-collective__bar-inner:has(.ck-search-container) .ck-search-container {
  flex: 1 1 auto;
  margin: 0 auto !important;
  min-width: 0;
  max-width: 340px;
  width: 100%;
  z-index: 2;
}

.c-header-collective__bar-inner.has-ck-header-search > #btn-open-menu,
.c-header-collective__bar-inner.has-ck-header-search > #btn-open-compact-tools,
.c-header-collective__bar-inner.has-ck-header-search > .c-button--menu--bar,
.c-header-collective__bar-inner:has(.ck-search-container) > #btn-open-menu,
.c-header-collective__bar-inner:has(.ck-search-container) > #btn-open-compact-tools,
.c-header-collective__bar-inner:has(.ck-search-container) > .c-button--menu--bar {
  margin-left: 0 !important;
  flex: 0 0 auto;
  align-self: center;
  z-index: 3;
}

.c-header-collective__bar-inner.has-ck-header-search > .c-header-collective__bar-tools,
.c-header-collective__bar-inner.has-ck-header-search > .c-user-menu--bar,
.c-header-collective__bar-inner:has(.ck-search-container) > .c-header-collective__bar-tools,
.c-header-collective__bar-inner:has(.ck-search-container) > .c-user-menu--bar {
  flex: 0 0 auto;
  margin-left: 0 !important;
  align-self: center;
}

.c-header-collective:not(.c-header-collective--compact) .c-header-collective__bar-inner.has-ck-header-search > .c-header-collective__bar-tools,
.c-header-collective:not(.c-header-collective--compact) .c-header-collective__bar-inner:has(.ck-search-container) > .c-header-collective__bar-tools {
  width: 0 !important;
  height: 0 !important;
  overflow: visible;
  pointer-events: none;
}

.c-header-collective__bar .ck-search-container {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.c-header-collective:has(.ck-search-dropdown.is-open),
.c-header-collective__bar:has(.ck-search-dropdown.is-open),
.c-header-collective__bar-inner:has(.ck-search-dropdown.is-open),
.c-header-collective__bar > .o-container:has(.ck-search-dropdown.is-open) {
  overflow: visible !important;
}

/* === Mobile / tablet chica < 768px === */
@media (max-width: 767.98px) {
  .c-header-collective.has-ck-header-search .c-header-collective__bar > .o-container,
  .c-header-collective:has(.ck-search-container) .c-header-collective__bar > .o-container {
    padding-top: 8px;
    padding-bottom: 10px;
  }

  .c-header-collective__bar-inner.has-ck-header-search,
  .c-header-collective__bar-inner:has(.ck-search-container) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "ck-brand ck-actions"
      "ck-search ck-search";
    align-items: center;
    justify-content: stretch;
    column-gap: 12px;
    row-gap: 10px;
    min-height: 0;
    width: 100%;
  }

  .c-header-collective__bar-inner.has-ck-header-search .c-collective-brand--bar,
  .c-header-collective__bar-inner:has(.ck-search-container) .c-collective-brand--bar {
    grid-area: ck-brand;
    max-width: min(148px, 46vw);
    justify-self: start;
    z-index: 4;
    overflow: visible;
  }

  .c-header-collective__bar-inner.has-ck-header-search .c-collective-brand__img--bar,
  .c-header-collective__bar-inner:has(.ck-search-container) .c-collective-brand__img--bar {
    max-height: 34px;
    max-width: 100% !important;
  }

  .ck-header-mobile-actions {
    display: flex !important;
    grid-area: ck-actions;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    justify-self: end;
    z-index: 4;
    position: relative;
  }

  .ck-search-toggle {
    display: inline-flex !important;
  }

  .ck-header-mobile-actions > #btn-open-menu,
  .ck-header-mobile-actions > #btn-open-compact-tools,
  .ck-header-mobile-actions > .c-button--menu--bar {
    flex: 0 0 auto;
    margin: 0 !important;
    min-width: 40px;
    min-height: 40px;
  }

  .c-header-collective__bar-inner.has-ck-header-search .ck-search-container,
  .c-header-collective__bar-inner:has(.ck-search-container) .ck-search-container {
    grid-area: ck-search;
    width: 100%;
    max-width: none;
    margin: 0 !important;
    padding: 0;
    flex: none;
    z-index: 3;
  }

  .ck-search-container {
    width: 100%;
    max-width: none;
    margin: 0 !important;
  }

  .ck-search-bar {
    width: 100%;
    min-height: 44px;
    height: 44px;
    padding: 4px 6px 4px 14px;
    box-sizing: border-box;
  }

  .ck-search-icon {
    width: 16px;
    height: 16px;
    margin-right: 10px;
  }

  .ck-search-input {
    font-size: 0.875rem;
  }

  .ck-search-input::placeholder {
    font-size: 0.8125rem;
  }

  .ck-search-btn {
    min-height: 34px;
    height: 34px;
    padding: 6px 12px;
  }

  .ck-search-btn span {
    display: none;
  }

  .ck-destinations-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ck-search-dropdown {
    left: 0;
    right: 0;
    width: auto;
    max-width: none;
    transform: translateY(8px);
    padding: 16px 14px;
    border-radius: 16px;
  }

  .ck-search-dropdown.is-open {
    transform: translateY(0);
  }

  /* No forzar cápsula en la fila del logo */
  .c-header-collective__bar-inner.has-ck-header-search > #btn-open-menu,
  .c-header-collective__bar-inner.has-ck-header-search > #btn-open-compact-tools,
  .c-header-collective__bar-inner.has-ck-header-search > .c-button--menu--bar,
  .c-header-collective__bar-inner:has(.ck-search-container) > #btn-open-menu,
  .c-header-collective__bar-inner:has(.ck-search-container) > #btn-open-compact-tools,
  .c-header-collective__bar-inner:has(.ck-search-container) > .c-button--menu--bar {
    grid-area: unset;
  }
}

@media (max-width: 480px) {
  .c-header-collective__bar-inner.has-ck-header-search .c-collective-brand--bar,
  .c-header-collective__bar-inner:has(.ck-search-container) .c-collective-brand--bar {
    max-width: min(132px, 48vw);
  }

  .c-header-collective__bar-inner.has-ck-header-search .c-collective-brand__img--bar,
  .c-header-collective__bar-inner:has(.ck-search-container) .c-collective-brand__img--bar {
    max-height: 32px;
  }

  .ck-header-mobile-actions {
    gap: 10px;
  }
}
