/* Global Reset Scoped to Plugin */
.mspc,
.mspc *,
.mspc *:before,
.mspc *:after {
  box-sizing: border-box;
}

.mspc {
  --mspc-radius: 22px;
  --mspc-radius-sm: 14px;
  --mspc-border: rgba(0, 0, 0, .10);
  --mspc-muted: rgba(0, 0, 0, .65);
  --mspc-muted-2: rgba(0, 0, 0, .45);
  --mspc-bg: #fff;
  --mspc-bg-soft: rgba(0, 0, 0, .03);
  --mspc-text: #111;
  --mspc-accent: #3b82f6;
  --mspc-id-bg: #fff;
  --mspc-shadow: 0 18px 50px rgba(0, 0, 0, .08);
  --mspc-shadow-sm: 0 10px 30px rgba(0, 0, 0, .06);
  --mspc-max: 1080px;
  --mspc-font: 'Inter', system-ui, -apple-system, sans-serif;
}

.mspc {
  font-family: var(--mspc-font);
  max-width: var(--mspc-max);
  margin: 0 auto;
  color: var(--mspc-text);
}

/* Header / progress */
.mspc-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--mspc-bg);
  /* simplified from gradient to ensure bg color usage */
  backdrop-filter: blur(10px);
  padding: 14px 0 10px;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
}

.mspc-header__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.mspc-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mspc-badge {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--mspc-border);
  background: rgba(0, 0, 0, .02);
}

.mspc-title {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: .2px;
  color: var(--mspc-text);
}

.mspc-sub {
  font-size: 13px;
  color: var(--mspc-muted);
}

.mspc-progress {
  height: 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .06);
  overflow: hidden;
}

.mspc-progress__bar {
  height: 100%;
  width: 0%;
  background: var(--mspc-accent);
  transition: width .25s ease;
}

.mspc-stepper {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.mspc-stepper__item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mspc-stepper__dot {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--mspc-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--mspc-bg);
  color: var(--mspc-text);
}

.mspc-stepper__dot.is-done {
  background: var(--mspc-accent);
  border-color: var(--mspc-accent);
  color: #fff;
  opacity: 0.8;
}

.mspc-stepper__dot.is-active {
  background: var(--mspc-bg);
  border-color: var(--mspc-accent);
  color: var(--mspc-accent);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, .1);
  /* hardcoded shadow color for now, could be derived */
}

.mspc-stepper__label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  color: var(--mspc-muted);
}

/* Layout */
.mspc-body {
  padding: 18px 0 8px;
}

.mspc-card {
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: var(--mspc-radius);
  padding: 18px;
  box-shadow: var(--mspc-shadow-sm);
  background: var(--mspc-bg);
}

.mspc-card__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.mspc-card__title h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
  color: var(--mspc-text);
}

.mspc-card__title p {
  margin: 0;
  font-size: 13px;
  color: var(--mspc-muted);
}

.mspc-card__body p {
  color: var(--mspc-text);
  line-height: 1.55;
  opacity: .9;
}

.mspc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 960px) {
  .mspc-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .mspc-grid {
    grid-template-columns: 1fr;
  }
}

/* Option tiles */
.mspc-tile {
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: var(--mspc-radius);
  background: var(--mspc-bg);
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 78px;
}

.mspc-tile:hover {
  transform: translateY(-1px);
  box-shadow: var(--mspc-shadow-sm);
}

.mspc-tile.is-active {
  border-color: var(--mspc-accent);
  box-shadow: 0 0 0 2px var(--mspc-accent);
  /* Simplified shadow */
}

.mspc-tile__img {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, .08);
  object-fit: cover;
  background: rgba(0, 0, 0, .02);
}

.mspc-tile__meta {
  min-width: 0;
}

.mspc-tile__title {
  font-size: var(--mspc-fs-tile-t, 15px);
  font-weight: 800;
  margin: 0 0 2px;
  color: var(--mspc-text);
}

.mspc-tile__desc {
  font-size: var(--mspc-fs-tile-d, 12px);
  color: var(--mspc-muted);
  margin: 0;
}

/* Tile card (div-based, can contain nested controls) */
.mspc-tilecard {
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: var(--mspc-radius);
  background: var(--mspc-bg);
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.mspc-tilecard:hover {
  transform: translateY(-1px);
  box-shadow: var(--mspc-shadow-sm);
}

.mspc-tilecard.is-active {
  border-color: var(--mspc-accent);
  box-shadow: 0 0 0 2px var(--mspc-accent);
}

.mspc-tilecard__top {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 78px;
}

.mspc-tilecard__bottom {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, .06);
}

/* Controls */
.mspc-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 10px 0;
  flex-wrap: wrap;
}

.mspc-label {
  font-size: 13px;
  color: var(--mspc-muted);
  color: var(--mspc-muted);
  font-weight: 650;
}

/* Product Link in Tile */
.mspc-tile__productlink {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--mspc-accent);
  text-decoration: underline;
  cursor: pointer;
}

.mspc-tile__productlink:hover {
  text-decoration: none;
  opacity: 0.8;
}



.mspc-stepperctl {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  max-width: 100%;
}

.mspc-stepperctl button {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, .10);
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}

.mspc-stepperctl input {
  width: 60px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, .10);
  padding: 0 4px;
  font-size: 15px;
  font-weight: 750;
  text-align: center;
  flex-shrink: 1;
  min-width: 40px;
}

.mspc-stepperctl input::-webkit-outer-spin-button,
.mspc-stepperctl input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.mspc-stepperctl input {
  appearance: textfield;
}

.mspc-qtyrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.mspc-qtyrow__label {
  font-size: 12px;
  color: var(--mspc-muted);
  font-weight: 700;
}

/* Nav */
.mspc-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.mspc-btn {
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, .10);
  background: #fff;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: .2px;
}

.mspc-btn:hover {
  box-shadow: var(--mspc-shadow-sm);
}

.mspc-btn--primary {
  border: none;
  background: linear-gradient(90deg, rgba(59, 130, 246, 1), rgba(20, 184, 166, 1));
  color: #fff;
}

.mspc-btn--ghost {
  background: transparent;
}

.mspc-btn[disabled] {
  opacity: .55;
  cursor: not-allowed;
  box-shadow: none;
}

/* Summary */
.mspc-summary {
  margin-top: 6px;
}

.mspc-lines {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.mspc-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: var(--mspc-radius);
  background: rgba(0, 0, 0, .01);
}

.mspc-line__left {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
}

.mspc-line__img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, .08);
  background: #fff;
}

.mspc-line__name {
  font-weight: 850;
  font-size: var(--mspc-fs-sum-l, 14px);
  text-decoration: none;
  color: inherit;
  display: inline-block;
}

.mspc-line__meta {
  font-size: var(--mspc-fs-sum-m, 12px);
  color: var(--mspc-muted);
  margin-top: 2px;
}

.mspc-line__right {
  text-align: right;
}

.mspc-line__qty {
  font-size: 12px;
  color: var(--mspc-muted);
}

.mspc-line__price {
  font-weight: 900;
  font-size: var(--mspc-result-line-price-size, 16px);
}

.mspc-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding: 14px 12px;
  border-radius: var(--mspc-radius);
  border: 1px solid rgba(0, 0, 0, .08);
  background: #fff;
  font-size: var(--mspc-fs-tot-box, 16px);
  font-weight: 900;
}

.mspc-total__value {
  font-size: var(--mspc-result-total-price-size, 20px);
}

/* Notes / errors */
.mspc-note {
  font-size: 13px;
  color: var(--mspc-muted);
  margin-top: 6px;
}

.mspc-error {
  border: 1px solid rgba(220, 38, 38, .22);
  background: rgba(220, 38, 38, .06);
  padding: 12px;
  border-radius: var(--mspc-radius);
  margin-top: 12px;
}

.mspc-error__title {
  font-weight: 900;
  margin-bottom: 6px;
}

.mspc-loading {
  font-size: 13px;
  color: var(--mspc-muted);
}

/* Small helpers */
.mspc-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .04);
  border: 1px solid rgba(0, 0, 0, .06);
  font-size: 12px;
  color: var(--mspc-muted);
}

.mspc-skeleton {
  height: 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .06);
  overflow: hidden;
  position: relative;
}

.mspc-skeleton:after {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .55), rgba(255, 255, 255, 0));
  transform: translateX(-60%);
  animation: mspcShimmer 1.1s infinite;
}

@keyframes mspcShimmer {
  to {
    transform: translateX(60%);
  }
}

/* Cable configurator */
.mspc-chiprow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mspc-chip {
  appearance: none;
  border: 1px solid rgba(0, 0, 0, .10);
  background: #fff;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 850;
  font-size: 12px;
}

.mspc-chip:hover {
  box-shadow: var(--mspc-shadow-sm);
}

.mspc-chip.is-active {
  border-color: rgba(59, 130, 246, .65);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, .12);
}

.mspc-chip--danger {
  border-color: rgba(220, 38, 38, .4);
}

.mspc-cable-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mspc-cable-row {
  border: 1px solid rgba(0, 0, 0, .08);
  background: #fff;
  border-radius: var(--mspc-radius);
  padding: 12px;
}

.mspc-cable-row__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.mspc-cable-row__title {
  font-weight: 900;
}

.mspc-cable-row__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

@media (max-width: 900px) {
  .mspc-cable-row__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Modal */
.mspc-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 9999;
}

.mspc-modal__inner {
  width: min(560px, 100%);
  background: #fff;
  border-radius: 22px;
  border: 1px solid rgba(0, 0, 0, .12);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
  padding: 16px;
}

.mspc-modal__title {
  font-weight: 950;
  font-size: 18px;
}

/* WooCommerce cart: bundle parent + child items */
.woocommerce-cart .cart_item.mspc-bundle-parent td.product-name {
  font-weight: 900;
}

.woocommerce-cart .cart_item.mspc-bundle-child td.product-name {
  padding-left: 28px;
  opacity: .95;
}

.woocommerce-cart .cart_item.mspc-bundle-child td.product-remove {
  opacity: .35;
}

.woocommerce-cart .cart_item.mspc-bundle-child td.product-remove a {
  pointer-events: none;
}

.mspc-bundle-child__prefix {
  display: inline-block;
  width: 16px;
  margin-left: -16px;
  opacity: .7;
}

.mspc-bundle-included {
  color: rgba(0, 0, 0, .58);
  font-weight: 700;
}

.mspc-bundle-config {
  color: rgba(0, 0, 0, .58);
  font-weight: 700;
}

.mspc-qty-fixed {
  display: inline-block;
  min-width: 22px;
  text-align: center;
  font-weight: 800;
}

/* =========================================
   LANDING LAYOUT V2 (Story Mode)
   ========================================= */

.mspc-layout-landing {
  --mspc-story-bg: #f9fafb;
  --mspc-story-text: #374151;
}

/* Hero Section */
.mspc-landing-hero {
  text-align: center;
  padding: 40px 20px;
  background: linear-gradient(180deg, #fff 0%, #f3f4f6 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  margin-bottom: 30px;
}

.mspc-landing-hero h1 {
  font-size: 32px;
  font-weight: 800;
  margin: 0 0 12px;
  color: #111;
}

.mspc-landing-hero p {
  font-size: 18px;
  color: var(--mspc-muted);
  max-width: 600px;
  margin: 0 auto 24px;
  line-height: 1.5;
}

.mspc-badges {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.mspc-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--mspc-muted);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

/* Split Layout (Desktop) */
.mspc-landing-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 0 20px 40px;
  align-items: start;
}

@media (max-width: 900px) {
  .mspc-landing-split {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* Left Column: Story */
.mspc-story-col {
  position: sticky;
  top: 100px;
  /* Below sticky header if present */
}

@media (max-width: 900px) {
  .mspc-story-col {
    position: static;
  }
}

.mspc-story-card {
  background: var(--mspc-bg);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--mspc-radius);
  padding: 24px;
  box-shadow: var(--mspc-shadow-sm);
}

.mspc-story-img-wrapper {
  background: var(--mspc-story-bg);
  border-radius: var(--mspc-radius-sm);
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.mspc-story-img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: contain;
  display: block;
}

/* Ensure parent centers it if it's treated as flex item */
.mspc-story-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  /* Stretch children to fill width */
  text-align: left;
}

.mspc-story-card>* {
  width: 100%;
}

/* Restore width for children */

.mspc-story-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 12px;
}

.mspc-story-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--mspc-story-text);
  margin-bottom: 16px;
}

.mspc-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}

.mspc-bullets li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--mspc-muted);
}

.mspc-bullets li:before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #10b981;
  /* Green */
  font-weight: 800;
}

.mspc-faq-item {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding-top: 12px;
  margin-top: 12px;
}

.mspc-faq-q {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
  color: #111;
}

.mspc-faq-a {
  font-size: 13px;
  color: var(--mspc-muted);
  line-height: 1.5;
}

/* Right Column: Config (reuse existing components but adjust spacing) */
.mspc-config-col {
  min-width: 0;
  /* Prevent grid blowout */
}

.mspc-config-col .mspc-card {
  border: none;
  box-shadow: none;
  padding: 0;
  background: transparent;
}

.mspc-config-col .mspc-card__title {
  /* Hide standard card title in landing mode if story title covers it */
  display: none;
}

/* Mobile Bottom Bar */
.mspc-mobile-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding: 16px 20px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  z-index: 100;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

@media (max-width: 900px) {
  .mspc-mobile-bar {
    display: flex;
  }

  .mspc-layout-landing {
    padding-bottom: 80px;
    /* Space for bar */
  }

  /* Hide standard nav in landing mode on mobile to duplicate */
  .mspc-layout-landing .mspc-nav {
    display: none;
  }
}

.mspc-mobile-total {
  font-size: 14px;
  color: var(--mspc-muted);
}

.mspc-mobile-price {
  font-size: 18px;
  font-weight: 800;
  color: #111;
}