/* Ynisek - Configurateur PC */

.ynpcb-intro {
  margin-bottom: 24px;
  color: var(--yn-muted, #6e6e73);
  font-size: 1.0625rem;
}

.ynpcb-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}

/* ---------- Étapes ---------- */

.ynpcb-step {
  margin-bottom: 12px;
  border-radius: var(--yn-radius, 12px);
  background: #fff;
  box-shadow: var(--yn-shadow, 0 2px 10px rgba(0, 0, 0, .06));
  overflow: hidden;
  scroll-margin-top: 16px;
}

.ynpcb-step-head {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 20px;
  border: 0;
  background: transparent;
  color: var(--yn-text, #1d1d1f);
  text-align: left;
  cursor: pointer;
}

.ynpcb-step-num {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--yn-primary, #3b1151);
  color: #fff;
  font-weight: 700;
  line-height: 30px;
  text-align: center;
}

.ynpcb-step-icon {
  color: var(--yn-primary-light, #4e1c70);
}

.ynpcb-step-title {
  flex: 1 1 auto;
  min-width: 0;
}

.ynpcb-step-title strong {
  font-size: 1.0625rem;
}

.ynpcb-req {
  margin-left: 8px;
  color: var(--yn-accent, #f08300);
  font-weight: 600;
}

.ynpcb-step-choice {
  display: block;
  overflow: hidden;
  color: var(--yn-success, #00a86b);
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ynpcb-step-done {
  display: none;
  color: var(--yn-success, #00a86b);
}

.ynpcb-step.is-done .ynpcb-step-done {
  display: inline-block;
}

.ynpcb-step.is-done .ynpcb-step-num {
  background: var(--yn-success, #00a86b);
}

.ynpcb-step-caret {
  color: var(--yn-muted, #6e6e73);
  transition: transform .2s;
}

.ynpcb-step.is-open .ynpcb-step-caret {
  transform: rotate(180deg);
}

.ynpcb-step-body {
  display: none;
  padding: 0 20px 20px;
}

.ynpcb-step.is-open .ynpcb-step-body {
  display: block;
}

.ynpcb-filter {
  max-width: 360px;
  margin-bottom: 16px;
  border-radius: 8px;
}

/* ---------- Produits ---------- */

.ynpcb-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.ynpcb-product {
  position: relative;
  margin: 0;
  cursor: pointer;
}

.ynpcb-product input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ynpcb-product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 12px;
  border: 2px solid var(--yn-border, #e5e5ea);
  border-radius: 10px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}

.ynpcb-product:hover .ynpcb-product-card {
  border-color: var(--yn-primary-light, #4e1c70);
}

.ynpcb-product input:checked + .ynpcb-product-card {
  border-color: var(--yn-accent, #f08300);
  box-shadow: 0 0 0 3px rgba(240, 131, 0, .18);
}

.ynpcb-product input:focus-visible + .ynpcb-product-card {
  outline: 2px solid var(--yn-primary, #3b1151);
  outline-offset: 2px;
}

.ynpcb-product.is-unavailable {
  cursor: not-allowed;
  opacity: .5;
}

.ynpcb-product-img img {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 8px;
  aspect-ratio: 1;
  object-fit: contain;
}

.ynpcb-product-name {
  color: var(--yn-text, #1d1d1f);
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.3;
}

.ynpcb-product-desc {
  margin-top: 4px;
  color: var(--yn-muted, #6e6e73);
  font-size: .8125rem;
  line-height: 1.35;
}

.ynpcb-product-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
}

.ynpcb-product-price {
  color: var(--yn-accent, #f08300);
  font-size: 1.125rem;
  font-weight: 700;
}

.ynpcb-stock {
  color: #c0392b;
  font-size: .75rem;
  font-weight: 600;
}

.ynpcb-stock.is-ok {
  color: var(--yn-success, #00a86b);
}

.ynpcb-product-link {
  margin-top: 6px;
  font-size: .8125rem;
}

.ynpcb-product--none .ynpcb-product-card {
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 120px;
  color: var(--yn-muted, #6e6e73);
  text-align: center;
}

.ynpcb-empty {
  color: var(--yn-muted, #6e6e73);
}

/* ---------- Récapitulatif ---------- */

.ynpcb-summary {
  position: sticky;
  top: 16px;
}

.ynpcb-summary-box {
  padding: 20px;
  border-radius: var(--yn-radius, 12px);
  background: #fff;
  box-shadow: var(--yn-shadow, 0 2px 10px rgba(0, 0, 0, .06));
}

.ynpcb-summary-title {
  margin: 0 0 14px;
  color: var(--yn-primary, #3b1151);
  font-size: 1.25rem;
  font-weight: 700;
}

.ynpcb-summary-list {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.ynpcb-summary-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--yn-border, #e5e5ea);
  font-size: .875rem;
}

.ynpcb-summary-label {
  display: block;
  color: var(--yn-muted, #6e6e73);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.ynpcb-summary-value {
  display: block;
  color: var(--yn-text, #1d1d1f);
  font-weight: 600;
}

.ynpcb-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 8px;
  font-size: 1.125rem;
}

.ynpcb-total strong {
  color: var(--yn-accent, #f08300);
  font-size: 1.75rem;
}

.ynpcb-missing {
  min-height: 1em;
  color: var(--yn-muted, #6e6e73);
  font-size: .8125rem;
}

.ynpcb-errors {
  color: #c0392b;
  font-size: .875rem;
}

.ynpcb-errors p {
  margin: 0 0 6px;
}

.ynpcb-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  font-size: 1rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 991px) {
  .ynpcb-layout {
    grid-template-columns: 1fr;
  }

  .ynpcb-summary {
    position: static;
  }
}

@media (max-width: 479px) {
  .ynpcb-products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .ynpcb-product-desc {
    display: none;
  }
}
