/* Scoped to WooCommerce single products and the real size attribute only. */
body.single-product .alh-size-cell { width: 100%; min-width: 0; }
body.single-product .alh-original-size-select {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important;
  border: 0 !important; opacity: 0 !important; pointer-events: none !important;
}
body.single-product .alh-size-picker {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px; width: 100%; max-width: 100%; min-width: 0;
  margin: 4px 0 8px; box-sizing: border-box;
}
body.single-product .alh-size-option {
  appearance: none; display: inline-flex; justify-content: center; align-items: center;
  width: 100%; min-width: 0; min-height: 46px; padding: 9px 5px;
  border: 1px solid #d9dde4; border-radius: 7px; background: #fff;
  color: #14213a; font-size: 13px; font-weight: 600; line-height: 1.3;
  text-align: center; cursor: pointer; box-sizing: border-box;
  transition: background .18s, border-color .18s, color .18s;
}
body.single-product .alh-size-option:hover:not(:disabled) {
  border-color: #071e55; background: #f5f7fb;
}
body.single-product .alh-size-option.is-selected {
  background: #071e55; border-color: #071e55; color: #fff;
}
body.single-product .alh-size-option.is-selected:hover { background: #12377e; color: #fff; }
body.single-product .alh-size-option:focus-visible {
  outline: 3px solid #8ca7d9; outline-offset: 2px;
}
body.single-product .alh-size-option:disabled {
  opacity: .38; cursor: not-allowed; text-decoration: line-through;
}
body.single-product .alh-custom-size-option {
  grid-column: 1 / -1; min-height: 48px; font-weight: 700;
}
/* Measurement form stays in the existing variation widget and wraps correctly. */
body.single-product .woocommerce-variation-add-to-cart > .wcm-measurements {
  flex: 0 0 100%; width: 100%; max-width: 100%; min-width: 0;
  box-sizing: border-box;
}
body.single-product .wcm-measurements .wcm-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr));
  width: 100%; max-width: 100%; gap: 16px;
}
body.single-product .wcm-measurements .wcm-field,
body.single-product .wcm-measurements .wcm-field input {
  min-width: 0; max-width: 100%; width: 100%; box-sizing: border-box;
}
@media (max-width: 1024px) {
  body.single-product .alh-size-picker { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  body.single-product .alh-size-picker { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 7px; }
  body.single-product .alh-size-option { min-height: 44px; font-size: 12px; }
  body.single-product .wcm-measurements .wcm-grid { grid-template-columns: minmax(0, 1fr); }
}
