/*
 * EPHARO AI 2060
 * Product assistant orchestration layer.
 *
 * Táto vrstva:
 * - neprepisuje produktový strom,
 * - nemení hover logiku mega menu,
 * - dopĺňa formulárový stav,
 * - aktivuje akcie,
 * - pridáva návrat a históriu,
 * - pripravuje analytiku.
 */

:root {
  --eph-flow-green: #126c3d;
  --eph-flow-green-dark: #0c4f2d;
  --eph-flow-text: #173d29;
  --eph-flow-muted: #617568;
  --eph-flow-border: rgba(24, 103, 58, 0.16);
  --eph-flow-surface: rgba(255, 255, 255, 0.86);
}

.eph-flow-hidden {
  display: none !important;
}

.eph-flow-extra-field {
  display: none;
  width: 100%;
  margin-top: 9px;
}

.eph-flow-extra-field.is-visible {
  display: block;
}

.eph-flow-extra-field input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;

  border: 1px solid rgba(19, 103, 58, 0.23);
  border-radius: 14px;

  background: rgba(255, 255, 255, 0.92);
  color: var(--eph-flow-text);

  font: inherit;
  font-size: 14px;
  outline: none;
}

.eph-flow-extra-field input:focus {
  border-color: rgba(18, 108, 61, 0.65);
  box-shadow: 0 0 0 3px rgba(18, 108, 61, 0.10);
}

.eph-flow-field-error {
  display: none;
  margin-top: 5px;

  color: #a12d2d;
  font-size: 12px;
  font-weight: 650;
}

.eph-flow-field-error.is-visible {
  display: block;
}

.eph-flow-xenyra-orb {
  position: relative;

  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;

  width: 38px;
  height: 38px;

  overflow: hidden;

  border: 1px solid rgba(35, 128, 75, 0.18);
  border-radius: 999px;

  background:
    radial-gradient(
      circle at 34% 28%,
      #ffffff 0 15%,
      #e8f8ed 34%,
      #b9e2c8 67%,
      #82c79c 100%
    );

  box-shadow:
    0 7px 18px rgba(20, 87, 50, 0.20),
    inset 0 1px 1px rgba(255, 255, 255, 0.9);
}

.eph-flow-xenyra-orb img {
  width: 72%;
  height: 72%;
  object-fit: contain;
}

.eph-flow-xenyra-orb-fallback {
  display: grid;
  place-items: center;

  width: 72%;
  height: 72%;

  color: transparent;

  background:
    linear-gradient(
      135deg,
      #155cff 5%,
      #6548ff 48%,
      #00b8e8 96%
    );

  -webkit-background-clip: text;
  background-clip: text;

  font-size: 23px;
  font-weight: 950;
  line-height: 1;
}

.eph-flow-xenyra-orb-fallback::before {
  content: "X";
}

.eph-flow-xenyra-orb.is-spinning img,
.eph-flow-xenyra-orb.is-spinning .eph-flow-xenyra-orb-fallback {
  animation: eph-flow-spin 1.05s linear infinite;
}

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

.eph-flow-loading {
  position: fixed;
  z-index: 2147483000;
  inset: 0;

  display: none;
  align-items: center;
  justify-content: center;

  padding: 24px;

  background: rgba(37, 56, 46, 0.34);

  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}

.eph-flow-loading.is-visible {
  display: flex;
}

.eph-flow-loading-card {
  display: grid;
  justify-items: center;
  gap: 12px;

  min-width: 250px;
  max-width: 360px;

  padding: 26px 30px;

  border: 1px solid rgba(29, 110, 62, 0.16);
  border-radius: 26px;

  background: rgba(249, 253, 250, 0.92);

  box-shadow: 0 25px 70px rgba(15, 50, 29, 0.22);
}

.eph-flow-loading-card .eph-flow-xenyra-orb {
  width: 68px;
  height: 68px;
}

.eph-flow-loading-title {
  color: var(--eph-flow-text);

  font-size: 17px;
  font-weight: 850;
  text-align: center;
}

.eph-flow-loading-note {
  color: var(--eph-flow-muted);

  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
}

.eph-flow-related-clickable {
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.eph-flow-related-clickable:hover,
.eph-flow-related-clickable:focus-visible {
  transform: translateY(-2px);

  border-color: rgba(18, 108, 61, 0.38) !important;

  box-shadow:
    0 10px 24px rgba(16, 77, 42, 0.11);
}

.eph-flow-related-clickable::after {
  content: "Otvoriť →";

  display: block;
  margin-top: 9px;

  color: var(--eph-flow-green);

  font-size: 12px;
  font-weight: 800;
}

.eph-flow-back-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;

  margin: 12px 0 0;
}

.eph-flow-back-button {
  min-height: 38px;
  padding: 8px 14px;

  border: 1px solid rgba(17, 98, 54, 0.22);
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.78);
  color: var(--eph-flow-green-dark);

  font: inherit;
  font-size: 13px;
  font-weight: 750;

  cursor: pointer;
}

.eph-flow-back-button:hover {
  background: #ffffff;
}

.eph-flow-recent {
  position: fixed;
  z-index: 2147482000;
  right: 20px;
  bottom: 18px;
  left: 20px;

  display: none;

  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 12px;

  border: 1px solid rgba(17, 98, 54, 0.16);
  border-radius: 18px;

  background: rgba(250, 253, 251, 0.93);

  box-shadow: 0 14px 34px rgba(13, 53, 30, 0.14);

  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.eph-flow-recent.is-visible {
  display: flex;
  align-items: center;
  gap: 10px;
}

.eph-flow-recent-title {
  flex: 0 0 auto;

  color: #63766a;

  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eph-flow-recent-items {
  display: flex;
  align-items: center;
  gap: 7px;

  overflow-x: auto;
}

.eph-flow-recent-item {
  flex: 0 0 auto;

  min-height: 34px;
  padding: 7px 12px;

  border: 1px solid rgba(17, 98, 54, 0.15);
  border-radius: 999px;

  background: #ffffff;
  color: var(--eph-flow-text);

  font: inherit;
  font-size: 12px;
  font-weight: 700;

  cursor: pointer;
}

.eph-flow-recent-close {
  flex: 0 0 auto;

  width: 32px;
  height: 32px;

  border: 0;
  border-radius: 999px;

  background: transparent;
  color: var(--eph-flow-text);

  font-size: 18px;
  cursor: pointer;
}

.eph-flow-inline-xenyra {
  display: none;

  margin-top: 14px;
  padding: 13px;

  border: 1px solid var(--eph-flow-border);
  border-radius: 17px;

  background: rgba(255, 255, 255, 0.72);
}

.eph-flow-inline-xenyra.is-visible {
  display: block;
}

.eph-flow-inline-xenyra-header {
  display: flex;
  align-items: center;
  gap: 9px;

  margin-bottom: 10px;

  color: var(--eph-flow-text);
  font-size: 13px;
  font-weight: 800;
}

.eph-flow-inline-xenyra-header .eph-flow-xenyra-orb {
  width: 30px;
  height: 30px;
}

.eph-flow-inline-xenyra-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.eph-flow-inline-xenyra-row textarea {
  flex: 1 1 auto;
  min-height: 58px;
  padding: 10px 12px;

  border: 1px solid rgba(17, 98, 54, 0.18);
  border-radius: 13px;

  background: #fff;
  color: var(--eph-flow-text);

  font: inherit;
  font-size: 13px;
  resize: vertical;
}

.eph-flow-inline-xenyra-send {
  flex: 0 0 auto;

  min-width: 88px;

  border: 0;
  border-radius: 13px;

  background: var(--eph-flow-green);
  color: #fff;

  font: inherit;
  font-size: 13px;
  font-weight: 800;

  cursor: pointer;
}

@media (max-width: 720px) {
  .eph-flow-inline-xenyra-row {
    flex-direction: column;
  }

  .eph-flow-recent {
    right: 8px;
    bottom: 8px;
    left: 8px;
  }

  .eph-flow-recent-title {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .eph-flow-xenyra-orb img,
  .eph-flow-xenyra-orb-fallback {
    animation: none !important;
  }
}
