/* Compatibility styles for the data-driven product page.
   The primary product layout remains in assets/css/styles.css. */

.commerce-product-page {
  overflow-x: clip;
}

.product-gallery-stage [data-product-badges] {
  position: absolute;
  z-index: 2;
  top: 1rem;
  left: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  max-width: calc(100% - 8rem);
}

.product-gallery-stage [data-product-badges] .gallery-badge {
  position: static;
}

.product-gallery-stage .gallery-favorite {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 3;
}

.product-gallery-stage .product-image-placeholder {
  position: absolute;
  inset: 0;
}

.gallery-favorite,
.gallery-zoom {
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--green-900);
  background: #fff;
  border: 0;
  border-radius: 50%;
}

.gallery-favorite.active {
  color: #a13c3c;
}

.product-image-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  align-content: center;
  gap: .75rem;
  color: var(--green-800);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
}

.product-image-placeholder i {
  font-size: clamp(5rem, 12vw, 10rem);
  opacity: .35;
}

.product-thumbnails {
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
}

.product-stock {
  color: var(--green-700);
  font-size: .86rem;
  font-weight: 700;
}

.product-stock.is-unavailable {
  color: #a13c3c;
}

.product-stock i {
  margin-right: .25rem;
}

.product-highlights[hidden] {
  display: none;
}

.product-highlights strong {
  overflow-wrap: anywhere;
}

.product-configurator form {
  display: flow-root;
}

.product-configurator .config-group {
  min-width: 0;
}

.product-configurator fieldset {
  padding: 0;
  border: 0;
}

.product-configurator legend {
  float: none;
  width: auto;
}

.product-dimensions {
  margin-top: 0;
}

.product-dimension-group {
  margin-top: 0 !important;
}

.product-color-options,
.product-variant-options {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}

.product-color-group .colour-group-title {
  flex: 0 0 100%;
  margin: .35rem 0 .15rem;
  color: #5b6b73;
  font-size: .82rem;
  font-weight: 700;
}

.product-color-option,
.product-variant-options button,
.product-variant-option {
  position: relative;
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin: 0;
  padding: .65rem .8rem;
  color: var(--ink);
  background: #faf8f3;
  border: 1px solid #cec7bb;
  cursor: pointer;
}

.product-variant-option input,
.product-color-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.product-color-option.active,
.product-color-option:has(input:checked),
.product-variant-options button.active,
.product-variant-option:has(input:checked) {
  color: var(--green-900);
  background: #edf3ef;
  border-color: var(--green-900);
  box-shadow: inset 0 0 0 1px var(--green-900);
}

.product-color-option > span {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  background: var(--swatch, #ddd);
  border: 1px solid rgba(0, 0, 0, .18);
  border-radius: 50%;
}

.product-variant-options button,
.product-variant-option {
  min-width: 105px;
  flex-direction: column;
}

.product-variant-options i {
  color: var(--gold-dark);
  font-size: 1.35rem;
}

.product-price-large > del {
  display: inline-block;
  margin: .15rem 0 0;
  color: rgba(255, 255, 255, .6);
  font-size: 1.05rem;
  text-decoration: line-through;
}

.product-price-large > del .msoptionsprice-old-cost,
.product-price-large > del span {
  display: inline;
  color: inherit;
  font-size: inherit;
}

.quantity-control {
  display: grid;
  grid-template-columns: 36px 42px 36px;
  flex: 0 0 auto;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, .45);
}

.quantity-control button,
.quantity-control input {
  width: 100%;
  color: var(--green-950);
  background: transparent;
  border: 0;
  text-align: center;
}

.quantity-control input {
  appearance: textfield;
}

.quantity-control input::-webkit-inner-spin-button {
  appearance: none;
}

.technical-card-icon {
  display: block;
  margin-bottom: 1rem;
  color: var(--gold-dark);
  font-size: 3rem;
}

.product-modal-placeholder {
  min-height: 65vh;
  color: #fff;
}

.product-related-grid .storefront-product-card {
  width: 100%;
}

.product-related-grid .catalog-card-media,
.product-related-grid .storefront-card-media img,
.product-related-grid .catalog-card-placeholder {
  height: 225px;
  min-height: 225px;
}

[data-product-rails] .related-section + .related-section {
  border-top: 1px solid #dfd7ca;
}

@media (max-width: 991.98px) {
  .product-related-grid .catalog-card-media,
  .product-related-grid .storefront-card-media img,
  .product-related-grid .catalog-card-placeholder {
    height: 220px;
    min-height: 220px;
  }
}

@media (max-width: 575.98px) {
  .product-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .quantity-control {
    width: 122px;
    min-height: 46px;
  }

  .product-tabs .nav-item {
    min-width: 50%;
    flex-basis: 50%;
  }

  .product-tabs .nav-link {
    width: 100%;
    min-height: 60px;
    padding: .8rem .55rem;
    white-space: normal;
    font-size: .86rem;
  }

  .product-tabs .nav-link::after {
    right: .55rem;
    left: .55rem;
  }

  .specification-table,
  .specification-table tbody,
  .specification-table tr,
  .specification-table th,
  .specification-table td {
    display: block;
    width: 100%;
  }

  .specification-table tr + tr {
    border-top: 1px solid #ddd5c9;
  }

  .product-related-grid .catalog-card-media,
  .product-related-grid .storefront-card-media img,
  .product-related-grid .catalog-card-placeholder {
    height: 250px;
    min-height: 250px;
  }
}

/* PVC window configurator */
.pvc-hint {
  margin: 0 0 .85rem;
  color: #65716b;
  font-size: .86rem;
}

.pvc-dim-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
}

.pvc-dim-field {
  display: grid;
  gap: .35rem;
  min-width: 0;
}

.pvc-dim-field > span {
  color: var(--green-900);
  font-size: .82rem;
  font-weight: 800;
}

.pvc-dim-field input {
  width: 100%;
  min-height: 46px;
  padding: .55rem .75rem;
  border: 1px solid #c9c2b7;
  border-radius: .2rem;
  font-weight: 700;
}

.pvc-dim-field small {
  color: #6d7872;
  font-size: .75rem;
}

.pvc-dim-field.is-invalid input {
  border-color: #a12f35;
  box-shadow: 0 0 0 3px rgba(161, 47, 53, .12);
}

.pvc-dim-field.is-invalid small {
  color: #a12f35;
  font-weight: 700;
}

.pvc-dim-field.is-low small,
.pvc-dim-field.is-high small {
  color: #a12f35;
}

.pvc-system-option span {
  display: grid;
  gap: .15rem;
  text-align: left;
}

.pvc-system-option small {
  color: #68736e;
  font-size: .72rem;
  font-weight: 500;
}

.pvc-area-note {
  margin: 1rem 0 0;
  color: #5f6a64;
  font-size: .86rem;
  font-weight: 700;
}

.pvc-area-note [data-pvc-status].is-invalid {
  color: #a12f35;
}

@media (max-width: 575.98px) {
  .pvc-dim-grid {
    grid-template-columns: 1fr;
  }
}

.pvc-option-thumb {
  display: block;
  width: 100%;
  max-width: 140px;
  height: 72px;
  margin: 0 auto .35rem;
  object-fit: cover;
  background: #eee8df;
  border: 1px solid #d7d0c4;
}

.product-variant-option:has([data-pvc-glazing]) {
  min-width: 150px;
  padding: .55rem .65rem;
}
