/* ============================================================
   EVENT PACKET BUILDER — Signal & Circuit quote builder
   Scoped under .pkt. Uses the experience theme variables.
   ============================================================ */

.pkt {
  --pkt-gap: clamp(16px, 2vw, 24px);
}

.pkt-intro {
  max-width: 720px;
  margin-bottom: clamp(28px, 5vh, 48px);
}
.pkt-intro__text {
  margin-top: 16px;
  color: var(--color-text-gray);
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  line-height: 1.6;
}

/* ---------------- Toolbar ---------------- */
.pkt-toolbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  padding: 16px 0;
  margin-bottom: 8px;
  background: linear-gradient(180deg, var(--exp-bg) 70%, transparent);
  backdrop-filter: blur(6px);
}
.pkt-search {
  position: relative;
  flex: 1 1 280px;
  min-width: 220px;
}
.pkt-search i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--exp-muted);
  font-size: 0.85rem;
}
.pkt-search input {
  width: 100%;
  padding: 13px 16px 13px 42px;
  background: var(--exp-surface);
  border: 1px solid var(--exp-line);
  border-radius: 999px;
  color: var(--exp-ink);
  font-family: var(--exp-font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.pkt-search input:focus {
  border-color: var(--exp-current);
}
.pkt-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pkt-pill {
  padding: 9px 16px;
  background: transparent;
  border: 1px solid var(--exp-line);
  border-radius: 999px;
  color: var(--color-text-gray);
  font-family: var(--exp-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.pkt-pill:hover {
  border-color: var(--exp-current-dim);
  color: var(--exp-ink);
}
.pkt-pill.is-active {
  background: var(--exp-current);
  border-color: var(--exp-current);
  color: #05231b;
  font-weight: 700;
}

/* ---------------- Layout ---------------- */
.pkt-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: clamp(24px, 3vw, 44px);
  align-items: start;
}

/* ---------------- Catalog ---------------- */
.pkt-cat {
  margin-bottom: clamp(28px, 4vh, 44px);
}
.pkt-cat__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--exp-line);
}
.pkt-cat__name {
  font-family: var(--exp-font-display);
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  font-weight: 700;
  color: var(--exp-ink);
  display: flex;
  align-items: center;
  gap: 12px;
}
.pkt-cat__name i {
  color: var(--exp-current);
  font-size: 0.85em;
}
.pkt-cat__count {
  font-family: var(--exp-font-mono);
  font-size: 0.72rem;
  color: var(--exp-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pkt-cat__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 10px;
}

/* Item row (selectable) */
.pkt-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--exp-surface);
  border: 1px solid var(--exp-line);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}
.pkt-item:hover {
  border-color: var(--exp-current-dim);
}
.pkt-item__check {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.pkt-item__box {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--exp-muted);
  border-radius: 6px;
  display: grid;
  place-items: center;
  transition: all 0.18s;
}
.pkt-item__box i {
  font-size: 0.7rem;
  color: #05231b;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.15s;
}
.pkt-item__name {
  flex: 1 1 auto;
  color: var(--exp-ink);
  font-size: 0.92rem;
  line-height: 1.35;
}
.pkt-item__tier {
  display: inline-block;
  margin-left: 6px;
  font-family: var(--exp-font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.03em;
  color: var(--exp-current-dim);
  white-space: nowrap;
  opacity: 0.8;
}
.pkt-item__qty {
  flex: 0 0 auto;
  display: none;
  align-items: center;
  gap: 2px;
  background: var(--exp-bg);
  border: 1px solid var(--exp-line);
  border-radius: 8px;
  padding: 2px;
}
.pkt-qty__btn {
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  color: var(--exp-ink);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
}
.pkt-qty__btn:hover {
  background: var(--exp-surface);
  color: var(--exp-current);
}
.pkt-qty__val {
  width: 40px;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--exp-ink);
  font-family: var(--exp-font-mono);
  font-size: 0.85rem;
  outline: none;
  -moz-appearance: textfield;
}
.pkt-qty__val::-webkit-outer-spin-button,
.pkt-qty__val::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Selected state */
.pkt-item.is-selected {
  border-color: var(--exp-current);
  background: rgba(0, 229, 160, 0.06);
}
.pkt-item.is-selected .pkt-item__box {
  background: var(--exp-current);
  border-color: var(--exp-current);
}
.pkt-item.is-selected .pkt-item__box i {
  opacity: 1;
  transform: scale(1);
}
.pkt-item.is-selected .pkt-item__qty {
  display: flex;
}

.pkt-empty {
  color: var(--exp-muted);
  font-family: var(--exp-font-mono);
  padding: 40px 0;
  text-align: center;
}

/* ---------------- Summary / form ---------------- */
.pkt-summary {
  position: sticky;
  top: 84px;
}
.pkt-summary__inner {
  background: var(--exp-surface);
  border: 1px solid var(--exp-line);
  border-radius: 16px;
  padding: 22px;
}
.pkt-summary__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--exp-line);
}
.pkt-summary__head h2 {
  font-family: var(--exp-font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--exp-ink);
}
.pkt-summary__badge {
  min-width: 28px;
  height: 28px;
  padding: 0 9px;
  display: grid;
  place-items: center;
  background: var(--exp-current);
  color: #05231b;
  border-radius: 999px;
  font-family: var(--exp-font-mono);
  font-weight: 700;
  font-size: 0.8rem;
}
.pkt-summary__list {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pkt-summary__hint {
  color: var(--exp-muted);
  font-size: 0.85rem;
  line-height: 1.5;
  padding: 8px 0;
}
.pkt-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}
.pkt-line__qty {
  flex: 0 0 auto;
  font-family: var(--exp-font-mono);
  color: var(--exp-current);
  font-weight: 700;
}
.pkt-line__name {
  flex: 1 1 auto;
  color: var(--color-text-gray);
  line-height: 1.3;
}
.pkt-line__rm {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: var(--exp-muted);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  transition: color 0.15s;
}
.pkt-line__rm:hover {
  color: #ff6b6b;
}

.pkt-form__row {
  margin-bottom: 10px;
}
.pkt-form__row--2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pkt-form input,
.pkt-form select {
  width: 100%;
  padding: 11px 14px;
  background: var(--exp-bg);
  border: 1px solid var(--exp-line);
  border-radius: 8px;
  color: var(--exp-ink);
  font-family: var(--exp-font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.18s;
}
.pkt-form input:focus,
.pkt-form select:focus {
  border-color: var(--exp-current);
}
.pkt-form input::placeholder {
  color: var(--exp-muted);
}
.pkt-submit {
  width: 100%;
  margin-top: 6px;
  padding: 14px;
  background: var(--exp-current);
  border: none;
  border-radius: 999px;
  color: #05231b;
  font-family: var(--exp-font-display);
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: opacity 0.18s, transform 0.12s;
}
.pkt-submit .exp-btn__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #05231b;
}
.pkt-submit:hover:not(:disabled) {
  transform: translateY(-1px);
}
.pkt-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pkt-form__fine {
  margin-top: 10px;
  text-align: center;
  color: var(--exp-muted);
  font-size: 0.72rem;
}

.pkt-alert {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 14px;
  line-height: 1.4;
}
.pkt-alert--ok {
  background: rgba(0, 229, 160, 0.12);
  border: 1px solid var(--exp-current);
  color: var(--exp-ink);
}
.pkt-alert--err {
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid #ff6b6b;
  color: #ffd2d2;
}

/* ---------------- Mobile FAB ---------------- */
.pkt-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: var(--exp-current);
  color: #05231b;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: grid;
  place-items: center;
}
.pkt-fab__count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  background: var(--exp-bg);
  color: var(--exp-current);
  border: 1.5px solid var(--exp-current);
  border-radius: 999px;
  font-family: var(--exp-font-mono);
  font-size: 0.7rem;
  font-weight: 700;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 980px) {
  .pkt-layout {
    grid-template-columns: 1fr;
  }
  .pkt-fab {
    display: grid;
  }
  .pkt-summary {
    position: fixed;
    inset: auto 0 0 0;
    top: auto;
    z-index: 55;
    max-height: 82vh;
    overflow-y: auto;
    transform: translateY(110%);
    transition: transform 0.3s ease;
    padding: 0 14px 14px;
  }
  .pkt-summary.is-open {
    transform: translateY(0);
  }
  .pkt-summary__inner {
    border-radius: 16px 16px 0 0;
    border-bottom: none;
  }
  .pkt-summary__inner::before {
    content: '';
    display: block;
    width: 44px;
    height: 4px;
    border-radius: 999px;
    background: var(--exp-muted);
    margin: 0 auto 14px;
  }
}

@media (max-width: 520px) {
  .pkt-cat__grid {
    grid-template-columns: 1fr;
  }
}
