/**
 * PATH: /wp-content/plugins/tornado-core/assets/css/configurator.css
 *
 * Purpose:
 *   - Style the public Tornado Configurator V3 page.
 *   - Define configurator layout, cards, form fields, options grid, parts grid, summary panel, feedback states and responsive behavior.
 *   - Keep the public configurator visually aligned with Tornado premium public pages.
 *
 * Layer:
 *   - front-assets
 *
 * Depends:
 *   - Public configurator markup rendered by /wp-content/plugins/tornado-core/inc/pages/shortcode-configurator.php
 *
 * Version:
 *   1.4.2
 *
 * Change:
 *   - Enforce hidden attribute handling for submitted feedback and summary actions so the success panel only appears after a real submit.
 *   - Preserve submitted-state styling, summary swatch styling and reset CTA presentation for the updated configurator UX.
 */

.tnd-configurator-page {
  width: 100%;
  max-width: 1100px;
  margin: 40px auto 80px;
  padding: 0 16px;
  box-sizing: border-box;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #111827;
}

.tnd-configurator-page,
.tnd-configurator-page * {
  box-sizing: border-box;
}

.tnd-configurator-page__hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
  padding: 40px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: linear-gradient(135deg, #0b0f14 0%, #121a24 100%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  color: #ffffff;
}

.tnd-configurator-page__hero::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 122, 26, 0.15) 0%, rgba(255, 122, 26, 0.00) 40%);
  pointer-events: none;
}

.tnd-configurator-page__hero-inner {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.tnd-configurator-page__eyebrow {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
}

.tnd-configurator-page__title {
  margin: 14px 0 14px;
  font-size: 40px;
  line-height: 1.1;
  font-weight: 800;
  color: #ff7a1a;
}

.tnd-configurator-page__intro {
  max-width: 760px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
}

.tnd-configurator-page__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
  gap: 24px;
  align-items: start;
}

.tnd-configurator-page__main,
.tnd-configurator-page__side {
  display: grid;
  gap: 18px;
}

.tnd-configurator-card {
  padding: 22px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.tnd-configurator-card--sticky {
  position: sticky;
  top: 24px;
}

.tnd-configurator-card__label {
  display: inline-block;
  margin-bottom: 10px;
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f3f4f6;
  font-size: 12px;
  font-weight: 700;
  color: #374151;
}

.tnd-configurator-card__title {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.2;
  color: #111827;
}

.tnd-configurator-card__text {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.65;
  color: #4b5563;
}

.tnd-configurator-fields {
  display: grid;
  gap: 16px;
}

.tnd-configurator-fields--two {
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.tnd-configurator-field {
  display: grid;
  gap: 8px;
}

.tnd-configurator-field label {
  font-size: 13px;
  font-weight: 700;
  color: #1f2937;
}

.tnd-configurator-field input,
.tnd-configurator-field select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #ffffff;
  color: #111827;
  font-size: 15px;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, background-color .2s ease;
}

.tnd-configurator-field input:hover,
.tnd-configurator-field select:hover {
  border-color: #9ca3af;
}

.tnd-configurator-field input:focus,
.tnd-configurator-field select:focus {
  outline: none;
  border-color: #3399ff;
  box-shadow: 0 0 0 4px rgba(51, 153, 255, 0.12);
  transform: translateY(-1px);
}

.tnd-configurator-field input:disabled,
.tnd-configurator-field select:disabled {
  background: #f9fafb;
  color: #9ca3af;
  cursor: not-allowed;
}

.tnd-configurator-field__error {
  min-height: 18px;
  font-size: 12px;
  color: #b91c1c;
}

/* ============================================================
 * Options
 * ============================================================ */

.tnd-configurator-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.tnd-configurator-options:empty {
  display: none;
}

.tnd-configurator-options-empty {
  padding: 16px 18px;
  border: 1px dashed #d1d5db;
  border-radius: 14px;
  background: #f9fafb;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.6;
}

.tnd-option-card {
  display: block;
  cursor: pointer;
}

.tnd-option-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tnd-option-card__body {
  display: grid;
  grid-template-columns: 20px minmax(0, 120px) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 16px 18px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfc 100%);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, background-color .2s ease;
  position: relative;
}

.tnd-option-card__body::before {
  content: "";
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1.5px solid #c7ced8;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: inset 0 0 0 2px #ffffff;
  transition: all .2s ease;
}

.tnd-option-card__body:hover {
  border-color: #cbd5e1;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.tnd-option-card input:checked + .tnd-option-card__body {
  border-color: rgba(255, 122, 26, 0.55);
  background: linear-gradient(180deg, rgba(255, 122, 26, 0.08) 0%, rgba(255, 122, 26, 0.03) 100%);
  box-shadow: 0 10px 24px rgba(255, 122, 26, 0.12);
}

.tnd-option-card input:checked + .tnd-option-card__body::before {
  border-color: #ff7a1a;
  background: #ff7a1a;
  box-shadow: inset 0 0 0 3px #ffffff;
}

.tnd-option-card__media {
  width: 120px;
  max-width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 12px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
}

.tnd-option-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tnd-option-card__media--empty {
  background:
    linear-gradient(135deg, rgba(255, 122, 26, 0.10) 0%, rgba(255, 122, 26, 0.03) 100%),
    #f3f4f6;
}

.tnd-option-card__main {
  min-width: 0;
}

.tnd-option-card__title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  color: #111827;
}

.tnd-option-card__meta {
  display: inline-block;
  margin-bottom: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  font-size: 11px;
  font-weight: 700;
  color: #4b5563;
}

.tnd-option-card__desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #6b7280;
}

.tnd-option-card__price {
  align-self: center;
  justify-self: end;
  font-size: 14px;
  font-weight: 800;
  color: #111827;
  white-space: nowrap;
}

/* ============================================================
 * Parts
 * ============================================================ */

.tnd-configurator-parts {
  display: grid;
  gap: 18px;
}

.tnd-configurator-parts:empty {
  display: none;
}

.tnd-configurator-parts-empty {
  padding: 16px 18px;
  border: 1px dashed #d1d5db;
  border-radius: 14px;
  background: #f9fafb;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.6;
}

.tnd-part-group {
  display: grid;
  gap: 12px;
}

.tnd-part-group__title {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  background: #111827;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.tnd-part-group__items {
  display: grid;
  gap: 12px;
}

.tnd-part-card {
  display: block;
  cursor: pointer;
}

.tnd-part-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tnd-part-card__body {
  display: grid;
  grid-template-columns: 20px minmax(0, 120px) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 16px 18px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfc 100%);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, background-color .2s ease;
  position: relative;
}

.tnd-part-card__body::before {
  content: "";
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1.5px solid #c7ced8;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: inset 0 0 0 2px #ffffff;
  transition: all .2s ease;
}

.tnd-part-card__body:hover {
  border-color: #cbd5e1;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.tnd-part-card input:checked + .tnd-part-card__body {
  border-color: rgba(255, 122, 26, 0.55);
  background: linear-gradient(180deg, rgba(255, 122, 26, 0.08) 0%, rgba(255, 122, 26, 0.03) 100%);
  box-shadow: 0 10px 24px rgba(255, 122, 26, 0.12);
}

.tnd-part-card input:checked + .tnd-part-card__body::before {
  border-color: #ff7a1a;
  background: #ff7a1a;
  box-shadow: inset 0 0 0 3px #ffffff;
}

.tnd-part-card__media {
  width: 120px;
  max-width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 12px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
}

.tnd-part-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tnd-part-card__main {
  min-width: 0;
}

.tnd-part-card__title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  color: #111827;
}

.tnd-part-card__meta {
  display: inline-block;
  margin-bottom: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  font-size: 11px;
  font-weight: 700;
  color: #4b5563;
}

.tnd-part-card__desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #6b7280;
}

.tnd-part-card__price {
  align-self: center;
  justify-self: end;
  font-size: 14px;
  font-weight: 800;
  color: #111827;
  white-space: nowrap;
}

/* ============================================================
 * Submit / feedback
 * ============================================================ */

.tnd-configurator-submit {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.tnd-configurator-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 13px 28px;
  border: 0;
  border-radius: 999px;
  background: #ff7a1a;
  color: #000000;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: transform .2s ease, background-color .2s ease, opacity .2s ease, box-shadow .2s ease;
}

.tnd-configurator-button:hover,
.tnd-configurator-button:focus {
  outline: none;
  background: #ff8c3a;
  box-shadow: 0 10px 24px rgba(255, 122, 26, 0.22);
  transform: translateY(-2px);
}

.tnd-configurator-button:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.tnd-configurator-button--secondary {
  width: 100%;
  background: #111827;
  color: #ffffff;
}

.tnd-configurator-button--secondary:hover,
.tnd-configurator-button--secondary:focus {
  background: #1f2937;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.22);
}

.tnd-configurator-feedback {
  min-height: 22px;
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.5;
}

.tnd-configurator-feedback.is-error {
  color: #b91c1c;
}

.tnd-configurator-feedback.is-success {
  color: #166534;
}

.tnd-configurator-feedback--submitted {
  display: grid;
  gap: 8px;
  min-height: 0;
  margin-top: 18px;
  padding: 18px 18px 16px;
  border: 1px solid rgba(22, 101, 52, 0.16);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(22, 163, 74, 0.10) 0%, rgba(22, 163, 74, 0.04) 100%);
  color: #166534;
}

.tnd-configurator-feedback[hidden],
.tnd-configurator-summary-actions[hidden] {
  display: none !important;
}

.tnd-configurator-feedback__eyebrow {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(22, 101, 52, 0.10);
  border: 1px solid rgba(22, 101, 52, 0.14);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.tnd-configurator-feedback__title {
  font-size: 20px;
  line-height: 1.2;
  font-weight: 800;
  color: #14532d;
}

.tnd-configurator-feedback__text {
  font-size: 14px;
  line-height: 1.65;
  color: #166534;
}

.tnd-configurator-summary-actions {
  margin-top: 16px;
}

/* ============================================================
 * Summary
 * ============================================================ */

.tnd-configurator-summary {
  display: grid;
  gap: 12px;
}

.tnd-configurator-summary__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
  position: relative;
}

.tnd-configurator-summary__row span {
  color: #6b7280;
}

.tnd-configurator-summary__row strong {
  color: #111827;
  text-align: right;
}

.tnd-configurator-summary__row--total {
  margin-top: 4px;
  padding-top: 4px;
}

.tnd-configurator-summary__row--total strong {
  font-size: 16px;
}

.tnd-configurator-summary__value {
  min-width: 0;
}

.tnd-summary-color {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.tnd-summary-color__label {
  color: #111827 !important;
  text-align: right;
  line-height: 1.3;
}

.tnd-summary-swatch {
  display: inline-block;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
  vertical-align: middle;
}

.tnd-summary-swatch--img {
  overflow: hidden;
}

.tnd-summary-swatch--img img {
  display: block;
  width: 18px;
  height: 18px;
  object-fit: cover;
  border-radius: 999px;
}

#tnd-summary-price,
#tnd-summary-options-total,
#tnd-summary-parts-total,
#tnd-summary-grand-total {
  display: inline-block;
  filter: blur(6px);
  -webkit-filter: blur(6px);
  user-select: none;
  pointer-events: none;
}

/* ============================================================
 * Submitted state
 * ============================================================ */

.tnd-configurator-page.is-submitted .tnd-configurator-page__grid {
  grid-template-columns: minmax(0, 1fr);
}

.tnd-configurator-page.is-submitted .tnd-configurator-page__main {
  display: none;
}

.tnd-configurator-page.is-submitted .tnd-configurator-page__side {
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
}

.tnd-configurator-page.is-submitted .tnd-configurator-card--sticky {
  position: static;
  top: auto;
}

.tnd-configurator-page.is-submitted .tnd-configurator-summary {
  margin-bottom: 4px;
}

/* ============================================================
 * Responsive
 * ============================================================ */

@media (max-width: 900px) {
  .tnd-configurator-page__grid {
    grid-template-columns: 1fr;
  }

  .tnd-configurator-card--sticky {
    position: static;
    top: auto;
  }

  .tnd-configurator-page.is-submitted .tnd-configurator-page__side {
    max-width: none;
    margin: 0;
  }
}

@media (max-width: 768px) {
  .tnd-configurator-page {
    margin: 28px auto 56px;
  }

  .tnd-configurator-page__hero {
    padding: 28px 18px;
    border-radius: 16px;
  }

  .tnd-configurator-page__title {
    font-size: 32px;
  }

  .tnd-configurator-fields--two {
    grid-template-columns: 1fr;
  }

  .tnd-option-card__body {
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .tnd-option-card__media {
    grid-column: 2;
    width: 100%;
    max-width: 220px;
  }

  .tnd-option-card__price {
    grid-column: 2;
    justify-self: start;
    margin-top: 4px;
  }

  .tnd-part-card__body {
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .tnd-part-card__media {
    grid-column: 2;
    width: 100%;
    max-width: 220px;
  }

  .tnd-part-card__price {
    grid-column: 2;
    justify-self: start;
    margin-top: 4px;
  }

  .tnd-configurator-button {
    width: 100%;
  }

  .tnd-configurator-submit {
    justify-content: stretch;
  }

  .tnd-configurator-summary__row {
    align-items: flex-start;
    flex-direction: column;
  }

  .tnd-configurator-summary__row strong {
    text-align: left;
  }

  .tnd-summary-color {
    justify-content: flex-start;
  }

  .tnd-summary-color__label {
    text-align: left;
  }

  .tnd-configurator-feedback__title {
    font-size: 18px;
  }
}