/**
 * Product test layout — full-width row: type tester | sticky info panel.
 */

.jt-product-test-layout {
  margin: 32px 0 56px;
}

.jt-product-test-layout__shell {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 0 var(--jt-product-shell-x, 30px);
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 440px);
  gap: 24px;
  align-items: start;
}

.jt-product-test-layout--solo .jt-product-test-layout__shell {
  grid-template-columns: 1fr;
}

.jt-product-test-layout__content {
  grid-column: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.jt-product-test-layout__row {
  display: contents;
}

.jt-product-test-layout .jt-product-type-tester {
  min-width: 0;
  margin: 0;
}

.jt-product-test-layout .jt-product-type-tester__controls {
  margin-bottom: 20px;
}

.jt-product-test-layout .jt-product-type-tester__stage-wrap {
  margin-top: 0;
}

.jt-product-info-panel {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  position: sticky;
  top: var(--jt-sticky-top, calc(var(--jt-header-h, 72px) + 16px));
  align-self: start;
  z-index: 5;
  max-height: calc(100vh - var(--jt-sticky-top, calc(var(--jt-header-h, 72px) + 16px)) - 24px);
}

.jt-product-info-panel__frame {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: calc(100vh - var(--jt-sticky-top, calc(var(--jt-header-h, 72px) + 16px)) - 24px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 24px 22px;
  border: 1px solid var(--jt-border);
  border-radius: var(--jt-radius);
  background: var(--jt-surface);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.jt-product-info-panel__name {
  margin: 0;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.jt-product-info-panel__category {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--jt-muted, rgba(255, 255, 255, 0.55));
}

.jt-product-info-panel__license-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.jt-product-info-panel__license-heading {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.jt-product-info-panel__license-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.jt-license-card {
  border: 1px solid var(--jt-border);
  border-radius: 10px;
  background: var(--jt-surface-2, #1a1a1a);
  overflow: hidden;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) {
  .jt-license-card:not(.is-selected):not(.is-expanded):hover {
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
  }

  .jt-license-card.is-selected:not(.is-expanded):hover,
  .jt-license-card.is-expanded:hover {
    border-color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.05);
  }

  .jt-license-card__head:hover {
    background: rgba(255, 255, 255, 0.04);
  }

  .jt-license-card:not(.is-selected) .jt-license-card__head:hover .jt-license-card__radio {
    border-color: rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.06);
  }

  .jt-license-card__head:hover .jt-license-card__name,
  .jt-license-card__head:hover .jt-license-card__price {
    color: #fff;
  }
}

.jt-license-card.is-selected {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.03);
}

.jt-license-card.is-expanded {
  border-color: rgba(255, 255, 255, 0.45);
}

.jt-license-card__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.jt-license-card__head:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: -2px;
}

.jt-license-card__radio {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  position: relative;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.jt-license-card.is-selected .jt-license-card__radio {
  border-color: #fff;
  background: #fff;
}

.jt-license-card.is-selected .jt-license-card__radio::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #0a0a0a;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.jt-license-card__meta {
  flex: 1;
  min-width: 0;
}

.jt-license-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.jt-license-card__name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  transition: color 0.15s ease;
}

.jt-license-card__price {
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: color 0.15s ease;
}

.jt-license-card__summary {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--jt-muted, rgba(255, 255, 255, 0.55));
}

.jt-license-card__body {
  padding: 0 16px 16px 48px;
}

.jt-license-card__body[hidden] {
  display: none;
}

.jt-license-card__section {
  margin-bottom: 16px;
}

.jt-license-card__section:last-child {
  margin-bottom: 0;
}

.jt-license-card__section-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
}

.jt-license-card__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.jt-license-card__list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--jt-muted, rgba(255, 255, 255, 0.55));
}

.jt-license-card__list li:last-child {
  margin-bottom: 0;
}

.jt-license-card__icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.jt-license-card__list--allowed .jt-license-card__icon {
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #fff;
}

.jt-license-card__list--denied .jt-license-card__icon {
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.45);
}

.jt-product-info-panel__qty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
}

.jt-product-info-panel__qty-label {
  font-size: 14px;
  font-weight: 500;
}

.jt-product-info-panel__qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--jt-border);
  border-radius: 999px;
  overflow: hidden;
}

.jt-product-info-panel__qty-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--jt-text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.jt-product-info-panel__qty-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.jt-product-info-panel__qty-value {
  min-width: 36px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.jt-product-info-panel__cart {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid #fff;
  border-radius: 8px;
  background: #fff;
  color: #0a0a0a;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.jt-product-info-panel__cart:hover,
.jt-product-info-panel__cart:focus-visible {
  background: #0a0a0a;
  color: #fff;
  outline: none;
}

.jt-product-info-panel__cart:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.jt-product-info-panel__cart:disabled:hover {
  background: #fff;
  color: #0a0a0a;
}

html.jt-light .jt-product-info-panel__cart,
body.jt-light .jt-product-info-panel__cart {
  border-color: #0a0a0a;
  background: #0a0a0a;
  color: #fff;
}

html.jt-light .jt-product-info-panel__cart:hover,
body.jt-light .jt-product-info-panel__cart:hover {
  background: #fff;
  color: #0a0a0a;
}

@media (max-width: 991px) {
  .jt-product-test-layout__shell {
    grid-template-columns: 1fr;
  }

  .jt-product-test-layout__content {
    grid-column: auto;
  }

  .jt-product-info-panel {
    grid-column: auto;
    grid-row: auto;
    position: static;
    max-height: none;
  }

  .jt-product-info-panel__frame {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 767px) {
  .jt-product-test-layout__shell,
  .jt-product-type-tester__shell {
    padding-left: var(--jt-product-shell-x, 20px);
    padding-right: var(--jt-product-shell-x, 20px);
  }

  .jt-license-card__body {
    padding-left: 16px;
  }
}
