.cwpc-configurator {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(260px, 380px);
  gap: 1.5rem;
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  background: #fff
}

.cwpc-preview canvas {
  width: 100%;
  height: auto;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #fafafa
}

.cwpc-panel h3 {
  margin-top: 0
}

.cwpc-set-item-colors {
  display: flex;
  gap: 10px;
}

.cwpc-field {
  margin: 0 0 1rem;
  padding: 1rem;
  border: 1px solid #e5e5e5;
  border-radius: 10px
}

.cwpc-choice {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin: .4rem 0;
  cursor: pointer
}

.cwpc-choice span {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 1px solid #aaa;
  border-radius: 50%;
  vertical-align: middle
}

.cwpc-choice img {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border: 1px solid #e5e5e5;
  border-radius: 6px
}

.cwpc-field input[type=text],
.cwpc-field input[type=file] {
  width: 100%;
  max-width: 100%
}

.cwpc-price {
  font-weight: 700;
  margin: 1rem 0
}

.cwpc-dining-configurator {
  --cwpc-border: #e5e5e5;
  --cwpc-active: #4f9b3f;
  --cwpc-text: #222;
  --cwpc-muted: #777;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(300px, 430px);
  gap: 24px;
  margin: 28px 0;
  padding: 22px;
  border: 1px solid var(--cwpc-border);
  border-radius: 18px;
  background: #fff;
  color: var(--cwpc-text);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .04)
}

/* .cwpc-dining-preview {
position: relative;
min-height: 420px;
border: 1px solid var(--cwpc-border);
border-radius: 16px;
background: #fafafa;
overflow: hidden;
display: flex;
align-items: flex-start;
justify-content: center
} */

.cwpc-dining-preview {
  position: sticky;
  top: 0;
  align-self: start;
  height: calc(100vh - 100px);
  max-height: calc(100vh - 100px);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.cwpc-dining-preview .cwpc-preview-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 0
}

.cwpc-table-layer {
  z-index: 1
}

.cwpc-chair-layer {
  z-index: 2
}

.cwpc-preview-empty {
  color: var(--cwpc-muted)
}

.cwpc-dining-fields {
  display: grid;
  gap: 15px;
  direction: ltr;
  text-align: left;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding-inline-end: 10px;
  align-content: start;
}

.cwpc-dining-fields button{
  border: 0 !important;
  background: transparent !important;
}

.cwpc-dining-fields .cwpc-chair-mode button{
  background: #92bf7d !important;
  border: 1px solid #92bf7d;
  color: #fff !important;
  transition: all 0.5s ease-in-out;
}

.cwpc-dining-fields .cwpc-chair-mode button:hover{
  color: #92bf7d  !important;
  background: transparent !important;
}

.rtl .cwpc-dining-fields,
body.rtl .cwpc-dining-fields {
  direction: rtl;
  text-align: right
}

.cwpc-step {
  padding: 0px 15px 20px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--cwpc-border);
  border-radius: 0;
  background: #fff
}

.cwpc-step h4 {
  margin: 0 0 12px;
  font-size: 18px !important;
  font-weight: 700;
  color: var(--cwpc-text)
}

.cwpc-table-colors,
.cwpc-chair-colors,
.cwpc-chair-designs,
.cwpc-chair-mode,
.cwpc-addons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px
}

.cwpc-swatch {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  min-width: 78px;
  padding: 10px 10px 9px;
  border: 1px solid var(--cwpc-border);
  border-radius: 14px;
  background: #fff;
  color: var(--cwpc-text);
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease
}

.cwpc-swatch:hover,
.cwpc-design:hover,
.cwpc-mode:hover,
.cwpc-addon-card:hover {
  border-color: #cfcfcf;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .05)
}

.cwpc-swatch-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #d0d0d0;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7)
}

.cwpc-swatch-label {
  font-size: 12px;
  line-height: 1.25
}

.cwpc-swatch small,
.cwpc-design small,
.cwpc-addon-card small {
  font-size: 11px;
  color: var(--cwpc-muted)
}

.cwpc-active {
  border-color: var(--cwpc-active) !important;
  box-shadow: 0 0 0 2px rgba(79, 155, 63, .16) !important
}

.cwpc-active:after {
  content: '✔';
  position: absolute;
  top: 14px;
  right: 7px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cwpc-active);
  color: #fff;
  font-size: 14px;
  line-height: 18px;
  text-align: center
}

.rtl .cwpc-active:after,
body.rtl .cwpc-active:after {
  right: auto;
  left: -25px
}

.cwpc-design {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 104px;
  padding: 10px;
  border: 1px solid var(--cwpc-border);
  border-radius: 14px;
  background: #fff;
  color: var(--cwpc-text);
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease
}

.cwpc-design img,
.cwpc-design-placeholder {
  width: 78px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  background: #f5f5f5;
  border: 1px solid var(--cwpc-border)
}

.cwpc-design span {
  font-size: 13px;
  font-weight: 600
}

.cwpc-mode {
  position: relative;
  padding: 10px 14px;
  border: 1px solid var(--cwpc-border);
  border-radius: 999px;
  background: #fff;
  color: var(--cwpc-text);
  cursor: pointer
}

.cwpc-extra-chairs {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--cwpc-border);
  border-radius: 10px;
  background: #fff;
  color: var(--cwpc-text);
  padding: 0 12px
}

.cwpc-extra-chairs.cwpc-active {
  box-shadow: 0 0 0 2px rgba(79, 155, 63, .1) !important
}

.cwpc-addon-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--cwpc-border);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  color: var(--cwpc-text)
}

.cwpc-addon-card input {
  margin: 0
}

.cwpc-dining-price {
  padding: 14px 16px;
  border-radius: 12px;
  background: #f8fbf7;
  color: var(--cwpc-text);
  font-weight: 700;
  border: 1px solid rgba(79, 155, 63, .18)
}

.cwpc-dining-modal__dialog .cwpc-dining-modal__close {
  position: absolute;
  top: 20px;
  padding: 0;
  width: 40px;
  height: 40px;
  color: #fff;
  font-size: 28px;
  font-weight: 400;
  border: 0;
  left: 20px;
}

@media(max-width:900px) {
  .cwpc-dining-configurator {
    grid-template-columns: 1fr
  }

  /* .cwpc-dining-preview {
  min-height: 320px
} */

  .cwpc-dining-modal__dialog {
    overflow: auto;
    height: auto;
  }

  .cwpc-dining-modal .cwpc-dining-configurator {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .cwpc-dining-fields {
    max-height: none;
    overflow: visible;
    padding-inline-end: 0;
  }

  .cwpc-dining-preview {
    position: relative;
    top: auto;
    height: auto;
    max-height: none;
  }

  .cwpc-preview-canvas {
    height: auto;
  }
}

@media(max-width:760px) {
  .cwpc-configurator {
    grid-template-columns: 1fr
  }

  .cwpc-dining-configurator {
    padding: 14px;
    gap: 16px
  }

  .cwpc-step {
    padding: 14px
  }

  .cwpc-swatch {
    min-width: 70px
  }

  .cwpc-design {
    width: 96px
  }
}

.summary.entry-summary .cwpc-dining-enabled-form button.single_add_to_cart_button,
.summary.entry-summary .cwpc-dining-product form.cart button.single_add_to_cart_button,
.summary.entry-summary .cwpc-configurator-product form.cart button.single_add_to_cart_button,
.cwpc-native-add-to-cart {
  display: none !important;
}

.cwpc-dining-launch {
  margin: 30px 0 10px;
  width: 100%;
}

.cwpc-dining-launch .cwpc-open-dining-modal, .cwpc-linked-component-launch a.cwpc-component-wizard-button {
  width: 100%;
  font-size: 16px !important;
  padding: 1.2rem 1.5rem !important;
  text-align: center;
  font-weight: 700 !important;
  line-height: 26px !important;
}

.cwpc-open-dining-modal,
.cwpc-popup-add-to-cart {
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid #4f9b3f;
  background: #4f9b3f;
  color: #fff;
  font-weight: 700;
  cursor: pointer
}

.cwpc-dining-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999
}

.cwpc-dining-modal.cwpc-open {
  display: flex;
  align-items: center;
}

.cwpc-dining-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55)
}

.cwpc-dining-modal__dialog {
  position: relative;
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  margin: 24px auto;
  padding: 22px;
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .28)
}

.cwpc-dining-modal .cwpc-dining-configurator {
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  border-radius: 0;
  display: grid;
  align-items: stretch;
  grid-template-columns: 1fr 1fr;
}

.cwpc-dining-modal__close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 1px solid #e5e5e5;
  border-radius: 50%;
  background: #fff;
  color: #222;
  font-size: 24px;
  line-height: 1;
  cursor: pointer
}

.rtl .cwpc-dining-modal__close,
body.rtl .cwpc-dining-modal__close {
  float: left
}

.cwpc-modal-open {
  overflow: hidden
}

.cwpc-dining-modal .cwpc-dining-configurator {
  margin: 0;
  border: 0;
  box-shadow: none;
  padding: 0
}

.cwpc-dining-modal .cwpc-popup-add-to-cart {
  width: 100%;
  margin-top: 4px
}

.cwpc-swatch {
  min-width: 72px;
  padding: 10px 8px
}

.cwpc-swatch-dot {
  width: 42px;
  height: 42px
}

.cwpc-swatch-label {
  display: block;
  max-width: 82px;
  white-space: normal;
  text-align: center;
  color: #777
}

.cwpc-design {
  padding: 8px
}

.cwpc-design span {
  font-size: 12px;
  color: #777
}

.cwpc-addon-card.cwpc-active {
  background: #f8fbf7
}

@media(max-width:760px) {
  .cwpc-dining-modal__dialog {
    width: calc(100vw - 18px);
    max-height: calc(100vh - 18px);
    margin: 9px auto;
    padding: 14px
  }

  .cwpc-dining-modal .cwpc-dining-preview {
    min-height: 240px
  }
}

.cwpc-swatch-wrap,
.cwpc-design-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #777;
  font-size: 12px;
  text-align: center
}

.cwpc-color-swatch {
  width: 54px !important;
  height: 54px !important;
  min-width: 54px !important;
  padding: 5px !important;
  border-radius: 50% !important
}

.cwpc-color-swatch .cwpc-swatch-dot {
  width: 42px;
  height: 42px;
  margin: 0;
  display: block;
}

.cwpc-image-swatch {
  width: 92px !important;
  height: 82px !important;
  padding: 6px !important;
  border-radius: 14px !important
}

.cwpc-image-swatch img,
.cwpc-image-swatch .cwpc-design-placeholder {
  width: 78px;
  height: 66px
}

.cwpc-design-wrap>span,
.cwpc-swatch-wrap>.cwpc-swatch-label {
  line-height: 1.25;
  max-width: 90px
}

.cwpc-design-wrap small,
.cwpc-swatch-wrap small {
  color: #777;
  font-size: 11px
}

.cwpc-color-swatch.cwpc-active:after{
  top: -4px;  
}

.cwpc-image-swatch.cwpc-active:after {
  top: 40%;
  right: -4px
}

.rtl .cwpc-color-swatch.cwpc-active:after,
body.rtl .cwpc-color-swatch.cwpc-active:after{
  right: -4px;
  left: auto;
}


.rtl .cwpc-image-swatch.cwpc-active:after,
body.rtl .cwpc-image-swatch.cwpc-active:after {
  right: -20px;
  left: auto;
}

.cwpc-preview-canvas {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain
}

.cwpc-mixed-note {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--cwpc-border);
  border-radius: 10px;
  background: #fff;
  color: var(--cwpc-text);
  padding: 0 12px
}

.cwpc-custom-chair-color-picker {
  width: 42px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--cwpc-border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.cwpc-dot-transparent {
  background:
    linear-gradient(45deg, #ddd 25%, transparent 25%),
    linear-gradient(-45deg, #ddd 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ddd 75%),
    linear-gradient(-45deg, transparent 75%, #ddd 75%) !important;
  background-size: 10px 10px !important;
  background-position: 0 0, 0 5px, 5px -5px, -5px 0 !important;
  background-color: #fff !important;
}

.cwpc-mixed-color-wrap {
  gap: 5px;
}
/* Chair design quantity allocation (v1.1.0) */
.cwpc-chair-allocation-status {
  margin: 0 0 10px;
  padding: 9px 12px;
  border: 1px solid #e2e2e2;
  border-radius: 10px;
  background: #fafafa;
  color: #555;
  font-size: 13px;
  font-weight: 600
}

.cwpc-chair-allocation-status.cwpc-complete {
  border-color: rgba(79, 155, 63, .28);
  background: #f5faf3;
  color: #39752f
}

.cwpc-chair-allocation-error {
  display: none;
  margin-top: 10px;
  padding: 9px 12px;
  border: 1px solid #dba4a4;
  border-radius: 10px;
  background: #fff7f7;
  color: #9c2f2f;
  font-size: 13px;
  line-height: 1.45
}

.cwpc-chair-designs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%
}

.cwpc-design-allocation {
  display: flex;
  gap: 10px 12px;
  align-items: center;
  padding: 11px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
  justify-content: flex-start;
}

.cwpc-design-allocation.cwpc-design-selected {
  border-color: rgba(79, 155, 63, .45);
  background: #fbfdfb;
  padding-right: 40px;
}

.cwpc-chair-designs .cwpc-design-allocation.cwpc-design-selected{
  padding-right: 11px;
}

.cwpc-design-allocation.cwpc-design-focused {
  box-shadow: none
}

.cwpc-design-allocation>.cwpc-design {
  grid-area: image;
  margin: 0;
  width: 92px !important
}

.cwpc-design-allocation .cwpc-managed-set-type, .cwpc-design-allocation .cwpc-image-swatch{
  padding: 0;
  box-shadow: none !important;
}

.rtl .cwpc-design-allocation .cwpc-active:after, body.rtl .cwpc-design-allocation .cwpc-active:after{
  right: -30px;
  left: auto;
}

.rtl .cwpc-chair-designs .cwpc-design-allocation .cwpc-active:after, body.rtl .cwpc-chair-designs .cwpc-design-allocation .cwpc-active:after{
  right: -10px;
  left: auto;
  top: -15px;
}

.cwpc-design-allocation-meta {
  grid-area: meta;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding-right: 20px;
  gap: 10px;
  color: var(--cwpc-text);
  align-items: flex-start;
}

.cwpc-chair-designs .cwpc-design-allocation-meta{
  padding-right: 0px;
}

.cwpc-design-allocation-meta .cwpc-design{
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.cwpc-design-allocation-meta strong {
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.3
}

.cwpc-design-allocation-meta small {
  color: var(--cwpc-muted);
  font-size: 11px
}

.cwpc-chair-qty-controls {
  grid-area: controls;
  display: grid;
  grid-template-columns: 33px minmax(52px, 1fr) 33px;
  gap: 2px;
  align-items: center;
  direction: ltr
}

.cwpc-dining-fields .cwpc-chair-qty-controls button {
  width: 33px;
  height: 33px;
  padding: 0 !important;
  border: 1px solid #d7d7d7 !important;
  border-radius: 9px !important;
  background: #fff !important;
  color: #333 !important;
  font-size: 20px;
  font-weight: 600;
  line-height: 1 !important;
  cursor: pointer
}

.cwpc-dining-fields .cwpc-chair-qty-controls button:hover {
  border-color: var(--cwpc-active) !important;
  color: var(--cwpc-active) !important
}

.cwpc-chair-qty {
  width: 100%;
  height: 33px;
  padding: 0 6px;
  border: 1px solid #d7d7d7;
  border-radius: 9px;
  background: #fff;
  color: #222;
  text-align: center;
  font-weight: 700;
  appearance: textfield
}

.cwpc-chair-qty::-webkit-inner-spin-button,
.cwpc-chair-qty::-webkit-outer-spin-button {
  margin: 0;
  appearance: none
}

.cwpc-no-common-colors {
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #e2b6b6;
  border-radius: 10px;
  background: #fff8f8;
  color: #973b3b;
  font-size: 13px;
  line-height: 1.45
}

@media(max-width:760px) {
  .cwpc-chair-designs {
    grid-template-columns: 1fr
  }
}
/* Managed table and complete-set profiles (v1.2.0) */
.cwpc-managed-title {
  margin: 0 0 14px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--cwpc-border);
}

.cwpc-managed-title span {
  display: block;
  margin-bottom: 4px;
  color: var(--cwpc-muted);
  font-size: 12px;
  font-weight: 600;
}

.cwpc-managed-title h3 {
  margin: 0;
  color: var(--cwpc-text);
  font-size: 22px;
  line-height: 1.3;
}

.cwpc-managed-options:empty {
  display: none;
}

.cwpc-managed-included {
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--cwpc-border);
  border-radius: 14px;
  background: #fafafa;
}

.cwpc-managed-included h4 {
  margin: 0 0 10px;
  font-size: 15px;
}

.cwpc-managed-included article + article {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--cwpc-border);
}

.cwpc-managed-included strong {
  display: block;
  color: var(--cwpc-text);
}

.cwpc-managed-included p {
  margin: 4px 0 0;
  color: var(--cwpc-muted);
  font-size: 13px;
  line-height: 1.45;
}

.cwpc-managed-table-canvas {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.cwpc-managed-set-preview {
  display: grid;
  gap: 14px;
  width: 100%;
  padding: 8px;
}

.cwpc-set-preview-card {
  display: grid;
  grid-template-columns: minmax(150px, .9fr) minmax(0, 1.1fr);
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--cwpc-border);
  border-radius: 16px;
  background: #fff;
}

.cwpc-set-preview-image {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 170px;
  border-radius: 12px;
  background: #fafafa;
  overflow: hidden;
}

.cwpc-set-preview-image img {
  display: block;
  width: 100%;
  max-height: 250px;
  object-fit: contain;
}

.cwpc-set-preview-placeholder {
  width: 70%;
  height: 110px;
  border: 1px dashed #ccc;
  border-radius: 10px;
}

.cwpc-set-preview-copy h4 {
  margin: 0 0 8px;
  color: var(--cwpc-text);
  font-size: 18px;
}

.cwpc-set-preview-copy p {
  margin: 0 0 10px;
  color: var(--cwpc-muted);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-line;
}

.cwpc-set-preview-color {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid var(--cwpc-border);
  border-radius: 999px;
  color: var(--cwpc-text);
  font-size: 12px;
  font-weight: 600;
}

.cwpc-set-preview-color i {
  display: block;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 50%;
}

.cwpc-managed-preview {
  align-content: start;
}

.cwpc-managed-modal .cwpc-dining-price {
  margin-top: 14px;
}

.cwpc-chair-mode-step .cwpc-chair-mode{
  padding-right: 30px;
}

.rtl .cwpc-chair-mode .cwpc-active:after, body.rtl .cwpc-chair-mode .cwpc-active:after{
  right: -30px;
  left: auto;
}

@media(max-width:760px) {
  .cwpc-managed-title h3 {
    font-size: 19px;
  }

  .cwpc-set-preview-card {
    grid-template-columns: 1fr;
  }

  .cwpc-set-preview-image {
    min-height: 130px;
  }
}
/* ==========================================================
Mobile configurator UX â€” v1.2.1
Covers: generic, legacy dining, table preview, complete set
========================================================== */

/* Keep configurator controls usable on touch screens. */
.cwpc-configurator button,
.cwpc-configurator label,
.cwpc-dining-configurator button,
.cwpc-dining-configurator label,
.cwpc-dining-configurator select,
.cwpc-dining-configurator input {
  touch-action: manipulation;
}

.cwpc-dining-modal,
.cwpc-dining-modal__dialog,
.cwpc-dining-configurator,
.cwpc-dining-fields,
.cwpc-dining-preview {
  box-sizing: border-box;
}

@media (max-width: 900px) {
  /* Full-screen modal: preview remains visible while choices scroll. */
  .cwpc-dining-modal__dialog {
    width: 100vw;
    width: 100dvw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border-radius: 0;
    overflow: hidden;
    overscroll-behavior: contain;
  }

  .cwpc-chair-designs .cwpc-design-allocation.cwpc-design-selected{
    position: relative;  
  }

  .cwpc-dining-modal .cwpc-dining-configurator {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(190px, 36vh) minmax(0, 1fr);
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    gap: 0;
    padding: 0;
    overflow: hidden;
    background: #fff;
  }

  /* DOM has fields first. Visually move preview above choices on mobile. */
  .cwpc-dining-modal .cwpc-dining-preview {
    order: 1;
    position: relative;
    top: auto;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    padding: 12px 48px 10px;
    border-bottom: 1px solid var(--cwpc-border);
    background: #fafafa;
    overflow: hidden;
    scrollbar-gutter: auto;
  }

  .cwpc-dining-modal .cwpc-dining-fields {
    order: 2;
    min-width: 0;
    min-height: 0;
    max-height: none;
    gap: 0;
    padding: 12px 12px calc(84px + env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: auto;
  }

  /* Canvas keeps its own aspect ratio and does not make the modal wider. */
  .cwpc-dining-modal .cwpc-preview-canvas,
  .cwpc-dining-modal .cwpc-managed-table-canvas {
    display: block;
    width: auto !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    margin: auto;
    object-fit: contain;
  }

  .cwpc-dining-modal .cwpc-managed-set-preview {
    width: 100%;
    max-height: 100%;
    padding: 0;
    overflow: auto;
  }

  /* Close button always stays reachable above the preview. */
  .cwpc-dining-modal__dialog .cwpc-dining-modal__close {
    position: absolute;
    z-index: 50;
    top: max(10px, env(safe-area-inset-top));
    left: 10px;
    right: auto;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .72) !important;
    border-radius: 12px;
    background: rgba(79, 155, 63, .94) !important;
    color: #fff !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
    font-size: 27px;
    line-height: 40px;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }

  .rtl .cwpc-dining-modal__dialog .cwpc-dining-modal__close,
  body.rtl .cwpc-dining-modal__dialog .cwpc-dining-modal__close {
    left: 10px;
    right: auto;
  }

  .cwpc-step {
    margin: 0;
    padding: 12px;
    border-radius: 0;
    box-shadow: none;
  }

  .cwpc-step h4 {
    margin-bottom: 10px;
    font-size: 15px !important;
    line-height: 1.35;
  }

  .cwpc-managed-title {
    margin: 0;
    padding: 0 0 10px;
  }

  .cwpc-managed-title span {
    margin-bottom: 2px;
    font-size: 11px;
  }

  .cwpc-managed-title h3 {
    font-size: 18px;
    line-height: 1.25;
  }

  /* Horizontal color rail: bigger targets, no cramped wrapping. */
  .cwpc-table-colors,
  .cwpc-chair-colors,
  .cwpc-set-item-colors {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    padding: 10px 2px 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .cwpc-table-colors .cwpc-swatch-wrap,
  .cwpc-chair-colors .cwpc-swatch-wrap,
  .cwpc-set-item-colors .cwpc-swatch-wrap {
    flex: 0 0 auto;
    min-width: 66px;
    scroll-snap-align: start;
  }

  .cwpc-color-swatch {
    width: 58px !important;
    min-width: 58px !important;
    height: 58px !important;
    padding: 5px !important;
  }

  .cwpc-color-swatch .cwpc-swatch-dot {
    width: 46px;
    height: 46px;
  }

  .cwpc-swatch-label {
    max-width: 76px;
    font-size: 12px;
    line-height: 1.25;
  }

  /* Active checkmark stays inside the touch target. */
  .cwpc-active:after,
  .rtl .cwpc-active:after,
  body.rtl .cwpc-active:after,
  .rtl .cwpc-color-swatch.cwpc-active:after,
  body.rtl .cwpc-color-swatch.cwpc-active:after,
  .rtl .cwpc-image-swatch.cwpc-active:after,
  body.rtl .cwpc-image-swatch.cwpc-active:after {
    top: -4px;
    right: -4px;
    left: auto;
    width: 20px;
    height: 20px;
    line-height: 20px;
    font-size: 13px;
  }

  .rtl .cwpc-chair-mode .cwpc-active:after, body.rtl .cwpc-chair-mode .cwpc-active:after{
    top: 14px;
  }

  .cwpc-chair-design-step .cwpc-chair-designs {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .cwpc-chair-design-step .cwpc-design-allocation {
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: 0;
    padding: 10px;
    border: 0;
    flex-direction: column;
  }

  .cwpc-chair-design-step .cwpc-design-allocation > .cwpc-design,
  .cwpc-chair-design-step .cwpc-image-swatch {
    position: unset;
    width: 82px !important;
    min-width: 82px !important;
    height: 72px !important;
  }

  .cwpc-chair-design-step .cwpc-image-swatch img,
  .cwpc-chair-design-step .cwpc-image-swatch .cwpc-design-placeholder {
    width: 68px;
    height: 58px;
  }

  .cwpc-chair-design-step .cwpc-design-allocation-meta {
    min-width: 0;
    padding: 0;
    gap: 7px;
    align-items: stretch;
  }

  .cwpc-chair-design-step .cwpc-design-allocation-meta strong {
    font-size: 14px;
    text-align: center;
  }

  .cwpc-chair-qty-controls {
    grid-template-columns: 33px minmax(54px, 1fr) 33px;
    gap: 6px;
    width: 100%;
    max-width: 220px;
  }

  .cwpc-dining-fields .cwpc-chair-qty-controls button,
  .cwpc-chair-qty {
    height: 33px;
    min-height: 33px;
  }

  .cwpc-dining-fields .cwpc-chair-qty-controls button {
    width: 33px;
    font-size: 22px;
  }

  .cwpc-chair-qty {
    font-size: 16px;
  }

  /* Complete-set selector: compact visual two-column grid. */
  .cwpc-managed-set-types {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .cwpc-managed-set-types .cwpc-design-allocation {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
    min-width: 0;
    padding: 8px !important;
    border: 1px solid var(--cwpc-border);
    background: #fff;
  }

  .cwpc-managed-set-types .cwpc-design-allocation.cwpc-design-selected {
    border-color: rgba(79, 155, 63, .5);
    background: #f8fbf7;
  }

  .cwpc-managed-set-types .cwpc-managed-set-type {
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    aspect-ratio: 4 / 3;
    border-radius: 10px !important;
    overflow: hidden;
  }

  .cwpc-managed-set-types .cwpc-managed-set-type img,
  .cwpc-managed-set-types .cwpc-design-placeholder {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
  }

  .cwpc-managed-set-types .cwpc-design-allocation-meta {
    min-width: 0;
    padding: 0;
    align-items: center;
    text-align: center;
  }

  .cwpc-managed-set-types .cwpc-design-allocation-meta strong {
    display: -webkit-box;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  /* Modes and extras become full-width, thumb-friendly rows. */
  .cwpc-chair-mode,
  .cwpc-addons {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .cwpc-mode,
  .cwpc-addon-card {
    width: 100%;
    min-height: 48px;
    justify-content: flex-start;
    padding: 11px 12px;
    border-radius: 11px;
    font-size: 14px;
    line-height: 1.35;
  }

  .cwpc-addon-card input {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
  }

  .cwpc-addon-card span {
    min-width: 0;
    flex: 1 1 auto;
    overflow-wrap: anywhere;
  }

  .cwpc-addon-card small {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .cwpc-extra-chairs,
  .cwpc-mixed-note,
  .cwpc-custom-chair-color-picker,
  .cwpc-dining-fields input,
  .cwpc-dining-fields select,
  .cwpc-dining-fields textarea {
    font-size: 16px; /* prevents iOS input zoom */
  }

  .cwpc-extra-chairs,
  .cwpc-mixed-note {
    min-height: 48px;
  }

  .cwpc-chair-allocation-status,
  .cwpc-chair-allocation-error {
    font-size: 12px;
    line-height: 1.4;
  }

  .cwpc-dining-price {
    margin: 0;
    padding: 12px;
    border-radius: 11px;
    font-size: 16px;
    line-height: 1.3;
  }

  /* The main action remains visible at the bottom of the scrolling panel. */
  .cwpc-dining-modal .cwpc-popup-add-to-cart {
    position: sticky;
    z-index: 30;
    bottom: max(8px, env(safe-area-inset-bottom));
    width: 100%;
    min-height: 52px;
    margin: 0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(32, 83, 24, .24);
    font-size: 16px;
  }

  /* Generic non-modal configurator. */
  .cwpc-configurator {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin: 14px 0;
    padding: 10px;
    border-radius: 12px;
  }

  .cwpc-configurator .cwpc-preview canvas {
    display: block;
    max-height: 42vh;
    margin: auto;
    object-fit: contain;
  }

  .cwpc-configurator .cwpc-panel h3 {
    font-size: 18px;
  }

  .cwpc-configurator .cwpc-field {
    margin-bottom: 8px;
    padding: 10px;
  }

  .cwpc-configurator .cwpc-choice {
    min-height: 46px;
    margin: 6px 0;
    padding: 8px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
  }
}

@media (max-width: 480px) {
  .cwpc-dining-modal .cwpc-dining-configurator {
    grid-template-rows: minmax(170px, 31vh) minmax(0, 1fr);
  }

  .cwpc-dining-modal .cwpc-dining-preview {
    padding: 10px 44px 8px;
  }

  .cwpc-dining-modal .cwpc-dining-fields {
    padding-inline: 9px;
  }

  .cwpc-step {
    padding: 20px 10px;
  }

  .cwpc-managed-set-types {
    gap: 6px !important;
  }

  .cwpc-managed-set-types .cwpc-design-allocation {
    padding: 6px !important;
  }

  .cwpc-color-swatch {
    width: 54px !important;
    min-width: 54px !important;
    height: 54px !important;
  }

  .cwpc-color-swatch .cwpc-swatch-dot {
    width: 42px;
    height: 42px;
  }
}

/* Mobile landscape: use side-by-side preview and choices. */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 560px) {
  .cwpc-dining-modal .cwpc-dining-configurator {
    grid-template-columns: minmax(260px, 42%) minmax(0, 58%);
    grid-template-rows: minmax(0, 1fr);
  }

  .cwpc-dining-modal .cwpc-dining-preview {
    grid-column: 1;
    grid-row: 1;
    height: 100%;
    padding: 10px;
    border-right: 1px solid var(--cwpc-border);
    border-bottom: 0;
  }

  .cwpc-dining-modal .cwpc-dining-fields {
    grid-column: 2;
    grid-row: 1;
    height: 100%;
    padding-top: 10px;
  }
}

@media (max-width: 900px) {
  .cwpc-dining-fields .cwpc-color-swatch {
    border: 1px solid var(--cwpc-border) !important;
    background: #fff !important;
  }

  .cwpc-dining-fields .cwpc-chair-mode .cwpc-mode {
    border: 1px solid var(--cwpc-border) !important;
    background: #fff !important;
    color: var(--cwpc-text) !important;
  }

  .cwpc-dining-fields .cwpc-chair-mode .cwpc-mode.cwpc-active {
    border-color: var(--cwpc-active) !important;
    background: #92bf7d !important;
    color: #fff !important;
  }

  .cwpc-dining-modal .cwpc-popup-add-to-cart {
    border: 1px solid #4f9b3f !important;
    background: #4f9b3f !important;
    color: #fff !important;
  }
}


@media (max-width: 767px) {

  .cwpc-dining-modal .cwpc-chair-design-step .cwpc-chair-designs {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .cwpc-dining-modal .cwpc-chair-design-step .cwpc-design-allocation {
    display: flex !important;
    gap: 10px !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 9px 10px !important;
    border: 1px solid var(--cwpc-border) !important;
    border-radius: 12px !important;
  }

  .cwpc-dining-modal .cwpc-chair-design-step .cwpc-design-allocation > .cwpc-design,
  .cwpc-dining-modal .cwpc-chair-design-step .cwpc-image-swatch {
    grid-area: image !important;
    width: 76px !important;
    min-width: 76px !important;
    height: 68px !important;
    margin: 0 !important;
  }

  .cwpc-dining-modal .cwpc-chair-design-step .cwpc-image-swatch img,
  .cwpc-dining-modal .cwpc-chair-design-step .cwpc-image-swatch .cwpc-design-placeholder {
    width: 64px !important;
    height: 56px !important;
    object-fit: contain !important;
  }

  .cwpc-dining-modal .cwpc-chair-design-step .cwpc-design-allocation-meta {
    display: flex !important;
    gap: 5px 8px !important;
    align-items: center !important;
    min-width: 0 !important;
    padding: 0 !important;
  }

  .cwpc-dining-modal .cwpc-chair-design-step .cwpc-design-allocation-meta strong {
    grid-area: name !important;
    min-width: 0 !important;
    font-size: 14px !important;
    line-height: 1.25 !important;
    overflow-wrap: anywhere !important;
  }

  .cwpc-dining-modal .cwpc-chair-design-step .cwpc-design-allocation-meta > small {
    grid-area: price !important;
    margin: 0 !important;
  }

  .rtl .cwpc-chair-designs .cwpc-design-allocation .cwpc-active:after, body.rtl .cwpc-chair-designs .cwpc-design-allocation .cwpc-active:after{
    right: -5px;
    left: auto;
    top: -5px;  
  }

  .cwpc-dining-modal .cwpc-chair-design-step .cwpc-chair-qty-controls {
    grid-area: controls !important;
    grid-template-columns: 38px 50px 38px !important;
    gap: 4px !important;
    width: auto !important;
    max-width: none !important;
    justify-self: end !important;
  }

  .cwpc-dining-modal .cwpc-chair-design-step .cwpc-chair-qty-controls button,
  .cwpc-dining-modal .cwpc-chair-design-step .cwpc-chair-qty {
    width: 33px !important;
    min-width: 33px !important;
    height: 33px !important;
    min-height: 33px !important;
  }

  .cwpc-dining-modal .cwpc-chair-design-step .cwpc-chair-qty {
    width: 50px !important;
    min-width: 50px !important;
    padding-inline: 3px !important;
    text-align: center !important;
  }

  /* The mobile canvas now shows table + focused chair only, so reserve a
  compact, stable preview height rather than growing with chair count. */
  .cwpc-dining-modal .cwpc-dining-preview {
    min-height: 180px !important;
  }
}

@media (max-width: 380px) {
  .cwpc-dining-modal .cwpc-chair-design-step .cwpc-design-allocation {
    grid-template-columns: 66px minmax(0, 1fr) !important;
    padding-inline: 8px !important;
  }

  .cwpc-dining-modal .cwpc-chair-design-step .cwpc-design-allocation > .cwpc-design,
  .cwpc-dining-modal .cwpc-chair-design-step .cwpc-image-swatch {
    width: 66px !important;
    min-width: 66px !important;
    height: 62px !important;
  }

  .cwpc-dining-modal .cwpc-chair-design-step .cwpc-chair-qty-controls {
    grid-template-columns: 34px 44px 34px !important;
  }

  .cwpc-dining-modal .cwpc-chair-design-step .cwpc-chair-qty-controls button,
  .cwpc-dining-modal .cwpc-chair-design-step .cwpc-chair-qty {
    width: 34px !important;
    min-width: 34px !important;
    height: 36px !important;
    min-height: 36px !important;
  }

  .cwpc-dining-modal .cwpc-chair-design-step .cwpc-chair-qty {
    width: 44px !important;
    min-width: 44px !important;
  }
}

/* ==========================================================
Existing-image click lightbox â€” v1.2.5
No additional gallery/thumbnail panel is rendered.
========================================================== */
.cwpc-dining-preview,
.cwpc-configurator .cwpc-preview {
  position: relative;
}

.cwpc-preview-canvas,
.cwpc-managed-table-canvas,
.cwpc-configurator .cwpc-preview canvas,
.cwpc-lightbox-trigger {
  cursor: zoom-in;
}

.cwpc-lightbox-trigger {
  -webkit-user-drag: none;
  user-select: none;
  transition: transform .18s ease, opacity .18s ease;
}

.cwpc-design:hover .cwpc-lightbox-trigger,
.cwpc-design:focus-visible .cwpc-lightbox-trigger,
.cwpc-choice:hover .cwpc-lightbox-trigger {
  transform: scale(1.045);
}

.cwpc-lightbox-trigger:active {
  opacity: .72;
}

body.cwpc-lightbox-open {
  overflow: hidden !important;
}

.cwpc-image-lightbox {
  position: fixed;
  z-index: 1000000;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cwpc-image-lightbox.cwpc-open {
  display: flex;
}

.cwpc-image-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 18, 14, .86);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.cwpc-image-lightbox__dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: min(920px, 94vw);
  height: min(780px, 90vh);
  height: min(780px, 90dvh);
  padding: 18px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
}

.cwpc-image-lightbox__image {
  display: block;
  width: 100%;
  height: 100% !important;
  min-height: 0;
  object-fit: contain;
}

.cwpc-image-lightbox__caption {
  min-height: 24px;
  padding-top: 10px;
  color: #222;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}

.cwpc-image-lightbox__caption:empty {
  display: none;
}

.cwpc-image-lightbox__close {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0 !important;
  border-radius: 50%;
  background: #4f9b3f !important;
  color: #fff !important;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
}

@media (max-width: 900px) {
  .cwpc-image-lightbox {
    padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
  }

  .cwpc-image-lightbox__dialog {
    width: 100%;
    height: min(82dvh, 720px);
    padding: 12px;
    border-radius: 15px;
  }

  .cwpc-image-lightbox__close {
    top: 8px;
    right: 8px;
    width: 40px;
    height: 40px;
  }
}

/* Mobile horizontally scrollable table + chairs preview */
@media (max-width: 767px) {

  .cwpc-dining-modal .cwpc-dining-preview {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;

    padding: 12px 8px 10px !important;

    overflow-x: auto !important;
    overflow-y: hidden !important;

    /*
    * Scroll left side se start hoga,
    * isliye initially table visible rahegi.
    */
    direction: ltr !important;

    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;

    scrollbar-width: thin;
  }

  .cwpc-dining-modal .cwpc-preview-canvas {
    display: block !important;

    /*
    * max-width: 100% hataana mandatory hai,
    * warna wide canvas viewport mein compress ho jayega
    * aur scrollbar nahi aayega.
    */
    width: auto !important;
    max-width: none !important;

    height: 100% !important;
    max-height: 100% !important;

    margin: 0 !important;
    flex: 0 0 auto !important;
  }

  .cwpc-dining-modal .cwpc-dining-preview::-webkit-scrollbar {
    height: 5px;
  }

  .cwpc-dining-modal .cwpc-dining-preview::-webkit-scrollbar-track {
    background: #eeeeee;
    border-radius: 20px;
  }

  .cwpc-dining-modal .cwpc-dining-preview::-webkit-scrollbar-thumb {
    background: #8fc279;
    border-radius: 20px;
  }
}
/* ==========================================================
Complete-set additional WooCommerce products â€” final step
========================================================== */
.cwpc-additional-products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cwpc-additional-product-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 76px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  min-height: 92px;
  padding: 9px 10px;
  border: 1px solid #e4e7e2;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.cwpc-additional-product-card:hover,
.cwpc-additional-product-card.cwpc-active {
  border-color: #8fc279;
  background: #f7fbf5;
}

.cwpc-additional-product-card.cwpc-active {
  box-shadow: 0 0 0 1px rgba(79, 155, 63, .08);
}

.cwpc-additional-product-card > input {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  margin: 0 !important;
  accent-color: #4f9b3f;
}

.cwpc-additional-product-card > img,
.cwpc-additional-product-placeholder {
  display: block;
  width: 76px;
  height: 76px !important;
  border: 1px solid #eceeeb;
  border-radius: 9px;
  background: #fafafa;
  object-fit: contain;
}

.cwpc-additional-product-placeholder {
  background: linear-gradient(135deg, #fafafa, #f1f3f0);
}

.cwpc-additional-product-info {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.cwpc-additional-product-info strong {
  overflow-wrap: anywhere;
  color: #202420;
  font-size: 14px;
  line-height: 1.35;
}

.cwpc-additional-product-info small {
  color: #4f9b3f;
  font-size: 13px;
  font-weight: 700;
}



@media (max-width: 767px) {
  .cwpc-additional-products {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .cwpc-additional-product-card {
    grid-template-columns: auto 68px minmax(0, 1fr);
    min-height: 82px;
    padding: 8px;
  }

  .cwpc-additional-product-card > img,
  .cwpc-additional-product-placeholder {
    width: 68px;
    height: 68px !important;
  }
}


/* Complete Set v1.4: the parent product is only a configurator landing page.
The selected mapped WooCommerce product supplies the real price. 
body.cwpc-complete-set-product div.product .summary > .price,
body.cwpc-complete-set-product div.product .summary > p.price,
body.cwpc-complete-set-product .woocommerce div.product .summary > .price {
  display: none !important;
}
*/

/* ==========================================================
   Desktop modal: content-based height + scroll only if needed
   ========================================================== */

@media (min-width: 901px) {

    .cwpc-managed-modal .cwpc-dining-modal__dialog {
        height: auto !important;
        max-height: calc(100vh - 48px) !important;

        overflow-x: hidden !important;
        overflow-y: auto !important;

        scrollbar-gutter: auto;
    }

    .cwpc-managed-modal .cwpc-dining-configurator {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;

        align-items: start !important;
    }

    .cwpc-managed-modal .cwpc-dining-preview {
        position: relative !important;
        top: auto !important;

        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;

        align-self: start !important;

        overflow: visible !important;
        scrollbar-gutter: auto !important;
    }

    .cwpc-managed-modal .cwpc-dining-fields {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;

        align-self: start !important;

        overflow: visible !important;
    }

    .cwpc-managed-modal .cwpc-managed-table-canvas {
        display: block;
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
    }
}
body.cwpc-linked-component-product form.cart,
body.cwpc-linked-component-product .quantity,
body.cwpc-linked-component-product .single_add_to_cart_button {
  display: none !important;
}

body.cwpc-linked-component-product .cwpc-linked-component-launch {
  margin-top: 16px;
}

/* Linked WooCommerce products that cannot satisfy the requested stock stay
   visible in the configurator, but cannot be selected. */
.cwpc-stock-disabled-wrap {
  opacity: 1;
}

.cwpc-swatch.cwpc-stock-disabled,
.cwpc-swatch:disabled,
.cwpc-chair-qty-plus:disabled {
  cursor: not-allowed !important;
  filter: grayscale(1);
  box-shadow: none !important;
}

.cwpc-swatch.cwpc-stock-disabled,
.cwpc-swatch:disabled {
  opacity: 0.45 !important;
  pointer-events: none;
}

.cwpc-chair-qty-plus:disabled {
  opacity: 0.35 !important;
}

.cwpc-out-of-stock-text {
	display: block;
	margin-top: 3px;
	font-size: 12px;
	color: red !important;
	font-weight: 600;
}

/* Chair type thumbnails in the dining wizard: show the clean white chair image with no grey tile or frame. */
.cwpc-dining-modal .cwpc-chair-design-step .cwpc-image-swatch,
.cwpc-dining-modal .cwpc-chair-design-step .cwpc-image-swatch img {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
.cwpc-dining-modal .cwpc-chair-design-step .cwpc-image-swatch img {
  width: 74px !important;
  height: 74px !important;
  max-width: none !important;
  object-fit: contain !important;
  padding: 0 !important;
}
.cwpc-dining-modal .cwpc-chair-design-step .cwpc-design-allocation > .cwpc-design,
.cwpc-dining-modal .cwpc-chair-design-step .cwpc-image-swatch {
  width: 80px !important;
  min-width: 80px !important;
  height: 78px !important;
}

/* Mobile: keep the chair-type cards and color swatches inside the screen width. */
@media (max-width: 767px) {
	.cwpc-dining-fields > * {
		min-width: 0;
	}
	.cwpc-chair-designs {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
	.cwpc-chair-colors {
		flex-wrap: wrap;
		gap: 8px;
	}
}
