/*
 * W18 Variation Matrix UI skin
 * (CSS-only changes + small markup wrappers in PHP/JS; no changes to pricing/cart logic)
 */

.w18-matrix {
  max-width: 760px;
}

/* Top quantity pricing strip (above color selection) */
.w18-matrix .w18-tierstrip {
  margin: 0 0 14px 0;
}

/* Step titles (orange pill) */
.w18-matrix .w18-step__title {
  display: inline-block;
  background: #f28c28;
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  line-height: 1;
  padding: 9px 14px;
  border-radius: 20px;
  margin: 0 0 10px 0;
}

.w18-matrix .w18-step {
  margin: 14px 0;
}

/* Colors (swatches) */
.w18-matrix .w18-colors {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 20px 40px;
  border-radius: 20px;
  background: #fff;
}

.w18-matrix .w18-colors::-webkit-scrollbar {
  height: 6px;
}
.w18-matrix .w18-colors::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 20px;
}

.w18-matrix .w18-swatch {
  width: 16px;
  height: 16px;
  border-radius: 20px;
  border: 2px solid #e6e6e6;
  box-sizing: content-box;
  cursor: pointer;
  background: #fff;
}

/* Prevent any theme pseudo-elements from drawing a "dot" inside the swatch */
.w18-matrix .w18-swatch::before,
.w18-matrix .w18-swatch::after {
  content: none !important;
  display: none !important;
}

.w18-matrix .w18-swatch.is-active {
  outline: 2px solid #f28c28;
  outline-offset: 3px;
}

.w18-matrix .w18-sizes {
  background: #fff;
  border-radius: 20px;
  padding: 14px 14px 10px;
}

.w18-matrix .w18-size-grid {
  width: 100%;
}

.w18-matrix .w18-size-grid__head,
.w18-matrix .w18-size-grid__body {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(54px, 1fr);
  gap: 12px;
  align-items: center;
}

.w18-matrix .w18-size-grid__head {
  margin-bottom: 8px;
}

.w18-matrix .w18-size__label {
  display: block;
  text-align: center;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #111;
  background: transparent !important;
}

.w18-matrix .w18-size-grid__total {
  justify-self: end;
}

.w18-matrix .w18-size-grid__col.is-disabled {
  opacity: 0.35;
}

/* Quantity inputs: use native number spinners (no custom +/- buttons)
   and keep spinners always visible. */
.w18-matrix input.w18-qty {
  box-sizing: border-box;
  font-size: 16px;
  width: 64px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  text-align: center;
  padding: 0 6px;
  background: #fff;
  appearance: auto;
  -webkit-appearance: auto;
  -moz-appearance: auto;
}

.w18-matrix input.w18-qty::-webkit-outer-spin-button,
.w18-matrix input.w18-qty::-webkit-inner-spin-button {
  opacity: 1;
}

.w18-matrix .w18-totalqty {
  display: inline-flex;
  min-width: 44px;
  height: 34px;
  padding: 0 12px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #0b4ea2;
  color: #fff;
  font-weight: 900;
}

/* Step 3 button (orange outline; hover -> orange filled, white text) */
.w18-matrix .w18-step3-btn {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 20px;
  border: 2px solid #f28c28;
  background: transparent;
  color: #f28c28;
  font-weight: 900;
  padding: 12px 16px;
  cursor: pointer;
}

.w18-matrix .w18-step3-plus {
  width: 28px;
  height: 28px;
  font-size: 20px;
  line-height: 22px;
  border-radius: 50%;
  border: 1px solid;
}

.w18-matrix .w18-step3-btn:hover,
.w18-matrix .w18-step3-btn:focus {
  background: #f28c28 !important;
  color: #fff !important;
}

.w18-matrix .w18-step3-btn:hover .w18-step3-plus,
.w18-matrix .w18-step3-btn:focus .w18-step3-plus {
  border-color: #fff;
}

/* Total line (Total: £123.00) */
.w18-matrix .w18-totalline {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 18px 0 8px;
}

.w18-matrix .w18-totalline__label {
  font-size: 20px;
  color: #666;
}

.w18-matrix .w18-total__price {
  font-size: 34px;
  font-weight: 900;
  color: #f28c28;
}

/* Step 4 button (navy; hover -> darker navy) */
.w18-matrix .w18-step4-btn {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  border-radius: 20px;
  padding: 12px 16px;
  font-weight: 900;
  border: 0;
  background: #0b4ea2;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
}

.w18-matrix .w18-step4-btn:hover,
.w18-matrix .w18-step4-btn:focus {
  background: #083c7f !important;
  color: #fff !important;
}

.w18-matrix .w18-step4-btn:disabled {
  background: #cfd8e6 !important;
  color: #6d7a90 !important;
  box-shadow: none;
  cursor: not-allowed;
}

/* Quantity pricing table (horizontal, like the reference screenshot) */
.w18-matrix .w18-tiers__table table.w18-tier-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
}

.w18-matrix .w18-tier-table th,
.w18-matrix .w18-tier-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 12px;
}

.w18-matrix .w18-tier-table tr:last-child th,
.w18-matrix .w18-tier-table tr:last-child td {
  border-bottom: 0;
}

.w18-matrix .w18-tier-table th {
  width: 120px;
  text-align: left;
  font-weight: 900;
  color: #444;
}

.w18-matrix .w18-tier-table td {
  text-align: center;
  color: #111;
  white-space: nowrap;
}

.w18-matrix .w18-tier-table tr:nth-child(1) td {
  color: #666;
}
.w18-matrix .w18-tier-table tr:nth-child(3) td {
  color: #f28c28;
  font-weight: 900;
}

/* Size grid: center headers over inputs and make inputs wider so spinners don't cover 3 digits */
.w18-matrix .w18-size-grid__head .w18-size-grid__col,
.w18-matrix .w18-size-grid__body .w18-size-grid__col {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* keep native spinners visible */
.w18-matrix input.w18-qty::-webkit-outer-spin-button,
.w18-matrix input.w18-qty::-webkit-inner-spin-button {
  opacity: 1 !important;
  display: block !important;
}

/* Tier table: no borders, white card background */
.w18-matrix .w18-tierstrip {
  background: #fff;
  border-radius: 20px;
  padding: 10px 12px;
}

.w18-matrix .w18-tier-table {
  background: #fff;
}

.w18-matrix .w18-tier-table th,
.w18-matrix .w18-tier-table td {
  border: 0 !important;
  background: #fff !important;
}

/* Ensure no zebra/row shading from themes */
.w18-matrix .w18-tier-table tr,
.w18-matrix .w18-tier-table thead,
.w18-matrix .w18-tier-table tbody {
  background: #fff !important;
}

/* Keep size grid and color strip fully white even if theme adds shading */
.w18-matrix .w18-sizes,
.w18-matrix .w18-colors {
  background: #fff !important;
}

/* Buttons: smaller and left-aligned (responsive without %) */
.w18-matrix .w18-step3-btn {
  width: min(320px, 100%);
  max-width: none;
  margin: 0;
  padding: 10px 14px;
  font-size: 14px;
}

.w18-matrix .w18-step4-btn {
  width: min(320px, 100%);
  max-width: none;
  margin: 0;
  padding: 12px 14px;
  font-size: 16px;
}
