/**
 * DD WooCommerce Choice Help - Tab-style wizard
 */

.ddwch-choice-help {
  --ddwch-dark: var(--darkblue-500, #1a3a4a);
  --ddwch-light: #e8f4f8;
  --ddwch-radius: 0.5rem;
  font-size: 1.6rem;
  width: 100%;
  margin: 0 auto;
}

/* Tab navigation */
.ddwch-choice-help__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.ddwch-choice-help__tab strong {
  color: var(--turquoise-500);
}

.ddwch-choice-help__tab {
  padding: 1.4rem 2rem;
  font-size: 1.6rem;
  font-weight: 500;
  border: none;
  border-radius: 1rem 1rem 0 0;
  background: var(--ddwch-dark);
  color: rgba(255, 255, 255, 0.50);
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, opacity 0.3s ease;
}

.ddwch-choice-help__tab.is-active,
.ddwch-choice-help__tab.is-completed {
  background: white;
  color: var(--darkblue-500);
}

.ddwch-choice-help__tab[data-step]:hover:not(:disabled) {
  opacity: 0.9;
}

.ddwch-choice-help__tab[data-step]:disabled {
  cursor: not-allowed;
}

.ddwch-choice-help__tab--results {
  background: var(--ddwch-dark);
  color: rgba(255, 255, 255, 0.50);
  cursor: not-allowed;
}

.ddwch-choice-help__tab--results.is-active {
  background: var(--ddwch-light);
  color: var(--darkblue-500);
}

/* Panels - stacked for slide animation (right to left) */
.ddwch-choice-help__panels {
  display: grid;
  min-height: 12rem;
  overflow: hidden;
  border-radius: 0 2rem 2rem 2rem;
  background: white;
  padding: 4rem;
}

.ddwch-choice-help__panel {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateX(100%);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

.ddwch-choice-help__panel.is-active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

/* Exiting: slide out to left */
.ddwch-choice-help__panel.is-exiting {
  transform: translateX(-100%);
}

/* Entering: start from right, then animate to center */
.ddwch-choice-help__panel.is-entering {
  opacity: 1;
  transform: translateX(100%);
  z-index: 1;
}

.ddwch-choice-help__panel.is-entering.is-active {
  transform: translateX(0);
}

/* Going back: exiting slides right, entering comes from left */
.ddwch-choice-help--going-back .ddwch-choice-help__panel.is-exiting {
  transform: translateX(100%) !important;
}

.ddwch-choice-help--going-back .ddwch-choice-help__panel.is-entering {
  transform: translateX(-100%) !important;
}

.ddwch-choice-help--going-back .ddwch-choice-help__panel.is-entering.is-active {
  transform: translateX(0) !important;
}

/* Snap to start position without transition, then animate */
.ddwch-choice-help__panel.is-entering.is-positioning {
  transition: none !important;
}

.ddwch-choice-help__question-text {
  font-weight: 700;
  color: var(--ddwch-dark);
  margin: 0 0 2rem;
  line-height: 1.3;
}

.ddwch-choice-help__hint {
  font-size: 1.6rem;
  color: #666;
  margin: 0 0 1rem;
}

/* Answer grid */
.ddwch-choice-help__answers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .ddwch-choice-help__answers {
    gap: 1.25rem;
  }
}

.ddwch-choice-help__answer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1rem 0;
  margin-bottom: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  height: 10rem;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.05);
  box-sizing: content-box;
}

.ddwch-choice-help__answer:hover {
  border-color: var(--turquoise-500);
}

.ddwch-choice-help__answer.is-selected {
  border-color: var(--turquoise-500);
  box-shadow: 0 0 0 1px var(--turquoise-500);
}

.ddwch-choice-help__answer::before {
  content: '';
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 5px;
  border: 1px solid #969696;
  background: #fff;
  position: absolute;
  left: 1rem;
  top: 1rem;
}
.ddwch-choice-help__answer.is-selected::before {
  content: '';
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  content: '✓';
  text-align: center;
  position: absolute;
  left: 1rem;
  top: 1rem;
}

.ddwch-choice-help__answer input {
  flex-shrink: 0;
  margin-top: 0.2rem;
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--darkblue-500);
}

.ddwch-choice-help__answer-label {
  flex: 1;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--ddwch-dark);
  display: flex;
  align-items: center;
}

.ddwch-choice-help__answer-label::before, .ddwch-choice-help__answer-label::after {
  display: none !important;
}

/* Image type */
.ddwch-choice-help__answers--image .ddwch-choice-help__answer {
  flex-direction: column;
}

.ddwch-choice-help__answer-image {
  margin: 0;
  width: 6rem;
  height: 6rem;
  filter: brightness(1) invert(1);
}

.ddwch-choice-help__answer-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ddwch-choice-help__answers--pill .ddwch-choice-help__answer{
  padding-right: 2rem !important;
}

/* Actions (Next + Skip) */
.ddwch-choice-help__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.ddwch-choice-help__next-btn {
  min-width: 10rem;
}

.ddwch-choice-help__next-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Skip link */
.ddwch-choice-help__skip {
  margin: 0;
  text-align: center;
}

.ddwch-choice-help__skip-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 1.6rem;
  color: var(--darkblue-500);
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.3s ease;
}

.ddwch-choice-help__skip-btn:hover {
  color: var(--turquoise-500);
}



@media screen and (max-width: 640px) {
  .ddwch-choice-help__tab {
    display: none;
  }
  .ddwch-choice-help__tab.is-active{
    display: block;
  }
  .ddwch-choice-help__answers{
    grid-template-columns: 1fr !important;
  }
  .ddwch-choice-help__answer{
    flex-direction: row !important;
    gap: 1.4rem;
    height: auto !important;
    padding: 1rem !important;
  }
  .ddwch-choice-help__answer-image{
    width: 4rem;
    height: 4rem;
  }
  .ddwch-choice-help__answer::before{
    display: block !important;
    position: relative !important;
    top: 0 !important;
    margin-right: 1.5rem !important;
  }
}