/**
 * Dahls product option presentation.
 *
 * @author Bullmade
 */

@media (min-width: 992px) {
  #customizer > .contain.product-container {
    width: min(calc(100% - 3rem), 1280px);
    max-width: 1280px;
    justify-self: center;
    grid-template-columns: minmax(0, 2fr) minmax(360px, 1fr);
  }
}

#customizer .product-add-to-cart.js-product-add-to-cart > h2 {
  font-size: calc(1.75rem - 5px) !important;
  margin-bottom: 0.375rem !important;
}

.wk_product_opt_container .bm-engraving-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.375rem 0.875rem;
  margin-bottom: 0.875rem;
}

#customizer .wk_product_opt_container .bm-engraving-grid > .wk-product-variants-item {
  min-width: 0;
  margin: 0 !important;
}

.wk_product_opt_container .bm-engraving-grid textarea,
.wk_product_opt_container .bm-engraving-grid input[type="text"] {
  width: 100%;
  padding-inline: 0.5rem !important;
}

.wk_product_opt_container .bm-engraving-grid textarea::placeholder,
.wk_product_opt_container .bm-engraving-grid input[type="text"]::placeholder {
  font-size: 14px !important;
}

.wk_product_opt_container .bm-font-dropdown .dd-option {
  min-height: 3.25rem;
  display: flex;
  align-items: center;
}

.wk_product_opt_container .bm-font-dropdown .dd-select {
  height: 2rem !important;
  min-height: 2rem !important;
}

.wk_product_opt_container .bm-font-dropdown .dd-selected {
  height: 100% !important;
  min-height: 0 !important;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  padding: 0 2.5rem 0 0.625rem !important;
}

.wk_product_opt_container .bm-font-dropdown .dd-option-image,
.wk_product_opt_container .bm-font-dropdown .dd-selected-image {
  display: none !important;
}

.wk_product_opt_container .bm-font-dropdown .dd-option .dd-option-text,
.wk_product_opt_container .bm-font-dropdown .dd-selected .dd-selected-text {
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  overflow: visible !important;
  clip: auto !important;
  white-space: normal !important;
  font-weight: 400 !important;
}

.wk_product_opt_container .bm-font-dropdown .dd-option .dd-option-text.bm-font-value,
.wk_product_opt_container .bm-font-dropdown .dd-selected .dd-selected-text.bm-font-value {
  font-size: 1.375rem !important;
  font-weight: 400 !important;
  line-height: 1.25 !important;
}

.wk_product_opt_container .bm-font-dropdown .dd-selected .dd-selected-text.bm-font-value {
  font-size: 1.125rem !important;
  line-height: 1.2 !important;
}

.wk_product_opt_container .bm-motif-dropdown {
  display: none !important;
}

.wk_product_opt_container .bm-motif-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.375rem;
  margin-top: 0.375rem;
}

.wk_product_opt_container .bm-motif-choice {
  position: relative;
  min-width: 0;
  min-height: 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1875rem;
  margin: 0;
  padding: 0.3125rem 0.1875rem;
  border: 1px solid #d8e0dd;
  border-radius: 0.375rem;
  background: #fff;
  color: #333;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.wk_product_opt_container .bm-motif-choice:hover {
  z-index: 3;
  border-color: #91c7ae;
  background: #f5fbf8;
}

.wk_product_opt_container .bm-motif-choice.is-selected {
  border-color: #00a963;
  background: #eef9f4;
  box-shadow: inset 0 0 0 1px #00bb6d;
}

.wk_product_opt_container .bm-motif-choice:has(input:focus-visible) {
  outline: 2px solid #00bb6d;
  outline-offset: 2px;
}

.wk_product_opt_container .bm-motif-choice input[type="radio"] {
  position: absolute;
  top: 0.375rem;
  left: 0.375rem;
  width: 0.875rem;
  height: 0.875rem;
  margin: 0;
  accent-color: #00a963;
}

.wk_product_opt_container .bm-motif-choice img {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

@media (hover: hover) and (pointer: fine) {
  .wk_product_opt_container .bm-motif-choice:hover img {
    position: relative;
    z-index: 4;
    border-radius: 0.25rem;
    background: #fff;
    box-shadow: 0 0.375rem 1rem rgba(0, 0, 0, 0.2);
    transform: scale(2.25);
  }
}

.wk_product_opt_container .bm-motif-choice-text {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.625rem;
  font-weight: 500;
  line-height: 1.15;
  text-align: center;
}

.wk_product_opt_container .bm-motif-choice--no-image .bm-motif-choice-text {
  max-width: calc(100% - 1.25rem);
}

#customizer .price_box > .bm-customizer-price-row {
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 1.25rem;
}

#customizer .bm-customizer-trust-stock {
  width: auto;
  flex: 0 0 auto;
  justify-content: flex-start;
  gap: 0.625rem;
  margin-left: auto;
  font-size: 0.6875rem;
  line-height: 1.15;
}

#customizer .bm-customizer-trust-stock > span {
  gap: 0.25rem;
}

#customizer .bm-customizer-trust-stock svg {
  width: 4.5rem;
  height: 0.8125rem;
  flex: 0 0 auto;
}

#customizer .bm-customizer-trust-stock .stock-delivery,
#customizer .bm-customizer-trust-stock .product-delivery {
  display: flex !important;
  align-items: center;
  gap: 0.1875rem;
  margin: 0 !important;
  font-size: 0.75rem !important;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
}

/* Keep the final price/CTA area compact. Hummingbird adds padding on the
 * nested add-to-cart container even though the customizer already has its own
 * panel padding. */
#customizer .price_box > .bm-customizer-price-row {
  margin-bottom: 0.25rem !important;
}

#customizer .product__add-to-cart-container.product-add-to-cart {
  padding: 0.25rem 0 0.5rem !important;
}

#customizer .product__actions-qty-add,
#customizer .product__add-to-cart,
#customizer .product__add-to-cart-button {
  width: 100% !important;
  margin-top: 0 !important;
}

@media (min-width: 768px) {
  .wk_product_opt_container .bm-motif-choices {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 992px) {
  .wk_product_opt_container .bm-motif-choices {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  /* The font dropdown is intentionally half-width, but the motif field also
     contains a hidden dropdown and was therefore caught by that theme rule.
     Give the motif group its own full row so eight choices remain readable. */
  .wk_product_opt_container > .wk-product-variants-item:has(.bm-motif-dropdown) {
    width: 100% !important;
    max-width: 100% !important;
  }
}

@media (max-width: 767.98px) {
  #customizer .product-add-to-cart.js-product-add-to-cart > h2 {
    font-size: calc(1.75rem - 10px) !important;
  }

  .wk_product_opt_container .bm-engraving-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 575.98px) {
  #customizer > .contain.product-container > .product-add-to-cart.js-product-add-to-cart {
    padding: 0.625rem !important;
  }

  #customizer .product__add-to-cart-container.product-add-to-cart.js-product-add-to-cart {
    padding: 0.25rem 0 0.5rem !important;
  }

  .wk_product_opt_container .bm-engraving-grid textarea::placeholder,
  .wk_product_opt_container .bm-engraving-grid input[type="text"]::placeholder {
    font-size: 14px !important;
  }

  #customizer .price_box > .bm-customizer-price-row {
    align-items: center;
    flex-direction: row;
    gap: 0.5rem;
    padding-top: 0.375rem !important;
  }

  #customizer .bm-customizer-trust-stock {
    width: auto;
    max-width: calc(100% - 7rem);
    flex: 0 1 auto;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.1875rem;
    margin-left: auto;
    font-size: 0.625rem;
  }

  #customizer .bm-customizer-trust-stock svg {
    width: 3.75rem;
    height: 0.6875rem;
  }

  #customizer .bm-customizer-trust-stock .stock-delivery,
  #customizer .bm-customizer-trust-stock .product-delivery {
    font-size: 0.6875rem !important;
  }
}

@media (max-width: 350px) {
  #customizer .price_box > .bm-customizer-price-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.375rem;
  }

  #customizer .bm-customizer-trust-stock {
    max-width: 100%;
    margin-left: 0;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
  }
}

#customizer .addtocart_alert .alert.alert-danger {
  text-align: center;
}

/* The theme's generic primary-button rule leaves the upload control with
 * white text on a transparent background. Give the module file picker its
 * own visible, compact button. */
#customizer .wk-custom-file {
  overflow: hidden;
  border-color: #d7dcda;
  border-radius: 0.25rem;
}

#customizer .wk-product-variants-item:has(.wk-custom-file) {
  width: 100% !important;
  max-width: 100% !important;
}

#customizer .wk-custom-file .wk_image_upload {
  top: 0.25rem;
  right: 0.25rem;
  bottom: 0.25rem;
  display: inline-flex;
  min-width: 6.5rem;
  height: auto;
  align-items: center;
  justify-content: center;
  padding: 0 0.875rem !important;
  border: 0 !important;
  border-radius: 0.25rem;
  background: #222 !important;
  color: #fff !important;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  text-indent: 0;
  cursor: pointer;
}

#customizer .wk-custom-file .wk_image_upload:hover,
#customizer .wk-custom-file .wk_image_upload:focus-visible {
  background: #000 !important;
  color: #fff !important;
}

@media (max-width: 575.98px) {
  #customizer .wk-custom-file {
    height: 4.5rem;
    line-height: 1.2;
    padding-top: 0.625rem;
  }

  #customizer .wk-custom-file .wk_image_upload {
    inset: auto 0.25rem 0.25rem;
    width: auto;
    min-width: 0;
    height: 1.875rem;
  }
}
